scene-capability-engine 3.2.0 → 3.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -727,6 +727,7 @@ Close-loop controller session maintenance:
727
727
  Cross-archive autonomous governance maintenance:
728
728
  - `sce auto governance stats [--days <n>] [--status <csv>] [--json]`: aggregate a unified governance snapshot from session/batch-session/controller-session archives plus recovery memory state.
729
729
  - JSON output includes `totals`, `throughput`, `health` (`risk_level`, `concerns`, `recommendations`, `release_gate`, `handoff_quality`), `top_master_specs`, `recovery_memory`, and full per-archive stats under `archives`.
730
+ - `health.release_gate` now carries weekly-ops governance pressure signals from release gate history (`weekly_ops_*`, including block/warning/config-warning totals and authorization/dialogue block-rate maxima) for risk scoring and recommendation routing.
730
731
  - When handoff Moqui matrix regressions are positive, `health.recommendations` now include phased anti-429 baseline one-shot remediation commands.
731
732
  - `health.handoff_quality` carries Moqui matrix + capability lexicon governance signals:
732
733
  - `latest_capability_expected_unknown_count`
@@ -749,6 +750,7 @@ Cross-archive autonomous governance maintenance:
749
750
  - `--governance-session-keep` (with optional `--governance-session-older-than-days`) enables post-run governance session retention pruning while protecting the current session snapshot.
750
751
  - `--execute-advisory` enables automatic advisory action execution (`recover-latest`, `controller-resume-latest`) when governance assessment detects failed sessions or controller pending goals; sce auto-selects the latest actionable advisory source and reports `skipped` (not `failed`) when no actionable source exists.
751
752
  - JSON output includes round-by-round risk/action telemetry (`rounds`, with `risk_before/risk_after` and `release_gate_before/release_gate_after`), advisory telemetry (`execute_advisory`, `advisory_policy`, `advisory_summary`, `rounds[*].advisory_actions`), `stop_detail` + `recommendations` for explicit blocking reasons, plus `initial_assessment`, `final_assessment`, and convergence metadata.
753
+ - When blocked by weekly release pressure, `stop_detail.weekly_ops` provides structured latest/aggregate/pressure fields so downstream agents and UI assistants do not need to parse reason strings.
752
754
  - Release-gate block reasons now include handoff matrix regression reasons when present:
753
755
  - `handoff-capability-expected-unknown-positive:<n>`
754
756
  - `handoff-capability-provided-unknown-positive:<n>`
@@ -756,8 +758,15 @@ Cross-archive autonomous governance maintenance:
756
758
  - `handoff-capability-provided-unknown-positive-rate:<percent>`
757
759
  - `handoff-moqui-matrix-regressions-positive:<n>`
758
760
  - `handoff-moqui-matrix-regressions-over-gate:<n>/<max>`
761
+ - Release-gate block reasons also include weekly-ops pressure reasons when present (examples):
762
+ - `weekly-ops-latest-blocked`
763
+ - `weekly-ops-blocked-runs-positive:<n>`
764
+ - `weekly-ops-config-warnings-positive:<n>`
765
+ - `weekly-ops-auth-tier-block-rate-high:<percent>`
766
+ - `weekly-ops-dialogue-authorization-block-rate-high:<percent>`
759
767
  - `sce auto governance session list [--limit <n>] [--status <csv>] [--resume-only] [--json]`: list persisted governance close-loop sessions (`--resume-only` filters to resumed-chain sessions only).
760
768
  - `sce auto governance session stats [--days <n>] [--status <csv>] [--resume-only] [--json]`: aggregate governance close-loop session telemetry (completion/failure/convergence, rounds, risk/stop composition, resumed-chain ratios/source counts, and aggregated `release_gate` round telemetry trends).
769
+ - `release_gate.weekly_ops_stop` summarizes weekly-ops stop pressure across governance sessions (session counts/rates, high-pressure/config-warning/auth-tier/dialogue pressure rates, and averaged blocked-runs/block-rate/config-warning totals).
761
770
  - `sce auto governance session prune [--keep <n>] [--older-than-days <n>] [--dry-run] [--json]`: prune governance close-loop session archive by retention policy.
762
771
 
763
772
  Close-loop recovery memory maintenance:
@@ -775,6 +784,8 @@ Autonomous KPI trend:
775
784
  Unified observability snapshot:
776
785
  - `sce auto observability snapshot [--days <n>] [--status <csv>] [--weeks <n>] [--trend-mode <mode>] [--trend-period <period>] [--out <path>] [--json]`: generate one unified observability snapshot that combines close-loop session stats, batch stats, controller stats, governance session stats, governance health, and KPI trend.
777
786
  - JSON output includes top-level `highlights` plus detailed archive/trend payloads under `snapshots`.
787
+ - `highlights` includes governance weekly-ops pressure counters (`governance_weekly_ops_stop_sessions`, high-pressure/config-warning/auth-tier/dialogue pressure counts/rates) plus runtime pressure counters (`governance_weekly_ops_runtime_block_rate_high_sessions`, `governance_weekly_ops_runtime_ui_mode_violation_high_sessions`, `governance_weekly_ops_runtime_ui_mode_violation_total_sum`).
788
+ - `snapshots.governance_weekly_ops_stop` exposes the full weekly-ops stop aggregate object from governance session stats for direct dashboard consumption.
778
789
 
779
790
  Agent-facing spec interfaces:
780
791
  - `sce auto spec status <spec-name> [--json]`: structured status for one spec (`docs`, `task_progress`, `collaboration`, `health`).
@@ -792,6 +803,9 @@ Dual-track handoff integration:
792
803
  - `sce auto handoff capability-matrix --manifest <path> [--profile <default|moqui|enterprise>] [--strict] [--strict-warnings] [--min-capability-coverage <n>] [--min-capability-semantic <n>] [--no-require-capability-semantic] [--format <json|markdown>] [--out <path>] [--remediation-queue-out <path>] [--fail-on-gap] [--json]`: generate a fast Moqui capability matrix (`template-diff + baseline + capability coverage + semantic completeness`) and optionally fail fast on gaps.
793
804
  - When matrix regressions are detected in baseline compare, recommendations prioritize capability-cluster phased execution first (`npm run run:matrix-remediation-clusters-phased -- --json`), then baseline phased one-shot (`node scripts/moqui-matrix-remediation-phased-runner.js --baseline ... --json`).
794
805
  - When `manifest.capabilities` is empty, sce auto-infers canonical expected capabilities from `manifest.templates` using the Moqui lexicon before deciding whether capability coverage should be skipped.
806
+ - `sce auto handoff preflight-check [--profile <default|moqui|enterprise>] [--history-file <path>] [--require-release-gate-preflight|--no-require-release-gate-preflight] [--release-evidence-window <n>] [--require-pass] [--json]`: inspect release-gate history preflight readiness and return machine-readable `pass|warning|blocked` status with reasons, runtime weekly-ops pressure signals, and executable remediation commands.
807
+ - `--require-pass` exits non-zero when status is not `pass` (recommended for CI/release hard gates).
808
+ - Default policy follows profile defaults and enforces release-gate preflight hard requirement (`default`/`moqui`/`enterprise` all require preflight by default).
795
809
  - `sce auto handoff run --manifest <path> [--profile <default|moqui|enterprise>] [--out <path>] [--queue-out <path>] [--append] [--no-include-known-gaps] [--continue-from <session|latest|file>] [--continue-strategy <auto|pending|failed-only>] [--dry-run] [--strict] [--strict-warnings] [--no-dependency-batching] [--min-spec-success-rate <n>] [--max-risk-level <level>] [--max-moqui-matrix-regressions <n>] [--no-require-ontology-validation] [--no-require-moqui-baseline] [--min-capability-coverage <n>] [--no-require-capability-coverage] [--require-release-gate-preflight] [--release-evidence-window <n>] [--json]`: execute handoff end-to-end (`plan -> queue -> close-loop-batch -> observability`) with automatic report archive to `.kiro/reports/handoff-runs/<session>.json`.
796
810
  - Default mode is dependency-aware: spec integration goals are grouped into dependency batches and executed in topological order.
797
811
  - `--continue-from` resumes pending goals from an existing handoff run report (`latest`, session id, or JSON file path). For safety, sce enforces manifest-path consistency between the previous report and current run.
@@ -804,11 +818,13 @@ Dual-track handoff integration:
804
818
  - Run output includes `moqui_capability_coverage` snapshot by default (when manifest `capabilities` is declared), with artifacts at `.kiro/reports/release-evidence/moqui-capability-coverage.json` and `.kiro/reports/release-evidence/moqui-capability-coverage.md`.
805
819
  - When `manifest.capabilities` is not declared, sce attempts lexicon-based capability inference from `manifest.templates` first; only fully non-mappable manifests keep capability coverage in skipped mode.
806
820
  - Run output includes `release_gate_preflight` (latest release gate history signal snapshot + blocked reasons) and carries this context into `warnings`.
807
- - `release_gate_preflight` is advisory by default; use `--require-release-gate-preflight` to hard-fail when preflight is unavailable/blocked.
821
+ - `release_gate_preflight` now also carries runtime weekly-ops pressure metrics (`latest_weekly_ops_runtime_block_rate_percent`, `latest_weekly_ops_runtime_ui_mode_violation_total`, `latest_weekly_ops_runtime_ui_mode_violation_rate_percent`) for UI-mode policy diagnostics.
822
+ - `release_gate_preflight` is hard-gated by default; use `--no-require-release-gate-preflight` only for emergency bypass or isolated diagnostics.
823
+ - `phases[*].details` for `observability` now includes weekly-ops stop pressure counters (`weekly_ops_stop_sessions`, `weekly_ops_high_pressure_sessions`, config-warning/auth-tier/dialogue pressure session counts) and runtime pressure counters (`weekly_ops_runtime_block_rate_high_sessions`, `weekly_ops_runtime_ui_mode_violation_high_sessions`, `weekly_ops_runtime_ui_mode_violation_total_sum`) sourced from the unified observability snapshot.
808
824
  - `--profile` applies preset gate policy defaults before explicit option overrides:
809
- - `default`: current baseline gate policy.
810
- - `moqui`: explicit Moqui-intake baseline (same strict defaults as `default`).
811
- - `enterprise`: stricter release control baseline (`max-risk-level=medium`, `require-release-gate-preflight=true`, `release-evidence-window=10`).
825
+ - `default`: default takeover policy (release-gate preflight hard requirement enabled).
826
+ - `moqui`: explicit Moqui-intake baseline (same hard-gate defaults as `default`).
827
+ - `enterprise`: stricter release control baseline (`max-risk-level=medium`, `release-evidence-window=10`, preflight hard requirement enabled).
812
828
  - When Moqui baseline/capability gates fail, sce auto-generates remediation queue lines at `.kiro/auto/moqui-remediation.lines`.
813
829
  - Run result includes `failure_summary` (failed phase/gate/release-gate preflight highlights) and `recommendations` with executable follow-up commands (for example, auto-generated `--continue-from <session>` on failed/incomplete batches).
814
830
  - When matrix regressions are detected, recommendations now prioritize capability-cluster phased execution (`npm run run:matrix-remediation-clusters-phased -- --json`) and include capability-cluster batch fallback plus baseline phased one-shot remediation (`node scripts/moqui-matrix-remediation-phased-runner.js --baseline ... --json`).
@@ -827,6 +843,7 @@ Dual-track handoff integration:
827
843
  - `--window` (1-50, default `5`) controls how many recent sessions are aggregated in review.
828
844
  - JSON output includes `current_overview` (with `release_gate_preflight`, `failure_summary`, and preflight policy flags), `aggregates.status_counts`, `aggregates.gate_pass_rate_percent`, and `risk_layers`.
829
845
  - Markdown output includes `Current Gate`, `Current Release Gate Preflight`, `Current Failure Summary`, `Current Ontology`, `Current Regression`, `Current Moqui Baseline`, `Current Capability Coverage`, `Trend Series`, and `Risk Layer View`.
846
+ - `Current Release Gate Preflight` includes runtime pressure lines (runtime block-rate and ui-mode violation totals/rates) when signals exist in release-gate history.
830
847
  - Add `--release-draft <path>` to auto-generate a release notes draft and evidence review markdown in one run.
831
848
  - `--release-version` sets draft version tag (defaults to `v<package.json version>`), and `--release-date` accepts `YYYY-MM-DD` (default: current UTC date).
832
849
  - Use `--review-out <path>` to override the generated evidence review markdown path (default `.kiro/reports/release-evidence/handoff-evidence-review.md`).
@@ -834,7 +851,7 @@ Dual-track handoff integration:
834
851
  - Default scan dir is `.kiro/reports/release-evidence`, default output file is `.kiro/reports/release-evidence/release-gate-history.json`.
835
852
  - `--history-file` merges an existing index (for example, previous release asset) before dedup/refresh.
836
853
  - `--keep` retains latest N entries (`1-5000`, default `200`).
837
- - Aggregates include scene package batch, capability unknown trend, drift, and release-preflight/hard-gate signals (`scene_package_batch_*`, `capability_expected_unknown_*`, `capability_provided_unknown_*`, `drift_alert_*`, `drift_block_*`, `release_gate_preflight_*`) when present in gate reports.
854
+ - Aggregates include scene package batch, capability unknown trend, drift, weekly ops pressure (including runtime ui-mode/runtime block-rate telemetry), config warning pressure, and release-preflight/hard-gate signals (`scene_package_batch_*`, `capability_expected_unknown_*`, `capability_provided_unknown_*`, `drift_alert_*`, `drift_block_*`, `weekly_ops_*`, `config_warnings_total`, `release_gate_preflight_*`) when present in gate reports.
838
855
  - `--markdown-out <path>` writes a human-readable trend card markdown for PR/Issue handoff.
839
856
 
840
857
  Moqui template library lexicon audit (script-level governance helper):
@@ -888,12 +905,18 @@ Release weekly ops gate helper (release hard-gate):
888
905
  - `RELEASE_WEEKLY_OPS_MAX_RISK_LEVEL=medium`
889
906
  - optional thresholds:
890
907
  - `RELEASE_WEEKLY_OPS_MAX_GOVERNANCE_BREACHES=<n>`
908
+ - `RELEASE_WEEKLY_OPS_MAX_AUTHORIZATION_TIER_BLOCK_RATE_PERCENT=<n>` (default `40`)
909
+ - `RELEASE_WEEKLY_OPS_MAX_DIALOGUE_AUTHORIZATION_BLOCK_RATE_PERCENT=<n>` (default `40`)
910
+ - `RELEASE_WEEKLY_OPS_MAX_RUNTIME_UI_MODE_VIOLATION_TOTAL=<n>` (default `0`)
911
+ - `RELEASE_WEEKLY_OPS_MAX_RUNTIME_UI_MODE_VIOLATION_RATE_PERCENT=<n>`
891
912
  - `RELEASE_WEEKLY_OPS_MAX_MATRIX_REGRESSION_RATE_PERCENT=<n>`
913
+ - invalid numeric threshold values emit `config_warnings` and fall back to defaults.
892
914
  - merges result into `RELEASE_GATE_REPORT_FILE` when provided.
893
915
  - npm alias: `npm run gate:release-ops-weekly`
894
916
 
895
917
  Release risk remediation bundle helper (weekly + drift unified command pack):
896
918
  - `node scripts/release-risk-remediation-bundle.js [--gate-report <path>] [--out <path>] [--markdown-out <path>] [--lines-out <path>] [--json]`: derive deduplicated remediation commands from `release-gate` report signals (`weekly_ops`, `drift`) and export JSON/Markdown/lines artifacts.
919
+ - when weekly gate includes `dialogue-authorization`/`authorization-tier` block-rate pressure, plan includes policy-specific diagnostics (`interactive-dialogue-governance`, `interactive-authorization-tier-evaluate`).
897
920
  - Default input: `.kiro/reports/release-evidence/release-gate.json`
898
921
  - Default outputs:
899
922
  - `.kiro/reports/release-evidence/release-risk-remediation-bundle.json`
@@ -987,11 +1010,15 @@ Interactive context bridge helper (script-level provider normalization):
987
1010
  - npm alias: `npm run report:interactive-context-bridge`
988
1011
 
989
1012
  Interactive full flow helper (script-level one-command entry):
990
- - `node scripts/interactive-flow.js --input <path> (--goal <text> | --goal-file <path>) [--provider <moqui|generic>] [--execution-mode <suggestion|apply>] [--runtime-mode <user-assist|ops-fix|feature-dev>] [--runtime-environment <dev|staging|prod>] [--runtime-policy <path>] [--policy <path>] [--catalog <path>] [--dialogue-policy <path>] [--context-contract <path>] [--approval-role-policy <path>] [--approval-actor-role <name>] [--approver-actor-role <name>] [--auto-execute-low-risk] [--auth-password-hash <sha256>] [--auth-password <text>] [--feedback-score <0..5>] [--work-order-out <path>] [--work-order-markdown-out <path>] [--fail-on-runtime-non-allow] [--no-matrix] [--matrix-min-score <0..100>] [--matrix-min-valid-rate <0..100>] [--matrix-compare-with <path>] [--matrix-signals <path>] [--matrix-fail-on-portfolio-fail] [--matrix-fail-on-regression] [--json]`: run `context-bridge -> interactive-loop -> matrix-baseline-snapshot` in one command for Moqui workbench integration.
1013
+ - `node scripts/interactive-flow.js --input <path> (--goal <text> | --goal-file <path>) [--provider <moqui|generic>] [--execution-mode <suggestion|apply>] [--runtime-mode <user-assist|ops-fix|feature-dev>] [--runtime-environment <dev|staging|prod>] [--runtime-policy <path>] [--authorization-tier-policy <path>] [--authorization-tier-out <path>] [--policy <path>] [--catalog <path>] [--dialogue-policy <path>] [--dialogue-profile <business-user|system-maintainer>] [--ui-mode <user-app|ops-console>] [--context-contract <path>] [--approval-role-policy <path>] [--approval-actor-role <name>] [--approver-actor-role <name>] [--auto-execute-low-risk] [--auth-password-hash <sha256>] [--auth-password <text>] [--feedback-score <0..5>] [--work-order-out <path>] [--work-order-markdown-out <path>] [--fail-on-runtime-non-allow] [--no-matrix] [--matrix-min-score <0..100>] [--matrix-min-valid-rate <0..100>] [--matrix-compare-with <path>] [--matrix-signals <path>] [--matrix-fail-on-portfolio-fail] [--matrix-fail-on-regression] [--json]`: run `context-bridge -> interactive-loop -> matrix-baseline-snapshot` in one command for Moqui workbench integration.
991
1014
  - Default flow artifact root: `.kiro/reports/interactive-flow/<session-id>/`
992
1015
  - Default flow summary output: `.kiro/reports/interactive-flow/<session-id>/interactive-flow.summary.json`
993
1016
  - Default dialogue report output: `.kiro/reports/interactive-flow/<session-id>/interactive-dialogue-governance.json`
1017
+ - Default dialogue-authorization signal stream:
1018
+ - `.kiro/reports/interactive-flow/<session-id>/interactive-dialogue-authorization-signals.jsonl` (session)
1019
+ - `.kiro/reports/interactive-dialogue-authorization-signals.jsonl` (global append-only stream)
994
1020
  - Default runtime report output: `.kiro/reports/interactive-flow/<session-id>/interactive-runtime-policy.json`
1021
+ - Default authorization tier report output: `.kiro/reports/interactive-flow/<session-id>/interactive-authorization-tier.json`
995
1022
  - Default work-order outputs:
996
1023
  - `.kiro/reports/interactive-flow/<session-id>/interactive-work-order.json`
997
1024
  - `.kiro/reports/interactive-flow/<session-id>/interactive-work-order.md`
@@ -1014,9 +1041,13 @@ Interactive read-only intent helper (script-level stage-A copilot bridge):
1014
1041
  - This helper never executes write actions; it only produces suggestion-stage artifacts.
1015
1042
 
1016
1043
  Interactive dialogue governance helper (script-level communication-rule gate):
1017
- - `node scripts/interactive-dialogue-governance.js (--goal <text> | --goal-file <path>) [--context <path>] [--policy <path>] [--out <path>] [--fail-on-deny] [--json]`: evaluate user request text against embedded-assistant communication policy, output `allow|clarify|deny`, and produce clarification questions for non-technical users.
1044
+ - `node scripts/interactive-dialogue-governance.js (--goal <text> | --goal-file <path>) [--context <path>] [--policy <path>] [--profile <business-user|system-maintainer>] [--ui-mode <user-app|ops-console>] [--execution-mode <suggestion|apply>] [--runtime-environment <dev|staging|prod>] [--authorization-dialogue-policy <path>] [--out <path>] [--fail-on-deny] [--json]`: evaluate user request text against embedded-assistant communication policy, output `allow|clarify|deny`, and produce machine-readable authorization dialogue requirements (`authorization_dialogue`) for non-technical users.
1045
+ - Embedded assistant authorization dialogue baseline: `docs/interactive-customization/embedded-assistant-authorization-dialogue-rules.md`
1046
+ - Dual-surface integration guide: `docs/interactive-customization/dual-ui-mode-integration-guide.md`
1018
1047
  - Default output: `.kiro/reports/interactive-dialogue-governance.json`
1019
1048
  - Default policy: `docs/interactive-customization/dialogue-governance-policy-baseline.json` (fallback builtin policy when missing)
1049
+ - Default authorization dialogue policy: `docs/interactive-customization/authorization-dialogue-policy-baseline.json`
1050
+ - Default profile: `business-user` (use `system-maintainer` for maintenance/operator conversations)
1020
1051
  - `--fail-on-deny` exits with code `2` to block unsafe requests in CI/automation.
1021
1052
 
1022
1053
  Interactive change-plan generator helper (script-level stage-B planning bridge):
@@ -1027,13 +1058,23 @@ Interactive change-plan generator helper (script-level stage-B planning bridge):
1027
1058
  - Generated plans can be evaluated directly by `interactive-change-plan-gate`.
1028
1059
 
1029
1060
  Interactive one-click loop helper (script-level orchestration entry):
1030
- - `node scripts/interactive-customization-loop.js --context <path> (--goal <text> | --goal-file <path>) [--execution-mode <suggestion|apply>] [--runtime-mode <user-assist|ops-fix|feature-dev>] [--runtime-environment <dev|staging|prod>] [--runtime-policy <path>] [--policy <path>] [--catalog <path>] [--dialogue-policy <path>] [--context-contract <path>] [--approval-role-policy <path>] [--approval-actor-role <name>] [--approver-actor-role <name>] [--no-strict-contract] [--auto-approve-low-risk] [--auto-execute-low-risk] [--auth-password-hash <sha256>] [--auth-password <text>] [--feedback-score <0..5>] [--feedback-comment <text>] [--feedback-tags <csv>] [--allow-suggestion-apply] [--work-order-out <path>] [--work-order-markdown-out <path>] [--fail-on-dialogue-deny] [--fail-on-gate-non-allow] [--fail-on-runtime-non-allow] [--json]`: run dialogue->intent->plan->gate->runtime->approval pipeline in one command and optionally trigger low-risk one-click apply via Moqui adapter.
1061
+ - `node scripts/interactive-customization-loop.js --context <path> (--goal <text> | --goal-file <path>) [--execution-mode <suggestion|apply>] [--runtime-mode <user-assist|ops-fix|feature-dev>] [--runtime-environment <dev|staging|prod>] [--runtime-policy <path>] [--authorization-tier-policy <path>] [--authorization-tier-out <path>] [--policy <path>] [--catalog <path>] [--dialogue-policy <path>] [--dialogue-profile <business-user|system-maintainer>] [--ui-mode <user-app|ops-console>] [--context-contract <path>] [--approval-role-policy <path>] [--approval-actor-role <name>] [--approver-actor-role <name>] [--no-strict-contract] [--auto-approve-low-risk] [--auto-execute-low-risk] [--auth-password-hash <sha256>] [--auth-password <text>] [--feedback-score <0..5>] [--feedback-comment <text>] [--feedback-tags <csv>] [--allow-suggestion-apply] [--work-order-out <path>] [--work-order-markdown-out <path>] [--fail-on-dialogue-deny] [--fail-on-gate-non-allow] [--fail-on-runtime-non-allow] [--json]`: run dialogue->intent->plan->gate->runtime->authorization-tier->approval pipeline in one command and optionally trigger low-risk one-click apply via Moqui adapter.
1031
1062
  - CLI equivalent: `sce scene interactive-loop --context <path> --goal "<goal>" --context-contract docs/interactive-customization/moqui-copilot-context-contract.json --execution-mode apply --auto-execute-low-risk --auth-password "<password>" --feedback-score 5 --json`
1032
1063
  - Default loop artifact root: `.kiro/reports/interactive-loop/<session-id>/`
1033
1064
  - Default summary output: `.kiro/reports/interactive-loop/<session-id>/interactive-customization-loop.summary.json`
1034
1065
  - `--auto-execute-low-risk` executes `interactive-moqui-adapter --action low-risk-apply` only when `risk_level=low`, dialogue decision != `deny`, and gate decision=`allow`.
1035
1066
  - `--runtime-mode` and `--runtime-environment` default to `ops-fix@staging`; runtime decision must be `allow` before low-risk auto execute.
1067
+ - Authorization tier defaults:
1068
+ - `business-user` profile is suggestion-only (`apply` denied by default)
1069
+ - `system-maintainer` profile can apply, but environment step-up requirements still apply (password/role separation/manual review)
1036
1070
  - Default runtime report: `.kiro/reports/interactive-loop/<session-id>/interactive-runtime-policy.json`
1071
+ - Default authorization tier report: `.kiro/reports/interactive-loop/<session-id>/interactive-authorization-tier.json`
1072
+ - Default authorization tier signal stream:
1073
+ - Session: `.kiro/reports/interactive-loop/<session-id>/interactive-authorization-tier-signals.jsonl`
1074
+ - Global: `.kiro/reports/interactive-authorization-tier-signals.jsonl`
1075
+ - Default dialogue-authorization signal stream:
1076
+ - Session: `.kiro/reports/interactive-loop/<session-id>/interactive-dialogue-authorization-signals.jsonl`
1077
+ - Global: `.kiro/reports/interactive-dialogue-authorization-signals.jsonl`
1037
1078
  - Default work-order outputs:
1038
1079
  - `.kiro/reports/interactive-loop/<session-id>/interactive-work-order.json`
1039
1080
  - `.kiro/reports/interactive-loop/<session-id>/interactive-work-order.md`
@@ -1042,13 +1083,20 @@ Interactive one-click loop helper (script-level orchestration entry):
1042
1083
  - npm alias: `npm run run:interactive-loop -- --context docs/interactive-customization/page-context.sample.json --goal "Improve order entry clarity" --json`
1043
1084
 
1044
1085
  Interactive runtime policy helper (script-level mode/environment gate):
1045
- - `node scripts/interactive-runtime-policy-evaluate.js --plan <path> [--runtime-mode <user-assist|ops-fix|feature-dev>] [--runtime-environment <dev|staging|prod>] [--policy <path>] [--fail-on-non-allow] [--json]`: evaluate plan execution safety by runtime role and environment constraints.
1086
+ - `node scripts/interactive-runtime-policy-evaluate.js --plan <path> [--ui-mode <user-app|ops-console>] [--runtime-mode <user-assist|ops-fix|feature-dev>] [--runtime-environment <dev|staging|prod>] [--policy <path>] [--fail-on-non-allow] [--json]`: evaluate plan execution safety by runtime role, UI surface, and environment constraints.
1046
1087
  - Default policy: `docs/interactive-customization/runtime-mode-policy-baseline.json`
1088
+ - `policy.ui_modes` (when configured) enforces UI-surface contract, such as `user-app` suggestion-only and apply routed to `ops-console`.
1047
1089
  - Default output: `.kiro/reports/interactive-runtime-policy.json`
1048
1090
  - `--fail-on-non-allow` exits with code `2` on `deny` or `review-required`.
1049
1091
 
1092
+ Interactive authorization-tier helper (script-level profile/environment step-up gate):
1093
+ - `node scripts/interactive-authorization-tier-evaluate.js [--execution-mode <suggestion|apply>] [--dialogue-profile <business-user|system-maintainer>] [--runtime-mode <name>] [--runtime-environment <dev|staging|prod>] [--auto-execute-low-risk] [--live-apply] [--policy <path>] [--out <path>] [--fail-on-non-allow] [--json]`: evaluate whether execution intent is permitted under dialogue profile and runtime environment authorization tier.
1094
+ - Default policy: `docs/interactive-customization/authorization-tier-policy-baseline.json`
1095
+ - Default output: `.kiro/reports/interactive-authorization-tier.json`
1096
+ - `--fail-on-non-allow` exits with code `2` on `deny` or `review-required`.
1097
+
1050
1098
  Interactive work-order helper (script-level usage/maintenance/dev closure):
1051
- - `node scripts/interactive-work-order-build.js --plan <path> [--dialogue <path>] [--intent <path>] [--gate <path>] [--runtime <path>] [--approval-state <path>] [--execution-attempted] [--execution-result <value>] [--execution-id <id>] [--out <path>] [--markdown-out <path>] [--json]`: build auditable work-order record from dialogue/plan/gate/runtime/approval/execution signals.
1099
+ - `node scripts/interactive-work-order-build.js --plan <path> [--dialogue <path>] [--intent <path>] [--gate <path>] [--runtime <path>] [--authorization-tier <path>] [--approval-state <path>] [--execution-attempted] [--execution-result <value>] [--execution-id <id>] [--out <path>] [--markdown-out <path>] [--json]`: build auditable work-order record from dialogue/plan/gate/runtime/authorization-tier/approval/execution signals.
1052
1100
  - Default outputs:
1053
1101
  - `.kiro/reports/interactive-work-order.json`
1054
1102
  - `.kiro/reports/interactive-work-order.md`
@@ -1078,11 +1126,14 @@ Interactive user feedback helper (script-level stage-D feedback ingestion):
1078
1126
  - npm alias: `npm run log:interactive-feedback -- --score 5 --comment "clear and safe"`
1079
1127
 
1080
1128
  Interactive governance report helper (script-level stage-D/6 observability + alerting):
1081
- - `node scripts/interactive-governance-report.js [--intent-audit <path>] [--approval-audit <path>] [--execution-ledger <path>] [--feedback-file <path>] [--matrix-signals <path>] [--thresholds <path>] [--period <weekly|monthly|all|custom>] [--from <iso>] [--to <iso>] [--out <path>] [--markdown-out <path>] [--fail-on-alert] [--json]`: compute interactive governance KPIs (adoption/success/rollback/security-intercept/satisfaction + matrix pass/regression/stage-error), evaluate threshold breaches, and emit machine/human-readable governance report.
1129
+ - `node scripts/interactive-governance-report.js [--intent-audit <path>] [--approval-audit <path>] [--execution-ledger <path>] [--feedback-file <path>] [--matrix-signals <path>] [--dialogue-authorization-signals <path>] [--runtime-signals <path>] [--authorization-tier-signals <path>] [--thresholds <path>] [--period <weekly|monthly|all|custom>] [--from <iso>] [--to <iso>] [--out <path>] [--markdown-out <path>] [--fail-on-alert] [--json]`: compute interactive governance KPIs (adoption/success/rollback/security-intercept/satisfaction + matrix pass/regression/stage-error + dialogue/runtime/authorization-tier pressure), evaluate threshold breaches, and emit machine/human-readable governance report.
1082
1130
  - Default thresholds: `docs/interactive-customization/governance-threshold-baseline.json`
1083
1131
  - Default minimum intent sample threshold: `min_intent_samples=5` (below this becomes warning, not breach)
1084
1132
  - Default feedback input: `.kiro/reports/interactive-user-feedback.jsonl`
1085
1133
  - Default matrix input: `.kiro/reports/interactive-matrix-signals.jsonl`
1134
+ - Default dialogue authorization signal input: `.kiro/reports/interactive-dialogue-authorization-signals.jsonl`
1135
+ - Default runtime policy signal input: `.kiro/reports/interactive-runtime-signals.jsonl`
1136
+ - Default authorization tier signal input: `.kiro/reports/interactive-authorization-tier-signals.jsonl`
1086
1137
  - Default outputs:
1087
1138
  - `.kiro/reports/interactive-governance-report.json`
1088
1139
  - `.kiro/reports/interactive-governance-report.md`
@@ -10,7 +10,9 @@ This directory contains baseline contracts and safety policy artifacts for the i
10
10
  - `page-context.schema.json`: schema for page-level read-only context payloads.
11
11
  - `guardrail-policy-baseline.json`: default secure-by-default guardrail policy.
12
12
  - `dialogue-governance-policy-baseline.json`: baseline communication rules for embedded assistant dialogue.
13
- - `runtime-mode-policy-baseline.json`: baseline runtime mode/environment policy (`user-assist|ops-fix|feature-dev` x `dev|staging|prod`).
13
+ - `authorization-dialogue-policy-baseline.json`: machine-readable authorization dialogue policy (profile/env confirmation + step-up prompts).
14
+ - `authorization-tier-policy-baseline.json`: baseline authorization tier policy for profile/environment step-up requirements.
15
+ - `runtime-mode-policy-baseline.json`: baseline runtime mode/environment policy (`user-assist|ops-fix|feature-dev` x `dev|staging|prod`) with optional `ui_modes` surface contract (`user-app|ops-console`).
14
16
  - `approval-role-policy-baseline.json`: optional approval role policy baseline (`submit/approve/execute/verify/archive` role requirements).
15
17
  - `high-risk-action-catalog.json`: baseline high-risk action classification for deny/review decisions.
16
18
  - `change-plan.sample.json`: runnable sample plan for gate checks.
@@ -27,6 +29,8 @@ This directory contains baseline contracts and safety policy artifacts for the i
27
29
  - `governance-threshold-baseline.json`: governance KPI threshold baseline for alerting.
28
30
  - `governance-report-template.md`: periodic governance report template.
29
31
  - `governance-alert-playbook.md`: threshold breach response workflow.
32
+ - `embedded-assistant-authorization-dialogue-rules.md`: required user/maintainer conversation + authorization behavior for embedded AI assistants.
33
+ - `dual-ui-mode-integration-guide.md`: integration pattern for user-app and ops-console dual-surface deployments.
30
34
  - `phase-acceptance-evidence.md`: stage A/B/C/D acceptance evidence checklist.
31
35
  - `non-technical-usability-report.md`: business-user usability assessment and improvement backlog.
32
36
  - `cross-industry-replication-guide.md`: replication boundary and rollout sequence beyond Moqui.
@@ -71,10 +75,12 @@ Run one-command full flow (bridge -> loop):
71
75
  node scripts/interactive-flow.js \
72
76
  --input docs/interactive-customization/moqui-context-provider.sample.json \
73
77
  --goal "Adjust order screen field layout for clearer input flow" \
78
+ --dialogue-profile system-maintainer \
74
79
  --runtime-mode ops-fix \
75
80
  --runtime-environment staging \
76
81
  --context-contract docs/interactive-customization/moqui-copilot-context-contract.json \
77
82
  --dialogue-policy docs/interactive-customization/dialogue-governance-policy-baseline.json \
83
+ --authorization-tier-policy docs/interactive-customization/authorization-tier-policy-baseline.json \
78
84
  --runtime-policy docs/interactive-customization/runtime-mode-policy-baseline.json \
79
85
  --execution-mode apply \
80
86
  --auto-execute-low-risk \
@@ -105,9 +111,21 @@ Flow output defaults:
105
111
  - Bridge context: `.kiro/reports/interactive-flow/<session-id>/interactive-page-context.normalized.json`
106
112
  - Loop summary: `.kiro/reports/interactive-flow/<session-id>/interactive-customization-loop.summary.json`
107
113
  - Dialogue governance report: `.kiro/reports/interactive-flow/<session-id>/interactive-dialogue-governance.json`
114
+ - Dialogue authorization signal stream:
115
+ - Session: `.kiro/reports/interactive-flow/<session-id>/interactive-dialogue-authorization-signals.jsonl`
116
+ - Global: `.kiro/reports/interactive-dialogue-authorization-signals.jsonl`
117
+ - Authorization tier report: `.kiro/reports/interactive-flow/<session-id>/interactive-authorization-tier.json`
118
+ - Authorization tier signal stream:
119
+ - Session: `.kiro/reports/interactive-flow/<session-id>/interactive-authorization-tier-signals.jsonl`
120
+ - Global: `.kiro/reports/interactive-authorization-tier-signals.jsonl`
108
121
  - Matrix summary JSON: `.kiro/reports/interactive-flow/<session-id>/moqui-template-baseline.json`
109
122
  - Matrix summary Markdown: `.kiro/reports/interactive-flow/<session-id>/moqui-template-baseline.md`
110
123
  - Matrix signal stream: `.kiro/reports/interactive-matrix-signals.jsonl`
124
+ - Loop/flow summaries now include execution block diagnostics:
125
+ - `summary.dialogue_authorization_decision` (`allow|review-required|deny`)
126
+ - `summary.execution_block_reason_category` (`password-authorization|role-policy|authorization-tier|runtime-policy|approval-policy|unknown`)
127
+ - `summary.execution_block_remediation_hint` (human-readable fix hint)
128
+ - `summary.authorization_execute_roles` (flow-level execute role requirements when role policy is enabled)
111
129
 
112
130
  Build read-only change intent from page context:
113
131
 
@@ -134,8 +152,13 @@ Run dialogue governance (communication-rule check only):
134
152
  ```bash
135
153
  node scripts/interactive-dialogue-governance.js \
136
154
  --goal "Improve order entry speed without changing payment policy" \
155
+ --execution-mode suggestion \
156
+ --runtime-environment staging \
157
+ --profile business-user \
158
+ --ui-mode user-app \
137
159
  --context docs/interactive-customization/page-context.sample.json \
138
160
  --policy docs/interactive-customization/dialogue-governance-policy-baseline.json \
161
+ --authorization-dialogue-policy docs/interactive-customization/authorization-dialogue-policy-baseline.json \
139
162
  --json
140
163
  ```
141
164
 
@@ -147,6 +170,8 @@ node scripts/interactive-customization-loop.js \
147
170
  --context docs/interactive-customization/page-context.sample.json \
148
171
  --context-contract docs/interactive-customization/moqui-copilot-context-contract.json \
149
172
  --goal "Improve order entry clarity for business users" \
173
+ --dialogue-profile business-user \
174
+ --ui-mode user-app \
150
175
  --json
151
176
 
152
177
  # low-risk one-click apply loop
@@ -154,8 +179,11 @@ node scripts/interactive-customization-loop.js \
154
179
  --context docs/interactive-customization/page-context.sample.json \
155
180
  --context-contract docs/interactive-customization/moqui-copilot-context-contract.json \
156
181
  --goal "Adjust order screen field layout for clearer input flow" \
182
+ --dialogue-profile system-maintainer \
183
+ --ui-mode ops-console \
157
184
  --runtime-mode ops-fix \
158
185
  --runtime-environment staging \
186
+ --authorization-tier-policy docs/interactive-customization/authorization-tier-policy-baseline.json \
159
187
  --runtime-policy docs/interactive-customization/runtime-mode-policy-baseline.json \
160
188
  --approval-role-policy docs/interactive-customization/approval-role-policy-baseline.json \
161
189
  --approval-actor-role product-owner \
@@ -174,6 +202,7 @@ sce scene interactive-loop \
174
202
  --context docs/interactive-customization/page-context.sample.json \
175
203
  --context-contract docs/interactive-customization/moqui-copilot-context-contract.json \
176
204
  --goal "Adjust order screen field layout for clearer input flow" \
205
+ --dialogue-profile system-maintainer \
177
206
  --execution-mode apply \
178
207
  --auto-execute-low-risk \
179
208
  --auth-password-hash "<sha256-of-demo-pass>" \
@@ -185,21 +214,38 @@ sce scene interactive-loop \
185
214
  `--feedback-score` writes feedback into both:
186
215
  - Session artifact: `.kiro/reports/interactive-loop/<session-id>/interactive-user-feedback.jsonl`
187
216
  - Governance global stream: `.kiro/reports/interactive-user-feedback.jsonl`
217
+ - `--dialogue-profile` defaults to `business-user`; use `system-maintainer` for operations/maintenance sessions that must surface ticket + rollback requirements before execution.
218
+ - `--ui-mode user-app|ops-console` binds interaction surface semantics (user app vs management console) and participates in authorization dialogue decisioning.
219
+ - In default authorization tier, `business-user` only allows `suggestion` mode; apply path requires `system-maintainer` profile plus environment-specific step-up requirements.
188
220
  - Context contract validation is strict by default (required fields, payload size, forbidden keys). Use `--no-strict-contract` only for temporary diagnostics.
189
221
  - `--execution-mode apply` with mutating actions requires password authorization by default (`plan.authorization.password_required=true`).
190
222
  - Runtime policy defaults to `ops-fix@staging`; low-risk auto execute requires runtime decision `allow`.
223
+ - Runtime policy can enforce UI-surface contract via `ui_modes` (default baseline: `user-app` suggestion-only, `ops-console` supports apply).
191
224
 
192
225
  Run runtime mode/environment policy evaluation directly:
193
226
 
194
227
  ```bash
195
228
  node scripts/interactive-runtime-policy-evaluate.js \
196
229
  --plan .kiro/reports/interactive-change-plan.generated.json \
230
+ --ui-mode ops-console \
197
231
  --runtime-mode ops-fix \
198
232
  --runtime-environment staging \
199
233
  --policy docs/interactive-customization/runtime-mode-policy-baseline.json \
200
234
  --json
201
235
  ```
202
236
 
237
+ Run authorization tier profile/environment evaluation directly:
238
+
239
+ ```bash
240
+ node scripts/interactive-authorization-tier-evaluate.js \
241
+ --execution-mode apply \
242
+ --dialogue-profile system-maintainer \
243
+ --runtime-environment staging \
244
+ --auto-execute-low-risk \
245
+ --policy docs/interactive-customization/authorization-tier-policy-baseline.json \
246
+ --json
247
+ ```
248
+
203
249
  Build interactive work-order artifacts directly:
204
250
 
205
251
  ```bash
@@ -208,6 +254,7 @@ node scripts/interactive-work-order-build.js \
208
254
  --dialogue .kiro/reports/interactive-dialogue-governance.json \
209
255
  --gate .kiro/reports/interactive-change-plan-gate.json \
210
256
  --runtime .kiro/reports/interactive-runtime-policy.json \
257
+ --authorization-tier .kiro/reports/interactive-authorization-tier.json \
211
258
  --approval-state .kiro/reports/interactive-approval-state.json \
212
259
  --execution-attempted \
213
260
  --execution-result success \
@@ -309,6 +356,9 @@ node scripts/interactive-governance-report.js \
309
356
 
310
357
  The governance report consumes feedback events from `.kiro/reports/interactive-user-feedback.jsonl` by default.
311
358
  The governance report also consumes matrix signals from `.kiro/reports/interactive-matrix-signals.jsonl` by default.
359
+ The governance report consumes dialogue-authorization signals from `.kiro/reports/interactive-dialogue-authorization-signals.jsonl` by default.
360
+ The governance report consumes runtime policy signals from `.kiro/reports/interactive-runtime-signals.jsonl` by default.
361
+ The governance report consumes authorization-tier signals from `.kiro/reports/interactive-authorization-tier-signals.jsonl` by default.
312
362
  When `intent_total` is below `min_intent_samples` (default `5`), adoption emits a low-severity sample warning instead of a breach.
313
363
 
314
364
  Export matrix regression remediation queue lines (for close-loop-batch):
@@ -0,0 +1,47 @@
1
+ {
2
+ "version": "1.0.0",
3
+ "default_profile": "business-user",
4
+ "prompt_templates": {
5
+ "scope_confirmation": "Confirm target module/page and business boundary before execution.",
6
+ "impact_confirmation": "Confirm expected business impact and out-of-scope boundaries.",
7
+ "rollback_confirmation": "Confirm rollback reference is prepared before apply.",
8
+ "ticket_reference": "Provide approved change ticket id.",
9
+ "password_step_up": "Complete one-time password authorization before apply.",
10
+ "role_policy": "Provide actor role and approver role according to role policy.",
11
+ "role_separation": "Confirm operator role and approver role are different.",
12
+ "manual_review_ack": "Acknowledge manual review is required before production apply."
13
+ },
14
+ "profiles": {
15
+ "business-user": {
16
+ "allow_execution_modes": ["suggestion"],
17
+ "base_required_steps": ["scope_confirmation"]
18
+ },
19
+ "system-maintainer": {
20
+ "allow_execution_modes": ["suggestion", "apply"],
21
+ "base_required_steps": ["scope_confirmation", "impact_confirmation", "rollback_confirmation"]
22
+ }
23
+ },
24
+ "environments": {
25
+ "dev": {
26
+ "require_ticket": false,
27
+ "require_password_for_apply": false,
28
+ "require_role_policy": false,
29
+ "require_distinct_actor_roles": false,
30
+ "require_manual_review_ack": false
31
+ },
32
+ "staging": {
33
+ "require_ticket": true,
34
+ "require_password_for_apply": true,
35
+ "require_role_policy": false,
36
+ "require_distinct_actor_roles": false,
37
+ "require_manual_review_ack": false
38
+ },
39
+ "prod": {
40
+ "require_ticket": true,
41
+ "require_password_for_apply": true,
42
+ "require_role_policy": true,
43
+ "require_distinct_actor_roles": true,
44
+ "require_manual_review_ack": true
45
+ }
46
+ }
47
+ }
@@ -0,0 +1,46 @@
1
+ {
2
+ "version": "1.0.0",
3
+ "defaults": {
4
+ "profile": "business-user"
5
+ },
6
+ "profiles": {
7
+ "business-user": {
8
+ "allow_execution_modes": [
9
+ "suggestion"
10
+ ],
11
+ "auto_execute_allowed": false,
12
+ "allow_live_apply": false
13
+ },
14
+ "system-maintainer": {
15
+ "allow_execution_modes": [
16
+ "suggestion",
17
+ "apply"
18
+ ],
19
+ "auto_execute_allowed": true,
20
+ "allow_live_apply": true
21
+ }
22
+ },
23
+ "environments": {
24
+ "dev": {
25
+ "require_secondary_authorization": false,
26
+ "require_password_for_apply": false,
27
+ "require_role_policy": false,
28
+ "require_distinct_actor_roles": false,
29
+ "manual_review_required_for_apply": false
30
+ },
31
+ "staging": {
32
+ "require_secondary_authorization": true,
33
+ "require_password_for_apply": true,
34
+ "require_role_policy": false,
35
+ "require_distinct_actor_roles": false,
36
+ "manual_review_required_for_apply": false
37
+ },
38
+ "prod": {
39
+ "require_secondary_authorization": true,
40
+ "require_password_for_apply": true,
41
+ "require_role_policy": true,
42
+ "require_distinct_actor_roles": true,
43
+ "manual_review_required_for_apply": true
44
+ }
45
+ }
46
+ }
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "version": "1.0.0",
3
3
  "mode": "business-safe-assistant",
4
+ "default_profile": "business-user",
4
5
  "length_policy": {
5
6
  "min_chars": 12,
6
7
  "max_chars": 1200,
@@ -45,5 +46,41 @@
45
46
  "clarification_templates": [
46
47
  "What business metric should improve first (speed, accuracy, cost, compliance)?",
47
48
  "Which module/page should be changed first, and what must remain unchanged?"
48
- ]
49
+ ],
50
+ "profiles": {
51
+ "business-user": {
52
+ "mode": "business-safe-assistant",
53
+ "response_rules": [
54
+ "Prefer business outcomes and measurable impact language over implementation details."
55
+ ]
56
+ },
57
+ "system-maintainer": {
58
+ "mode": "maintenance-safe-assistant",
59
+ "length_policy": {
60
+ "min_chars": 8,
61
+ "max_chars": 1600,
62
+ "min_significant_tokens": 3
63
+ },
64
+ "deny_patterns": [
65
+ {
66
+ "id": "prod-change-without-ticket",
67
+ "pattern": "\\b(prod|production)\\b[^.\\n]{0,120}\\b(without ticket|no ticket|skip ticket)\\b",
68
+ "reason": "production maintenance request is missing approved change ticket"
69
+ },
70
+ {
71
+ "id": "maintenance-no-rollback",
72
+ "pattern": "\\b(hotfix|patch|change|deploy)\\b[^.\\n]{0,120}\\b(without rollback|no rollback)\\b",
73
+ "reason": "maintenance request lacks rollback safeguard"
74
+ }
75
+ ],
76
+ "response_rules": [
77
+ "For maintenance requests, require change ticket, rollback plan, and approval role before execution.",
78
+ "If request targets production, require staged validation evidence first."
79
+ ],
80
+ "clarification_templates": [
81
+ "What is the approved change ticket id and rollback plan reference?",
82
+ "Which environment should run first (dev/staging/prod), and who is the approver role?"
83
+ ]
84
+ }
85
+ }
49
86
  }
@@ -0,0 +1,92 @@
1
+ # Dual UI Mode Integration Guide
2
+
3
+ This guide maps two UI surfaces to SCE interactive governance behavior.
4
+
5
+ ## 1. Target Surfaces
6
+
7
+ - `user-app`: end-user business operation UI.
8
+ - `ops-console`: maintenance and new-requirement management UI.
9
+
10
+ ## 2. Default Governance Mapping
11
+
12
+ - `user-app`
13
+ - Recommended dialogue profile: `business-user`
14
+ - Recommended execution mode: `suggestion`
15
+ - Apply intent is denied by authorization dialogue policy by default.
16
+ - `ops-console`
17
+ - Recommended dialogue profile: `system-maintainer`
18
+ - Execution mode: `suggestion|apply` (subject to runtime/authorization-tier/approval gates)
19
+
20
+ ## 3. Runtime Integration Pattern
21
+
22
+ Use the same backend flow and switch only mode/profile by surface:
23
+
24
+ ```bash
25
+ # user-facing application UI
26
+ sce scene interactive-flow \
27
+ --input <provider-payload.json> \
28
+ --goal "<business-goal>" \
29
+ --ui-mode user-app \
30
+ --dialogue-profile business-user \
31
+ --execution-mode suggestion \
32
+ --json
33
+
34
+ # operations / maintenance console
35
+ sce scene interactive-flow \
36
+ --input <provider-payload.json> \
37
+ --goal "<maintenance-goal>" \
38
+ --ui-mode ops-console \
39
+ --dialogue-profile system-maintainer \
40
+ --execution-mode apply \
41
+ --runtime-environment staging \
42
+ --auto-execute-low-risk \
43
+ --json
44
+ ```
45
+
46
+ ## 4. UI Rendering Contract
47
+
48
+ Read these fields from loop/flow output:
49
+
50
+ - `summary.ui_mode`
51
+ - `summary.dialogue_authorization_decision`
52
+ - `summary.authorization_tier_decision`
53
+ - `summary.execution_block_reason_category`
54
+ - `summary.execution_block_remediation_hint`
55
+
56
+ Recommended rendering:
57
+
58
+ - `dialogue_authorization_decision=deny`: block execute button and show guided fallback.
59
+ - `dialogue_authorization_decision=review-required`: show review handoff panel.
60
+ - `authorization_tier_decision=allow` and runtime/gate allow: enable guarded apply action.
61
+
62
+ ## 5. Runtime UI-Mode Contract (Default)
63
+
64
+ `runtime-mode-policy-baseline.json` now includes `ui_modes` policy:
65
+
66
+ - `user-app`
67
+ - `allow_execution_modes=["suggestion"]`
68
+ - `deny_execution_modes=["apply"]`
69
+ - Apply intents should switch to `ops-console`.
70
+ - `ops-console`
71
+ - `allow_execution_modes=["suggestion","apply"]`
72
+ - Supports maintenance/apply flows with approval and authorization-tier gates.
73
+
74
+ When evaluating runtime policy directly, pass `--ui-mode`:
75
+
76
+ ```bash
77
+ node scripts/interactive-runtime-policy-evaluate.js \
78
+ --plan .kiro/reports/interactive-change-plan.generated.json \
79
+ --ui-mode user-app \
80
+ --runtime-mode ops-fix \
81
+ --runtime-environment staging \
82
+ --json
83
+ ```
84
+
85
+ ## 6. Audit and Compliance
86
+
87
+ For both modes, persist:
88
+
89
+ - work-order (`interactive-work-order.json|.md`)
90
+ - approval events (`interactive-approval-events.jsonl`)
91
+ - execution ledger (`interactive-execution-ledger.jsonl`)
92
+ - authorization-tier signals (`interactive-authorization-tier-signals.jsonl`)