scene-capability-engine 3.0.7 → 3.1.0

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.
Files changed (51) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/docs/331-poc-adaptation-roadmap.md +21 -2
  3. package/docs/331-poc-dual-track-integration-guide.md +10 -6
  4. package/docs/331-poc-weekly-delivery-checklist.md +15 -0
  5. package/docs/README.md +6 -0
  6. package/docs/command-reference.md +279 -5
  7. package/docs/handoff-profile-integration-guide.md +88 -0
  8. package/docs/interactive-customization/331-poc-sce-integration-checklist.md +148 -0
  9. package/docs/interactive-customization/README.md +354 -0
  10. package/docs/interactive-customization/adapter-extension-contract.md +55 -0
  11. package/docs/interactive-customization/adapter-extension-contract.sample.json +59 -0
  12. package/docs/interactive-customization/adapter-extension-contract.schema.json +192 -0
  13. package/docs/interactive-customization/change-intent.schema.json +72 -0
  14. package/docs/interactive-customization/change-plan.sample.json +41 -0
  15. package/docs/interactive-customization/change-plan.schema.json +125 -0
  16. package/docs/interactive-customization/cross-industry-replication-guide.md +49 -0
  17. package/docs/interactive-customization/dialogue-governance-policy-baseline.json +49 -0
  18. package/docs/interactive-customization/domain-pack-extension-flow.md +71 -0
  19. package/docs/interactive-customization/execution-record.schema.json +62 -0
  20. package/docs/interactive-customization/governance-alert-playbook.md +51 -0
  21. package/docs/interactive-customization/governance-report-template.md +46 -0
  22. package/docs/interactive-customization/governance-threshold-baseline.json +14 -0
  23. package/docs/interactive-customization/guardrail-policy-baseline.json +27 -0
  24. package/docs/interactive-customization/high-risk-action-catalog.json +22 -0
  25. package/docs/interactive-customization/moqui-adapter-interface.md +40 -0
  26. package/docs/interactive-customization/moqui-context-provider.sample.json +72 -0
  27. package/docs/interactive-customization/moqui-copilot-context-contract.json +50 -0
  28. package/docs/interactive-customization/moqui-copilot-integration-guide.md +100 -0
  29. package/docs/interactive-customization/moqui-interactive-template-playbook.md +94 -0
  30. package/docs/interactive-customization/non-technical-usability-report.md +57 -0
  31. package/docs/interactive-customization/page-context.sample.json +73 -0
  32. package/docs/interactive-customization/page-context.schema.json +150 -0
  33. package/docs/interactive-customization/phase-acceptance-evidence.md +110 -0
  34. package/docs/interactive-customization/runtime-mode-policy-baseline.json +99 -0
  35. package/docs/moqui-template-core-library-playbook.md +71 -0
  36. package/docs/release-checklist.md +29 -4
  37. package/docs/security-governance-default-baseline.md +53 -0
  38. package/docs/starter-kit/README.md +50 -0
  39. package/docs/starter-kit/handoff-manifest.starter.json +32 -0
  40. package/docs/starter-kit/handoff-profile-ci.sample.yml +53 -0
  41. package/docs/starter-kit/release.workflow.sample.yml +41 -0
  42. package/docs/zh/README.md +12 -0
  43. package/lib/auto/moqui-recovery-sequence.js +62 -0
  44. package/lib/commands/auto.js +325 -42
  45. package/lib/commands/scene.js +837 -0
  46. package/lib/data/moqui-capability-lexicon.json +14 -1
  47. package/lib/interactive-customization/change-plan-gate-core.js +201 -0
  48. package/lib/interactive-customization/index.js +9 -0
  49. package/lib/interactive-customization/moqui-interactive-adapter.js +732 -0
  50. package/lib/orchestrator/orchestration-engine.js +64 -6
  51. package/package.json +28 -2
@@ -0,0 +1,73 @@
1
+ {
2
+ "product": "moqui-poc",
3
+ "module": "governance-platform",
4
+ "page": "screen-explorer-workbench",
5
+ "entity": "Screen",
6
+ "scene_id": "sce.scene--platform-screen-explorer-assist--0.1.0",
7
+ "workflow_node": "screen-analysis",
8
+ "fields": [
9
+ {
10
+ "name": "screen_name",
11
+ "type": "string",
12
+ "sensitive": false
13
+ },
14
+ {
15
+ "name": "component_type",
16
+ "type": "enum",
17
+ "sensitive": false
18
+ },
19
+ {
20
+ "name": "api_token",
21
+ "type": "string",
22
+ "sensitive": true
23
+ }
24
+ ],
25
+ "current_state": {
26
+ "screen_name": "Screen Explorer",
27
+ "component_type": "Entity",
28
+ "api_token": "tok_live_example_abc",
29
+ "operator": "platform_manager"
30
+ },
31
+ "scene_workspace": {
32
+ "scene_name": "Screen 探索场景",
33
+ "scene_type": "screen-analysis",
34
+ "screen_explorer": {
35
+ "active_tab": "Overview",
36
+ "selected_screen": "Screen Explorer",
37
+ "selected_component": "Entity",
38
+ "filters": [
39
+ "AI Components",
40
+ "Forms",
41
+ "Widgets"
42
+ ],
43
+ "result_total": 0
44
+ },
45
+ "ontology": {
46
+ "entities": [
47
+ "Screen",
48
+ "Form",
49
+ "Widget"
50
+ ],
51
+ "relations": [
52
+ "Screen_has_Form",
53
+ "Screen_has_Widget"
54
+ ],
55
+ "business_rules": [
56
+ "screen_name_unique",
57
+ "component_reference_consistency",
58
+ "change_requires_audit_record"
59
+ ],
60
+ "decision_policies": [
61
+ "publish_requires_risk_review",
62
+ "fallback_to_read_only_when_gate_non_allow"
63
+ ]
64
+ }
65
+ },
66
+ "assistant_panel": {
67
+ "session_id": "session-1771",
68
+ "agent_id": "codex-gpt4-1",
69
+ "model": "Spec-Expert",
70
+ "mode": "read-only",
71
+ "current_page_context": "Ask what should be fixed on the current page and propose actionable plan."
72
+ }
73
+ }
@@ -0,0 +1,150 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://scene-capability-engine.dev/schemas/interactive/page-context.schema.json",
4
+ "title": "Interactive Page Context",
5
+ "type": "object",
6
+ "additionalProperties": true,
7
+ "required": [
8
+ "product",
9
+ "module",
10
+ "page"
11
+ ],
12
+ "properties": {
13
+ "product": {
14
+ "type": "string",
15
+ "minLength": 1
16
+ },
17
+ "module": {
18
+ "type": "string",
19
+ "minLength": 1
20
+ },
21
+ "page": {
22
+ "type": "string",
23
+ "minLength": 1
24
+ },
25
+ "entity": {
26
+ "type": "string"
27
+ },
28
+ "scene_id": {
29
+ "type": "string"
30
+ },
31
+ "workflow_node": {
32
+ "type": "string"
33
+ },
34
+ "fields": {
35
+ "type": "array",
36
+ "items": {
37
+ "type": "object",
38
+ "required": [
39
+ "name"
40
+ ],
41
+ "properties": {
42
+ "name": {
43
+ "type": "string",
44
+ "minLength": 1
45
+ },
46
+ "type": {
47
+ "type": "string"
48
+ },
49
+ "sensitive": {
50
+ "type": "boolean"
51
+ },
52
+ "description": {
53
+ "type": "string"
54
+ }
55
+ }
56
+ }
57
+ },
58
+ "current_state": {
59
+ "type": "object"
60
+ },
61
+ "scene_workspace": {
62
+ "type": "object",
63
+ "additionalProperties": true,
64
+ "properties": {
65
+ "scene_name": {
66
+ "type": "string"
67
+ },
68
+ "scene_type": {
69
+ "type": "string"
70
+ },
71
+ "screen_explorer": {
72
+ "type": "object",
73
+ "additionalProperties": true,
74
+ "properties": {
75
+ "active_tab": {
76
+ "type": "string"
77
+ },
78
+ "selected_screen": {
79
+ "type": "string"
80
+ },
81
+ "selected_component": {
82
+ "type": "string"
83
+ },
84
+ "filters": {
85
+ "type": "array",
86
+ "items": {
87
+ "type": "string"
88
+ }
89
+ },
90
+ "result_total": {
91
+ "type": "integer",
92
+ "minimum": 0
93
+ }
94
+ }
95
+ },
96
+ "ontology": {
97
+ "type": "object",
98
+ "additionalProperties": true,
99
+ "properties": {
100
+ "entities": {
101
+ "type": "array",
102
+ "items": {
103
+ "type": "string"
104
+ }
105
+ },
106
+ "relations": {
107
+ "type": "array",
108
+ "items": {
109
+ "type": "string"
110
+ }
111
+ },
112
+ "business_rules": {
113
+ "type": "array",
114
+ "items": {
115
+ "type": "string"
116
+ }
117
+ },
118
+ "decision_policies": {
119
+ "type": "array",
120
+ "items": {
121
+ "type": "string"
122
+ }
123
+ }
124
+ }
125
+ }
126
+ }
127
+ },
128
+ "assistant_panel": {
129
+ "type": "object",
130
+ "additionalProperties": true,
131
+ "properties": {
132
+ "session_id": {
133
+ "type": "string"
134
+ },
135
+ "agent_id": {
136
+ "type": "string"
137
+ },
138
+ "model": {
139
+ "type": "string"
140
+ },
141
+ "mode": {
142
+ "type": "string"
143
+ },
144
+ "current_page_context": {
145
+ "type": "string"
146
+ }
147
+ }
148
+ }
149
+ }
150
+ }
@@ -0,0 +1,110 @@
1
+ # Interactive Phase Acceptance Evidence
2
+
3
+ This document provides stage-level acceptance evidence for the Moqui interactive customization experiment.
4
+
5
+ ## Stage A (Read-only Dialogue)
6
+
7
+ Scope:
8
+
9
+ - Page context ingestion and masking.
10
+ - Change_Intent generation.
11
+ - Read-only explain output and audit trace.
12
+
13
+ Evidence:
14
+
15
+ - `scripts/interactive-context-bridge.js`
16
+ - `scripts/interactive-intent-build.js`
17
+ - `scripts/interactive-flow.js`
18
+ - `docs/interactive-customization/page-context.schema.json`
19
+ - `docs/interactive-customization/moqui-copilot-context-contract.json`
20
+ - `docs/interactive-customization/moqui-context-provider.sample.json`
21
+ - `docs/interactive-customization/moqui-copilot-integration-guide.md`
22
+ - `tests/unit/scripts/interactive-context-bridge.test.js`
23
+ - `tests/unit/scripts/interactive-intent-build.test.js`
24
+ - `tests/unit/scripts/interactive-flow.test.js`
25
+
26
+ Verification:
27
+
28
+ ```bash
29
+ npx jest tests/unit/scripts/interactive-intent-build.test.js --runInBand
30
+ npx jest tests/unit/scripts/interactive-context-bridge.test.js --runInBand
31
+ npx jest tests/unit/scripts/interactive-flow.test.js --runInBand
32
+ npm run report:interactive-context-bridge
33
+ npm run report:interactive-intent
34
+ ```
35
+
36
+ ## Stage B (Suggestion + Approval)
37
+
38
+ Scope:
39
+
40
+ - Change_Plan generation.
41
+ - Guardrail gate decision (`allow/review-required/deny`).
42
+ - Approval workflow state machine.
43
+
44
+ Evidence:
45
+
46
+ - `scripts/interactive-plan-build.js`
47
+ - `scripts/interactive-change-plan-gate.js`
48
+ - `scripts/interactive-approval-workflow.js`
49
+ - `tests/unit/scripts/interactive-plan-build.test.js`
50
+ - `tests/unit/scripts/interactive-change-plan-gate.test.js`
51
+ - `tests/unit/scripts/interactive-approval-workflow.test.js`
52
+
53
+ Verification:
54
+
55
+ ```bash
56
+ npx jest tests/unit/scripts/interactive-plan-build.test.js tests/unit/scripts/interactive-change-plan-gate.test.js tests/unit/scripts/interactive-approval-workflow.test.js --runInBand
57
+ npm run report:interactive-plan
58
+ npm run gate:interactive-plan
59
+ ```
60
+
61
+ ## Stage C (Controlled Execute + Rollback)
62
+
63
+ Scope:
64
+
65
+ - Adapter minimal interface (`capabilities/plan/validate/apply/rollback`).
66
+ - Low-risk one-click apply path.
67
+ - Execution/rollback audit records.
68
+
69
+ Evidence:
70
+
71
+ - `lib/interactive-customization/moqui-interactive-adapter.js`
72
+ - `scripts/interactive-moqui-adapter.js`
73
+ - `docs/interactive-customization/moqui-adapter-interface.md`
74
+ - `tests/unit/scripts/interactive-moqui-adapter.test.js`
75
+
76
+ Verification:
77
+
78
+ ```bash
79
+ npx jest tests/unit/scripts/interactive-moqui-adapter.test.js --runInBand
80
+ npm run report:interactive-adapter-capabilities
81
+ ```
82
+
83
+ ## Stage D (Template Sedimentation + Extension)
84
+
85
+ Scope:
86
+
87
+ - Moqui interactive loop template package.
88
+ - Adapter extension contract.
89
+ - Domain_Pack extension flow.
90
+
91
+ Evidence:
92
+
93
+ - `.kiro/templates/scene-packages/kse.scene--moqui-interactive-customization-loop--0.1.0/scene-package.json`
94
+ - `.kiro/templates/scene-packages/kse.scene--moqui-interactive-customization-loop--0.1.0/scene.template.yaml`
95
+ - `docs/interactive-customization/moqui-interactive-template-playbook.md`
96
+ - `docs/interactive-customization/adapter-extension-contract.schema.json`
97
+ - `docs/interactive-customization/domain-pack-extension-flow.md`
98
+
99
+ Verification:
100
+
101
+ ```bash
102
+ node scripts/moqui-template-baseline-report.js --json
103
+ npm run report:interactive-governance
104
+ ```
105
+
106
+ ## Acceptance Conclusion
107
+
108
+ - Stage A/B/C/D evidence artifacts are present.
109
+ - Associated unit tests and report commands are executable.
110
+ - Governance and ontology baseline remain default-on without bypass flags.
@@ -0,0 +1,99 @@
1
+ {
2
+ "version": "1.0.0",
3
+ "profile": "interactive-runtime-default",
4
+ "defaults": {
5
+ "runtime_mode": "ops-fix",
6
+ "runtime_environment": "staging"
7
+ },
8
+ "modes": {
9
+ "user-assist": {
10
+ "description": "Business user guidance mode. Prefer suggestion and controlled changes.",
11
+ "allow_execution_modes": [
12
+ "suggestion",
13
+ "apply"
14
+ ],
15
+ "allow_mutating_apply": false,
16
+ "deny_action_types": [
17
+ "credential_export",
18
+ "permission_grant_super_admin",
19
+ "bulk_delete_without_filter"
20
+ ],
21
+ "review_required_action_types": [
22
+ "workflow_approval_chain_change",
23
+ "payment_rule_change",
24
+ "inventory_adjustment_bulk"
25
+ ],
26
+ "require_work_order": true
27
+ },
28
+ "ops-fix": {
29
+ "description": "Operational maintenance and bug-fix mode.",
30
+ "allow_execution_modes": [
31
+ "suggestion",
32
+ "apply"
33
+ ],
34
+ "allow_mutating_apply": true,
35
+ "deny_action_types": [
36
+ "credential_export"
37
+ ],
38
+ "review_required_action_types": [
39
+ "permission_grant_super_admin",
40
+ "bulk_delete_without_filter"
41
+ ],
42
+ "require_work_order": true
43
+ },
44
+ "feature-dev": {
45
+ "description": "Feature development mode for controlled iterative delivery.",
46
+ "allow_execution_modes": [
47
+ "suggestion",
48
+ "apply"
49
+ ],
50
+ "allow_mutating_apply": true,
51
+ "deny_action_types": [
52
+ "credential_export"
53
+ ],
54
+ "review_required_action_types": [
55
+ "workflow_approval_chain_change",
56
+ "permission_grant_super_admin",
57
+ "bulk_delete_without_filter"
58
+ ],
59
+ "require_work_order": true
60
+ }
61
+ },
62
+ "environments": {
63
+ "dev": {
64
+ "allow_live_apply": true,
65
+ "require_dry_run_before_live_apply": false,
66
+ "require_password_for_apply_mutations": true,
67
+ "require_approval_for_risk_levels": [
68
+ "high"
69
+ ],
70
+ "max_risk_level_for_apply": "high",
71
+ "max_auto_execute_risk_level": "medium",
72
+ "manual_review_required_for_apply": false
73
+ },
74
+ "staging": {
75
+ "allow_live_apply": true,
76
+ "require_dry_run_before_live_apply": true,
77
+ "require_password_for_apply_mutations": true,
78
+ "require_approval_for_risk_levels": [
79
+ "medium",
80
+ "high"
81
+ ],
82
+ "max_risk_level_for_apply": "high",
83
+ "max_auto_execute_risk_level": "low",
84
+ "manual_review_required_for_apply": false
85
+ },
86
+ "prod": {
87
+ "allow_live_apply": false,
88
+ "require_dry_run_before_live_apply": true,
89
+ "require_password_for_apply_mutations": true,
90
+ "require_approval_for_risk_levels": [
91
+ "medium",
92
+ "high"
93
+ ],
94
+ "max_risk_level_for_apply": "medium",
95
+ "max_auto_execute_risk_level": "low",
96
+ "manual_review_required_for_apply": true
97
+ }
98
+ }
99
+ }
@@ -33,6 +33,53 @@ Emergency bypass exists but is not recommended:
33
33
  - `--no-require-moqui-baseline`
34
34
  - `--no-require-capability-coverage`
35
35
 
36
+ Profile presets are available for external intake standardization:
37
+
38
+ - `--profile default`: baseline strict intake defaults.
39
+ - `--profile moqui`: explicit Moqui baseline alias (same strict defaults).
40
+ - `--profile enterprise`: stricter release control baseline (`max-risk-level=medium`, `require-release-gate-preflight=true`, `release-evidence-window=10`).
41
+
42
+ Default onboarding and safety baselines:
43
+
44
+ - Starter intake assets: `docs/starter-kit/README.md`
45
+ - Default security/governance controls: `docs/security-governance-default-baseline.md`
46
+
47
+ ## Template Capability Matrix Contract
48
+
49
+ Use the baseline report as the canonical matrix contract (`.kiro/reports/moqui-template-baseline.json`):
50
+
51
+ | Matrix Dimension | Meaning | Default Gate Target |
52
+ | --- | --- | --- |
53
+ | `graph_valid.rate_percent` | Ontology graph structural validity | `100%` |
54
+ | `score_passed.rate_percent` | Semantic score above baseline threshold | `100%` |
55
+ | `entity_coverage.rate_percent` | Entity model coverage | `100%` |
56
+ | `relation_coverage.rate_percent` | Entity relation coverage | `100%` |
57
+ | `business_rule_coverage.rate_percent` | Business-rule presence coverage | `100%` |
58
+ | `business_rule_closed.among_covered_rate_percent` | No unmapped rules among covered templates | `100%` |
59
+ | `decision_coverage.rate_percent` | Decision logic presence coverage | `100%` |
60
+ | `decision_closed.among_covered_rate_percent` | No undecided decisions among covered templates | `100%` |
61
+ | `baseline_passed.rate_percent` | Full matrix closure rate | `100%` |
62
+
63
+ Trend regression should stay hard-gated by default:
64
+
65
+ - `compare.coverage_matrix_regressions.length` must be `0`
66
+ - `sce auto handoff run` default `--max-moqui-matrix-regressions 0`
67
+
68
+ ## External POC Handoff Requirements
69
+
70
+ When an upstream business project (e.g. a POC) feeds templates into sce, require the following by default:
71
+
72
+ - Every handoff spec contains:
73
+ - `custom/scene.yaml` with entity/service/screen binding refs
74
+ - `custom/scene-package.json` with explicit `capabilities.expected/provided`
75
+ - ontology semantics for entity, relation, business-rule, and decision dimensions
76
+ - Handoff evidence includes:
77
+ - latest `moqui-template-baseline.json|.md`
78
+ - latest `handoff-capability-matrix` report
79
+ - latest `moqui-lexicon-audit` report
80
+ - ontology batch report from `scene package-publish-batch --dry-run`
81
+ - New/updated templates must provide deterministic IDs and version bumps so baseline comparisons are stable across releases.
82
+
36
83
  ## One-Shot Intake Flow
37
84
 
38
85
  ```bash
@@ -60,6 +107,14 @@ node scripts/moqui-lexicon-audit.js \
60
107
  --fail-on-gap \
61
108
  --json
62
109
 
110
+ # 0.4) Consolidated release gate summary (single-file pass/fail/incomplete verdict)
111
+ node scripts/moqui-release-summary.js \
112
+ --fail-on-gate-fail \
113
+ --json
114
+
115
+ # 0.5) Weekly ops closed-loop card (handoff + gate history + governance + matrix)
116
+ node scripts/release-ops-weekly-summary.js --json
117
+
63
118
  # 1) Handoff close-loop
64
119
  sce auto handoff run --manifest docs/handoffs/handoff-manifest.json --json
65
120
 
@@ -99,6 +154,10 @@ Required artifacts for each intake batch:
99
154
  - `.kiro/reports/release-evidence/moqui-capability-coverage.md`
100
155
  - `.kiro/reports/release-evidence/moqui-lexicon-audit.json`
101
156
  - `.kiro/reports/release-evidence/moqui-lexicon-audit.md`
157
+ - `.kiro/reports/release-evidence/moqui-release-summary.json`
158
+ - `.kiro/reports/release-evidence/moqui-release-summary.md`
159
+ - `.kiro/reports/release-evidence/weekly-ops-summary.json`
160
+ - `.kiro/reports/release-evidence/weekly-ops-summary.md`
102
161
  - `.kiro/reports/handoff-capability-matrix.md` (or JSON equivalent from `sce auto handoff capability-matrix`)
103
162
  - `.kiro/reports/handoff-runs/<session>.json`
104
163
  - `.kiro/reports/scene-package-ontology-batch.json`
@@ -137,3 +196,15 @@ sce scene package-publish-batch \
137
196
 
138
197
  sce auto close-loop-batch .kiro/auto/ontology-remediation.lines --format lines --json
139
198
  ```
199
+
200
+ ## Interactive Customization Template Baseline
201
+
202
+ Stage-D baseline package for the interactive business customization loop:
203
+
204
+ - `kse.scene--moqui-interactive-customization-loop--0.1.0`
205
+
206
+ This package captures:
207
+
208
+ - intent -> plan -> gate -> approval -> low-risk apply -> rollback flow
209
+ - ontology entities/relations for plan/decision/execution trace
210
+ - governance rules and decision strategy for approval and rollback constraints
@@ -31,16 +31,31 @@ node bin/scene-capability-engine.js value metrics --help
31
31
  ```bash
32
32
  sce value metrics sample --out ./kpi-input.json --json
33
33
  sce value metrics snapshot --input ./kpi-input.json --json
34
+ node scripts/release-ops-weekly-summary.js --json
35
+ node scripts/release-risk-remediation-bundle.js --gate-report .kiro/reports/release-evidence/release-gate.json --json
34
36
  ```
35
37
 
36
38
  Expected:
37
39
 
38
40
  - `sample` writes a valid JSON scaffold.
39
41
  - `snapshot` returns machine-readable result with `snapshot_path` and risk metadata.
42
+ - `release-ops-weekly-summary` emits weekly governance risk card (`json` + `markdown`) under release-evidence.
43
+ - `release-risk-remediation-bundle` outputs unified weekly/drift remediation commands (`json` + `markdown` + `lines`).
40
44
 
41
45
  ---
42
46
 
43
- ## 3. Packaging Hygiene
47
+ ## 3. Security Governance Baseline
48
+
49
+ Confirm default baseline controls are still active:
50
+
51
+ - `docs/security-governance-default-baseline.md` is aligned with current release policy.
52
+ - interactive governance gate uses `--fail-on-alert` in CI/release.
53
+ - approval/execution ledgers are retained for audit (`interactive-approval-events.jsonl`, `interactive-execution-ledger.jsonl`).
54
+ - release evidence includes weekly ops summary and governance snapshot assets.
55
+
56
+ ---
57
+
58
+ ## 4. Packaging Hygiene
44
59
 
45
60
  ```bash
46
61
  npm pack --dry-run
@@ -53,7 +68,7 @@ Verify:
53
68
 
54
69
  ---
55
70
 
56
- ## 4. Documentation Consistency
71
+ ## 5. Documentation Consistency
57
72
 
58
73
  Check that key docs are aligned with current version and capabilities:
59
74
 
@@ -75,7 +90,7 @@ rg -n "github.com/scene-capability-engine/sce" README.md README.zh.md docs START
75
90
 
76
91
  ---
77
92
 
78
- ## 5. Git Readiness
93
+ ## 6. Git Readiness
79
94
 
80
95
  ```bash
81
96
  git status -sb
@@ -89,7 +104,7 @@ Verify:
89
104
 
90
105
  ---
91
106
 
92
- ## 6. Publish Readiness
107
+ ## 7. Publish Readiness
93
108
 
94
109
  Ensure:
95
110
 
@@ -115,6 +130,16 @@ Ensure:
115
130
  - `KSE_RELEASE_DRIFT_PREFLIGHT_BLOCK_RATE_MIN_PERCENT`: minimum release preflight blocked rate in latest 5 known runs (default `40`)
116
131
  - `KSE_RELEASE_DRIFT_HARD_GATE_BLOCK_STREAK_MIN`: minimum consecutive hard-gate preflight blocked streak (latest window, default `2`)
117
132
  - `KSE_RELEASE_DRIFT_PREFLIGHT_UNAVAILABLE_STREAK_MIN`: minimum consecutive release preflight unavailable streak (latest window, default `2`)
133
+ - Optional: tune weekly ops release gate:
134
+ - `KSE_RELEASE_WEEKLY_OPS_ENFORCE`: `true|false` (default `true`)
135
+ - `KSE_RELEASE_WEEKLY_OPS_REQUIRE_SUMMARY`: require weekly summary artifact (`true|false`, default `true`)
136
+ - `KSE_RELEASE_WEEKLY_OPS_MAX_RISK_LEVEL`: `low|medium|high|unknown` (default `medium`)
137
+ - `KSE_RELEASE_WEEKLY_OPS_MAX_GOVERNANCE_BREACHES`: optional max breach count
138
+ - `KSE_RELEASE_WEEKLY_OPS_MAX_MATRIX_REGRESSION_RATE_PERCENT`: optional max regression-positive rate percent
139
+ - Optional: tune release asset integrity gate:
140
+ - `KSE_RELEASE_ASSET_INTEGRITY_ENFORCE`: `true|false` (default `true`)
141
+ - `KSE_RELEASE_ASSET_INTEGRITY_REQUIRE_NON_EMPTY`: `true|false` (default `true`)
142
+ - `KSE_RELEASE_ASSET_INTEGRITY_REQUIRED_FILES`: override required asset list (comma-separated, supports `{tag}`)
118
143
  - Optional local dry-run for gate history index artifact:
119
144
  - `sce auto handoff gate-index --dir .kiro/reports/release-evidence --out .kiro/reports/release-evidence/release-gate-history.json --json`
120
145
 
@@ -0,0 +1,53 @@
1
+ # Security Governance Default Baseline
2
+
3
+ This baseline is the default operating policy for SCE-driven delivery, including Moqui template intake and interactive customization.
4
+
5
+ ## 1. Context and Data Safety
6
+
7
+ - Enforce strict context contract validation (`--context-contract`, strict mode on).
8
+ - Block forbidden keys (for example secrets/private keys) from UI/provider payloads.
9
+ - Keep payload masking enabled for business data and identity fields.
10
+ - Reject context payloads that exceed size budget or schema bounds.
11
+
12
+ ## 2. Approval and Execution Safety
13
+
14
+ - High-risk plans must pass approval workflow before `apply`.
15
+ - Low-risk auto-apply is allowed only when gate result is `allow`.
16
+ - Runtime policy gate is mandatory before apply (`runtime_mode=ops-fix`, `runtime_environment=staging` by default).
17
+ - Runtime non-allow (`deny|review-required`) should block unattended apply (`--fail-on-runtime-non-allow`).
18
+ - Apply-mode mutating plans require password authorization (`authorization.password_required=true` by default).
19
+ - Password verifier hash must be supplied via `SCE_INTERACTIVE_AUTH_PASSWORD_SHA256` (or explicit override).
20
+ - Work-order artifacts (`interactive-work-order.json|.md`) are required for usage/maintenance/dev integrated auditing.
21
+ - Every apply/rollback must write execution ledger evidence.
22
+ - Stage-C adapters must keep dry-run behavior as default unless explicitly switched.
23
+
24
+ ## 3. Release and Intake Gates
25
+
26
+ - Run handoff with profile baseline (`--profile moqui` or stricter).
27
+ - Keep scene package publish-batch gate enabled by default.
28
+ - Keep capability lexicon unknown count at zero.
29
+ - Keep release preflight hard-gate enabled for enterprise profile.
30
+ - Keep interactive governance weekly gate enabled (`--fail-on-alert`).
31
+
32
+ ## 4. Mandatory Audit Artifacts
33
+
34
+ - `.kiro/reports/release-evidence/handoff-runs.json`
35
+ - `.kiro/reports/release-evidence/release-gate-history.json`
36
+ - `.kiro/reports/release-evidence/governance-snapshot-<tag>.json`
37
+ - `.kiro/reports/release-evidence/weekly-ops-summary-<tag>.json`
38
+ - `.kiro/reports/interactive-governance-report.json`
39
+ - `.kiro/reports/interactive-dialogue-governance.json`
40
+ - `.kiro/reports/interactive-execution-ledger.jsonl`
41
+ - `.kiro/reports/interactive-approval-events.jsonl`
42
+
43
+ ## 5. Weekly Control Loop
44
+
45
+ ```bash
46
+ node scripts/interactive-governance-report.js --period weekly --fail-on-alert --json
47
+ node scripts/release-ops-weekly-summary.js --json
48
+ node scripts/release-weekly-ops-gate.js
49
+ node scripts/release-risk-remediation-bundle.js --gate-report .kiro/reports/release-evidence/release-gate.json --json
50
+ node scripts/release-asset-integrity-check.js
51
+ ```
52
+
53
+ If weekly ops summary risk is `high`, freeze release and run remediation before next tag.