docs(security): add parallel session sync checks

This commit is contained in:
Your Name
2026-05-19 13:31:50 +08:00
parent 6283886f1c
commit bcdf1636c3
19 changed files with 289 additions and 38 deletions

View File

@@ -113,6 +113,7 @@ def validate(root: Path) -> None:
"s4_13_owner_response_validation_reviewer_audit_retention_checks",
"s4_13_owner_response_validation_reviewer_audit_handoff_packets",
"s4_13_owner_response_validation_reviewer_audit_handoff_checks",
"s4_13_owner_response_validation_parallel_session_sync_checks",
]
assert_equal(
"progress_delta_ledger.delta_ids",
@@ -203,6 +204,11 @@ def validate(root: Path) -> None:
owner_summary["owner_response_validation_reviewer_audit_handoff_check_count"],
6,
)
assert_equal(
"owner_rollup.owner_response_validation_parallel_session_sync_check_count",
owner_summary["owner_response_validation_parallel_session_sync_check_count"],
6,
)
assert_false("owner_rollup.runtime_execution_authorized", owner_summary["runtime_execution_authorized"])
assert_false("owner_rollup.repo_creation_authorized", owner_summary["repo_creation_authorized"])
assert_false("owner_rollup.refs_sync_authorized", owner_summary["refs_sync_authorized"])

View File

@@ -386,6 +386,15 @@ EXPECTED_ROLLUP_REVIEWER_AUDIT_HANDOFF_CHECKS = [
"check-handoff-next-focus-not-received",
]
EXPECTED_ROLLUP_PARALLEL_SESSION_SYNC_CHECKS = [
"check-parallel-session-same-pr-branch",
"check-parallel-session-latest-delta-visible",
"check-parallel-session-owner-response-counters-zero",
"check-parallel-session-runtime-flags-false",
"check-parallel-session-source-control-mutations-blocked",
"check-parallel-session-next-focus-stays-s4-9",
]
def load_json(path: Path) -> dict[str, Any]:
return json.loads(path.read_text(encoding="utf-8"))
@@ -488,6 +497,11 @@ def validate(root: Path) -> None:
rollup_summary["owner_response_validation_reviewer_audit_handoff_check_count"],
len(EXPECTED_ROLLUP_REVIEWER_AUDIT_HANDOFF_CHECKS),
)
assert_equal(
"rollup.owner_response_validation_parallel_session_sync_check_count",
rollup_summary["owner_response_validation_parallel_session_sync_check_count"],
len(EXPECTED_ROLLUP_PARALLEL_SESSION_SYNC_CHECKS),
)
assert_true("rollup.quarantine_required", rollup_summary["quarantine_required"])
assert_equal("rollup.primary_ready_count", rollup_summary["primary_ready_count"], 0)
@@ -1272,6 +1286,58 @@ def validate(root: Path) -> None:
item["execution_authorized"],
)
parallel_session_sync_checks = rollup["owner_response_validation_parallel_session_sync_checks"]
assert_equal(
"owner_response_validation_parallel_session_sync_checks.ids",
[item["check_id"] for item in parallel_session_sync_checks],
EXPECTED_ROLLUP_PARALLEL_SESSION_SYNC_CHECKS,
)
assert_equal(
"owner_response_validation_parallel_session_sync_checks.display_order",
[item["display_order"] for item in parallel_session_sync_checks],
list(range(1, len(EXPECTED_ROLLUP_PARALLEL_SESSION_SYNC_CHECKS) + 1)),
)
for item in parallel_session_sync_checks:
assert_equal(
f"owner_response_validation_parallel_session_sync_checks.{item['check_id']}.awooop_display_mode",
item["awooop_display_mode"],
"display_parallel_session_sync_check_only",
)
assert_false(
f"owner_response_validation_parallel_session_sync_checks.{item['check_id']}.execution_authorized",
item["execution_authorized"],
)
assert_true(
f"owner_response_validation_parallel_session_sync_checks.{item['check_id']}.not_approval",
item["not_approval"],
)
for blocked in item["blocked_interpretations"]:
if blocked in {
"treat_parallel_session_as_runtime_owner",
"merge_without_branch_sync",
"treat_delta_visibility_as_authorization",
"treat_parallel_sync_as_owner_response_received",
"treat_parallel_sync_as_owner_response_accepted",
"treat_parallel_sync_as_audit_event_emitted",
"treat_parallel_sync_as_runtime_gate",
"treat_sync_complete_as_runtime_authorized",
"create_action_button_from_parallel_sync",
"enqueue_runtime_job_from_parallel_sync",
"start_kali_or_repo_action_from_parallel_sync",
"create_repo_from_parallel_sync",
"sync_refs_from_parallel_sync",
"modify_workflow_or_secret_from_parallel_sync",
"switch_primary_from_parallel_sync",
"auto_collect_owner_response_from_parallel_sync",
"mark_s4_9_received_from_parallel_sync",
"mark_s4_9_accepted_from_parallel_sync",
"create_followup_runtime_gate_from_parallel_sync",
}:
assert_false(
f"owner_response_validation_parallel_session_sync_checks.{item['check_id']}.runtime_execution_authorized",
item["execution_authorized"],
)
first_lane = LANES[0]
first_collection_item = collection_order_by_id[first_lane["lane_id"]]
first_missing_lane = missing_lane_by_id[first_lane["lane_id"]]