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,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://scene-capability-engine.dev/schemas/interactive/execution-record.schema.json",
|
|
4
|
+
"title": "Interactive Execution Record",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": true,
|
|
7
|
+
"required": [
|
|
8
|
+
"execution_id",
|
|
9
|
+
"plan_id",
|
|
10
|
+
"adapter_type",
|
|
11
|
+
"policy_decision",
|
|
12
|
+
"result",
|
|
13
|
+
"executed_at"
|
|
14
|
+
],
|
|
15
|
+
"properties": {
|
|
16
|
+
"execution_id": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"minLength": 1
|
|
19
|
+
},
|
|
20
|
+
"plan_id": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"minLength": 1
|
|
23
|
+
},
|
|
24
|
+
"adapter_type": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"minLength": 1
|
|
27
|
+
},
|
|
28
|
+
"policy_decision": {
|
|
29
|
+
"type": "string",
|
|
30
|
+
"enum": [
|
|
31
|
+
"allow",
|
|
32
|
+
"review-required",
|
|
33
|
+
"deny"
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
"approval_snapshot": {
|
|
37
|
+
"type": "object"
|
|
38
|
+
},
|
|
39
|
+
"diff_summary": {
|
|
40
|
+
"type": "object"
|
|
41
|
+
},
|
|
42
|
+
"result": {
|
|
43
|
+
"type": "string",
|
|
44
|
+
"enum": [
|
|
45
|
+
"success",
|
|
46
|
+
"failed",
|
|
47
|
+
"rolled-back",
|
|
48
|
+
"skipped"
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
"rollback_ref": {
|
|
52
|
+
"type": "string"
|
|
53
|
+
},
|
|
54
|
+
"audit_trace_id": {
|
|
55
|
+
"type": "string"
|
|
56
|
+
},
|
|
57
|
+
"executed_at": {
|
|
58
|
+
"type": "string",
|
|
59
|
+
"format": "date-time"
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Governance Alert Playbook
|
|
2
|
+
|
|
3
|
+
This playbook defines how to respond when governance thresholds are breached.
|
|
4
|
+
|
|
5
|
+
## Trigger
|
|
6
|
+
|
|
7
|
+
Any medium/high breach from `interactive-governance-report`:
|
|
8
|
+
|
|
9
|
+
- adoption-rate-low
|
|
10
|
+
- execution-success-low
|
|
11
|
+
- rollback-rate-high
|
|
12
|
+
- security-intercept-high
|
|
13
|
+
- satisfaction-low
|
|
14
|
+
|
|
15
|
+
## Severity Policy
|
|
16
|
+
|
|
17
|
+
- `high`: execution quality/safety risk. Start containment immediately.
|
|
18
|
+
- `medium`: quality/friction drift. Start corrective tuning in current cycle.
|
|
19
|
+
- `low`: data quality warning (e.g., insufficient intent/feedback samples).
|
|
20
|
+
|
|
21
|
+
## Response Workflow
|
|
22
|
+
|
|
23
|
+
1. Confirm signal quality
|
|
24
|
+
- Verify report window and evidence file completeness.
|
|
25
|
+
- Re-run report for the same window to exclude transient parse issues.
|
|
26
|
+
|
|
27
|
+
2. Containment (for high severity)
|
|
28
|
+
- Freeze non-essential apply actions.
|
|
29
|
+
- Force suggestion-only mode for affected scope.
|
|
30
|
+
- Require explicit reviewer approval.
|
|
31
|
+
|
|
32
|
+
3. Diagnosis
|
|
33
|
+
- Inspect failed/skipped execution records.
|
|
34
|
+
- Inspect blocked action categories from policy decision.
|
|
35
|
+
- Inspect rejected approval events and common intent patterns.
|
|
36
|
+
|
|
37
|
+
4. Fix
|
|
38
|
+
- Update template governance rules or decision logic.
|
|
39
|
+
- Tune risk classification hints and plan generation prompts.
|
|
40
|
+
- Strengthen pre-apply verification checks.
|
|
41
|
+
|
|
42
|
+
5. Verification
|
|
43
|
+
- Re-run report in next checkpoint window.
|
|
44
|
+
- Confirm breached metric returns within threshold.
|
|
45
|
+
|
|
46
|
+
## Mandatory Output
|
|
47
|
+
|
|
48
|
+
- Incident note with breach IDs.
|
|
49
|
+
- Implemented fix list.
|
|
50
|
+
- Re-validation report link.
|
|
51
|
+
- Rollback evidence (if rollback was executed).
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Governance Report Template
|
|
2
|
+
|
|
3
|
+
Use this template for weekly/monthly interactive customization governance review.
|
|
4
|
+
|
|
5
|
+
## Header
|
|
6
|
+
|
|
7
|
+
- Period:
|
|
8
|
+
- Generated at:
|
|
9
|
+
- Scope:
|
|
10
|
+
- Overall status: `ok | alert`
|
|
11
|
+
|
|
12
|
+
## Core Metrics
|
|
13
|
+
|
|
14
|
+
1. Adoption rate (%)
|
|
15
|
+
2. Execution success rate (%)
|
|
16
|
+
3. Rollback rate (%)
|
|
17
|
+
4. Security intercept rate (%)
|
|
18
|
+
5. Intent sample count
|
|
19
|
+
6. Satisfaction average score (1-5)
|
|
20
|
+
7. Satisfaction sample count
|
|
21
|
+
|
|
22
|
+
## Alert Summary
|
|
23
|
+
|
|
24
|
+
- Breach count:
|
|
25
|
+
- Warning count:
|
|
26
|
+
- Top breach IDs:
|
|
27
|
+
|
|
28
|
+
## Evidence
|
|
29
|
+
|
|
30
|
+
- Intent audit:
|
|
31
|
+
- Approval audit:
|
|
32
|
+
- Execution ledger:
|
|
33
|
+
- Feedback file:
|
|
34
|
+
- Threshold baseline:
|
|
35
|
+
|
|
36
|
+
## Remediation Actions
|
|
37
|
+
|
|
38
|
+
1. Immediate actions (0-24h):
|
|
39
|
+
2. Short-term actions (1-7d):
|
|
40
|
+
3. Policy/template tuning actions (1-2 iterations):
|
|
41
|
+
|
|
42
|
+
## Follow-up Checkpoint
|
|
43
|
+
|
|
44
|
+
- Next review date:
|
|
45
|
+
- Owner:
|
|
46
|
+
- Exit criteria:
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "1.1.0",
|
|
3
|
+
"min_intent_samples": 5,
|
|
4
|
+
"adoption_rate_min_percent": 30,
|
|
5
|
+
"execution_success_rate_min_percent": 90,
|
|
6
|
+
"rollback_rate_max_percent": 20,
|
|
7
|
+
"security_intercept_rate_max_percent": 60,
|
|
8
|
+
"satisfaction_min_score": 4,
|
|
9
|
+
"min_feedback_samples": 3,
|
|
10
|
+
"min_matrix_samples": 3,
|
|
11
|
+
"matrix_portfolio_pass_rate_min_percent": 80,
|
|
12
|
+
"matrix_regression_positive_rate_max_percent": 20,
|
|
13
|
+
"matrix_stage_error_rate_max_percent": 20
|
|
14
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "1.0.0",
|
|
3
|
+
"mode": "advice-first",
|
|
4
|
+
"approval_policy": {
|
|
5
|
+
"require_approval_for_risk_levels": [
|
|
6
|
+
"high"
|
|
7
|
+
],
|
|
8
|
+
"max_actions_without_approval": 5,
|
|
9
|
+
"require_dual_approval_for_privilege_escalation": true
|
|
10
|
+
},
|
|
11
|
+
"security_policy": {
|
|
12
|
+
"require_masking_when_sensitive_data": true,
|
|
13
|
+
"forbid_plaintext_secrets": true,
|
|
14
|
+
"require_backup_for_irreversible_actions": true
|
|
15
|
+
},
|
|
16
|
+
"authorization_policy": {
|
|
17
|
+
"require_password_for_apply_mutations": true,
|
|
18
|
+
"password_scope": [
|
|
19
|
+
"execute"
|
|
20
|
+
],
|
|
21
|
+
"password_hash_env": "SCE_INTERACTIVE_AUTH_PASSWORD_SHA256",
|
|
22
|
+
"password_ttl_seconds": 600
|
|
23
|
+
},
|
|
24
|
+
"catalog_policy": {
|
|
25
|
+
"catalog_file": "docs/interactive-customization/high-risk-action-catalog.json"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "1.0.0",
|
|
3
|
+
"generated_at": "2026-02-19T00:00:00.000Z",
|
|
4
|
+
"catalog": {
|
|
5
|
+
"deny_action_types": [
|
|
6
|
+
"credential_export",
|
|
7
|
+
"raw_sql_destructive",
|
|
8
|
+
"permission_grant_super_admin",
|
|
9
|
+
"bulk_delete_without_filter"
|
|
10
|
+
],
|
|
11
|
+
"review_required_action_types": [
|
|
12
|
+
"schema_migration",
|
|
13
|
+
"workflow_approval_chain_change",
|
|
14
|
+
"payment_rule_change",
|
|
15
|
+
"inventory_adjustment_bulk"
|
|
16
|
+
],
|
|
17
|
+
"notes": {
|
|
18
|
+
"deny": "Actions in deny_action_types are blocked by default.",
|
|
19
|
+
"review_required": "Actions in review_required_action_types require explicit human approval."
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Moqui Adapter Minimal Interface (Stage C)
|
|
2
|
+
|
|
3
|
+
This document defines the minimal adapter contract used by interactive customization execution in the Moqui experiment product.
|
|
4
|
+
|
|
5
|
+
## Interface
|
|
6
|
+
|
|
7
|
+
`capabilities()`
|
|
8
|
+
- Returns capability declaration (`supported_change_types`, risk statement, runtime behavior).
|
|
9
|
+
|
|
10
|
+
`plan(changeIntent, context)`
|
|
11
|
+
- Converts a `Change_Intent` into a structured `Change_Plan`.
|
|
12
|
+
- Output fields align with `change-plan.schema.json`.
|
|
13
|
+
|
|
14
|
+
`validate(changePlan)`
|
|
15
|
+
- Evaluates `Change_Plan` with guardrail policy + high-risk catalog.
|
|
16
|
+
- Decision: `allow | review-required | deny`.
|
|
17
|
+
|
|
18
|
+
`apply(changePlan)`
|
|
19
|
+
- Runs controlled execution after validation.
|
|
20
|
+
- Default behavior is safe simulation; live apply is opt-in.
|
|
21
|
+
- Produces `ExecutionRecord` and appends execution ledger.
|
|
22
|
+
|
|
23
|
+
`applyLowRisk(changePlan)`
|
|
24
|
+
- One-click execution entry for stage-C.
|
|
25
|
+
- Requires `risk_level=low` and policy decision `allow`, otherwise blocks with `ExecutionRecord(result=skipped)`.
|
|
26
|
+
|
|
27
|
+
`rollback(executionId)`
|
|
28
|
+
- Generates rollback execution record for a previous execution.
|
|
29
|
+
- Keeps append-only audit behavior.
|
|
30
|
+
|
|
31
|
+
## Reference Implementation
|
|
32
|
+
|
|
33
|
+
- Runtime module: `lib/interactive-customization/moqui-interactive-adapter.js`
|
|
34
|
+
- Script entry: `scripts/interactive-moqui-adapter.js`
|
|
35
|
+
- Validation core: `lib/interactive-customization/change-plan-gate-core.js`
|
|
36
|
+
|
|
37
|
+
## Artifacts
|
|
38
|
+
|
|
39
|
+
- Latest execution record: `.kiro/reports/interactive-execution-record.latest.json`
|
|
40
|
+
- Execution ledger (JSONL): `.kiro/reports/interactive-execution-ledger.jsonl`
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"product": "331-moqui-poc",
|
|
3
|
+
"workspace": {
|
|
4
|
+
"module": "governance-platform",
|
|
5
|
+
"page": "screen-explorer-workbench",
|
|
6
|
+
"scene": {
|
|
7
|
+
"id": "sce.scene--platform-screen-explorer-assist--0.1.0",
|
|
8
|
+
"name": "Screen 探索场景",
|
|
9
|
+
"type": "screen-analysis",
|
|
10
|
+
"workflow_node": "screen-analysis"
|
|
11
|
+
},
|
|
12
|
+
"screen_explorer": {
|
|
13
|
+
"active_tab": "Overview",
|
|
14
|
+
"selected_screen": "Screen Explorer",
|
|
15
|
+
"selected_component": "Entity",
|
|
16
|
+
"filters": [
|
|
17
|
+
"AI Components",
|
|
18
|
+
"Forms",
|
|
19
|
+
"Widgets"
|
|
20
|
+
],
|
|
21
|
+
"result_total": 0
|
|
22
|
+
},
|
|
23
|
+
"ontology": {
|
|
24
|
+
"entities": [
|
|
25
|
+
"Screen",
|
|
26
|
+
"Form",
|
|
27
|
+
"Widget"
|
|
28
|
+
],
|
|
29
|
+
"relations": [
|
|
30
|
+
"Screen_has_Form",
|
|
31
|
+
"Screen_has_Widget"
|
|
32
|
+
],
|
|
33
|
+
"business_rules": [
|
|
34
|
+
"screen_name_unique",
|
|
35
|
+
"component_reference_consistency",
|
|
36
|
+
"change_requires_audit_record"
|
|
37
|
+
],
|
|
38
|
+
"decision_policies": [
|
|
39
|
+
"publish_requires_risk_review",
|
|
40
|
+
"fallback_to_read_only_when_gate_non_allow"
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"fields": [
|
|
45
|
+
{
|
|
46
|
+
"name": "screen_name",
|
|
47
|
+
"type": "string"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"name": "component_type",
|
|
51
|
+
"type": "enum"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"name": "api_token",
|
|
55
|
+
"type": "string",
|
|
56
|
+
"sensitive": true
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
"current_state": {
|
|
60
|
+
"screen_name": "Screen Explorer",
|
|
61
|
+
"component_type": "Entity",
|
|
62
|
+
"api_token": "tok_live_example_abc",
|
|
63
|
+
"operator": "platform_manager"
|
|
64
|
+
},
|
|
65
|
+
"assistant": {
|
|
66
|
+
"sessionId": "session-1771",
|
|
67
|
+
"agentId": "codex-gpt4-1",
|
|
68
|
+
"model": "Spec-Expert",
|
|
69
|
+
"mode": "read-only",
|
|
70
|
+
"prompt": "Ask what should be fixed on the current page and propose actionable plan."
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "1.1.0",
|
|
3
|
+
"product": "scene-capability-engine",
|
|
4
|
+
"context_contract": {
|
|
5
|
+
"required_fields": [
|
|
6
|
+
"product",
|
|
7
|
+
"module",
|
|
8
|
+
"page"
|
|
9
|
+
],
|
|
10
|
+
"optional_fields": [
|
|
11
|
+
"entity",
|
|
12
|
+
"scene_id",
|
|
13
|
+
"workflow_node",
|
|
14
|
+
"fields",
|
|
15
|
+
"current_state",
|
|
16
|
+
"scene_workspace",
|
|
17
|
+
"assistant_panel"
|
|
18
|
+
],
|
|
19
|
+
"max_field_count": 400,
|
|
20
|
+
"max_payload_kb": 512
|
|
21
|
+
},
|
|
22
|
+
"security_contract": {
|
|
23
|
+
"mode": "read-only",
|
|
24
|
+
"masking_required": true,
|
|
25
|
+
"sensitive_key_patterns": [
|
|
26
|
+
"password",
|
|
27
|
+
"secret",
|
|
28
|
+
"token",
|
|
29
|
+
"api_key",
|
|
30
|
+
"apikey",
|
|
31
|
+
"credential",
|
|
32
|
+
"email",
|
|
33
|
+
"phone",
|
|
34
|
+
"bank",
|
|
35
|
+
"card"
|
|
36
|
+
],
|
|
37
|
+
"forbidden_keys": [
|
|
38
|
+
"raw_password",
|
|
39
|
+
"private_key",
|
|
40
|
+
"access_token_plaintext"
|
|
41
|
+
]
|
|
42
|
+
},
|
|
43
|
+
"runtime_contract": {
|
|
44
|
+
"provider": "ui-context-provider",
|
|
45
|
+
"transport": "json",
|
|
46
|
+
"schema": "docs/interactive-customization/page-context.schema.json",
|
|
47
|
+
"consumer": "scripts/interactive-intent-build.js",
|
|
48
|
+
"loop_entry": "scripts/interactive-customization-loop.js"
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# Moqui Copilot Integration Guide (Stage A)
|
|
2
|
+
|
|
3
|
+
This guide defines the page-level integration pattern for embedding the SCE Business Copilot into a customized Moqui product.
|
|
4
|
+
|
|
5
|
+
## Goal
|
|
6
|
+
|
|
7
|
+
Provide a deterministic and secure context bridge so non-technical users can describe business goals in UI, while backend automation remains read-only at this stage.
|
|
8
|
+
|
|
9
|
+
## Integration Model
|
|
10
|
+
|
|
11
|
+
```text
|
|
12
|
+
Moqui Page -> Context Provider -> interactive-context-bridge -> Masking Filter -> Copilot Panel -> interactive-intent-build
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
At stage A:
|
|
16
|
+
|
|
17
|
+
- Copilot is read-only.
|
|
18
|
+
- No write action is executed from the panel.
|
|
19
|
+
- Output artifacts are `Change_Intent`, explain markdown, and audit JSONL.
|
|
20
|
+
|
|
21
|
+
## Context Provider Contract
|
|
22
|
+
|
|
23
|
+
Reference file:
|
|
24
|
+
|
|
25
|
+
- `docs/interactive-customization/moqui-copilot-context-contract.json`
|
|
26
|
+
|
|
27
|
+
Minimum payload fields:
|
|
28
|
+
|
|
29
|
+
1. `product`
|
|
30
|
+
2. `module`
|
|
31
|
+
3. `page`
|
|
32
|
+
|
|
33
|
+
Optional but recommended:
|
|
34
|
+
|
|
35
|
+
1. `entity`
|
|
36
|
+
2. `scene_id`
|
|
37
|
+
3. `workflow_node`
|
|
38
|
+
4. `fields[]`
|
|
39
|
+
5. `current_state`
|
|
40
|
+
6. `scene_workspace` (screen explorer + ontology snapshot)
|
|
41
|
+
7. `assistant_panel` (AI panel session/model metadata)
|
|
42
|
+
|
|
43
|
+
Schema:
|
|
44
|
+
|
|
45
|
+
- `docs/interactive-customization/page-context.schema.json`
|
|
46
|
+
|
|
47
|
+
## Security Boundary
|
|
48
|
+
|
|
49
|
+
1. Provider must apply key-based masking for sensitive fields before sending context to Copilot.
|
|
50
|
+
2. Forbidden keys must be removed completely, not masked.
|
|
51
|
+
3. Copilot requests must run under read-only runtime identity.
|
|
52
|
+
4. Generated outputs are stored in report paths only, never direct code/runtime mutation.
|
|
53
|
+
|
|
54
|
+
## Suggested Moqui Hook Points
|
|
55
|
+
|
|
56
|
+
1. Build a page context object from screen/form state in controller/render pipeline.
|
|
57
|
+
2. Pass provider payload to `interactive-context-bridge` and store normalized page-context artifact.
|
|
58
|
+
3. Pass sanitized context to frontend Copilot panel via JSON endpoint or embedded script tag payload.
|
|
59
|
+
4. Trigger `interactive-intent-build` with user goal + sanitized context.
|
|
60
|
+
|
|
61
|
+
## Bridge Command
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
node scripts/interactive-context-bridge.js \
|
|
65
|
+
--input docs/interactive-customization/moqui-context-provider.sample.json \
|
|
66
|
+
--context-contract docs/interactive-customization/moqui-copilot-context-contract.json \
|
|
67
|
+
--json
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## One-Command Flow
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
node scripts/interactive-flow.js \
|
|
74
|
+
--input docs/interactive-customization/moqui-context-provider.sample.json \
|
|
75
|
+
--goal "Adjust order screen field layout for clearer input flow" \
|
|
76
|
+
--context-contract docs/interactive-customization/moqui-copilot-context-contract.json \
|
|
77
|
+
--execution-mode apply \
|
|
78
|
+
--auto-execute-low-risk \
|
|
79
|
+
--feedback-score 5 \
|
|
80
|
+
--json
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Example Command
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
node scripts/interactive-intent-build.js \
|
|
87
|
+
--context docs/interactive-customization/page-context.sample.json \
|
|
88
|
+
--context-contract docs/interactive-customization/moqui-copilot-context-contract.json \
|
|
89
|
+
--goal "Must improve approval speed without changing payment authorization policy" \
|
|
90
|
+
--user-id product-owner \
|
|
91
|
+
--json
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Acceptance Checklist
|
|
95
|
+
|
|
96
|
+
1. Context payload validates against schema.
|
|
97
|
+
2. Context contract gate passes (required fields + payload size + forbidden keys).
|
|
98
|
+
3. Sensitive keys are masked or removed.
|
|
99
|
+
4. Copilot outputs contain `readonly=true`.
|
|
100
|
+
5. Audit event is appended to `.kiro/reports/interactive-copilot-audit.jsonl`.
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# Moqui Interactive Template Playbook
|
|
2
|
+
|
|
3
|
+
This playbook defines how to turn validated Moqui interactive customization flows into reusable SCE template assets.
|
|
4
|
+
|
|
5
|
+
## Scope
|
|
6
|
+
|
|
7
|
+
- Stage A/B/C artifacts:
|
|
8
|
+
- `Change_Intent`
|
|
9
|
+
- `Change_Plan`
|
|
10
|
+
- guardrail gate decision
|
|
11
|
+
- approval workflow state
|
|
12
|
+
- execution/rollback records
|
|
13
|
+
- Stage D target:
|
|
14
|
+
- scene package template
|
|
15
|
+
- ontology model
|
|
16
|
+
- governance contract
|
|
17
|
+
- operational playbook
|
|
18
|
+
|
|
19
|
+
## Standard Template Asset
|
|
20
|
+
|
|
21
|
+
Primary package for the interactive loop:
|
|
22
|
+
|
|
23
|
+
- `.kiro/templates/scene-packages/kse.scene--moqui-interactive-customization-loop--0.1.0/scene-package.json`
|
|
24
|
+
- `.kiro/templates/scene-packages/kse.scene--moqui-interactive-customization-loop--0.1.0/scene.template.yaml`
|
|
25
|
+
- `.kiro/templates/scene-packages/kse.scene--moqui-interactive-customization-loop--0.1.0/custom/scene.yaml`
|
|
26
|
+
- `.kiro/templates/scene-packages/kse.scene--moqui-interactive-customization-loop--0.1.0/template.manifest.json`
|
|
27
|
+
|
|
28
|
+
## Capability Matrix Mapping
|
|
29
|
+
|
|
30
|
+
The template captures one full business-safe loop:
|
|
31
|
+
|
|
32
|
+
1. `spec.moqui.interactive.intent.build`
|
|
33
|
+
2. `spec.moqui.interactive.plan.generate`
|
|
34
|
+
3. `spec.moqui.interactive.plan.gate`
|
|
35
|
+
4. `spec.moqui.interactive.approval.workflow`
|
|
36
|
+
5. `spec.moqui.interactive.low-risk.apply`
|
|
37
|
+
6. `spec.moqui.interactive.rollback.record`
|
|
38
|
+
|
|
39
|
+
## Ontology Baseline
|
|
40
|
+
|
|
41
|
+
Minimum ontology entities:
|
|
42
|
+
|
|
43
|
+
- `change_intent`
|
|
44
|
+
- `change_plan`
|
|
45
|
+
- `gate_decision`
|
|
46
|
+
- `approval_state`
|
|
47
|
+
- `execution_record`
|
|
48
|
+
- `rollback_record`
|
|
49
|
+
|
|
50
|
+
Minimum relations:
|
|
51
|
+
|
|
52
|
+
- `change_intent -> change_plan (produces)`
|
|
53
|
+
- `change_plan -> gate_decision (produces)`
|
|
54
|
+
- `gate_decision -> approval_state (produces)`
|
|
55
|
+
- `approval_state -> execution_record (produces)`
|
|
56
|
+
- `execution_record -> rollback_record (produces)`
|
|
57
|
+
|
|
58
|
+
## Governance Baseline
|
|
59
|
+
|
|
60
|
+
Mandatory rule and decision coverage:
|
|
61
|
+
|
|
62
|
+
- Business rules:
|
|
63
|
+
- intent phase must remain read-only
|
|
64
|
+
- high-risk plans require approval
|
|
65
|
+
- one-click apply restricted to low-risk + allow
|
|
66
|
+
- rollback trace linkage is mandatory
|
|
67
|
+
- Decision logic:
|
|
68
|
+
- gate routing (`allow | review-required | deny`)
|
|
69
|
+
- execution routing (`low-risk apply` only)
|
|
70
|
+
- rollback routing (execution-ledger based)
|
|
71
|
+
|
|
72
|
+
## Publish/Gate Workflow
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
# baseline score and ontology quality
|
|
76
|
+
sce scene moqui-baseline --json
|
|
77
|
+
|
|
78
|
+
# strict intake gate
|
|
79
|
+
sce scene package-publish-batch \
|
|
80
|
+
--manifest docs/handoffs/handoff-manifest.json \
|
|
81
|
+
--dry-run \
|
|
82
|
+
--ontology-min-score 70 \
|
|
83
|
+
--ontology-min-average-score 70 \
|
|
84
|
+
--ontology-min-valid-rate 100 \
|
|
85
|
+
--json
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Acceptance Checklist
|
|
89
|
+
|
|
90
|
+
- Template has full `capability_contract` chain (intent -> rollback).
|
|
91
|
+
- `ontology_model.entities` and `ontology_model.relations` are non-empty.
|
|
92
|
+
- `governance_contract.business_rules` and `decision_logic` are non-empty and closed.
|
|
93
|
+
- Execution behavior remains guardrail-first (no direct high-risk auto-apply).
|
|
94
|
+
- Template passes baseline and ontology gates without bypass flags.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Non-Technical Usability Report (Moqui Experiment)
|
|
2
|
+
|
|
3
|
+
This report evaluates whether business users can complete optimization loops without software engineering expertise.
|
|
4
|
+
|
|
5
|
+
## Target User Profile
|
|
6
|
+
|
|
7
|
+
- Understands business process and constraints.
|
|
8
|
+
- Does not write source code.
|
|
9
|
+
- Needs explainable, reversible, low-risk change flow.
|
|
10
|
+
|
|
11
|
+
## Success Cases
|
|
12
|
+
|
|
13
|
+
1. Read-only understanding
|
|
14
|
+
- User asks for process/field/rule explanation in page context.
|
|
15
|
+
- System returns business-readable explain output and structured intent.
|
|
16
|
+
|
|
17
|
+
2. Suggestion-first planning
|
|
18
|
+
- User provides goal in business language.
|
|
19
|
+
- System generates structured plan with risk, verification, rollback.
|
|
20
|
+
|
|
21
|
+
3. Guardrail-protected execution
|
|
22
|
+
- Low-risk and allow decisions can proceed via controlled apply.
|
|
23
|
+
- High-risk/review-required actions are blocked or routed to approval.
|
|
24
|
+
|
|
25
|
+
4. Traceable rollback
|
|
26
|
+
- User can request rollback by execution id.
|
|
27
|
+
- System records rollback trace without hidden mutation.
|
|
28
|
+
|
|
29
|
+
## Failure Cases Observed
|
|
30
|
+
|
|
31
|
+
1. Adoption friction
|
|
32
|
+
- Users may receive too many `review-required`/`deny` outcomes when intent text is vague.
|
|
33
|
+
|
|
34
|
+
2. Feedback sparsity
|
|
35
|
+
- Satisfaction trend quality is weak when feedback sample count is low.
|
|
36
|
+
|
|
37
|
+
3. Policy mismatch
|
|
38
|
+
- Some domain intents are classified as medium/high by default and cannot use one-click path.
|
|
39
|
+
|
|
40
|
+
## Improvement Backlog
|
|
41
|
+
|
|
42
|
+
1. Improve intent guidance templates
|
|
43
|
+
- Add business-facing prompt examples per module (order/inventory/approval).
|
|
44
|
+
|
|
45
|
+
2. Add domain-tuned risk hints
|
|
46
|
+
- Improve risk classification precision for repeated safe operations.
|
|
47
|
+
|
|
48
|
+
3. Improve feedback capture
|
|
49
|
+
- Add lightweight feedback collection in page copilot UI for each action result.
|
|
50
|
+
|
|
51
|
+
4. Expand safe action catalog
|
|
52
|
+
- Promote proven medium-risk patterns into review-light, still-governed pathways.
|
|
53
|
+
|
|
54
|
+
## Current Verdict
|
|
55
|
+
|
|
56
|
+
- Baseline usability is acceptable for guided business users.
|
|
57
|
+
- Continuous improvement depends on better intent guidance + richer feedback samples.
|