scene-capability-engine 3.6.45 → 3.6.47

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 (72) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +1 -0
  3. package/README.zh.md +1 -0
  4. package/docs/agent-runtime/symbol-evidence.schema.json +1 -1
  5. package/docs/command-reference.md +8 -0
  6. package/docs/interactive-customization/dialogue-governance-policy-baseline.json +4 -1
  7. package/docs/interactive-customization/embedded-assistant-authorization-dialogue-rules.md +5 -0
  8. package/docs/releases/README.md +2 -0
  9. package/docs/releases/v3.6.46.md +23 -0
  10. package/docs/releases/v3.6.47.md +23 -0
  11. package/docs/sce-business-mode-map.md +2 -1
  12. package/docs/sce-capability-matrix-e2e-example.md +2 -1
  13. package/docs/security-governance-default-baseline.md +2 -0
  14. package/docs/starter-kit/README.md +3 -0
  15. package/docs/zh/releases/README.md +2 -0
  16. package/docs/zh/releases/v3.6.46.md +23 -0
  17. package/docs/zh/releases/v3.6.47.md +23 -0
  18. package/lib/workspace/takeover-baseline.js +293 -1
  19. package/package.json +6 -2
  20. package/scripts/auto-strategy-router.js +231 -0
  21. package/scripts/capability-mapping-report.js +339 -0
  22. package/scripts/check-branding-consistency.js +140 -0
  23. package/scripts/check-sce-tracking.js +54 -0
  24. package/scripts/check-skip-allowlist.js +94 -0
  25. package/scripts/clarification-first-audit.js +322 -0
  26. package/scripts/errorbook-registry-health-gate.js +172 -0
  27. package/scripts/errorbook-release-gate.js +132 -0
  28. package/scripts/failure-attribution-repair.js +317 -0
  29. package/scripts/git-managed-gate.js +464 -0
  30. package/scripts/interactive-approval-event-projection.js +400 -0
  31. package/scripts/interactive-approval-workflow.js +829 -0
  32. package/scripts/interactive-authorization-tier-evaluate.js +413 -0
  33. package/scripts/interactive-change-plan-gate.js +225 -0
  34. package/scripts/interactive-context-bridge.js +617 -0
  35. package/scripts/interactive-customization-loop.js +1690 -0
  36. package/scripts/interactive-dialogue-governance.js +873 -0
  37. package/scripts/interactive-feedback-log.js +253 -0
  38. package/scripts/interactive-flow-smoke.js +238 -0
  39. package/scripts/interactive-flow.js +1059 -0
  40. package/scripts/interactive-governance-report.js +1112 -0
  41. package/scripts/interactive-intent-build.js +707 -0
  42. package/scripts/interactive-loop-smoke.js +215 -0
  43. package/scripts/interactive-moqui-adapter.js +304 -0
  44. package/scripts/interactive-plan-build.js +426 -0
  45. package/scripts/interactive-runtime-policy-evaluate.js +495 -0
  46. package/scripts/interactive-work-order-build.js +552 -0
  47. package/scripts/matrix-regression-gate.js +167 -0
  48. package/scripts/moqui-core-regression-suite.js +397 -0
  49. package/scripts/moqui-lexicon-audit.js +651 -0
  50. package/scripts/moqui-matrix-remediation-phased-runner.js +865 -0
  51. package/scripts/moqui-matrix-remediation-queue.js +852 -0
  52. package/scripts/moqui-metadata-extract.js +1340 -0
  53. package/scripts/moqui-rebuild-gate.js +167 -0
  54. package/scripts/moqui-release-summary.js +729 -0
  55. package/scripts/moqui-standard-rebuild.js +1370 -0
  56. package/scripts/moqui-template-baseline-report.js +682 -0
  57. package/scripts/npm-package-runtime-asset-check.js +221 -0
  58. package/scripts/problem-closure-gate.js +441 -0
  59. package/scripts/release-asset-integrity-check.js +216 -0
  60. package/scripts/release-asset-nonempty-normalize.js +166 -0
  61. package/scripts/release-drift-evaluate.js +223 -0
  62. package/scripts/release-drift-signals.js +255 -0
  63. package/scripts/release-governance-snapshot-export.js +132 -0
  64. package/scripts/release-ops-weekly-summary.js +934 -0
  65. package/scripts/release-risk-remediation-bundle.js +315 -0
  66. package/scripts/release-weekly-ops-gate.js +423 -0
  67. package/scripts/state-migration-reconciliation-gate.js +110 -0
  68. package/scripts/state-storage-tiering-audit.js +337 -0
  69. package/scripts/steering-content-audit.js +393 -0
  70. package/scripts/symbol-evidence-locate.js +370 -0
  71. package/template/.sce/README.md +1 -0
  72. package/template/.sce/steering/CORE_PRINCIPLES.md +25 -0
package/CHANGELOG.md CHANGED
@@ -7,6 +7,28 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [3.6.47] - 2026-03-14
11
+
12
+ ### Changed
13
+ - Promoted "clarification before disable" to a global SCE baseline rule: missing business scene/module/page/entity context now defaults to clarification in builtin interactive governance, is written into steering/template core principles, and is documented as mandatory for all SCE-integrated projects with no exceptions.
14
+ - Added `clarification-first-audit` as a release/audit guard so core scripts, policy/docs, starter/template baselines, and legacy fallback phrases are continuously checked for regression.
15
+ - Wired `clarification-first-audit` into `test.yml`, `release.yml`, and `steering-hygiene.yml` so CI, tag releases, and scheduled hygiene runs all enforce the clarification-first baseline.
16
+ - Extended takeover baseline auto-alignment so older adopted projects also repair missing clarification-first `CORE_PRINCIPLES` content during best-effort startup/default alignment.
17
+ - Added CLI integration coverage for `sce adopt`, `sce upgrade`, and startup takeover auto-alignment so clarification-first baseline propagation is verified end-to-end on real project fixtures.
18
+ - Extended takeover baseline to auto-create `.sce/config/errorbook-registry.json` and to inventory project-defined mistake-book/postmortem style artifacts so SCE takeover converges them into the canonical `errorbook` flow instead of letting parallel mechanisms coexist.
19
+ - Added three more global core principles to the steering baseline: forbid blind fixes without problem evidence, require evaluation before any steering entry is added/removed/rewritten, and default frontend/backend mismatch fixes to align the frontend to the existing backend API contract unless an interface change is explicitly requested.
20
+
21
+ ## [3.6.46] - 2026-03-13
22
+
23
+ ### Added
24
+ - Added `scripts/npm-package-runtime-asset-check.js` and the `npm run gate:npm-runtime-assets` release gate to verify that every runtime `scripts/*.js` file is present in the npm pack dry-run payload before publish.
25
+ - Added Spec `123-00-npm-package-runtime-asset-integrity` with requirements, design, tasks, and deliverables to formalize the npm runtime asset integrity fix.
26
+ - Added unit coverage for runtime script discovery, pack payload parsing, missing-script detection, and pack execution failure reporting.
27
+
28
+ ### Fixed
29
+ - Fixed npm package publish contents by including the root `scripts/` directory in the package `files` allowlist, so installed `sce` tarballs no longer crash on missing runtime assets such as `scripts/git-managed-gate.js`.
30
+ - Fixed the new runtime asset gate on Windows by executing `npm pack --json --dry-run` through a shell-compatible path and raising the output buffer ceiling for large package manifests.
31
+
10
32
  ## [3.6.45] - 2026-03-13
11
33
 
12
34
  ### Added
package/README.md CHANGED
@@ -139,6 +139,7 @@ sce auth status --json
139
139
  SCE is opinionated by default.
140
140
 
141
141
  - `studio plan` runs intake and scene/spec governance unless policy explicitly allows bypass.
142
+ - When business scene/module/page/entity context is missing, SCE must route to clarification first; unknown business scope must not be turned into blanket disable.
142
143
  - `verify` and `release` enforce problem-closure and related gates when a spec is bound.
143
144
  - Autonomous program execution applies gate evaluation, fallback-chain logic, governance replay, and auto-remediation.
144
145
  - State persistence prefers SQLite, not ad hoc local caches.
package/README.zh.md CHANGED
@@ -144,6 +144,7 @@ sce auth status --json
144
144
  SCE 默认是强治理的。
145
145
 
146
146
  - `studio plan` 默认执行 intake 与 scene/spec 治理,除非策略显式允许绕过
147
+ - 缺少业务场景/模块/页面/实体上下文时,SCE 必须先进入澄清,而不是把未知业务范围直接变成一刀切禁用
147
148
  - 当 spec 绑定时,`verify` 和 `release` 默认执行 problem-closure 等相关门禁
148
149
  - `close-loop-program` 默认带 gate 评估、fallback-chain、governance replay、auto-remediation
149
150
  - 状态持久化默认优先走 SQLite,而不是零散本地缓存
@@ -86,7 +86,7 @@
86
86
  "type": "string",
87
87
  "enum": [
88
88
  "allow_write",
89
- "block_high_risk_write"
89
+ "clarify_business_scope"
90
90
  ]
91
91
  },
92
92
  "advisory": {
@@ -366,6 +366,8 @@ sce workspace takeover-apply --json
366
366
  # until manual migration is completed.
367
367
  # For adopted projects, startup auto-runs takeover baseline alignment
368
368
  # before command execution (best effort, non-blocking).
369
+ # Takeover alignment now also repairs missing clarification-first
370
+ # CORE_PRINCIPLES baseline when older adopted projects drift.
369
371
 
370
372
  # Legacy commands (still supported)
371
373
  sce workspace sync
@@ -1806,8 +1808,14 @@ Interactive dialogue governance helper (script-level communication-rule gate):
1806
1808
  - Default policy: `docs/interactive-customization/dialogue-governance-policy-baseline.json` (fallback builtin policy when missing)
1807
1809
  - Default authorization dialogue policy: `docs/interactive-customization/authorization-dialogue-policy-baseline.json`
1808
1810
  - Default profile: `business-user` (use `system-maintainer` for maintenance/operator conversations)
1811
+ - Missing business scene/module/page/entity context defaults to `clarify`; unknown scope must not be converted into blanket disable fallback.
1809
1812
  - `--fail-on-deny` exits with code `2` to block unsafe requests in CI/automation.
1810
1813
 
1814
+ Clarification-first baseline audit helper:
1815
+ - `node scripts/clarification-first-audit.js [--project-path <path>] [--out <path>] [--fail-on-violation] [--json]`: verify that SCE global clarification-first baselines are present across core scripts, policy/docs, starter/template assets, and that legacy blanket-disable phrases do not reappear in tracked source/docs.
1816
+ - Default behavior: audit current project root.
1817
+ - `--fail-on-violation` exits with code `2` when required clarification-first baselines drift or prohibited legacy phrases are detected.
1818
+
1811
1819
  Interactive change-plan generator helper (script-level stage-B planning bridge):
1812
1820
  - `node scripts/interactive-plan-build.js --intent <path> [--context <path>] [--execution-mode <suggestion|apply>] [--out-plan <path>] [--out-markdown <path>] [--json]`: generate structured `Change_Plan` from `Change_Intent`, including action candidates, risk level, verification checks, rollback plan, approval status, and gate hint command.
1813
1821
  - Default outputs:
@@ -41,11 +41,13 @@
41
41
  "Always restate objective, scope, and expected impact before recommendations.",
42
42
  "When risk or permission is involved, explicitly list required approvals and authorization.",
43
43
  "If requirement is ambiguous, ask at most two focused clarification questions.",
44
+ "If business scene, module, page, entity, or constraints are missing, clarify and narrow scope before using any fallback restriction; do not replace understanding with blanket disable.",
44
45
  "Never propose credential export, approval bypass, or secret leakage."
45
46
  ],
46
47
  "clarification_templates": [
47
48
  "What business metric should improve first (speed, accuracy, cost, compliance)?",
48
- "Which module/page should be changed first, and what must remain unchanged?"
49
+ "Which module/page should be changed first, and what must remain unchanged?",
50
+ "Which entity or business rule is affected, and what constraint must stay intact?"
49
51
  ],
50
52
  "profiles": {
51
53
  "business-user": {
@@ -75,6 +77,7 @@
75
77
  ],
76
78
  "response_rules": [
77
79
  "For maintenance requests, require change ticket, rollback plan, and approval role before execution.",
80
+ "When business context is incomplete, ask for the affected module/page/entity before considering deny or write restrictions.",
78
81
  "If request targets production, require staged validation evidence first."
79
82
  ],
80
83
  "clarification_templates": [
@@ -31,6 +31,7 @@ This guide defines mandatory conversation and authorization behavior for an embe
31
31
  3. Confirmation before mutation:
32
32
  - For `apply`, assistant must ask a final explicit confirmation.
33
33
  - Confirmation text must include impact summary and rollback availability.
34
+ - Missing business scene/context must trigger clarification first; it must not be treated as a reason to blanket-disable the request.
34
35
 
35
36
  ## 4. Step-Up Authorization Rules
36
37
 
@@ -49,6 +50,10 @@ This guide defines mandatory conversation and authorization behavior for an embe
49
50
  - reject execution,
50
51
  - explain the blocked policy reason in plain language,
51
52
  - provide at least one safe alternative (`suggestion`, ticket, or scope reduction).
53
+ - If business context or symbol evidence is incomplete, assistant must:
54
+ - ask for missing `module/page/entity/business constraint` details,
55
+ - reduce scope to a verifiable change candidate,
56
+ - avoid using fallback as a blanket disable substitute before context is understood.
52
57
  - If environment is rate-limited or unstable (`429`/timeouts), assistant must:
53
58
  - avoid aggressive retries,
54
59
  - switch to phased queue execution guidance,
@@ -9,6 +9,8 @@ This directory stores release-facing documents:
9
9
  ## Archived Versions
10
10
 
11
11
  - [Release checklist](../release-checklist.md)
12
+ - [v3.6.47 release notes](./v3.6.47.md)
13
+ - [v3.6.46 release notes](./v3.6.46.md)
12
14
  - [v3.6.45 release notes](./v3.6.45.md)
13
15
  - [v3.6.44 release notes](./v3.6.44.md)
14
16
  - [v3.6.43 release notes](./v3.6.43.md)
@@ -0,0 +1,23 @@
1
+ # v3.6.46 Release Notes
2
+
3
+ Release date: 2026-03-13
4
+
5
+ ## Highlights
6
+
7
+ - Fixed the npm package publish surface so the root `scripts/` directory is included in the released tarball again.
8
+ - Added `npm run gate:npm-runtime-assets`, which inspects `npm pack --json --dry-run` output and blocks publish if any runtime `scripts/*.js` file would be missing from the package.
9
+ - Hardened the new gate for Windows by running `npm pack` through a shell-compatible path and increasing the command output buffer for the repository's large manifest.
10
+
11
+ ## Verification
12
+
13
+ - `npx jest tests/unit/scripts/npm-package-runtime-asset-check.test.js --runInBand`
14
+ - `node scripts/npm-package-runtime-asset-check.js --json`
15
+ - `npm pack --json --dry-run`
16
+ - Installed the packed `scene-capability-engine-3.6.46.tgz` into a clean temp project and verified:
17
+ - `node node_modules/scene-capability-engine/bin/scene-capability-engine.js --version`
18
+ - `node node_modules/scene-capability-engine/bin/scene-capability-engine.js workspace delivery-audit --json`
19
+
20
+ ## Release Notes
21
+
22
+ - This release fixes the broken runtime asset packaging observed in `3.6.44` and `3.6.45`. The failure mode was a missing `scripts/git-managed-gate.js`, but the underlying defect affected the full root `scripts/` runtime surface.
23
+ - For already-installed `3.6.44` or `3.6.45`, the smallest emergency patch is to restore `scripts/git-managed-gate.js` into the installed package. `3.6.46` is the proper fix and should replace those versions.
@@ -0,0 +1,23 @@
1
+ # v3.6.47 Release Notes
2
+
3
+ Release date: 2026-03-14
4
+
5
+ ## Highlights
6
+
7
+ - Promoted clarification-first into an SCE-wide baseline: when business scene, module, page, entity, or constraints are unclear, the assistant must narrow scope first instead of converting uncertainty into blanket disable.
8
+ - Extended takeover baseline alignment so adopted and upgraded projects automatically repair missing core principles, auto-seed `.sce/config/errorbook-registry.json`, and inventory project-defined postmortem or mistake-book style mechanisms for convergence into `.sce/errorbook`.
9
+ - Added three more global steering baselines: no blind fixes without problem evidence, no arbitrary steering entry add/remove without evaluation, and frontend/backend mismatch fixes must default to the existing backend API contract unless an interface change is explicitly requested.
10
+
11
+ ## Validation
12
+
13
+ - `npx jest tests/unit/workspace/takeover-baseline.test.js --runInBand`
14
+ - `npx jest tests/integration/adopt-upgrade-clarification-first.integration.test.js --runInBand`
15
+ - `npx jest tests/integration/takeover-baseline-cli.integration.test.js --runInBand`
16
+ - `npm run audit:steering`
17
+ - `npm run gate:errorbook-registry-health`
18
+ - `npm run prepublishOnly`
19
+
20
+ ## Release Notes
21
+
22
+ - This patch release formalizes the steering and takeover rules discussed during recent SCE hardening work, so they are no longer implicit operator expectations but enforced project baselines.
23
+ - Existing SCE-integrated projects now inherit these rules automatically through startup takeover alignment, `sce adopt`, and `sce upgrade`, which prevents drift between newly adopted projects and older onboarded repositories.
@@ -34,6 +34,8 @@ After SCE integration is enabled:
34
34
  5. `gated execution`: runtime policy + authorization tier + approval gate.
35
35
  6. `execution + audit`: execute or block, then emit summary and evidence.
36
36
 
37
+ If business scene or symbol evidence is incomplete, route to scope clarification first instead of using a blanket fallback disable.
38
+
37
39
  ## 5. Mode Playbooks
38
40
 
39
41
  ### 5.1 user-mode (business usage UI)
@@ -100,4 +102,3 @@ See also: `docs/security-governance-default-baseline.md`
100
102
  3. Enable required gate artifacts and audit logs.
101
103
  4. Run weekly governance and release gates.
102
104
  5. Keep capability matrix and ontology mapping updated per release.
103
-
@@ -27,7 +27,8 @@ node scripts/symbol-evidence-locate.js \
27
27
 
28
28
  Expected:
29
29
  - reliable evidence => `fallback_action=allow_write`
30
- - no reliable evidence => `fallback_action=block_high_risk_write` and exit code `2`
30
+ - no reliable evidence => `fallback_action=clarify_business_scope` and exit code `2`
31
+ - assistant must narrow module/page/entity and business constraints before deciding whether writes should proceed
31
32
 
32
33
  ## 3) Failure Attribution and Bounded Repair
33
34
 
@@ -5,6 +5,8 @@ This baseline is the default operating policy for SCE-driven delivery, including
5
5
  ## 1. Context and Data Safety
6
6
 
7
7
  - Enforce strict context contract validation (`--context-contract`, strict mode on).
8
+ - Missing business scene/module/page/entity context must route to clarification first; unknown scope is never a valid reason for blanket disable.
9
+ - This clarification-first rule applies to every SCE-integrated project and surface with no project-specific exception.
8
10
  - Block forbidden keys (for example secrets/private keys) from UI/provider payloads.
9
11
  - Keep payload masking enabled for business data and identity fields.
10
12
  - Reject context payloads that exceed size budget or schema bounds.
@@ -2,6 +2,8 @@
2
2
 
3
3
  This starter kit is the default baseline for onboarding an external project (including Moqui-based solutions) into SCE without project-specific flags.
4
4
 
5
+ It also inherits SCE's clarification-first rule: if business scene/module/page/entity context is missing, the assistant must narrow scope before any deny/disable fallback. This baseline applies to every onboarded project with no project-specific exception.
6
+
5
7
  ## Included Assets
6
8
 
7
9
  - `handoff-manifest.starter.json`: minimal manifest contract that works with `sce auto handoff` and `sce scene package-publish-batch`.
@@ -33,6 +35,7 @@ node scripts/release-ops-weekly-summary.js --json
33
35
 
34
36
  - `scene package publish-batch` gate passes.
35
37
  - capability lexicon unknown count is zero.
38
+ - missing business scope is handled through clarification, not blanket disable fallback.
36
39
  - release preflight is not blocked for hard-gate profiles.
37
40
  - weekly ops summary risk is not `high` unless explicitly approved.
38
41
 
@@ -9,6 +9,8 @@
9
9
  ## 历史版本归档
10
10
 
11
11
  - [发布检查清单](../release-checklist.md)
12
+ - [v3.6.47 发布说明](./v3.6.47.md)
13
+ - [v3.6.46 发布说明](./v3.6.46.md)
12
14
  - [v3.6.45 发布说明](./v3.6.45.md)
13
15
  - [v3.6.44 发布说明](./v3.6.44.md)
14
16
  - [v3.6.43 发布说明](./v3.6.43.md)
@@ -0,0 +1,23 @@
1
+ # v3.6.46 发布说明
2
+
3
+ 发布日期:2026-03-13
4
+
5
+ ## 重点变化
6
+
7
+ - 修复 npm 包发布内容,重新把根目录 `scripts/` 一并纳入 tarball,避免安装后的 `sce` 因缺少运行时脚本而崩溃。
8
+ - 新增 `npm run gate:npm-runtime-assets`,基于 `npm pack --json --dry-run` 检查所有运行时 `scripts/*.js` 是否都会进入发布包,缺失时直接阻断发布。
9
+ - 加固了该门禁在 Windows 下的执行路径,避免 `npm pack` 命令解析和大体积输出导致误判。
10
+
11
+ ## 验证
12
+
13
+ - `npx jest tests/unit/scripts/npm-package-runtime-asset-check.test.js --runInBand`
14
+ - `node scripts/npm-package-runtime-asset-check.js --json`
15
+ - `npm pack --json --dry-run`
16
+ - 将打出的 `scene-capability-engine-3.6.46.tgz` 安装到全新临时工程后验证:
17
+ - `node node_modules/scene-capability-engine/bin/scene-capability-engine.js --version`
18
+ - `node node_modules/scene-capability-engine/bin/scene-capability-engine.js workspace delivery-audit --json`
19
+
20
+ ## 发布说明
21
+
22
+ - 这次补丁修复的是 `3.6.44` 与 `3.6.45` 中已经暴露的 npm 运行时缺件问题。表面报错是 `scripts/git-managed-gate.js` 缺失,但根因是整个根级 `scripts/` 运行时面没有被发布进去。
23
+ - 对已经安装的 `3.6.44` 或 `3.6.45`,最小应急补丁是补回安装目录中的 `scripts/git-managed-gate.js`;`3.6.46` 才是完整的正式修复版本。
@@ -0,0 +1,23 @@
1
+ # v3.6.47 发布说明
2
+
3
+ 发布日期:2026-03-14
4
+
5
+ ## 重点变化
6
+
7
+ - 将 clarification-first 提升为 SCE 全局基线:业务场景、模块、页面、实体或约束不清楚时,必须先澄清范围,禁止把“不理解业务”直接落成一刀切禁用。
8
+ - 扩展 takeover baseline 对齐能力:已接管和升级项目现在会自动补齐缺失的核心原则、自动落 `.sce/config/errorbook-registry.json`,并把项目内自定义复盘册/问题账本类机制盘点后统一收敛到 `.sce/errorbook`。
9
+ - 新增三条全局 steering 基线:禁止盲改问题、禁止未经评估随意增删 steering 条目、以及问题修复时前后端接口不一致默认以后端现有契约为准。
10
+
11
+ ## 验证
12
+
13
+ - `npx jest tests/unit/workspace/takeover-baseline.test.js --runInBand`
14
+ - `npx jest tests/integration/adopt-upgrade-clarification-first.integration.test.js --runInBand`
15
+ - `npx jest tests/integration/takeover-baseline-cli.integration.test.js --runInBand`
16
+ - `npm run audit:steering`
17
+ - `npm run gate:errorbook-registry-health`
18
+ - `npm run prepublishOnly`
19
+
20
+ ## 发布说明
21
+
22
+ - 这个补丁版把最近一轮 SCE 治理收敛中的关键规则正式固化为了可执行基线,不再依赖操作者“记得遵守”。
23
+ - 之后无论是 startup auto-takeover、`sce adopt` 还是 `sce upgrade`,都会自动把这些规则补齐到项目里,避免新老接入项目在治理要求上继续分叉。