From 451c7c00885806d1aee88f05a026ee154782345a Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 19 May 2026 23:39:23 +0800 Subject: [PATCH] feat(web): add IwoooS decision record drafts --- apps/web/messages/en.json | 43 ++++++ apps/web/messages/zh-TW.json | 43 ++++++ apps/web/src/app/[locale]/iwooos/page.tsx | 65 ++++++++ docs/LOGBOOK.md | 14 ++ .../iwooos_posture_projection_v1.schema.json | 93 ++++++++++++ docs/security/IWOOOS-POSTURE-PROJECTION.md | 22 ++- .../security/SECURITY-MIRROR-STATUS-ROLLUP.md | 3 +- .../SECURITY-SUPPLY-CHAIN-PROGRESS.md | 4 +- .../iwooos-posture-projection.snapshot.json | 139 +++++++++++++++++- ...ecurity-mirror-status-rollup.snapshot.json | 10 ++ .../security-mirror-progress-guard.py | 94 ++++++++++++ 11 files changed, 524 insertions(+), 6 deletions(-) diff --git a/apps/web/messages/en.json b/apps/web/messages/en.json index ed33d9017..2895b6d04 100644 --- a/apps/web/messages/en.json +++ b/apps/web/messages/en.json @@ -1758,6 +1758,49 @@ "next": "active runtime gates=0; action buttons=false" } } + }, + "hostOwnerDecisionRecordDrafts": { + "title": "Host Owner Decision Record Draft Packets", + "subtitle": "When owner review outcome enters the ready lane, IwoooS can still only display decision record draft fields. It does not create records, mark acceptance, or open runtime gates.", + "packetLabel": "Draft packet", + "metadataLabel": "Required metadata", + "items": { + "scopeStatementDraft": { + "title": "Scope statement draft", + "body": "The draft only organizes hosts, networks, services, exclusions, and observation intent so the owner decision does not stay ambiguous.", + "metadata": "host / network / service / exclusion; record created=false" + }, + "scanModeDraft": { + "title": "Scan mode draft", + "body": "The draft only describes observe-only, future active scan, or credentialed scan candidate modes. It is not scan approval.", + "metadata": "mode candidate; active scan=false" + }, + "credentialBoundaryDraft": { + "title": "Credential boundary draft", + "body": "The draft only keeps credential handling metadata, owner, and retention boundary. It does not collect sensitive material.", + "metadata": "metadata-only boundary; secret collection=false" + }, + "maintenanceConstraintsDraft": { + "title": "Maintenance constraints draft", + "body": "The draft only records future maintenance window candidates, constraints, and impact boundaries. It is not host update approval.", + "metadata": "window / constraint; host update=false" + }, + "rollbackOwnerDraft": { + "title": "Rollback owner draft", + "body": "The draft only organizes rollback owner, recovery path, and human contact so later gates have accountability.", + "metadata": "owner / recovery pointer; approval record=false" + }, + "validationMetricsDraft": { + "title": "Validation metrics draft", + "body": "The draft only lists post-check metrics, baseline, and evidence pointer for later human interpretation.", + "metadata": "metrics / baseline; accepted=0" + }, + "runtimeGateDraft": { + "title": "Runtime gate draft", + "body": "The draft only states that later approval must still open a separate follow-up runtime gate and cannot execute from the draft.", + "metadata": "runtime gate pointer; active gates=0" + } + } } }, "tickets": { diff --git a/apps/web/messages/zh-TW.json b/apps/web/messages/zh-TW.json index 460b83bc7..2b2406cda 100644 --- a/apps/web/messages/zh-TW.json +++ b/apps/web/messages/zh-TW.json @@ -1759,6 +1759,49 @@ "next": "active runtime gates=0;action buttons=false" } } + }, + "hostOwnerDecisionRecordDrafts": { + "title": "主機 Owner Decision Record Draft Packets", + "subtitle": "Owner review outcome 若進入 ready lane,IwoooS 也只能顯示 decision record 草稿欄位。不建立 record、不標示 accepted、不開 runtime gate。", + "packetLabel": "Draft packet", + "metadataLabel": "必要 metadata", + "items": { + "scopeStatementDraft": { + "title": "Scope statement draft", + "body": "草稿只整理主機、網段、服務、排除範圍與觀察目的,避免 owner decision 模糊。", + "metadata": "host / network / service / exclusion;record created=false" + }, + "scanModeDraft": { + "title": "Scan mode draft", + "body": "草稿只描述 observe-only、future active scan 或 credentialed scan 的候選模式,不代表掃描批准。", + "metadata": "mode candidate;active scan=false" + }, + "credentialBoundaryDraft": { + "title": "Credential boundary draft", + "body": "草稿只保留 credential handling 的 metadata、owner 與保存邊界,不收集敏感素材。", + "metadata": "metadata-only boundary;secret collection=false" + }, + "maintenanceConstraintsDraft": { + "title": "Maintenance constraints draft", + "body": "草稿只記錄未來可能維護窗口、限制條件與不可影響範圍,不代表可以更新主機。", + "metadata": "window / constraint;host update=false" + }, + "rollbackOwnerDraft": { + "title": "Rollback owner draft", + "body": "草稿只整理 rollback owner、復原路徑與人工聯絡點,讓後續 gate 不缺責任人。", + "metadata": "owner / recovery pointer;approval record=false" + }, + "validationMetricsDraft": { + "title": "Validation metrics draft", + "body": "草稿只列出 post-check metrics、baseline 與 evidence pointer,供未來人工判讀。", + "metadata": "metrics / baseline;accepted=0" + }, + "runtimeGateDraft": { + "title": "Runtime gate draft", + "body": "草稿只標示若未來批准,仍需另開 follow-up runtime gate,不能由草稿直接執行。", + "metadata": "runtime gate pointer;active gates=0" + } + } } }, "tickets": { diff --git a/apps/web/src/app/[locale]/iwooos/page.tsx b/apps/web/src/app/[locale]/iwooos/page.tsx index bb71e83ce..4edbfbd06 100644 --- a/apps/web/src/app/[locale]/iwooos/page.tsx +++ b/apps/web/src/app/[locale]/iwooos/page.tsx @@ -158,6 +158,13 @@ type HostOwnerDecisionReviewOutcomeLane = { tone: 'steady' | 'warn' | 'locked' } +type HostOwnerDecisionRecordDraftPacket = { + 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' }, @@ -369,6 +376,16 @@ const hostOwnerDecisionReviewOutcomeLanes: HostOwnerDecisionReviewOutcomeLane[] { key: 'runtimeGateRequired', lane: 'U7', icon: ShieldCheck, tone: 'locked' }, ] +const hostOwnerDecisionRecordDraftPackets: HostOwnerDecisionRecordDraftPacket[] = [ + { key: 'scopeStatementDraft', packet: 'DR1', icon: Radar, tone: 'warn' }, + { key: 'scanModeDraft', packet: 'DR2', icon: Activity, tone: 'locked' }, + { key: 'credentialBoundaryDraft', packet: 'DR3', icon: Lock, tone: 'locked' }, + { key: 'maintenanceConstraintsDraft', packet: 'DR4', icon: Clock3, tone: 'warn' }, + { key: 'rollbackOwnerDraft', packet: 'DR5', icon: FileWarning, tone: 'warn' }, + { key: 'validationMetricsDraft', packet: 'DR6', icon: CheckCircle2, tone: 'warn' }, + { key: 'runtimeGateDraft', packet: 'DR7', icon: ShieldCheck, tone: 'locked' }, +] + const evidenceItems = [ 'iwooos-posture-projection.snapshot.json', 'security-rollout-policy.snapshot.json', @@ -951,6 +968,34 @@ function HostOwnerDecisionReviewOutcomeCard({ item }: { item: HostOwnerDecisionR ) } +function HostOwnerDecisionRecordDraftCard({ item }: { item: HostOwnerDecisionRecordDraftPacket }) { + const t = useTranslations('iwooos.hostOwnerDecisionRecordDrafts') + const Icon = item.icon + return ( +
+
+
+ + {t('packetLabel')} +
+ {item.packet} +
+

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

+

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

+
+
{t('metadataLabel')}
+
+ {t(`items.${item.key}.metadata` as never)} +
+
+
+ ) +} + export default function IwoooSPage({ params }: { params: { locale: string } }) { const t = useTranslations('iwooos') @@ -1263,6 +1308,26 @@ export default function IwoooSPage({ params }: { params: { locale: string } }) { +
+
+

{t('hostOwnerDecisionRecordDrafts.title')}

+

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

+
+
+ {hostOwnerDecisionRecordDraftPackets.map(item => ( + + ))} +
+
+
None: "s2_23_iwooos_host_owner_decision_candidate_packets", "s2_24_iwooos_host_owner_decision_review_checklist", "s2_25_iwooos_host_owner_decision_review_outcome_lanes", + "s2_26_iwooos_host_owner_decision_record_draft_packets", ] assert_equal( "progress_delta_ledger.delta_ids", @@ -448,6 +449,15 @@ def validate(root: Path) -> None: "host_rollback_owner_required_decision_outcome_lane", "host_runtime_gate_required_decision_outcome_lane", ] + expected_iwooos_host_owner_decision_record_draft_packet_ids = [ + "host_decision_record_scope_draft_packet", + "host_decision_record_scan_mode_draft_packet", + "host_decision_record_credential_boundary_draft_packet", + "host_decision_record_maintenance_constraints_draft_packet", + "host_decision_record_rollback_owner_draft_packet", + "host_decision_record_validation_metrics_draft_packet", + "host_decision_record_runtime_gate_draft_packet", + ] assert_equal( "iwooos_projection.summary.frontend_surface_coverage_group_count", iwooos_projection["summary"]["frontend_surface_coverage_group_count"], @@ -528,6 +538,11 @@ def validate(root: Path) -> None: iwooos_projection["summary"]["host_owner_decision_review_outcome_lane_count"], len(expected_iwooos_host_owner_decision_review_outcome_lane_ids), ) + assert_equal( + "iwooos_projection.summary.host_owner_decision_record_draft_packet_count", + iwooos_projection["summary"]["host_owner_decision_record_draft_packet_count"], + len(expected_iwooos_host_owner_decision_record_draft_packet_ids), + ) iwooos_progress = iwooos_projection["progress"] assert_equal("iwooos_projection.progress.overall_percent", iwooos_progress["overall_percent"], progress["overall_percent"]) assert_equal( @@ -1472,6 +1487,81 @@ def validate(root: Path) -> None: f"iwooos_projection.host_owner_decision_review_outcome_lanes.{item['lane_id']}.not_authorization", item["not_authorization"], ) + iwooos_host_owner_decision_record_draft_packets = iwooos_projection[ + "host_owner_decision_record_draft_packets" + ] + assert_equal( + "iwooos_projection.host_owner_decision_record_draft_packets.ids", + [item["packet_id"] for item in iwooos_host_owner_decision_record_draft_packets], + expected_iwooos_host_owner_decision_record_draft_packet_ids, + ) + assert_equal( + "iwooos_projection.host_owner_decision_record_draft_packets.display_order", + [item["display_order"] for item in iwooos_host_owner_decision_record_draft_packets], + list(range(1, len(expected_iwooos_host_owner_decision_record_draft_packet_ids) + 1)), + ) + expected_iwooos_host_owner_decision_record_draft_fields = [ + "scope_statement", + "scan_mode_statement", + "credential_boundary_statement", + "maintenance_constraints_statement", + "rollback_owner_statement", + "validation_metrics_statement", + "runtime_gate_pointer_statement", + ] + assert_equal( + "iwooos_projection.host_owner_decision_record_draft_packets.draft_fields", + [item["draft_field"] for item in iwooos_host_owner_decision_record_draft_packets], + expected_iwooos_host_owner_decision_record_draft_fields, + ) + for item in iwooos_host_owner_decision_record_draft_packets: + assert_equal( + f"iwooos_projection.host_owner_decision_record_draft_packets.{item['packet_id']}.display_mode", + item["display_mode"], + "owner_decision_record_draft_only", + ) + assert_false( + f"iwooos_projection.host_owner_decision_record_draft_packets.{item['packet_id']}.decision_record_created", + item["decision_record_created"], + ) + assert_equal( + f"iwooos_projection.host_owner_decision_record_draft_packets.{item['packet_id']}.owner_decision_received_count", + item["owner_decision_received_count"], + 0, + ) + assert_equal( + f"iwooos_projection.host_owner_decision_record_draft_packets.{item['packet_id']}.owner_decision_accepted_count", + item["owner_decision_accepted_count"], + 0, + ) + assert_false( + f"iwooos_projection.host_owner_decision_record_draft_packets.{item['packet_id']}.owner_approval_record_created", + item["owner_approval_record_created"], + ) + assert_false( + f"iwooos_projection.host_owner_decision_record_draft_packets.{item['packet_id']}.runtime_gate_opened", + item["runtime_gate_opened"], + ) + assert_false( + f"iwooos_projection.host_owner_decision_record_draft_packets.{item['packet_id']}.raw_payload_allowed", + item["raw_payload_allowed"], + ) + assert_false( + f"iwooos_projection.host_owner_decision_record_draft_packets.{item['packet_id']}.secret_value_collection_allowed", + item["secret_value_collection_allowed"], + ) + assert_false( + f"iwooos_projection.host_owner_decision_record_draft_packets.{item['packet_id']}.runtime_execution_authorized", + item["runtime_execution_authorized"], + ) + assert_false( + f"iwooos_projection.host_owner_decision_record_draft_packets.{item['packet_id']}.action_buttons_allowed", + item["action_buttons_allowed"], + ) + assert_true( + f"iwooos_projection.host_owner_decision_record_draft_packets.{item['packet_id']}.not_authorization", + item["not_authorization"], + ) assert_equal( "iwooos_projection.non_blocking_lane_ids", iwooos_projection["non_blocking_lane_ids"], @@ -1506,6 +1596,7 @@ def validate(root: Path) -> None: "display_host_owner_decision_candidate_packets", "display_host_owner_decision_review_checklist", "display_host_owner_decision_review_outcome_lanes", + "display_host_owner_decision_record_draft_packets", "display_evidence_refs", "display_forbidden_actions", ]: @@ -1556,6 +1647,9 @@ def validate(root: Path) -> None: "treat_host_owner_decision_review_outcome_as_approval", "mark_host_owner_decision_review_outcome_passed", "open_runtime_gate_from_owner_decision_review_outcome", + "create_host_owner_decision_record_from_draft", + "mark_host_owner_decision_record_created", + "open_runtime_gate_from_owner_decision_record_draft", "apply_runtime_blocking_control", "switch_github_primary", "production_deploy",