scene-capability-engine 3.3.3 → 3.3.5

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 CHANGED
@@ -7,6 +7,27 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [3.3.5] - 2026-02-22
11
+
12
+ ### Added
13
+ - Capability matrix execution assets for Spec 117:
14
+ - `scripts/symbol-evidence-locate.js`
15
+ - `scripts/failure-attribution-repair.js`
16
+ - `scripts/capability-mapping-report.js`
17
+ - New machine-readable contracts and examples under `docs/agent-runtime/`:
18
+ - `symbol-evidence.schema.json`
19
+ - `failure-taxonomy-baseline.json`
20
+ - `capability-mapping-report.schema.json`
21
+ - `agent-result-summary-contract.schema.json`
22
+ - End-to-end capability matrix runbook:
23
+ - `docs/sce-capability-matrix-e2e-example.md`
24
+
25
+ ### Changed
26
+ - Orchestration merge governance now enforces sub-agent result summary contract and blocks merge on invalid summaries, failed tests, or unresolved conflict issues when policy requires it.
27
+ - `bootstrap-prompt-builder` now instructs sub-agents to emit a terminal `result_summary` JSON payload.
28
+ - Command reference and roadmap docs now include strategy/symbol/failure/mapping entrypoints and default merge-governance behavior.
29
+ - Core package version updated to `3.3.5`.
30
+
10
31
  ### Added
11
32
  - **Auto handoff default takeover hard gate + preflight-check command**: `sce auto handoff` profiles now default to release-gate preflight hard requirement (`default|moqui|enterprise`), added `sce auto handoff preflight-check` (`pass|warning|blocked` + reasons/signals/recommended commands), and `handoff run` precheck/details now exposes full runtime ui-mode pressure aggregates for machine-readable triage.
12
33
  - **Interactive runtime ui-mode telemetry closed-loop**: `interactive-customization-loop` now emits runtime policy signal streams (`interactive-runtime-signals.jsonl` global + session) with `ui_mode` violation markers; `interactive-governance-report` now ingests runtime signals by default and reports runtime/ui-mode pressure metrics + alerts; weekly ops summary/gate now carry and enforce runtime ui-mode violation signals (default `RELEASE_WEEKLY_OPS_MAX_RUNTIME_UI_MODE_VIOLATION_TOTAL=0`).
package/docs/README.md CHANGED
@@ -94,6 +94,8 @@ Detailed technical documentation:
94
94
  - **[Moqui Template Core Library Playbook](moqui-template-core-library-playbook.md)** - Default-gated intake flow for absorbing Moqui capabilities into sce templates
95
95
  - **[331-poc Dual-Track Integration Guide](331-poc-dual-track-integration-guide.md)** - Handoff contract and integration playbook between 331-poc and sce
96
96
  - **[331-poc Adaptation Roadmap](331-poc-adaptation-roadmap.md)** - Ongoing sce-side adaptation backlog and rollout phases
97
+ - **[SCE Capability Matrix Roadmap](sce-capability-matrix-roadmap.md)** - Strategy routing, symbol evidence, self-repair, ontology mapping, and multi-agent merge policy roadmap
98
+ - **[SCE Capability Matrix E2E Example](sce-capability-matrix-e2e-example.md)** - End-to-end example from strategy decision to summary-driven merge block/allow
97
99
  - **[Handoff Profile Integration Guide](handoff-profile-integration-guide.md)** - External project intake contract for `default|moqui|enterprise` handoff profiles
98
100
  - **[Multi-Agent Coordination Guide](multi-agent-coordination-guide.md)** - Multi-agent parallel coordination for concurrent development
99
101
  - **[Troubleshooting](troubleshooting.md)** - Solutions to common problems
@@ -0,0 +1,50 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://scene-capability-engine.dev/contracts/agent-result-summary-contract.schema.json",
4
+ "title": "Agent Result Summary Contract",
5
+ "type": "object",
6
+ "required": [
7
+ "spec_id",
8
+ "changed_files",
9
+ "tests_run",
10
+ "tests_passed",
11
+ "risk_level",
12
+ "open_issues"
13
+ ],
14
+ "properties": {
15
+ "spec_id": {
16
+ "type": "string",
17
+ "minLength": 1
18
+ },
19
+ "changed_files": {
20
+ "type": "array",
21
+ "items": {
22
+ "type": "string"
23
+ }
24
+ },
25
+ "tests_run": {
26
+ "type": "integer",
27
+ "minimum": 0
28
+ },
29
+ "tests_passed": {
30
+ "type": "integer",
31
+ "minimum": 0
32
+ },
33
+ "risk_level": {
34
+ "type": "string",
35
+ "enum": [
36
+ "low",
37
+ "medium",
38
+ "high",
39
+ "unknown"
40
+ ]
41
+ },
42
+ "open_issues": {
43
+ "type": "array",
44
+ "items": {
45
+ "type": "string"
46
+ }
47
+ }
48
+ },
49
+ "additionalProperties": true
50
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "spec_id": "117-02-symbol-evidence-locator",
3
+ "changed_files": [
4
+ "scripts/symbol-evidence-locate.js",
5
+ "tests/unit/scripts/symbol-evidence-locate.test.js"
6
+ ],
7
+ "tests_run": 6,
8
+ "tests_passed": 6,
9
+ "risk_level": "low",
10
+ "open_issues": []
11
+ }
@@ -0,0 +1,42 @@
1
+ {
2
+ "mode": "capability-mapping-report",
3
+ "mapping_report": [
4
+ {
5
+ "change_id": "entity:Order",
6
+ "capability": "entity:order",
7
+ "mapped_templates": [
8
+ "scene-moqui-order-core"
9
+ ],
10
+ "ontology_status": "covered",
11
+ "status": "mapped"
12
+ },
13
+ {
14
+ "change_id": "business_rule:credit-check",
15
+ "capability": "rule:credit-check",
16
+ "mapped_templates": [],
17
+ "ontology_status": "gap",
18
+ "status": "missing_template_and_ontology_gap"
19
+ }
20
+ ],
21
+ "missing_capabilities": [
22
+ "rule:credit-check"
23
+ ],
24
+ "recommended_templates": [
25
+ "scene-moqui-order-core"
26
+ ],
27
+ "ontology_gaps": [
28
+ {
29
+ "change_id": "business_rule:credit-check",
30
+ "type": "business_rule",
31
+ "name": "credit-check",
32
+ "capability": "rule:credit-check"
33
+ }
34
+ ],
35
+ "summary": {
36
+ "total_changes": 2,
37
+ "mapped_changes": 1,
38
+ "missing_capabilities": 1,
39
+ "ontology_gaps": 1,
40
+ "coverage_percent": 50
41
+ }
42
+ }
@@ -0,0 +1,136 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://scene-capability-engine.dev/contracts/capability-mapping-report.schema.json",
4
+ "title": "Capability Mapping Report Contract",
5
+ "type": "object",
6
+ "required": [
7
+ "mode",
8
+ "mapping_report",
9
+ "missing_capabilities",
10
+ "recommended_templates",
11
+ "ontology_gaps",
12
+ "summary"
13
+ ],
14
+ "properties": {
15
+ "mode": {
16
+ "const": "capability-mapping-report"
17
+ },
18
+ "mapping_report": {
19
+ "type": "array",
20
+ "items": {
21
+ "type": "object",
22
+ "required": [
23
+ "change_id",
24
+ "capability",
25
+ "mapped_templates",
26
+ "ontology_status",
27
+ "status"
28
+ ],
29
+ "properties": {
30
+ "change_id": {
31
+ "type": "string"
32
+ },
33
+ "capability": {
34
+ "type": "string"
35
+ },
36
+ "mapped_templates": {
37
+ "type": "array",
38
+ "items": {
39
+ "type": "string"
40
+ }
41
+ },
42
+ "ontology_status": {
43
+ "type": "string",
44
+ "enum": [
45
+ "covered",
46
+ "gap"
47
+ ]
48
+ },
49
+ "status": {
50
+ "type": "string",
51
+ "enum": [
52
+ "mapped",
53
+ "missing_template",
54
+ "missing_template_and_ontology_gap"
55
+ ]
56
+ }
57
+ },
58
+ "additionalProperties": false
59
+ }
60
+ },
61
+ "missing_capabilities": {
62
+ "type": "array",
63
+ "items": {
64
+ "type": "string"
65
+ }
66
+ },
67
+ "recommended_templates": {
68
+ "type": "array",
69
+ "items": {
70
+ "type": "string"
71
+ }
72
+ },
73
+ "ontology_gaps": {
74
+ "type": "array",
75
+ "items": {
76
+ "type": "object",
77
+ "required": [
78
+ "change_id",
79
+ "type",
80
+ "name",
81
+ "capability"
82
+ ],
83
+ "properties": {
84
+ "change_id": {
85
+ "type": "string"
86
+ },
87
+ "type": {
88
+ "type": "string"
89
+ },
90
+ "name": {
91
+ "type": "string"
92
+ },
93
+ "capability": {
94
+ "type": "string"
95
+ }
96
+ },
97
+ "additionalProperties": false
98
+ }
99
+ },
100
+ "summary": {
101
+ "type": "object",
102
+ "required": [
103
+ "total_changes",
104
+ "mapped_changes",
105
+ "missing_capabilities",
106
+ "ontology_gaps",
107
+ "coverage_percent"
108
+ ],
109
+ "properties": {
110
+ "total_changes": {
111
+ "type": "integer",
112
+ "minimum": 0
113
+ },
114
+ "mapped_changes": {
115
+ "type": "integer",
116
+ "minimum": 0
117
+ },
118
+ "missing_capabilities": {
119
+ "type": "integer",
120
+ "minimum": 0
121
+ },
122
+ "ontology_gaps": {
123
+ "type": "integer",
124
+ "minimum": 0
125
+ },
126
+ "coverage_percent": {
127
+ "type": "number",
128
+ "minimum": 0,
129
+ "maximum": 100
130
+ }
131
+ },
132
+ "additionalProperties": false
133
+ }
134
+ },
135
+ "additionalProperties": false
136
+ }
@@ -0,0 +1,99 @@
1
+ {
2
+ "version": "1.0.0",
3
+ "default_category": "unknown",
4
+ "categories": [
5
+ {
6
+ "id": "rate_limit",
7
+ "repairable": true,
8
+ "patterns": [
9
+ "429",
10
+ "too many requests",
11
+ "rate limit",
12
+ "retry after"
13
+ ],
14
+ "default_actions": [
15
+ "reduce parallelism and retry with backoff",
16
+ "delay launch window before next execution"
17
+ ]
18
+ },
19
+ {
20
+ "id": "dependency",
21
+ "repairable": true,
22
+ "patterns": [
23
+ "cannot find module",
24
+ "module not found",
25
+ "missing dependency",
26
+ "no such package"
27
+ ],
28
+ "default_actions": [
29
+ "install or restore missing dependencies",
30
+ "reconcile lockfile and package manifest"
31
+ ]
32
+ },
33
+ {
34
+ "id": "compilation",
35
+ "repairable": true,
36
+ "patterns": [
37
+ "syntax error",
38
+ "type error",
39
+ "compile failed",
40
+ "build failed"
41
+ ],
42
+ "default_actions": [
43
+ "fix compile diagnostics at failing symbol",
44
+ "re-run targeted build validation"
45
+ ]
46
+ },
47
+ {
48
+ "id": "test_assertion",
49
+ "repairable": true,
50
+ "patterns": [
51
+ "expected",
52
+ "received",
53
+ "test suite failed",
54
+ "assertion"
55
+ ],
56
+ "default_actions": [
57
+ "inspect failing tests and related symbols",
58
+ "apply minimal fix and re-run failing tests only"
59
+ ]
60
+ },
61
+ {
62
+ "id": "environment",
63
+ "repairable": true,
64
+ "patterns": [
65
+ "permission denied",
66
+ "enoent",
67
+ "timed out",
68
+ "network"
69
+ ],
70
+ "default_actions": [
71
+ "verify runtime prerequisites",
72
+ "stabilize environment and re-run deterministic checks"
73
+ ]
74
+ },
75
+ {
76
+ "id": "policy_gate",
77
+ "repairable": false,
78
+ "patterns": [
79
+ "policy gate",
80
+ "governance blocked",
81
+ "authorization denied",
82
+ "approval required"
83
+ ],
84
+ "default_actions": [
85
+ "request required authorization or approval",
86
+ "switch to advisory response mode"
87
+ ]
88
+ },
89
+ {
90
+ "id": "unknown",
91
+ "repairable": false,
92
+ "patterns": [],
93
+ "default_actions": [
94
+ "collect diagnostics",
95
+ "escalate with failure summary"
96
+ ]
97
+ }
98
+ ]
99
+ }
@@ -0,0 +1,38 @@
1
+ {
2
+ "version": "1.0.0",
3
+ "roles": {
4
+ "primary_agent": [
5
+ "goal decomposition",
6
+ "policy checks",
7
+ "final merge decision",
8
+ "release readiness summary"
9
+ ],
10
+ "sub_agent": [
11
+ "scoped implementation",
12
+ "targeted test execution",
13
+ "artifact evidence collection"
14
+ ]
15
+ },
16
+ "parallelism": {
17
+ "default_max_parallel": 3,
18
+ "adaptive_on_rate_limit": true,
19
+ "parallel_floor": 1,
20
+ "cooldown_ms": 45000
21
+ },
22
+ "coordination_rules": {
23
+ "require_scope_manifest": true,
24
+ "require_result_summary": true,
25
+ "block_merge_on_failed_tests": true,
26
+ "block_merge_on_unresolved_conflicts": true
27
+ },
28
+ "result_summary_contract": {
29
+ "required_fields": [
30
+ "spec_id",
31
+ "changed_files",
32
+ "tests_run",
33
+ "tests_passed",
34
+ "risk_level",
35
+ "open_issues"
36
+ ]
37
+ }
38
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "version": "1.0.0",
3
+ "decision_actions": [
4
+ "answer_only",
5
+ "code_change",
6
+ "code_fix",
7
+ "rollback"
8
+ ],
9
+ "answer_only_goal_types": [
10
+ "question",
11
+ "analysis",
12
+ "explain",
13
+ "summarize"
14
+ ],
15
+ "rollback_when": {
16
+ "require_checkpoint": true,
17
+ "require_high_risk_or_explicit": true
18
+ },
19
+ "code_fix_when_tests_fail": true,
20
+ "notes": [
21
+ "default strategy is conservative and evidence-first",
22
+ "high-risk failures prefer rollback before iterative repair"
23
+ ]
24
+ }
@@ -0,0 +1,34 @@
1
+ {
2
+ "mode": "symbol-evidence-locate",
3
+ "query": "approve order",
4
+ "hits": [
5
+ {
6
+ "file": "src/order-service.js",
7
+ "line": 42,
8
+ "snippet": "function approveOrder(orderId, actorId) {",
9
+ "symbol": "approveOrder",
10
+ "score": 0.92,
11
+ "source": "symbol-heuristic"
12
+ },
13
+ {
14
+ "file": "src/order-controller.js",
15
+ "line": 18,
16
+ "snippet": "const result = orderService.approveOrder(orderId, user.id);",
17
+ "symbol": "approveOrder",
18
+ "score": 0.81,
19
+ "source": "text-grep"
20
+ }
21
+ ],
22
+ "evidence": {
23
+ "confidence": "high",
24
+ "reliable": true,
25
+ "fallback_action": "allow_write",
26
+ "advisory": "Symbol evidence is strong enough for scoped code change."
27
+ },
28
+ "summary": {
29
+ "searched_files": 38,
30
+ "candidate_files": 12,
31
+ "total_hits": 6,
32
+ "reliable_hits": 3
33
+ }
34
+ }
@@ -0,0 +1,128 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://scene-capability-engine.dev/contracts/symbol-evidence.schema.json",
4
+ "title": "Symbol Evidence Contract",
5
+ "type": "object",
6
+ "required": [
7
+ "mode",
8
+ "query",
9
+ "hits",
10
+ "evidence",
11
+ "summary"
12
+ ],
13
+ "properties": {
14
+ "mode": {
15
+ "const": "symbol-evidence-locate"
16
+ },
17
+ "query": {
18
+ "type": "string",
19
+ "minLength": 1
20
+ },
21
+ "hits": {
22
+ "type": "array",
23
+ "items": {
24
+ "type": "object",
25
+ "required": [
26
+ "file",
27
+ "line",
28
+ "snippet",
29
+ "symbol",
30
+ "score",
31
+ "source"
32
+ ],
33
+ "properties": {
34
+ "file": {
35
+ "type": "string",
36
+ "minLength": 1
37
+ },
38
+ "line": {
39
+ "type": "integer",
40
+ "minimum": 1
41
+ },
42
+ "snippet": {
43
+ "type": "string"
44
+ },
45
+ "symbol": {
46
+ "type": "string"
47
+ },
48
+ "score": {
49
+ "type": "number",
50
+ "minimum": 0,
51
+ "maximum": 1
52
+ },
53
+ "source": {
54
+ "type": "string",
55
+ "enum": [
56
+ "text-grep",
57
+ "symbol-heuristic"
58
+ ]
59
+ }
60
+ },
61
+ "additionalProperties": false
62
+ }
63
+ },
64
+ "evidence": {
65
+ "type": "object",
66
+ "required": [
67
+ "confidence",
68
+ "reliable",
69
+ "fallback_action",
70
+ "advisory"
71
+ ],
72
+ "properties": {
73
+ "confidence": {
74
+ "type": "string",
75
+ "enum": [
76
+ "high",
77
+ "medium",
78
+ "low",
79
+ "none"
80
+ ]
81
+ },
82
+ "reliable": {
83
+ "type": "boolean"
84
+ },
85
+ "fallback_action": {
86
+ "type": "string",
87
+ "enum": [
88
+ "allow_write",
89
+ "block_high_risk_write"
90
+ ]
91
+ },
92
+ "advisory": {
93
+ "type": "string"
94
+ }
95
+ },
96
+ "additionalProperties": false
97
+ },
98
+ "summary": {
99
+ "type": "object",
100
+ "required": [
101
+ "searched_files",
102
+ "candidate_files",
103
+ "total_hits",
104
+ "reliable_hits"
105
+ ],
106
+ "properties": {
107
+ "searched_files": {
108
+ "type": "integer",
109
+ "minimum": 0
110
+ },
111
+ "candidate_files": {
112
+ "type": "integer",
113
+ "minimum": 0
114
+ },
115
+ "total_hits": {
116
+ "type": "integer",
117
+ "minimum": 0
118
+ },
119
+ "reliable_hits": {
120
+ "type": "integer",
121
+ "minimum": 0
122
+ }
123
+ },
124
+ "additionalProperties": false
125
+ }
126
+ },
127
+ "additionalProperties": false
128
+ }
@@ -267,6 +267,56 @@ sce orchestrate stop
267
267
 
268
268
  When you pass `--specs` to `sce spec bootstrap|pipeline run|gate run`, sce now defaults to this orchestrate mode automatically.
269
269
 
270
+ ### Capability Matrix Utilities
271
+
272
+ ```bash
273
+ # 1) Strategy routing: decide answer_only | code_change | code_fix | rollback
274
+ node scripts/auto-strategy-router.js \
275
+ --input '{"goal_type":"bugfix","requires_write":true,"test_failures":2,"changed_files":1}' \
276
+ --policy-file docs/agent-runtime/strategy-routing-policy-baseline.json \
277
+ --json
278
+
279
+ # 2) Symbol evidence localization: query -> ranked file/line/symbol hits
280
+ node scripts/symbol-evidence-locate.js \
281
+ --workspace . \
282
+ --query "approve order" \
283
+ --min-reliable-score 0.60 \
284
+ --json
285
+
286
+ # Strict evidence gate: exit code 2 when no reliable hit is found
287
+ node scripts/symbol-evidence-locate.js \
288
+ --workspace . \
289
+ --query "reconcile invoice accrual" \
290
+ --strict \
291
+ --json
292
+
293
+ # 3) Failure attribution + bounded self-repair plan (single repair pass max by default)
294
+ node scripts/failure-attribution-repair.js \
295
+ --error "Cannot find module @acme/order-core" \
296
+ --attempted-passes 0 \
297
+ --max-repair-passes 1 \
298
+ --tests "npm run test -- order-service" \
299
+ --json
300
+
301
+ # 4) Scene template + ontology capability mapping report
302
+ node scripts/capability-mapping-report.js \
303
+ --input-file .kiro/reports/capability-mapping-input.json \
304
+ --out .kiro/reports/capability-mapping-report.json \
305
+ --json
306
+ ```
307
+
308
+ Contract/baseline files:
309
+ - `docs/agent-runtime/symbol-evidence.schema.json`
310
+ - `docs/agent-runtime/failure-taxonomy-baseline.json`
311
+ - `docs/agent-runtime/capability-mapping-report.schema.json`
312
+ - `docs/agent-runtime/agent-result-summary-contract.schema.json`
313
+ - `docs/agent-runtime/multi-agent-coordination-policy-baseline.json`
314
+
315
+ Multi-agent merge governance default:
316
+ - `sce orchestrate run` loads `docs/agent-runtime/multi-agent-coordination-policy-baseline.json`.
317
+ - When `coordination_rules.require_result_summary=true`, each sub-agent must produce `spec_id/changed_files/tests_run/tests_passed/risk_level/open_issues`.
318
+ - Merge is blocked when summary contract is invalid, when `tests_passed < tests_run` (if enabled), or when unresolved conflict issues are present (if enabled).
319
+
270
320
  ### Autonomous Close-Loop Program
271
321
 
272
322
  ```bash
@@ -941,6 +991,20 @@ Release asset integrity check helper (release artifact completeness gate):
941
991
  - merges result into `RELEASE_GATE_REPORT_FILE` when provided.
942
992
  - npm alias: `npm run gate:release-asset-integrity`
943
993
 
994
+ Release optional-asset nonempty normalize helper (pre-upload 0-byte guard):
995
+ - `node scripts/release-asset-nonempty-normalize.js --file <path> [--file <path> ...] [--kind auto|json|jsonl|lines|text] [--note <text>] [--event <event>] [--dry-run] [--json]`:
996
+ - creates placeholder content when file is missing.
997
+ - fills placeholder content when file exists but is empty.
998
+ - keeps file untouched when it already has content.
999
+ - intended for optional release assets (`.jsonl`, `.lines`) before GitHub Release upload.
1000
+
1001
+ Autonomous strategy router helper (answer/code/fix/rollback policy):
1002
+ - `node scripts/auto-strategy-router.js --input-file <path> [--policy-file <path>] --json`
1003
+ - `node scripts/auto-strategy-router.js --input '{"goal_type":"bugfix","requires_write":true}' --json`
1004
+ - returns decision: `answer_only|code_change|code_fix|rollback`.
1005
+ - returns `reasons[]` and `next_actions[]` for auditable routing.
1006
+ - default policy baseline: `docs/agent-runtime/strategy-routing-policy-baseline.json`.
1007
+
944
1008
  Matrix regression gate helper (script-level configurable hard gate):
945
1009
  - `node scripts/matrix-regression-gate.js [--baseline <path>] [--max-regressions <n>] [--enforce] [--out <path>] [--json]`: evaluate matrix regression count from baseline compare payload (`coverage_matrix_regressions` preferred, fallback `regressions`) and enforce hard gate when enabled.
946
1010
  - Default baseline input: `.kiro/reports/release-evidence/moqui-template-baseline.json`