From 0a7ea52c65a903d41774c56027ab1484cc8bd1c1 Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 20 May 2026 12:15:47 +0800 Subject: [PATCH] feat(web): add IwoooS review preparation packets --- apps/web/messages/en.json | 53 ++++ apps/web/messages/zh-TW.json | 53 ++++ apps/web/src/app/[locale]/iwooos/page.tsx | 73 +++++ docs/LOGBOOK.md | 14 + .../iwooos_posture_projection_v1.schema.json | 134 ++++++++++ docs/security/IWOOOS-POSTURE-PROJECTION.md | 24 +- .../security/SECURITY-MIRROR-STATUS-ROLLUP.md | 3 +- .../SECURITY-SUPPLY-CHAIN-PROGRESS.md | 6 +- .../iwooos-posture-projection.snapshot.json | 251 +++++++++++++++++- ...ecurity-mirror-status-rollup.snapshot.json | 13 +- .../security-mirror-progress-guard.py | 166 ++++++++++++ 11 files changed, 782 insertions(+), 8 deletions(-) diff --git a/apps/web/messages/en.json b/apps/web/messages/en.json index e2f93938a..d92e037c7 100644 --- a/apps/web/messages/en.json +++ b/apps/web/messages/en.json @@ -2602,6 +2602,59 @@ "next": "active runtime gates=0; action buttons=false" } } + }, + "hostOwnerDecisionRecordHumanRecordOwnerReviewPreparationPackets": { + "title": "Host Owner Decision Record Human Record Owner Review Preparation Packets", + "subtitle": "Human record owner review preparation packets only organize metadata needed by a future human record owner review surface. They do not mark preparation completed, start review, mark review ready, collect owner decisions, create decision records, create approval records, or open runtime gates.", + "packetLabel": "Review preparation packet", + "guardLabel": "Guardrail", + "items": { + "preparationIdentityTrace": { + "title": "Preparation identity trace packet", + "body": "Organizes preparation id, source candidate outcome, version, trace pointer, and candidate checklist link so a future review surface can trace provenance.", + "guard": "prepared=0; review started=0" + }, + "preparationOwnerBoundary": { + "title": "Preparation owner boundary packet", + "body": "Organizes human record owner, backup owner, contact channel, responsibility boundary, and open clarifications without treating owner as engaged or decided.", + "guard": "owner decision received=0; review ready=0" + }, + "preparationDecisionSummary": { + "title": "Preparation decision summary packet", + "body": "Organizes candidate decision summary, risk acceptance boundary, no-execution statement, and formal record preface while remaining outside a decision record.", + "guard": "decision record created=false; accepted=0" + }, + "preparationScopeExpiry": { + "title": "Preparation scope and expiry packet", + "body": "Organizes host, network, service, exclusion, observation intent, expiry, and refresh need so the preparation layer remains read-only visible.", + "guard": "scope preparation only; runtime gate opened=false" + }, + "preparationScanLimits": { + "title": "Preparation scan limits packet", + "body": "Organizes observe-only, future active scan, credentialed scan limits, and scan boundaries that still require separate approval.", + "guard": "scan authorized=false; action buttons=false" + }, + "preparationCredentialBoundary": { + "title": "Preparation credential boundary packet", + "body": "Organizes credential owner, retention, masking, forbidden collection, and quarantine rules while allowing metadata only.", + "guard": "secret collection=false; raw payload=false" + }, + "preparationMaintenanceRollback": { + "title": "Preparation maintenance and rollback packet", + "body": "Organizes maintenance window, constraints, rollback owner, recovery path, and human contact without authorizing host change.", + "guard": "host change=false; Kali update=false" + }, + "preparationValidationRuntimeGate": { + "title": "Preparation validation and runtime gate packet", + "body": "Organizes validation evidence pointer, post-check metrics, and independent runtime gate requirement without opening a gate from preparation packet.", + "guard": "runtime gate opened=false; runtime execution=false" + }, + "preparationNoExecutionAttestation": { + "title": "Preparation no-execution attestation packet", + "body": "Fixes not authorization, no execution, no approval, and no runtime gate statements so the preparation packet is not mistaken for approval.", + "guard": "not_authorization=true; approval record=false" + } + } } }, "tickets": { diff --git a/apps/web/messages/zh-TW.json b/apps/web/messages/zh-TW.json index 33a0de3f9..b51d6d2d4 100644 --- a/apps/web/messages/zh-TW.json +++ b/apps/web/messages/zh-TW.json @@ -2603,6 +2603,59 @@ "next": "active runtime gates=0;action buttons=false" } } + }, + "hostOwnerDecisionRecordHumanRecordOwnerReviewPreparationPackets": { + "title": "主機 Owner Decision Record Human Record Owner Review Preparation Packets", + "subtitle": "Human record owner review preparation packets 只整理未來人工 record owner review 畫面需要的 metadata。它不代表 preparation completed、不開始 review、不標記 review ready、不收 owner decision、不建立 decision record、不建立 approval record、不開 runtime gate。", + "packetLabel": "Review preparation packet", + "guardLabel": "保護邊界", + "items": { + "preparationIdentityTrace": { + "title": "Preparation identity trace packet", + "body": "整理 preparation id、來源 candidate outcome、版本、trace pointer 與 candidate checklist link,讓未來 review 畫面能追溯來源。", + "guard": "prepared=0;review started=0" + }, + "preparationOwnerBoundary": { + "title": "Preparation owner boundary packet", + "body": "整理 human record owner、backup owner、聯絡窗口、責任邊界與待確認項目,但不代表 owner 已接案或已決策。", + "guard": "owner decision received=0;review ready=0" + }, + "preparationDecisionSummary": { + "title": "Preparation decision summary packet", + "body": "整理候選決策摘要、風險接受邊界、no-execution statement 與正式紀錄前置說明,仍不是 decision record。", + "guard": "decision record created=false;accepted=0" + }, + "preparationScopeExpiry": { + "title": "Preparation scope and expiry packet", + "body": "整理 host、network、service、exclusion、observation intent、expiry 與刷新需求,讓準備層保持只讀可見。", + "guard": "scope preparation only;runtime gate opened=false" + }, + "preparationScanLimits": { + "title": "Preparation scan limits packet", + "body": "整理 observe-only、future active scan、credentialed scan limits 與仍需獨立批准的掃描邊界。", + "guard": "scan authorized=false;action buttons=false" + }, + "preparationCredentialBoundary": { + "title": "Preparation credential boundary packet", + "body": "整理 credential owner、retention、masking、forbidden collection 與隔離規則,只允許 metadata-only。", + "guard": "secret collection=false;raw payload=false" + }, + "preparationMaintenanceRollback": { + "title": "Preparation maintenance and rollback packet", + "body": "整理 maintenance window、constraints、rollback owner、recovery path 與人工聯絡點,但不代表可以變更主機。", + "guard": "host change=false;Kali update=false" + }, + "preparationValidationRuntimeGate": { + "title": "Preparation validation and runtime gate packet", + "body": "整理 validation evidence pointer、post-check metrics 與獨立 runtime gate requirement,仍不能由 preparation packet 開 gate。", + "guard": "runtime gate opened=false;runtime execution=false" + }, + "preparationNoExecutionAttestation": { + "title": "Preparation no-execution attestation packet", + "body": "固定 not authorization、no execution、no approval、no runtime gate statement,避免 preparation packet 被誤解成批准。", + "guard": "not_authorization=true;approval record=false" + } + } } }, "tickets": { diff --git a/apps/web/src/app/[locale]/iwooos/page.tsx b/apps/web/src/app/[locale]/iwooos/page.tsx index ecb34387e..05235d820 100644 --- a/apps/web/src/app/[locale]/iwooos/page.tsx +++ b/apps/web/src/app/[locale]/iwooos/page.tsx @@ -285,6 +285,13 @@ type HostOwnerDecisionRecordHumanRecordOwnerReviewCandidateOutcomeLane = { tone: 'steady' | 'warn' | 'locked' } +type HostOwnerDecisionRecordHumanRecordOwnerReviewPreparationPacket = { + key: string + packet: string + icon: typeof ShieldCheck + tone: 'steady' | 'warn' | 'locked' +} + const postureMetrics: PostureMetric[] = [ { key: 'overall', value: '58%', tone: 'warn' }, { key: 'framework', value: '80-85%', tone: 'steady' }, @@ -690,6 +697,18 @@ const hostOwnerDecisionRecordHumanRecordOwnerReviewCandidateOutcomeLanes: HostOw { key: 'runtimeGateStillRequired', lane: 'FRV9', icon: ShieldCheck, tone: 'locked' }, ] +const hostOwnerDecisionRecordHumanRecordOwnerReviewPreparationPackets: HostOwnerDecisionRecordHumanRecordOwnerReviewPreparationPacket[] = [ + { key: 'preparationIdentityTrace', packet: 'FRP1', icon: FileText, tone: 'warn' }, + { key: 'preparationOwnerBoundary', packet: 'FRP2', icon: Bell, tone: 'warn' }, + { key: 'preparationDecisionSummary', packet: 'FRP3', icon: ClipboardCheck, tone: 'warn' }, + { key: 'preparationScopeExpiry', packet: 'FRP4', icon: Radar, tone: 'warn' }, + { key: 'preparationScanLimits', packet: 'FRP5', icon: Activity, tone: 'locked' }, + { key: 'preparationCredentialBoundary', packet: 'FRP6', icon: Lock, tone: 'locked' }, + { key: 'preparationMaintenanceRollback', packet: 'FRP7', icon: Clock3, tone: 'warn' }, + { key: 'preparationValidationRuntimeGate', packet: 'FRP8', icon: ShieldCheck, tone: 'locked' }, + { key: 'preparationNoExecutionAttestation', packet: 'FRP9', icon: ListChecks, tone: 'locked' }, +] + const evidenceItems = [ 'iwooos-posture-projection.snapshot.json', 'security-rollout-policy.snapshot.json', @@ -1832,6 +1851,38 @@ function HostOwnerDecisionRecordHumanRecordOwnerReviewCandidateOutcomeCard({ ) } +function HostOwnerDecisionRecordHumanRecordOwnerReviewPreparationPacketCard({ + item, +}: { + item: HostOwnerDecisionRecordHumanRecordOwnerReviewPreparationPacket +}) { + const t = useTranslations('iwooos.hostOwnerDecisionRecordHumanRecordOwnerReviewPreparationPackets') + const Icon = item.icon + return ( +
+
+
+ + {t('packetLabel')} +
+ {item.packet} +
+

+ {t(`items.${item.key}.title` as never)} +

+

+ {t(`items.${item.key}.body` as never)} +

+
+
{t('guardLabel')}
+
+ {t(`items.${item.key}.guard` as never)} +
+
+
+ ) +} + export default function IwoooSPage({ params }: { params: { locale: string } }) { const t = useTranslations('iwooos') @@ -2512,6 +2563,28 @@ export default function IwoooSPage({ params }: { params: { locale: string } }) { +
+
+

+ {t('hostOwnerDecisionRecordHumanRecordOwnerReviewPreparationPackets.title')} +

+

+ {t('hostOwnerDecisionRecordHumanRecordOwnerReviewPreparationPackets.subtitle')} +

+
+
+ {hostOwnerDecisionRecordHumanRecordOwnerReviewPreparationPackets.map(item => ( + + ))} +
+
+
None: "s2_41_iwooos_host_owner_decision_record_human_record_owner_review_candidate_packets", "s2_42_iwooos_host_owner_decision_record_human_record_owner_review_candidate_checklist", "s2_43_iwooos_host_owner_decision_record_human_record_owner_review_candidate_outcome_lanes", + "s2_44_iwooos_host_owner_decision_record_human_record_owner_review_preparation_packets", ] assert_equal( "progress_delta_ledger.delta_ids", @@ -642,6 +643,17 @@ def validate(root: Path) -> None: "host_decision_record_human_record_owner_review_candidate_maintenance_rollback_incomplete_outcome_lane", "host_decision_record_human_record_owner_review_candidate_runtime_gate_required_outcome_lane", ] + expected_iwooos_host_owner_decision_record_human_record_owner_review_preparation_packet_ids = [ + "host_decision_record_human_record_owner_review_preparation_identity_trace_packet", + "host_decision_record_human_record_owner_review_preparation_owner_boundary_packet", + "host_decision_record_human_record_owner_review_preparation_decision_summary_packet", + "host_decision_record_human_record_owner_review_preparation_scope_expiry_packet", + "host_decision_record_human_record_owner_review_preparation_scan_limits_packet", + "host_decision_record_human_record_owner_review_preparation_credential_boundary_packet", + "host_decision_record_human_record_owner_review_preparation_maintenance_rollback_packet", + "host_decision_record_human_record_owner_review_preparation_validation_runtime_gate_packet", + "host_decision_record_human_record_owner_review_preparation_no_execution_attestation_packet", + ] assert_equal( "iwooos_projection.summary.frontend_surface_coverage_group_count", iwooos_projection["summary"]["frontend_surface_coverage_group_count"], @@ -816,6 +828,11 @@ def validate(root: Path) -> None: ], len(expected_iwooos_host_owner_decision_record_human_record_owner_review_candidate_outcome_lane_ids), ) + assert_equal( + "iwooos_projection.summary.host_owner_decision_record_human_record_owner_review_preparation_packet_count", + iwooos_projection["summary"]["host_owner_decision_record_human_record_owner_review_preparation_packet_count"], + len(expected_iwooos_host_owner_decision_record_human_record_owner_review_preparation_packet_ids), + ) iwooos_progress = iwooos_projection["progress"] assert_equal("iwooos_projection.progress.overall_percent", iwooos_progress["overall_percent"], progress["overall_percent"]) assert_equal( @@ -3473,6 +3490,147 @@ def validate(root: Path) -> None: f"iwooos_projection.host_owner_decision_record_human_record_owner_review_candidate_outcome_lanes.{item['lane_id']}.not_authorization", item["not_authorization"], ) + iwooos_host_owner_decision_record_human_record_owner_review_preparation_packets = iwooos_projection[ + "host_owner_decision_record_human_record_owner_review_preparation_packets" + ] + assert_equal( + "iwooos_projection.host_owner_decision_record_human_record_owner_review_preparation_packets.ids", + [ + item["packet_id"] + for item in iwooos_host_owner_decision_record_human_record_owner_review_preparation_packets + ], + expected_iwooos_host_owner_decision_record_human_record_owner_review_preparation_packet_ids, + ) + assert_equal( + "iwooos_projection.host_owner_decision_record_human_record_owner_review_preparation_packets.display_order", + [ + item["display_order"] + for item in iwooos_host_owner_decision_record_human_record_owner_review_preparation_packets + ], + list( + range( + 1, + len(expected_iwooos_host_owner_decision_record_human_record_owner_review_preparation_packet_ids) + 1, + ) + ), + ) + expected_iwooos_host_owner_decision_record_human_record_owner_review_preparation_fields = [ + "preparation_identity_trace", + "preparation_owner_boundary", + "preparation_decision_summary", + "preparation_scope_expiry", + "preparation_scan_limits", + "preparation_credential_boundary", + "preparation_maintenance_rollback", + "preparation_validation_runtime_gate", + "preparation_no_execution_attestation", + ] + assert_equal( + "iwooos_projection.host_owner_decision_record_human_record_owner_review_preparation_packets.preparation_fields", + [ + item["preparation_field"] + for item in iwooos_host_owner_decision_record_human_record_owner_review_preparation_packets + ], + expected_iwooos_host_owner_decision_record_human_record_owner_review_preparation_fields, + ) + for item in iwooos_host_owner_decision_record_human_record_owner_review_preparation_packets: + assert_equal( + f"iwooos_projection.host_owner_decision_record_human_record_owner_review_preparation_packets.{item['packet_id']}.source_outcome_lane_id", + item["source_outcome_lane_id"], + "host_decision_record_human_record_owner_review_candidate_ready_for_human_record_owner_review_preparation_outcome_lane", + ) + assert_equal( + f"iwooos_projection.host_owner_decision_record_human_record_owner_review_preparation_packets.{item['packet_id']}.display_mode", + item["display_mode"], + "owner_decision_record_human_record_owner_review_preparation_packet_only", + ) + assert_equal( + f"iwooos_projection.host_owner_decision_record_human_record_owner_review_preparation_packets.{item['packet_id']}.human_record_owner_review_prepared_count", + item["human_record_owner_review_prepared_count"], + 0, + ) + assert_equal( + f"iwooos_projection.host_owner_decision_record_human_record_owner_review_preparation_packets.{item['packet_id']}.human_record_owner_review_check_passed_count", + item["human_record_owner_review_check_passed_count"], + 0, + ) + assert_equal( + f"iwooos_projection.host_owner_decision_record_human_record_owner_review_preparation_packets.{item['packet_id']}.human_record_owner_review_started_count", + item["human_record_owner_review_started_count"], + 0, + ) + assert_equal( + f"iwooos_projection.host_owner_decision_record_human_record_owner_review_preparation_packets.{item['packet_id']}.human_record_owner_review_ready_count", + item["human_record_owner_review_ready_count"], + 0, + ) + assert_equal( + f"iwooos_projection.host_owner_decision_record_human_record_owner_review_preparation_packets.{item['packet_id']}.human_record_owner_handoff_review_passed_count", + item["human_record_owner_handoff_review_passed_count"], + 0, + ) + assert_equal( + f"iwooos_projection.host_owner_decision_record_human_record_owner_review_preparation_packets.{item['packet_id']}.human_record_owner_handoff_started_count", + item["human_record_owner_handoff_started_count"], + 0, + ) + assert_equal( + f"iwooos_projection.host_owner_decision_record_human_record_owner_review_preparation_packets.{item['packet_id']}.human_record_owner_handoff_ready_count", + item["human_record_owner_handoff_ready_count"], + 0, + ) + assert_equal( + f"iwooos_projection.host_owner_decision_record_human_record_owner_review_preparation_packets.{item['packet_id']}.formal_record_queue_review_passed_count", + item["formal_record_queue_review_passed_count"], + 0, + ) + assert_equal( + f"iwooos_projection.host_owner_decision_record_human_record_owner_review_preparation_packets.{item['packet_id']}.formal_record_queue_enqueued_count", + item["formal_record_queue_enqueued_count"], + 0, + ) + assert_false( + f"iwooos_projection.host_owner_decision_record_human_record_owner_review_preparation_packets.{item['packet_id']}.decision_record_created", + item["decision_record_created"], + ) + assert_equal( + f"iwooos_projection.host_owner_decision_record_human_record_owner_review_preparation_packets.{item['packet_id']}.owner_decision_received_count", + item["owner_decision_received_count"], + 0, + ) + assert_equal( + f"iwooos_projection.host_owner_decision_record_human_record_owner_review_preparation_packets.{item['packet_id']}.owner_decision_accepted_count", + item["owner_decision_accepted_count"], + 0, + ) + assert_false( + f"iwooos_projection.host_owner_decision_record_human_record_owner_review_preparation_packets.{item['packet_id']}.owner_approval_record_created", + item["owner_approval_record_created"], + ) + assert_false( + f"iwooos_projection.host_owner_decision_record_human_record_owner_review_preparation_packets.{item['packet_id']}.runtime_gate_opened", + item["runtime_gate_opened"], + ) + assert_false( + f"iwooos_projection.host_owner_decision_record_human_record_owner_review_preparation_packets.{item['packet_id']}.raw_payload_allowed", + item["raw_payload_allowed"], + ) + assert_false( + f"iwooos_projection.host_owner_decision_record_human_record_owner_review_preparation_packets.{item['packet_id']}.secret_value_collection_allowed", + item["secret_value_collection_allowed"], + ) + assert_false( + f"iwooos_projection.host_owner_decision_record_human_record_owner_review_preparation_packets.{item['packet_id']}.runtime_execution_authorized", + item["runtime_execution_authorized"], + ) + assert_false( + f"iwooos_projection.host_owner_decision_record_human_record_owner_review_preparation_packets.{item['packet_id']}.action_buttons_allowed", + item["action_buttons_allowed"], + ) + assert_true( + f"iwooos_projection.host_owner_decision_record_human_record_owner_review_preparation_packets.{item['packet_id']}.not_authorization", + item["not_authorization"], + ) assert_equal( "iwooos_projection.non_blocking_lane_ids", iwooos_projection["non_blocking_lane_ids"], @@ -3525,6 +3683,7 @@ def validate(root: Path) -> None: "display_host_owner_decision_record_human_record_owner_review_candidate_packets", "display_host_owner_decision_record_human_record_owner_review_candidate_checklist", "display_host_owner_decision_record_human_record_owner_review_candidate_outcome_lanes", + "display_host_owner_decision_record_human_record_owner_review_preparation_packets", "display_evidence_refs", "display_forbidden_actions", ]: @@ -3665,6 +3824,13 @@ def validate(root: Path) -> None: "collect_owner_decision_from_human_record_owner_review_candidate_outcome", "create_host_owner_decision_record_from_human_record_owner_review_candidate_outcome", "open_runtime_gate_from_human_record_owner_review_candidate_outcome", + "treat_host_owner_decision_record_human_record_owner_review_preparation_packet_as_approval", + "mark_human_record_owner_review_preparation_completed", + "start_human_record_owner_review_from_preparation_packet", + "mark_human_record_owner_review_ready_from_preparation_packet", + "collect_owner_decision_from_human_record_owner_review_preparation_packet", + "create_host_owner_decision_record_from_human_record_owner_review_preparation_packet", + "open_runtime_gate_from_human_record_owner_review_preparation_packet", "apply_runtime_blocking_control", "switch_github_primary", "production_deploy",