scene-capability-engine 3.0.8 → 3.2.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.
- package/CHANGELOG.md +55 -0
- package/docs/331-poc-adaptation-roadmap.md +21 -2
- package/docs/331-poc-dual-track-integration-guide.md +10 -6
- package/docs/331-poc-weekly-delivery-checklist.md +5 -0
- package/docs/README.md +6 -0
- package/docs/command-reference.md +262 -4
- package/docs/handoff-profile-integration-guide.md +88 -0
- package/docs/interactive-customization/331-poc-sce-integration-checklist.md +148 -0
- package/docs/interactive-customization/README.md +362 -0
- package/docs/interactive-customization/adapter-extension-contract.md +55 -0
- package/docs/interactive-customization/adapter-extension-contract.sample.json +59 -0
- package/docs/interactive-customization/adapter-extension-contract.schema.json +192 -0
- package/docs/interactive-customization/approval-role-policy-baseline.json +36 -0
- package/docs/interactive-customization/change-intent.schema.json +72 -0
- package/docs/interactive-customization/change-plan.sample.json +41 -0
- package/docs/interactive-customization/change-plan.schema.json +125 -0
- package/docs/interactive-customization/cross-industry-replication-guide.md +49 -0
- package/docs/interactive-customization/dialogue-governance-policy-baseline.json +49 -0
- package/docs/interactive-customization/domain-pack-extension-flow.md +71 -0
- package/docs/interactive-customization/execution-record.schema.json +62 -0
- package/docs/interactive-customization/governance-alert-playbook.md +51 -0
- package/docs/interactive-customization/governance-report-template.md +46 -0
- package/docs/interactive-customization/governance-threshold-baseline.json +14 -0
- package/docs/interactive-customization/guardrail-policy-baseline.json +27 -0
- package/docs/interactive-customization/high-risk-action-catalog.json +22 -0
- package/docs/interactive-customization/moqui-adapter-interface.md +40 -0
- package/docs/interactive-customization/moqui-context-provider.sample.json +72 -0
- package/docs/interactive-customization/moqui-copilot-context-contract.json +50 -0
- package/docs/interactive-customization/moqui-copilot-integration-guide.md +100 -0
- package/docs/interactive-customization/moqui-interactive-template-playbook.md +94 -0
- package/docs/interactive-customization/non-technical-usability-report.md +57 -0
- package/docs/interactive-customization/page-context.sample.json +73 -0
- package/docs/interactive-customization/page-context.schema.json +150 -0
- package/docs/interactive-customization/phase-acceptance-evidence.md +110 -0
- package/docs/interactive-customization/runtime-mode-policy-baseline.json +99 -0
- package/docs/moqui-template-core-library-playbook.md +28 -0
- package/docs/release-checklist.md +29 -4
- package/docs/security-governance-default-baseline.md +54 -0
- package/docs/starter-kit/README.md +50 -0
- package/docs/starter-kit/handoff-manifest.starter.json +32 -0
- package/docs/starter-kit/handoff-profile-ci.sample.yml +53 -0
- package/docs/starter-kit/release.workflow.sample.yml +41 -0
- package/docs/zh/README.md +12 -0
- package/lib/auto/moqui-recovery-sequence.js +62 -0
- package/lib/commands/auto.js +245 -34
- package/lib/commands/scene.js +867 -0
- package/lib/data/moqui-capability-lexicon.json +14 -1
- package/lib/interactive-customization/change-plan-gate-core.js +201 -0
- package/lib/interactive-customization/index.js +9 -0
- package/lib/interactive-customization/moqui-interactive-adapter.js +732 -0
- package/package.json +27 -2
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Handoff Profile Integration Guide
|
|
2
|
+
|
|
3
|
+
This guide defines a stable external integration contract for `sce auto handoff` profile-based intake.
|
|
4
|
+
|
|
5
|
+
## Scope
|
|
6
|
+
|
|
7
|
+
- Profile-based defaults for:
|
|
8
|
+
- `sce auto handoff run`
|
|
9
|
+
- `sce auto handoff capability-matrix`
|
|
10
|
+
- Explicit override model for external projects.
|
|
11
|
+
- Recommended baseline for Moqui-driven template intake.
|
|
12
|
+
|
|
13
|
+
## Available Profiles
|
|
14
|
+
|
|
15
|
+
| Profile | Use Case | Default Policy Characteristics |
|
|
16
|
+
| --- | --- | --- |
|
|
17
|
+
| `default` | General handoff intake | Current strict baseline gates. |
|
|
18
|
+
| `moqui` | Moqui template-core ingestion | Explicit alias of strict Moqui baseline gates. |
|
|
19
|
+
| `enterprise` | Production-grade controlled rollout | `max-risk-level=medium`, `require-release-gate-preflight=true`, `release-evidence-window=10`. |
|
|
20
|
+
|
|
21
|
+
Notes:
|
|
22
|
+
|
|
23
|
+
- Profile defaults are applied first.
|
|
24
|
+
- Explicit CLI options always override profile defaults.
|
|
25
|
+
- Invalid profile values fail fast.
|
|
26
|
+
|
|
27
|
+
## Command Contract
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
# capability matrix precheck
|
|
31
|
+
sce auto handoff capability-matrix \
|
|
32
|
+
--manifest docs/handoffs/handoff-manifest.json \
|
|
33
|
+
--profile moqui \
|
|
34
|
+
--fail-on-gap \
|
|
35
|
+
--json
|
|
36
|
+
|
|
37
|
+
# full closed-loop intake
|
|
38
|
+
sce auto handoff run \
|
|
39
|
+
--manifest docs/handoffs/handoff-manifest.json \
|
|
40
|
+
--profile moqui \
|
|
41
|
+
--json
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Enterprise mode:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
sce auto handoff run \
|
|
48
|
+
--manifest docs/handoffs/handoff-manifest.json \
|
|
49
|
+
--profile enterprise \
|
|
50
|
+
--json
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## External Project Manifest Requirements
|
|
54
|
+
|
|
55
|
+
External handoff projects should provide:
|
|
56
|
+
|
|
57
|
+
- `templates[]`: source template set to absorb.
|
|
58
|
+
- `specs[]`: executable integration scope.
|
|
59
|
+
- `ontology_validation`: structured pass/fail payload.
|
|
60
|
+
- `capabilities[]` (recommended): explicit expected capability contract.
|
|
61
|
+
|
|
62
|
+
Recommended evidence files before `handoff run`:
|
|
63
|
+
|
|
64
|
+
- `.kiro/reports/release-evidence/moqui-template-baseline.json`
|
|
65
|
+
- `.kiro/reports/handoff-capability-matrix.json` or `.md`
|
|
66
|
+
- `.kiro/reports/release-evidence/moqui-lexicon-audit.json`
|
|
67
|
+
|
|
68
|
+
## Override Rules
|
|
69
|
+
|
|
70
|
+
Examples:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
# profile defaults + explicit override
|
|
74
|
+
sce auto handoff run \
|
|
75
|
+
--manifest docs/handoffs/handoff-manifest.json \
|
|
76
|
+
--profile enterprise \
|
|
77
|
+
--max-risk-level high \
|
|
78
|
+
--no-require-release-gate-preflight \
|
|
79
|
+
--json
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
`--profile enterprise` applies strict defaults, then explicit flags above override them.
|
|
83
|
+
|
|
84
|
+
## Recommended External Rollout
|
|
85
|
+
|
|
86
|
+
1. Start with `--profile moqui` for template sedimentation and matrix closure.
|
|
87
|
+
2. Move to `--profile enterprise` when release preflight governance is ready.
|
|
88
|
+
3. Keep explicit overrides minimal and auditable in CI scripts.
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# 331-poc SCE Integration Checklist
|
|
2
|
+
|
|
3
|
+
This checklist defines the minimum production-ready integration for embedding SCE interactive customization in `331-poc` (Moqui-focused solution).
|
|
4
|
+
|
|
5
|
+
## 1. Runtime Preconditions
|
|
6
|
+
|
|
7
|
+
- Node runtime: `>=16` (recommended `20.x`).
|
|
8
|
+
- SCE installed and available as `sce`.
|
|
9
|
+
- `docs/interactive-customization/moqui-copilot-context-contract.json` exists and is aligned with current UI payload fields.
|
|
10
|
+
- Interactive policy assets are present:
|
|
11
|
+
- `docs/interactive-customization/guardrail-policy-baseline.json`
|
|
12
|
+
- `docs/interactive-customization/high-risk-action-catalog.json`
|
|
13
|
+
|
|
14
|
+
## 2. Moqui UI Context Contract
|
|
15
|
+
|
|
16
|
+
Provider payload sent from UI must include:
|
|
17
|
+
|
|
18
|
+
- `product`, `workspace.module`, `workspace.page`
|
|
19
|
+
- `workspace.scene` (id/name/type)
|
|
20
|
+
- `workspace.ontology`:
|
|
21
|
+
- `entities`
|
|
22
|
+
- `relations`
|
|
23
|
+
- `business_rules`
|
|
24
|
+
- `decision_policies`
|
|
25
|
+
- `current_state` (masked/sanitized)
|
|
26
|
+
- `assistant.sessionId`
|
|
27
|
+
|
|
28
|
+
Hard rules:
|
|
29
|
+
|
|
30
|
+
- No plaintext secrets.
|
|
31
|
+
- No forbidden keys from context contract (for example `private_key`).
|
|
32
|
+
- Payload size must stay within contract limits.
|
|
33
|
+
|
|
34
|
+
## 3. Default One-Command Execution
|
|
35
|
+
|
|
36
|
+
Use this command as the default integration path:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
sce scene interactive-flow \
|
|
40
|
+
--input <provider-payload.json> \
|
|
41
|
+
--goal "<business goal>" \
|
|
42
|
+
--context-contract docs/interactive-customization/moqui-copilot-context-contract.json \
|
|
43
|
+
--execution-mode apply \
|
|
44
|
+
--auto-execute-low-risk \
|
|
45
|
+
--feedback-score 5 \
|
|
46
|
+
--json
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Notes:
|
|
50
|
+
|
|
51
|
+
- Matrix stage is enabled by default.
|
|
52
|
+
- Keep `--no-matrix` only for diagnostics.
|
|
53
|
+
|
|
54
|
+
## 4. Governance and Gate Defaults
|
|
55
|
+
|
|
56
|
+
Run governance gate on schedule and pre-release:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
node scripts/interactive-governance-report.js --period weekly --fail-on-alert --json
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Run matrix regression gate in release pipeline (configurable):
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
node scripts/matrix-regression-gate.js \
|
|
66
|
+
--baseline .kiro/reports/release-evidence/moqui-template-baseline.json \
|
|
67
|
+
--max-regressions 0 \
|
|
68
|
+
--enforce \
|
|
69
|
+
--json
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Recommended GitHub Variables:
|
|
73
|
+
|
|
74
|
+
- `KSE_MATRIX_REGRESSION_GATE_ENFORCE=true`
|
|
75
|
+
- `KSE_MATRIX_REGRESSION_GATE_MAX=0`
|
|
76
|
+
- `KSE_MOQUI_RELEASE_SUMMARY_ENFORCE=true` (optional hard gate for release summary `failed` state)
|
|
77
|
+
|
|
78
|
+
Security baseline:
|
|
79
|
+
|
|
80
|
+
- Apply default controls in `docs/security-governance-default-baseline.md`.
|
|
81
|
+
- Keep context contract strict mode enabled in production integration.
|
|
82
|
+
|
|
83
|
+
## 5. Evidence Artifacts (Must Keep)
|
|
84
|
+
|
|
85
|
+
- `.kiro/reports/interactive-governance-report.json`
|
|
86
|
+
- `.kiro/reports/interactive-governance-report.md`
|
|
87
|
+
- `.kiro/reports/interactive-matrix-signals.jsonl`
|
|
88
|
+
- `.kiro/reports/release-evidence/moqui-template-baseline.json`
|
|
89
|
+
- `.kiro/reports/release-evidence/matrix-regression-gate-<tag>.json`
|
|
90
|
+
- `.kiro/reports/release-evidence/matrix-remediation-plan-<tag>.json`
|
|
91
|
+
- `.kiro/reports/release-evidence/matrix-remediation-<tag>.lines`
|
|
92
|
+
- `.kiro/reports/release-evidence/matrix-remediation-high-<tag>.lines`
|
|
93
|
+
- `.kiro/reports/release-evidence/matrix-remediation-medium-<tag>.lines`
|
|
94
|
+
- `.kiro/reports/release-evidence/matrix-remediation-goals-high-<tag>.json`
|
|
95
|
+
- `.kiro/reports/release-evidence/matrix-remediation-goals-medium-<tag>.json`
|
|
96
|
+
- `.kiro/reports/release-evidence/matrix-remediation-phased-plan-<tag>.json`
|
|
97
|
+
- `.kiro/reports/release-evidence/weekly-ops-summary-<tag>.json`
|
|
98
|
+
- `.kiro/reports/release-evidence/weekly-ops-summary-<tag>.md`
|
|
99
|
+
|
|
100
|
+
## 6. Pass Criteria
|
|
101
|
+
|
|
102
|
+
- `interactive-flow.summary.status` is `completed` or `ready-for-apply` by policy.
|
|
103
|
+
- Governance summary status is `ok` (no medium/high breach).
|
|
104
|
+
- Matrix regression gate status is `passed` (or enforced policy satisfied).
|
|
105
|
+
- Release summary status is `passed` or explicitly approved when `incomplete`.
|
|
106
|
+
|
|
107
|
+
## 7. Remediation Loop
|
|
108
|
+
|
|
109
|
+
When matrix regressions are detected:
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
node scripts/moqui-matrix-remediation-queue.js \
|
|
113
|
+
--baseline .kiro/reports/release-evidence/moqui-template-baseline.json \
|
|
114
|
+
--lines-out .kiro/auto/matrix-remediation.lines \
|
|
115
|
+
--batch-json-out .kiro/auto/matrix-remediation.goals.json \
|
|
116
|
+
--commands-out .kiro/reports/release-evidence/matrix-remediation-commands.md \
|
|
117
|
+
--json
|
|
118
|
+
|
|
119
|
+
# anti-429 phased mode (recommended default)
|
|
120
|
+
sce auto close-loop-batch .kiro/auto/matrix-remediation.goals.high.json \
|
|
121
|
+
--format json \
|
|
122
|
+
--batch-parallel 1 \
|
|
123
|
+
--batch-agent-budget 2 \
|
|
124
|
+
--batch-retry-until-complete \
|
|
125
|
+
--batch-retry-max-rounds 3 \
|
|
126
|
+
--json
|
|
127
|
+
sleep 30
|
|
128
|
+
sce auto close-loop-batch .kiro/auto/matrix-remediation.goals.medium.json \
|
|
129
|
+
--format json \
|
|
130
|
+
--batch-parallel 1 \
|
|
131
|
+
--batch-agent-budget 2 \
|
|
132
|
+
--batch-retry-until-complete \
|
|
133
|
+
--batch-retry-max-rounds 2 \
|
|
134
|
+
--json
|
|
135
|
+
|
|
136
|
+
# one-shot equivalent
|
|
137
|
+
npm run run:matrix-remediation-phased -- --json
|
|
138
|
+
|
|
139
|
+
# zero-prep one-shot (prepare from baseline + run phased)
|
|
140
|
+
node scripts/moqui-matrix-remediation-phased-runner.js \
|
|
141
|
+
--baseline .kiro/reports/release-evidence/moqui-template-baseline.json \
|
|
142
|
+
--json
|
|
143
|
+
npm run run:matrix-remediation-from-baseline -- --json
|
|
144
|
+
|
|
145
|
+
# fallback
|
|
146
|
+
sce auto close-loop-batch .kiro/auto/matrix-remediation.lines --json
|
|
147
|
+
sce auto close-loop-batch .kiro/auto/matrix-remediation.goals.json --format json --json
|
|
148
|
+
```
|
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
# Interactive Customization Contracts
|
|
2
|
+
|
|
3
|
+
This directory contains baseline contracts and safety policy artifacts for the interactive business customization model.
|
|
4
|
+
|
|
5
|
+
## Files
|
|
6
|
+
|
|
7
|
+
- `change-intent.schema.json`: schema for business-level change intents generated from UI copilot conversations.
|
|
8
|
+
- `change-plan.schema.json`: schema for structured change plans (scope, risk, checks, rollback).
|
|
9
|
+
- `execution-record.schema.json`: schema for execution/audit records.
|
|
10
|
+
- `page-context.schema.json`: schema for page-level read-only context payloads.
|
|
11
|
+
- `guardrail-policy-baseline.json`: default secure-by-default guardrail policy.
|
|
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`).
|
|
14
|
+
- `approval-role-policy-baseline.json`: optional approval role policy baseline (`submit/approve/execute/verify/archive` role requirements).
|
|
15
|
+
- `high-risk-action-catalog.json`: baseline high-risk action classification for deny/review decisions.
|
|
16
|
+
- `change-plan.sample.json`: runnable sample plan for gate checks.
|
|
17
|
+
- `page-context.sample.json`: runnable page context sample for read-only intent generation.
|
|
18
|
+
- `moqui-context-provider.sample.json`: sample raw payload from Moqui workbench context provider (before normalization).
|
|
19
|
+
- `moqui-copilot-context-contract.json`: Moqui page context contract + security boundary baseline.
|
|
20
|
+
- `moqui-copilot-integration-guide.md`: stage-A Moqui integration guide for page-level copilot embedding.
|
|
21
|
+
- `moqui-adapter-interface.md`: stage-C Moqui adapter contract (`capabilities/plan/validate/apply/rollback`).
|
|
22
|
+
- `moqui-interactive-template-playbook.md`: stage-D template sedimentation playbook for Moqui interactive loop.
|
|
23
|
+
- `adapter-extension-contract.schema.json`: cross-stack adapter extension contract schema.
|
|
24
|
+
- `adapter-extension-contract.sample.json`: adapter extension contract sample payload.
|
|
25
|
+
- `adapter-extension-contract.md`: adapter extension contract guide and conformance checklist.
|
|
26
|
+
- `domain-pack-extension-flow.md`: Domain_Pack extension flow for cross-industry replication.
|
|
27
|
+
- `governance-threshold-baseline.json`: governance KPI threshold baseline for alerting.
|
|
28
|
+
- `governance-report-template.md`: periodic governance report template.
|
|
29
|
+
- `governance-alert-playbook.md`: threshold breach response workflow.
|
|
30
|
+
- `phase-acceptance-evidence.md`: stage A/B/C/D acceptance evidence checklist.
|
|
31
|
+
- `non-technical-usability-report.md`: business-user usability assessment and improvement backlog.
|
|
32
|
+
- `cross-industry-replication-guide.md`: replication boundary and rollout sequence beyond Moqui.
|
|
33
|
+
- `331-poc-sce-integration-checklist.md`: minimal production checklist for embedding SCE interactive flow in 331-poc.
|
|
34
|
+
|
|
35
|
+
## Usage
|
|
36
|
+
|
|
37
|
+
Validate a plan against guardrails:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
node scripts/interactive-change-plan-gate.js \
|
|
41
|
+
--plan docs/interactive-customization/change-plan.sample.json \
|
|
42
|
+
--json
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Use strict CI gating:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
node scripts/interactive-change-plan-gate.js \
|
|
49
|
+
--plan path/to/change-plan.json \
|
|
50
|
+
--fail-on-non-allow \
|
|
51
|
+
--json
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Normalize Moqui workbench payload into standard page-context:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
node scripts/interactive-context-bridge.js \
|
|
58
|
+
--input docs/interactive-customization/moqui-context-provider.sample.json \
|
|
59
|
+
--context-contract docs/interactive-customization/moqui-copilot-context-contract.json \
|
|
60
|
+
--json
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Bridge output defaults:
|
|
64
|
+
|
|
65
|
+
- Normalized page-context: `.kiro/reports/interactive-page-context.normalized.json`
|
|
66
|
+
- Bridge report: `.kiro/reports/interactive-context-bridge.json`
|
|
67
|
+
|
|
68
|
+
Run one-command full flow (bridge -> loop):
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
node scripts/interactive-flow.js \
|
|
72
|
+
--input docs/interactive-customization/moqui-context-provider.sample.json \
|
|
73
|
+
--goal "Adjust order screen field layout for clearer input flow" \
|
|
74
|
+
--runtime-mode ops-fix \
|
|
75
|
+
--runtime-environment staging \
|
|
76
|
+
--context-contract docs/interactive-customization/moqui-copilot-context-contract.json \
|
|
77
|
+
--dialogue-policy docs/interactive-customization/dialogue-governance-policy-baseline.json \
|
|
78
|
+
--runtime-policy docs/interactive-customization/runtime-mode-policy-baseline.json \
|
|
79
|
+
--execution-mode apply \
|
|
80
|
+
--auto-execute-low-risk \
|
|
81
|
+
--auth-password-hash "<sha256-of-demo-pass>" \
|
|
82
|
+
--auth-password "demo-pass" \
|
|
83
|
+
--feedback-score 5 \
|
|
84
|
+
--json
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Matrix stage behavior (enabled by default in `interactive-flow`):
|
|
88
|
+
|
|
89
|
+
- Runs `moqui-template-baseline-report` after loop stage to snapshot template matrix status.
|
|
90
|
+
- Writes session artifacts and appends a global matrix signal stream.
|
|
91
|
+
- Use `--no-matrix` to disable this stage for diagnostics.
|
|
92
|
+
|
|
93
|
+
Common matrix flags:
|
|
94
|
+
|
|
95
|
+
- `--matrix-min-score <0..100>`
|
|
96
|
+
- `--matrix-min-valid-rate <0..100>`
|
|
97
|
+
- `--matrix-compare-with <path>`
|
|
98
|
+
- `--matrix-signals <path>`
|
|
99
|
+
- `--matrix-fail-on-portfolio-fail`
|
|
100
|
+
- `--matrix-fail-on-regression`
|
|
101
|
+
|
|
102
|
+
Flow output defaults:
|
|
103
|
+
|
|
104
|
+
- Flow summary: `.kiro/reports/interactive-flow/<session-id>/interactive-flow.summary.json`
|
|
105
|
+
- Bridge context: `.kiro/reports/interactive-flow/<session-id>/interactive-page-context.normalized.json`
|
|
106
|
+
- Loop summary: `.kiro/reports/interactive-flow/<session-id>/interactive-customization-loop.summary.json`
|
|
107
|
+
- Dialogue governance report: `.kiro/reports/interactive-flow/<session-id>/interactive-dialogue-governance.json`
|
|
108
|
+
- Matrix summary JSON: `.kiro/reports/interactive-flow/<session-id>/moqui-template-baseline.json`
|
|
109
|
+
- Matrix summary Markdown: `.kiro/reports/interactive-flow/<session-id>/moqui-template-baseline.md`
|
|
110
|
+
- Matrix signal stream: `.kiro/reports/interactive-matrix-signals.jsonl`
|
|
111
|
+
|
|
112
|
+
Build read-only change intent from page context:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
node scripts/interactive-intent-build.js \
|
|
116
|
+
--context docs/interactive-customization/page-context.sample.json \
|
|
117
|
+
--goal "Must improve order approval speed without changing payment authorization policy" \
|
|
118
|
+
--context-contract docs/interactive-customization/moqui-copilot-context-contract.json \
|
|
119
|
+
--user-id demo-user \
|
|
120
|
+
--json
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Generate a change plan from intent (suggestion stage):
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
node scripts/interactive-plan-build.js \
|
|
127
|
+
--intent .kiro/reports/interactive-change-intent.json \
|
|
128
|
+
--context docs/interactive-customization/page-context.sample.json \
|
|
129
|
+
--json
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Run dialogue governance (communication-rule check only):
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
node scripts/interactive-dialogue-governance.js \
|
|
136
|
+
--goal "Improve order entry speed without changing payment policy" \
|
|
137
|
+
--context docs/interactive-customization/page-context.sample.json \
|
|
138
|
+
--policy docs/interactive-customization/dialogue-governance-policy-baseline.json \
|
|
139
|
+
--json
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Run one-command interactive loop (intent -> plan -> gate -> approval; optional low-risk apply):
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
# suggestion-first loop (no apply)
|
|
146
|
+
node scripts/interactive-customization-loop.js \
|
|
147
|
+
--context docs/interactive-customization/page-context.sample.json \
|
|
148
|
+
--context-contract docs/interactive-customization/moqui-copilot-context-contract.json \
|
|
149
|
+
--goal "Improve order entry clarity for business users" \
|
|
150
|
+
--json
|
|
151
|
+
|
|
152
|
+
# low-risk one-click apply loop
|
|
153
|
+
node scripts/interactive-customization-loop.js \
|
|
154
|
+
--context docs/interactive-customization/page-context.sample.json \
|
|
155
|
+
--context-contract docs/interactive-customization/moqui-copilot-context-contract.json \
|
|
156
|
+
--goal "Adjust order screen field layout for clearer input flow" \
|
|
157
|
+
--runtime-mode ops-fix \
|
|
158
|
+
--runtime-environment staging \
|
|
159
|
+
--runtime-policy docs/interactive-customization/runtime-mode-policy-baseline.json \
|
|
160
|
+
--approval-role-policy docs/interactive-customization/approval-role-policy-baseline.json \
|
|
161
|
+
--approval-actor-role product-owner \
|
|
162
|
+
--approver-actor-role release-operator \
|
|
163
|
+
--execution-mode apply \
|
|
164
|
+
--auto-execute-low-risk \
|
|
165
|
+
--auth-password-hash "<sha256-of-demo-pass>" \
|
|
166
|
+
--auth-password "demo-pass" \
|
|
167
|
+
--feedback-score 5 \
|
|
168
|
+
--feedback-comment "Flow is clearer and faster." \
|
|
169
|
+
--feedback-tags moqui,approval \
|
|
170
|
+
--json
|
|
171
|
+
|
|
172
|
+
# CLI equivalent
|
|
173
|
+
sce scene interactive-loop \
|
|
174
|
+
--context docs/interactive-customization/page-context.sample.json \
|
|
175
|
+
--context-contract docs/interactive-customization/moqui-copilot-context-contract.json \
|
|
176
|
+
--goal "Adjust order screen field layout for clearer input flow" \
|
|
177
|
+
--execution-mode apply \
|
|
178
|
+
--auto-execute-low-risk \
|
|
179
|
+
--auth-password-hash "<sha256-of-demo-pass>" \
|
|
180
|
+
--auth-password "demo-pass" \
|
|
181
|
+
--feedback-score 5 \
|
|
182
|
+
--json
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
`--feedback-score` writes feedback into both:
|
|
186
|
+
- Session artifact: `.kiro/reports/interactive-loop/<session-id>/interactive-user-feedback.jsonl`
|
|
187
|
+
- Governance global stream: `.kiro/reports/interactive-user-feedback.jsonl`
|
|
188
|
+
- Context contract validation is strict by default (required fields, payload size, forbidden keys). Use `--no-strict-contract` only for temporary diagnostics.
|
|
189
|
+
- `--execution-mode apply` with mutating actions requires password authorization by default (`plan.authorization.password_required=true`).
|
|
190
|
+
- Runtime policy defaults to `ops-fix@staging`; low-risk auto execute requires runtime decision `allow`.
|
|
191
|
+
|
|
192
|
+
Run runtime mode/environment policy evaluation directly:
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
node scripts/interactive-runtime-policy-evaluate.js \
|
|
196
|
+
--plan .kiro/reports/interactive-change-plan.generated.json \
|
|
197
|
+
--runtime-mode ops-fix \
|
|
198
|
+
--runtime-environment staging \
|
|
199
|
+
--policy docs/interactive-customization/runtime-mode-policy-baseline.json \
|
|
200
|
+
--json
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
Build interactive work-order artifacts directly:
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
node scripts/interactive-work-order-build.js \
|
|
207
|
+
--plan .kiro/reports/interactive-change-plan.generated.json \
|
|
208
|
+
--dialogue .kiro/reports/interactive-dialogue-governance.json \
|
|
209
|
+
--gate .kiro/reports/interactive-change-plan-gate.json \
|
|
210
|
+
--runtime .kiro/reports/interactive-runtime-policy.json \
|
|
211
|
+
--approval-state .kiro/reports/interactive-approval-state.json \
|
|
212
|
+
--execution-attempted \
|
|
213
|
+
--execution-result success \
|
|
214
|
+
--execution-id exec-xxxx \
|
|
215
|
+
--json
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
Run approval workflow state machine:
|
|
219
|
+
|
|
220
|
+
```bash
|
|
221
|
+
# init from generated plan
|
|
222
|
+
node scripts/interactive-approval-workflow.js \
|
|
223
|
+
--action init \
|
|
224
|
+
--plan .kiro/reports/interactive-change-plan.generated.json \
|
|
225
|
+
--actor product-owner \
|
|
226
|
+
--json
|
|
227
|
+
|
|
228
|
+
# submit -> approve -> execute -> verify
|
|
229
|
+
node scripts/interactive-approval-workflow.js --action submit --actor product-owner --json
|
|
230
|
+
node scripts/interactive-approval-workflow.js --action approve --actor security-admin --actor-role security-admin --json
|
|
231
|
+
node scripts/interactive-approval-workflow.js --action execute --actor release-operator --actor-role release-operator --password "demo-pass" --json
|
|
232
|
+
node scripts/interactive-approval-workflow.js --action verify --actor qa-owner --actor-role qa-owner --json
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
When role control is required, initialize workflow with:
|
|
236
|
+
- `--role-policy docs/interactive-customization/approval-role-policy-baseline.json`
|
|
237
|
+
- and pass `--actor-role <role>` in each mutating action.
|
|
238
|
+
|
|
239
|
+
Run the Moqui adapter interface (`capabilities/plan/validate/apply/rollback`):
|
|
240
|
+
|
|
241
|
+
```bash
|
|
242
|
+
# show adapter capability + risk declaration
|
|
243
|
+
node scripts/interactive-moqui-adapter.js \
|
|
244
|
+
--action capabilities \
|
|
245
|
+
--json
|
|
246
|
+
|
|
247
|
+
# build plan from intent through adapter contract
|
|
248
|
+
node scripts/interactive-moqui-adapter.js \
|
|
249
|
+
--action plan \
|
|
250
|
+
--intent .kiro/reports/interactive-change-intent.json \
|
|
251
|
+
--execution-mode suggestion \
|
|
252
|
+
--json
|
|
253
|
+
|
|
254
|
+
# validate/apply with policy gate and execution record output
|
|
255
|
+
node scripts/interactive-moqui-adapter.js \
|
|
256
|
+
--action validate \
|
|
257
|
+
--plan .kiro/reports/interactive-change-plan.adapter.json \
|
|
258
|
+
--json
|
|
259
|
+
node scripts/interactive-moqui-adapter.js \
|
|
260
|
+
--action apply \
|
|
261
|
+
--plan .kiro/reports/interactive-change-plan.adapter.json \
|
|
262
|
+
--json
|
|
263
|
+
|
|
264
|
+
# one-click path: only accepts low-risk + allow decision
|
|
265
|
+
node scripts/interactive-moqui-adapter.js \
|
|
266
|
+
--action low-risk-apply \
|
|
267
|
+
--plan .kiro/reports/interactive-change-plan.adapter.json \
|
|
268
|
+
--json
|
|
269
|
+
|
|
270
|
+
# rollback by execution id from execution ledger
|
|
271
|
+
node scripts/interactive-moqui-adapter.js \
|
|
272
|
+
--action rollback \
|
|
273
|
+
--execution-id exec-xxxx \
|
|
274
|
+
--json
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
Execution artifacts:
|
|
278
|
+
|
|
279
|
+
- Latest execution record: `.kiro/reports/interactive-execution-record.latest.json`
|
|
280
|
+
- Append-only execution ledger: `.kiro/reports/interactive-execution-ledger.jsonl`
|
|
281
|
+
- Execution records include diff summary, gate decision, validation snapshot, and rollback reference.
|
|
282
|
+
|
|
283
|
+
Append business-user feedback for governance scoring:
|
|
284
|
+
|
|
285
|
+
```bash
|
|
286
|
+
node scripts/interactive-feedback-log.js \
|
|
287
|
+
--score 5 \
|
|
288
|
+
--comment "Approval flow is clearer and faster." \
|
|
289
|
+
--user-id demo-user \
|
|
290
|
+
--session-id session-20260219 \
|
|
291
|
+
--intent-id intent-xxxx \
|
|
292
|
+
--plan-id plan-xxxx \
|
|
293
|
+
--execution-id exec-xxxx \
|
|
294
|
+
--tags moqui,approval \
|
|
295
|
+
--product moqui-suite \
|
|
296
|
+
--module order \
|
|
297
|
+
--page approval \
|
|
298
|
+
--scene-id scene-moqui-interactive \
|
|
299
|
+
--json
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
Generate governance KPI report and threshold alerts:
|
|
303
|
+
|
|
304
|
+
```bash
|
|
305
|
+
node scripts/interactive-governance-report.js \
|
|
306
|
+
--period weekly \
|
|
307
|
+
--json
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
The governance report consumes feedback events from `.kiro/reports/interactive-user-feedback.jsonl` by default.
|
|
311
|
+
The governance report also consumes matrix signals from `.kiro/reports/interactive-matrix-signals.jsonl` by default.
|
|
312
|
+
When `intent_total` is below `min_intent_samples` (default `5`), adoption emits a low-severity sample warning instead of a breach.
|
|
313
|
+
|
|
314
|
+
Export matrix regression remediation queue lines (for close-loop-batch):
|
|
315
|
+
|
|
316
|
+
```bash
|
|
317
|
+
node scripts/moqui-matrix-remediation-queue.js \
|
|
318
|
+
--baseline .kiro/reports/release-evidence/moqui-template-baseline.json \
|
|
319
|
+
--top-templates 5 \
|
|
320
|
+
--lines-out .kiro/auto/matrix-remediation.lines \
|
|
321
|
+
--batch-json-out .kiro/auto/matrix-remediation.goals.json \
|
|
322
|
+
--commands-out .kiro/reports/release-evidence/matrix-remediation-commands.md \
|
|
323
|
+
--json
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
Recommended anti-429 phased execution (default outputs):
|
|
327
|
+
|
|
328
|
+
```bash
|
|
329
|
+
sce auto close-loop-batch .kiro/auto/matrix-remediation.goals.high.json \
|
|
330
|
+
--format json \
|
|
331
|
+
--batch-parallel 1 \
|
|
332
|
+
--batch-agent-budget 2 \
|
|
333
|
+
--batch-retry-until-complete \
|
|
334
|
+
--batch-retry-max-rounds 3 \
|
|
335
|
+
--json
|
|
336
|
+
|
|
337
|
+
sleep 30
|
|
338
|
+
|
|
339
|
+
sce auto close-loop-batch .kiro/auto/matrix-remediation.goals.medium.json \
|
|
340
|
+
--format json \
|
|
341
|
+
--batch-parallel 1 \
|
|
342
|
+
--batch-agent-budget 2 \
|
|
343
|
+
--batch-retry-until-complete \
|
|
344
|
+
--batch-retry-max-rounds 2 \
|
|
345
|
+
--json
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
One-shot equivalent:
|
|
349
|
+
|
|
350
|
+
```bash
|
|
351
|
+
npm run run:matrix-remediation-phased -- --json
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
Zero-prep one-shot (prepare from baseline + run phased):
|
|
355
|
+
|
|
356
|
+
```bash
|
|
357
|
+
node scripts/moqui-matrix-remediation-phased-runner.js \
|
|
358
|
+
--baseline .kiro/reports/release-evidence/moqui-template-baseline.json \
|
|
359
|
+
--json
|
|
360
|
+
|
|
361
|
+
npm run run:matrix-remediation-from-baseline -- --json
|
|
362
|
+
```
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Adapter Extension Contract
|
|
2
|
+
|
|
3
|
+
This document defines the cross-stack adapter contract used to onboard new runtimes without changing core guardrail workflow.
|
|
4
|
+
|
|
5
|
+
## Purpose
|
|
6
|
+
|
|
7
|
+
- Keep `Change_Intent -> Change_Plan -> Gate -> Approval -> Apply -> Rollback` flow unchanged.
|
|
8
|
+
- Allow runtime-specific execution via adapter modules.
|
|
9
|
+
- Guarantee governance compatibility by contract instead of ad-hoc integration.
|
|
10
|
+
|
|
11
|
+
## Contract Artifacts
|
|
12
|
+
|
|
13
|
+
- Schema: `docs/interactive-customization/adapter-extension-contract.schema.json`
|
|
14
|
+
- Sample: `docs/interactive-customization/adapter-extension-contract.sample.json`
|
|
15
|
+
|
|
16
|
+
## Mandatory Sections
|
|
17
|
+
|
|
18
|
+
1. `capability_declaration`
|
|
19
|
+
- Declare supported change types.
|
|
20
|
+
- Declare runtime prerequisites.
|
|
21
|
+
|
|
22
|
+
2. `risk_declaration`
|
|
23
|
+
- Declare default execution mode (`suggestion` or `apply`).
|
|
24
|
+
- Declare auto-apply risk levels.
|
|
25
|
+
- Declare blocked action types.
|
|
26
|
+
|
|
27
|
+
3. `interfaces`
|
|
28
|
+
- Must implement:
|
|
29
|
+
- `capabilities()`
|
|
30
|
+
- `plan(changeIntent, context)`
|
|
31
|
+
- `validate(changePlan)`
|
|
32
|
+
- `apply(changePlan)`
|
|
33
|
+
- `rollback(executionId)`
|
|
34
|
+
|
|
35
|
+
4. `compliance`
|
|
36
|
+
- Must declare compatibility with:
|
|
37
|
+
- guardrail policy
|
|
38
|
+
- approval workflow
|
|
39
|
+
- rollback support
|
|
40
|
+
- Must declare audit record schema linkage.
|
|
41
|
+
|
|
42
|
+
## Runtime Integration Rules
|
|
43
|
+
|
|
44
|
+
- Adapter must not bypass policy gate.
|
|
45
|
+
- Adapter must not bypass approval state machine for review/high risk plans.
|
|
46
|
+
- Adapter must emit execution records compatible with:
|
|
47
|
+
- `docs/interactive-customization/execution-record.schema.json`
|
|
48
|
+
|
|
49
|
+
## Conformance Checklist
|
|
50
|
+
|
|
51
|
+
- Contract JSON validates against extension schema.
|
|
52
|
+
- `validate()` returns `allow | review-required | deny`.
|
|
53
|
+
- `apply()` writes execution record and append-only ledger.
|
|
54
|
+
- `rollback()` writes rollback execution record linked by `rollback_ref`.
|
|
55
|
+
- High-risk destructive actions stay blocked by default.
|