scene-capability-engine 3.6.64 → 3.6.67

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 (125) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/README.md +17 -6
  3. package/README.zh.md +18 -6
  4. package/bin/scene-capability-engine.js +4 -0
  5. package/docs/README.md +2 -2
  6. package/docs/command-reference.md +385 -8
  7. package/docs/document-governance.md +3 -2
  8. package/docs/integration-modes.md +62 -478
  9. package/docs/integration-philosophy.md +56 -263
  10. package/docs/magicball-cli-invocation-examples.md +1 -0
  11. package/docs/magicball-project-portfolio-contract.md +125 -4
  12. package/docs/project-management/README.md +14 -0
  13. package/docs/project-management/assurance/backup.md +3 -0
  14. package/docs/project-management/assurance/config.md +3 -0
  15. package/docs/project-management/assurance/evidence/README.md +3 -0
  16. package/docs/project-management/assurance/incidents/README.md +3 -0
  17. package/docs/project-management/assurance/logs.md +3 -0
  18. package/docs/project-management/assurance/overview.md +3 -0
  19. package/docs/project-management/assurance/recovery/README.md +3 -0
  20. package/docs/project-management/assurance/resource.md +3 -0
  21. package/docs/project-management/assurance/runbooks/README.md +3 -0
  22. package/docs/project-management/delivery/acceptance/README.md +3 -0
  23. package/docs/project-management/delivery/acceptance/evidence/README.md +3 -0
  24. package/docs/project-management/delivery/acceptance/exceptions/README.md +3 -0
  25. package/docs/project-management/delivery/acceptance/reports/README.md +3 -0
  26. package/docs/project-management/delivery/documents/changes.md +3 -0
  27. package/docs/project-management/delivery/documents/issues.md +3 -0
  28. package/docs/project-management/delivery/documents/overview.md +3 -0
  29. package/docs/project-management/delivery/documents/planning.md +3 -0
  30. package/docs/project-management/delivery/documents/requirements.md +3 -0
  31. package/docs/project-management/delivery/documents/tracking.md +3 -0
  32. package/docs/project-management/delivery/handoffs/README.md +3 -0
  33. package/docs/project-management/delivery/handoffs/evidence/README.md +3 -0
  34. package/docs/project-management/delivery/handoffs/records/README.md +3 -0
  35. package/docs/project-management/delivery/overview.md +10 -0
  36. package/docs/project-management/delivery/releases/README.md +3 -0
  37. package/docs/project-management/delivery/releases/baselines/README.md +3 -0
  38. package/docs/project-management/delivery/releases/evidence/README.md +3 -0
  39. package/docs/project-management/delivery/tables/changes.md +3 -0
  40. package/docs/project-management/delivery/tables/issues.md +3 -0
  41. package/docs/project-management/delivery/tables/planning.md +3 -0
  42. package/docs/project-management/delivery/tables/requirements.md +3 -0
  43. package/docs/project-management/delivery/tables/tracking.md +3 -0
  44. package/docs/project-management/environment/agent-discovery.md +3 -0
  45. package/docs/project-management/environment/development.md +3 -0
  46. package/docs/project-management/environment/overview.md +10 -0
  47. package/docs/project-management/environment/testing.md +3 -0
  48. package/docs/project-management/environment/version-alignment.md +3 -0
  49. package/docs/quick-start-with-ai-tools.md +68 -308
  50. package/docs/releases/README.md +3 -0
  51. package/docs/releases/v3.6.65.md +25 -0
  52. package/docs/releases/v3.6.66.md +23 -0
  53. package/docs/releases/v3.6.67.md +23 -0
  54. package/docs/steering-governance.md +64 -2
  55. package/docs/zh/README.md +2 -2
  56. package/docs/zh/releases/README.md +3 -0
  57. package/docs/zh/releases/v3.6.65.md +25 -0
  58. package/docs/zh/releases/v3.6.66.md +23 -0
  59. package/docs/zh/releases/v3.6.67.md +23 -0
  60. package/lib/commands/adopt.js +24 -0
  61. package/lib/commands/native.js +158 -0
  62. package/lib/commands/project.js +96 -0
  63. package/lib/commands/semantic.js +1459 -0
  64. package/lib/commands/session.js +74 -3
  65. package/lib/commands/spec-bootstrap.js +10 -1
  66. package/lib/commands/spec-gate.js +10 -1
  67. package/lib/commands/spec-pipeline.js +10 -1
  68. package/lib/commands/studio.js +405 -30
  69. package/lib/commands/task.js +141 -7
  70. package/lib/governance/supreme-principles.js +530 -0
  71. package/lib/problem/problem-evaluator.js +4 -0
  72. package/lib/project/candidate-inspection-service.js +24 -1
  73. package/lib/project/portfolio-projection-service.js +315 -5
  74. package/lib/project/project-channel-output.js +94 -0
  75. package/lib/project/project-channel-projection.js +181 -0
  76. package/lib/project/root-onboarding-service.js +107 -7
  77. package/lib/project/semantic-shared-source-projection.js +150 -0
  78. package/lib/project/supervision-action-model.js +277 -0
  79. package/lib/project/supervision-projection-service.js +305 -5
  80. package/lib/project/target-resolution-service.js +70 -5
  81. package/lib/project/visibility-policy.js +93 -0
  82. package/lib/runtime/multi-spec-scene-session.js +8 -1
  83. package/lib/runtime/project-channel-context-store.js +387 -0
  84. package/lib/runtime/project-channel-context.js +406 -0
  85. package/lib/runtime/scene-session-binding.js +46 -0
  86. package/lib/runtime/session-store.js +186 -0
  87. package/lib/runtime/steering-contract.js +7 -1
  88. package/lib/semantic/archive-report.js +283 -0
  89. package/lib/semantic/archive-routing.js +67 -0
  90. package/lib/semantic/backflow-report.js +245 -0
  91. package/lib/semantic/capability-contract.js +30 -0
  92. package/lib/semantic/delta-export.js +145 -0
  93. package/lib/semantic/interaction-observer.js +254 -0
  94. package/lib/semantic/kernel-loader.js +881 -0
  95. package/lib/semantic/native-runtime.js +359 -0
  96. package/lib/semantic/progress-ledger.js +433 -0
  97. package/lib/semantic/replay-evaluator.js +382 -0
  98. package/lib/semantic/shared-publication.js +592 -0
  99. package/lib/semantic/shared-source-config.js +183 -0
  100. package/lib/semantic/shared-source-connect.js +139 -0
  101. package/lib/semantic/shared-source-discovery.js +98 -0
  102. package/lib/semantic/shared-sync-export.js +413 -0
  103. package/lib/semantic/shared-sync-intake.js +592 -0
  104. package/lib/semantic/shared-sync-merge.js +547 -0
  105. package/lib/semantic/shared-sync-release.js +463 -0
  106. package/lib/semantic/supreme-intent-report.js +300 -0
  107. package/lib/state/sce-state-store.js +1360 -0
  108. package/lib/steering/context-sync-manager.js +276 -25
  109. package/lib/studio/spec-intake-governor.js +39 -3
  110. package/lib/studio/task-envelope.js +35 -2
  111. package/lib/workspace/takeover-baseline.js +342 -83
  112. package/package.json +7 -2
  113. package/scripts/agent-governance-baseline-audit.js +395 -0
  114. package/scripts/clarification-first-audit.js +9 -9
  115. package/scripts/deprecated-entry-audit.js +240 -0
  116. package/scripts/release-doc-version-audit.js +24 -0
  117. package/scripts/release-posture-report.js +262 -0
  118. package/template/.sce/README.md +62 -228
  119. package/template/.sce/config/semantic-shared-sources.json +5 -0
  120. package/template/.sce/config/supreme-principles-policy.json +105 -0
  121. package/template/.sce/config/takeover-baseline.json +7 -0
  122. package/template/.sce/steering/CORE_PRINCIPLES.md +23 -63
  123. package/template/.sce/steering/CURRENT_CONTEXT.md +4 -0
  124. package/template/.sce/steering/RULES_GUIDE.md +17 -9
  125. package/template/README.md +32 -96
@@ -2,8 +2,8 @@
2
2
 
3
3
  > Quick reference for all `sce` commands
4
4
 
5
- **Version**: 3.6.52
6
- **Last Updated**: 2026-03-16
5
+ **Version**: 3.6.67
6
+ **Last Updated**: 2026-03-29
7
7
 
8
8
  ---
9
9
 
@@ -52,11 +52,17 @@ sce doctor
52
52
  # Ensure an active scene primary session exists first
53
53
  sce studio plan --scene scene.customer-order-inventory --from-chat session-20260226 --goal "spec delivery cycle" --json
54
54
 
55
+ # Or inherit scene/spec focus from an existing project channel
56
+ sce studio plan --project-id project.customer-order --collab-channel channel-A --from-chat session-20260226 --goal "spec delivery cycle" --json
57
+
55
58
  # Legacy low-level: create spec directory only
56
59
  sce create-spec 01-00-feature-name
57
60
 
58
61
  # Bootstrap full Spec draft (requirements/design/tasks)
59
62
  sce spec bootstrap --name 01-00-feature-name --scene scene.customer-order-inventory --non-interactive
63
+
64
+ # Or inherit the current scene from one project collaboration channel
65
+ sce spec bootstrap --name 01-00-feature-name --project-id project.customer-order --collab-channel channel-A --non-interactive
60
66
  # Bootstrap now also generates mandatory scene artifacts:
61
67
  # - .sce/specs/<spec>/custom/problem-domain-map.md
62
68
  # - .sce/specs/<spec>/custom/scene-spec.md
@@ -65,9 +71,11 @@ sce spec bootstrap --name 01-00-feature-name --scene scene.customer-order-invent
65
71
 
66
72
  # Run pipeline for one Spec
67
73
  sce spec pipeline run --spec 01-00-feature-name --scene scene.customer-order-inventory
74
+ sce spec pipeline run --spec 01-00-feature-name --project-id project.customer-order --collab-channel channel-A
68
75
 
69
76
  # Run gate for one Spec
70
77
  sce spec gate run --spec 01-00-feature-name --scene scene.customer-order-inventory --json
78
+ sce spec gate run --spec 01-00-feature-name --project-id project.customer-order --collab-channel channel-A --json
71
79
 
72
80
  # Maintain domain modeling artifacts explicitly
73
81
  sce spec domain init --spec 01-00-feature-name --scene scene.customer-order-inventory --json
@@ -97,7 +105,9 @@ sce status --verbose
97
105
  ```
98
106
 
99
107
  Spec session governance:
100
- - `spec bootstrap|pipeline run|gate run` must bind to an active scene primary session (`--scene <scene-id>` or implicit binding from latest/unique active scene).
108
+ - `spec bootstrap|pipeline run|gate run` must bind to an active scene primary session.
109
+ - Recommended binding order is: `--scene <scene-id>` first, otherwise `--project-id <project-id> --collab-channel <channel-id>`, otherwise the legacy latest/unique active scene fallback.
110
+ - When `--project-id + --collab-channel` is provided, sce treats that channel as the formal scene recovery source and will not fall back to unrelated latest studio job or global active-scene guessing.
101
111
  - When multiple active scenes exist, you must pass `--scene` explicitly.
102
112
  - Multi-Spec orchestrate fallback (`--specs ...`) follows the same scene binding and writes per-spec child-session archive records.
103
113
  - `sce spec strategy assess` is read-only and should be used when you are not sure whether the current problem still fits one Spec.
@@ -209,6 +219,8 @@ sce task show --ref <SS.PP.TT> --json
209
219
  sce task rerun --ref <SS.PP.TT> --dry-run --json
210
220
  ```
211
221
 
222
+ When the referenced task comes from a studio stage, `task show/rerun --json` also returns `project_channel.active_scene + active_spec_id`, so rerun hints stay aligned with the original channel focus.
223
+
212
224
  Task references and studio runtime events are persisted in SQLite state store:
213
225
  - `.sce/state/sce-state.sqlite`
214
226
  - Backend policy: SQLite only (no file-backend mode).
@@ -263,6 +275,7 @@ sce steering compile --tool claude --agent-version 0.9.0
263
275
 
264
276
  # Start/resume/snapshot cross-agent runtime sessions
265
277
  sce session start "ship order workflow hardening" --tool codex --agent-version 1.2.3 --id release-20260224
278
+ sce session start "ship order workflow hardening" --tool codex --project-id project.customer-order --channel channel-A --scene scene.customer-order --spec 142-00-project-channel-session-parallel-collaboration-contract --json
266
279
  sce session resume release-20260224 --status active
267
280
  sce session snapshot release-20260224 --summary "post-gate checkpoint" --payload '{"tests_passed":42}' --json
268
281
  sce session show release-20260224 --json
@@ -271,11 +284,12 @@ sce session list --limit 20 --json
271
284
 
272
285
  Session governance defaults:
273
286
  - `1 scene = 1 primary session` (managed by `studio plan --scene ...`)
274
- - `spec` runs can bind as child sessions (`spec bootstrap|pipeline --scene <scene-id>`)
287
+ - `spec` runs can bind as child sessions (`spec bootstrap|pipeline|gate --scene <scene-id>` or `--project-id <project-id> --collab-channel <channel-id>`)
275
288
  - successful `studio release` auto-archives current scene session and opens next cycle session
276
289
  - `session show/list` JSON now includes runtime diagnostics:
277
290
  - `session_source`
278
291
  - `scene_index.status` (`aligned`, `pending-sync`, `sqlite-ahead`, etc.)
292
+ - when project/channel binding is requested, `project_channel.active_scene + active_spec_id + active_doc + resolved_session_id`
279
293
 
280
294
  ### Watch Mode
281
295
 
@@ -782,7 +796,9 @@ Studio JSON output now includes a stable UI-oriented task stream contract (in ad
782
796
  - `sce task rerun --ref <SS.PP.TT> [--dry-run] --json`
783
797
 
784
798
  Stage guardrails are enforced by default:
785
- - `plan` requires `--scene`; SCE binds one active primary session per scene
799
+ - `plan` accepts explicit `--scene`, or inherits `active_scene` from the resolved `project + channel` context
800
+ - explicit `--spec` always wins; channel-saved `activeSpecId` is only treated as a candidate binding and never as an implicit override
801
+ - `project_channel` projections in `session/studio/task/native` JSON payloads preserve both `active_scene` and `active_spec_id`
786
802
  - `plan` runs auto intake by default (`.sce/config/studio-intake-policy.json`):
787
803
  - detect goal intent (`change_request` vs `analysis_only`)
788
804
  - resolve spec via explicit binding / scene latest / related specs / auto-create
@@ -791,6 +807,7 @@ Stage guardrails are enforced by default:
791
807
  - `plan --no-spec-governance` is blocked by default (`governance.require_auto_on_plan=true`)
792
808
  - `plan --spec <id>` (recommended) ingests `.sce/specs/<spec>/custom/problem-domain-chain.json` into studio job context
793
809
  - when `--spec` is omitted, `plan` auto-resolves the latest matching spec chain by `scene_id` when available
810
+ - when `--scene` is omitted but `--project-id + --collab-channel` can resolve one channel focus, `plan/intake` inherit that channel's `active_scene`
794
811
  - `plan` auto-searches related historical specs by `scene + goal` and writes top candidates into job metadata (`source.related_specs`)
795
812
  - `plan` auto-runs scene spec governance snapshot and writes:
796
813
  - `.sce/spec-governance/scene-portfolio.latest.json`
@@ -806,6 +823,24 @@ Stage guardrails are enforced by default:
806
823
  - `release` requires `verify`
807
824
  - `verify` / `release` reports and failure auto-records inherit `spec_id + domain-chain` context for better root-cause traceability
808
825
 
826
+ Supreme-intent governance defaults:
827
+ - `studio plan` / `studio intake` first pass through the Four Teachings supreme-intent gate before scene/spec routing or job activation.
828
+ - Possible governance actions are `allow`, `clarify`, `rewrite`, `narrow`, and `refuse`.
829
+ - `clarify` stops execution and returns clarification questions; `rewrite` / `narrow` continue with an effective governed goal; `refuse` blocks plan execution and returns a governed denial.
830
+ - Supreme policy file: `.sce/config/supreme-principles-policy.json`
831
+ - When a bound spec already exists, the assessment is written to `.sce/specs/<spec>/custom/supreme-intent-assessment.json`.
832
+ - `studio plan` persists both `goal_original` and the governed `effective_goal` so downstream stages can audit how the goal was transformed.
833
+
834
+ Native semantic runtime:
835
+ - Start a native session with `sce native start --objective "<goal>" --project-id <project> --channel-id <channel> --scene <scene> [--spec <spec>] --json`
836
+ - Run one governed native turn with `sce native ask "<prompt>" --session-id <session> --project-id <project> --channel-id <channel> --scene <scene> [--spec <spec>] --json`
837
+ - `native ask` also passes through the same supreme-intent gate before semantic activation.
838
+ - `clarify` and `refuse` return a governed reply without activating promoted behaviors.
839
+ - `rewrite` and `narrow` activate the semantic runtime with the governed `effective_text` instead of the raw prompt.
840
+ - native preload/activation now defaults to the current `project + channel + scene + spec` scope so sibling channels in the same project do not silently share active behaviors.
841
+ - JSON output includes `supreme_principles`, and spec-scoped evidence is attached when the bound spec already exists.
842
+ - The same assessment is also written into the SQLite/state supreme-intent ledger so later progress and backflow analysis can query it without scraping session payloads.
843
+
809
844
  Problem evaluation mode (default required):
810
845
  - Studio now runs problem evaluation on every stage: `plan`, `generate`, `apply`, `verify`, `release`.
811
846
  - Default policy file: `.sce/config/problem-eval-policy.json` (also provisioned by template/adopt/takeover baseline).
@@ -1869,6 +1904,11 @@ Clarification-first baseline audit helper:
1869
1904
  - Default behavior: audit current project root.
1870
1905
  - `--fail-on-violation` exits with code `2` when required clarification-first baselines drift or prohibited legacy phrases are detected.
1871
1906
 
1907
+ Agent-governance baseline audit helper:
1908
+ - `node scripts/agent-governance-baseline-audit.js [--project-path <path>] [--out <path>] [--fail-on-violation] [--json]`: verify that the supreme-principle steering baseline, spec-scoped artifact rules, multi-channel `CURRENT_CONTEXT`, supreme runtime policy/config, and `studio/native` Four Teachings gate hooks are all still present.
1909
+ - Default behavior: audit current project root.
1910
+ - `--fail-on-violation` exits with code `2` when governance baseline drift or missing runtime gate snippets are detected.
1911
+
1872
1912
  Interactive change-plan generator helper (script-level stage-B planning bridge):
1873
1913
  - `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.
1874
1914
  - Default outputs:
@@ -2676,6 +2716,9 @@ sce project portfolio show [options]
2676
2716
  - Reuses registered workspace visibility from multi-workspace state
2677
2717
  - Marks inaccessible or partial projects explicitly instead of dropping them
2678
2718
  - Reuses project-local session governance signals to summarize active sessions and last activity
2719
+ - Returns `semanticSharedSources` summary on each project record so adapters can see approved/connected/pending shared-source state without scanning specs
2720
+ - Returns `projectChannelContext` summary on each project record so adapters can see focused channel, multi-channel counts, and `storageMode` without collapsing the project to one current thread
2721
+ - Returns `supervisionSignals` summary on each project record so operators can compare highest severity, actionable pressure, and the primary drillback command before entering a project
2679
2722
 
2680
2723
  #### `sce project candidate inspect`
2681
2724
 
@@ -2710,8 +2753,11 @@ sce project onboarding import --root <path> [options]
2710
2753
 
2711
2754
  **Behavior:**
2712
2755
  - Accepts a local root as the primary onboarding target without app-bundle-first indirection
2713
- - Reuses the canonical ordered step envelope (`register`, `attach`, `hydrate`, `activate`, `scaffold`)
2714
- - Registers onboarded roots into the workspace-backed portfolio without inventing a second registry
2756
+ - Reuses the canonical ordered step envelope (`register`, `attach`, `hydrate`, `publish`, `activate`, `scaffold`)
2757
+ - Publishes explicit `publication` state so adapters can distinguish import success from canonical portfolio visibility
2758
+ - Returns `semanticSharedSourceDiscovery` in successful JSON payloads so adapters can consume approved shared-source hints without a second scan
2759
+ - Returns `projectChannelContext` (and focused `projectChannel` when present) in successful JSON payloads so adapters can preserve existing channel scene/spec state after import, including whether the recovered context came from `split` or legacy storage
2760
+ - Registers onboarded roots into the workspace-backed portfolio before success returns in the default phase-1 path, without inventing a second registry
2715
2761
 
2716
2762
  #### `sce project target resolve`
2717
2763
 
@@ -2725,6 +2771,7 @@ sce project target resolve [options]
2725
2771
  **Options:**
2726
2772
  - `--request <text>` - Routing request text
2727
2773
  - `--current-project <id>` - Caller asserted current project id
2774
+ - `--channel <channel-id>` - Caller asserted current project channel id
2728
2775
  - `--workspace <name>` - Resolve caller context against one registered workspace
2729
2776
  - `--device <id>` - Opaque caller device id
2730
2777
  - `--tool-instance-id <id>` - Opaque caller tool instance id
@@ -2733,11 +2780,12 @@ sce project target resolve [options]
2733
2780
  **Behavior:**
2734
2781
  - Returns `current-project`, `resolved-other-project`, `ambiguous`, or `unresolved`
2735
2782
  - Echoes caller context used during resolution
2783
+ - Returns caller project-channel focus when the current project has recoverable project-channel context available, including `context_available`, `storage_mode`, and `requested_channel_id`
2736
2784
  - Returns alternative candidates for ambiguous matches
2737
2785
 
2738
2786
  #### `sce project supervision show`
2739
2787
 
2740
- Inspect one project-scoped supervision snapshot with blocked, handoff, risk, and active items.
2788
+ Inspect one project-scoped supervision snapshot with blocked, handoff, risk, active, archive-accumulation, governance-hotspot, and semantic-backflow items.
2741
2789
 
2742
2790
  **Usage:**
2743
2791
  ```bash
@@ -2746,16 +2794,345 @@ sce project supervision show --project <id> [options]
2746
2794
 
2747
2795
  **Options:**
2748
2796
  - `--project <id>` - Visible project id from the portfolio projection
2797
+ - `--channel <channel-id>` - Resolve one project-channel focus without overwriting sibling channels
2749
2798
  - `--cursor <cursor>` - Best-effort checkpoint input; phase-1 still returns a full snapshot
2750
2799
  - `--json` - Output the canonical `ProjectSupervisionProjection`
2751
2800
 
2752
2801
  **Behavior:**
2753
2802
  - Reuses project-local session governance, spec governance, and report artifacts
2754
2803
  - Preserves scene/spec/event drillback fields when evidence is available
2804
+ - Adds item-level control-plane fields: `severity`, `blocking_scope`, `recommended_action`, and `recommended_command`
2805
+ - Returns `actionQueue` sorted by severity and recency, plus project-level `highestSeverity`, `actionableCount`, severity bucket counts, and `primaryRecommendedCommand`
2806
+ - Summarizes semantic archive accumulation from the local ledger so operators can see how project training value is settling into experience, ontology-capability, and application assets
2807
+ - Summarizes project-scoped supreme-intent governance pressure from the SQLite/state ledger, including rewrite/refuse counts and top channel/spec hotspots
2808
+ - Summarizes semantic backflow pressure from local `publish_blocked` lessons and central merge/release receipts, including blocked spec count and recent blocker items
2809
+ - Surfaces `info` items when approved semantic shared source descriptors are available but not yet connected
2810
+ - Returns `projectChannelContext` plus one resolved `projectChannel` focus when recoverable project-channel context is available, and now exposes `storageMode` / `storage_mode` so adapters can distinguish formal split storage from legacy compat reads
2755
2811
  - Returns an opaque snapshot cursor for polling without pretending to expose a raw event stream
2756
2812
 
2757
2813
  ---
2758
2814
 
2815
+ ## Semantic Kernel
2816
+
2817
+ #### `sce semantic observe`
2818
+
2819
+ Record one vendor-neutral semantic observation from an embedded or native runtime.
2820
+
2821
+ **Usage:**
2822
+ ```bash
2823
+ sce semantic observe --runtime codex-cli --event reply --role assistant --project-id <project> --channel-id <channel> --session-id <session> --scene <scene> --spec <spec> --text "<summary>" --json
2824
+ ```
2825
+
2826
+ **Behavior:**
2827
+ - Normalizes embedded-host interaction into one SCE-owned semantic observation envelope
2828
+ - Preserves `project/channel/session/scene/spec/task` context when supplied
2829
+ - Distills a lesson candidate immediately when the observation carries enough signal
2830
+
2831
+ #### `sce semantic replay`
2832
+
2833
+ Build a replay dataset from recorded semantic observations.
2834
+
2835
+ **Usage:**
2836
+ ```bash
2837
+ sce semantic replay --project-id <project> --session-id <session> --spec <spec> --json
2838
+ ```
2839
+
2840
+ **Behavior:**
2841
+ - Restores project-aware semantic observations into one replay dataset
2842
+ - Keeps scene/spec/session provenance for later evaluation and promotion evidence
2843
+
2844
+ #### `sce semantic eval`
2845
+
2846
+ Evaluate a candidate reply or plan against recorded observations.
2847
+
2848
+ **Usage:**
2849
+ ```bash
2850
+ sce semantic eval --project-id <project> --spec <spec> --lesson-id <lesson-id> --candidate-reply "<reply>" --threshold 60 --json
2851
+ ```
2852
+
2853
+ **Behavior:**
2854
+ - Scores helpfulness, correctness, actionability, governance fit, and regression drift
2855
+ - Produces machine-readable evaluation evidence for promotion, quarantine, or rollback
2856
+
2857
+ #### `sce semantic promote` / `sce semantic rollback`
2858
+
2859
+ Promote or roll back a semantic lesson candidate.
2860
+
2861
+ **Usage:**
2862
+ ```bash
2863
+ sce semantic promote --lesson-id <lesson-id> --eval-run-id <evaluation-run-id> --json
2864
+ sce semantic rollback --lesson-id <lesson-id> --reason "<reason>" --json
2865
+ ```
2866
+
2867
+ **Behavior:**
2868
+ - Promotion writes capability-ledger lineage and, by default, immediately auto-publishes qualified deltas into the shared-library mirror under the adopt-implied model
2869
+ - Promotion/update also recalculates capability rank using recent supreme-intent pressure from the same project/channel/scene/spec scope
2870
+ - When the governed publication gate blocks shared publication, promotion still succeeds locally but the lesson/ledger move to `publish_blocked` instead of entering the shared library
2871
+ - Rollback deprecates the lesson and updates local capability state for future activation decisions
2872
+
2873
+ #### `sce semantic progress`
2874
+
2875
+ Summarize semantic learning, promotion, publication, and native backflow progress.
2876
+
2877
+ **Usage:**
2878
+ ```bash
2879
+ sce semantic progress --project-id <project> --spec <spec> --json
2880
+ ```
2881
+
2882
+ **Behavior:**
2883
+ - Reports the semantic funnel: observations, lessons, evaluation runs, promotions, and native activation
2884
+ - Reports publication state: `publish_pending`, `published-shared`, and `publish_blocked`
2885
+ - Reports archive accumulation summary so operators can see how training value is settling into experience, ontology-capability, and application assets
2886
+ - Reports approved-but-not-connected shared source descriptors so semantic intake pressure is visible in the same snapshot
2887
+ - Reports capability-ledger and native-hit signals for operator review, including how many promoted capabilities are currently governance-penalized/high-risk
2888
+ - Reports supreme-intent ledger counts (`allow|clarify|rewrite|narrow|refuse`) plus governed-action rate across the filtered scope
2889
+ - Returns operator control-plane fields (`operator_items`, `action_queue`, `operator_control_plane`) so semantic progress is no longer a progress-only snapshot
2890
+
2891
+ #### `sce semantic archive-report`
2892
+
2893
+ Summarize how project training value is routed and accumulated across the three semantic libraries.
2894
+
2895
+ **Usage:**
2896
+ ```bash
2897
+ sce semantic archive-report --project-id <project> --spec <spec> --recent-limit 10 --json
2898
+ ```
2899
+
2900
+ **Behavior:**
2901
+ - Aggregates lesson + capability-ledger state by `experience-library`, `ontology-capability-library`, and `application-library`
2902
+ - Returns archive-class and reuse-scope summaries so operators can distinguish experience accumulation from core capability growth and project application sediment
2903
+ - Returns recent archived items plus `missing_archive_count` so routing drift can be detected without manually reading lesson, ledger, and shared entry files
2904
+
2905
+ #### `sce semantic supreme-intent`
2906
+
2907
+ List supreme-intent governance assessments from the SQLite/state ledger.
2908
+
2909
+ **Usage:**
2910
+ ```bash
2911
+ sce semantic supreme-intent --project-id <project> --spec <spec> --source-kind studio-plan --action rewrite --json
2912
+ ```
2913
+
2914
+ **Behavior:**
2915
+ - Reads governed Four Teachings assessments from the SQLite/state ledger instead of scraping session payloads
2916
+ - Supports filtering by `project/channel/session/scene/spec/job/source-kind/action`
2917
+ - Returns the newest assessments first so operator review can inspect recent rewrites/refusals quickly
2918
+
2919
+ #### `sce semantic supreme-intent-show`
2920
+
2921
+ Show one supreme-intent governance assessment in full detail.
2922
+
2923
+ **Usage:**
2924
+ ```bash
2925
+ sce semantic supreme-intent-show <assessment-id> --json
2926
+ ```
2927
+
2928
+ **Behavior:**
2929
+ - Returns the full assessment payload, including worldview/lifeview/values/methodology fields, matched rules, evidence path, and metadata
2930
+
2931
+ #### `sce semantic governance-report`
2932
+
2933
+ Summarize supreme-intent governance hotspots from the SQLite/state ledger.
2934
+
2935
+ **Usage:**
2936
+ ```bash
2937
+ sce semantic governance-report --project-id <project> --hotspot-limit 5 --recent-limit 10 --json
2938
+ ```
2939
+
2940
+ **Behavior:**
2941
+ - Aggregates recent Four Teachings assessments into operator-facing hotspots instead of returning only raw rows
2942
+ - Reports totals, governed-action rate, planning/execution blocked counts, top projects/channels/specs, and top project+channel+scene+spec hotspots
2943
+ - Extracts repeated matched-rule ids and recent `rewrite` / `refuse` items so training backflow, capability rerank, and governance tuning can converge faster
2944
+
2945
+ #### `sce semantic backflow-report`
2946
+
2947
+ Summarize local and central backflow blockers across semantic publication and registry gates.
2948
+
2949
+ **Usage:**
2950
+ ```bash
2951
+ sce semantic backflow-report --project-id <project> --spec <spec> --recent-limit 10 --json
2952
+ ```
2953
+
2954
+ **Behavior:**
2955
+ - Aggregates local `publish_blocked` lessons plus the latest central merge/release receipts under the filtered specs
2956
+ - Separates blockers by stage: local publish gate, central merge gate, and approved-central release gate
2957
+ - Returns `blocked_spec_count` / `blocked_spec_ids` so project supervision and operator consoles can distinguish isolated failures from spec-wide stalled backflow
2958
+ - Returns grouped blocker reasons and recent blocked items/receipts so operators can see where capability flow is stalling without manually reading multiple receipts
2959
+
2960
+ #### `sce semantic export-delta`
2961
+
2962
+ Export governed `publish_pending` semantic deltas for shared-library publication.
2963
+
2964
+ **Usage:**
2965
+ ```bash
2966
+ sce semantic export-delta --project-id <project> --spec <spec> --json
2967
+ sce semantic export-delta --project-id <project> --spec <spec> --out-file .sce/specs/<spec>/deltas/latest.json --json
2968
+ ```
2969
+
2970
+ **Behavior:**
2971
+ - Exports sanitized delta entries instead of sharing the local SQLite database
2972
+ - Routes each entry toward exactly one of the experience, ontology-capability, or application libraries
2973
+ - Carries the normalized archive decision so downstream publication and operator reports preserve why the entry belongs to that library
2974
+ - When `--spec` is supplied and `--out-file` is omitted, writes to `.sce/specs/<spec>/deltas/latest.json` by default
2975
+
2976
+ #### `sce semantic publish-delta`
2977
+
2978
+ Publish governed semantic deltas into the local shared-library mirror and advance publish state.
2979
+
2980
+ **Usage:**
2981
+ ```bash
2982
+ sce semantic publish-delta --project-id <project> --spec <spec> --json
2983
+ sce semantic publish-delta --input-file .sce/specs/<spec>/deltas/latest.json --out-file .sce/specs/<spec>/publications/semantic/latest.json --json
2984
+ ```
2985
+
2986
+ **Behavior:**
2987
+ - Accepts an existing delta manifest or exports `publish_pending` entries first when `--input-file` is omitted
2988
+ - Writes shared-library mirror entries under `.sce/knowledge/semantic-shared/<library>/entries/`
2989
+ - Preserves project/channel/session/scene/spec provenance plus archive routing inside the published shared entry payload
2990
+ - Updates lesson/ledger publication state to `published-shared` and emits a machine-readable publication report
2991
+ - Applies the governed publication gate before shared write: entries with `refuse` / `execution_blocked` history or excessive governance penalty stay local and are marked `publish_blocked`
2992
+ - Keeps SQLite as local ledger only; the publish contract shares structured delta entries, not the database file
2993
+
2994
+ #### `sce semantic export-shared-sync`
2995
+
2996
+ Export the local semantic shared-library mirror into a governed sync handoff bundle.
2997
+
2998
+ **Usage:**
2999
+ ```bash
3000
+ sce semantic export-shared-sync --project-id <project> --spec <spec> --json
3001
+ sce semantic export-shared-sync --project-id <project> --spec <spec> --capability-id <capability> --json
3002
+ sce semantic export-shared-sync --project-id <project> --spec <spec> --out-file .sce/specs/<spec>/sync/semantic-shared/latest.bundle.json --json
3003
+ ```
3004
+
3005
+ **Behavior:**
3006
+ - Reads governed entries from `.sce/knowledge/semantic-shared/`, not from SQLite
3007
+ - Emits a spec-scoped bundle, index, receipt, and per-library shard files under `.sce/specs/<spec>/sync/semantic-shared/` by default
3008
+ - Carries forward project/channel/session/scene/spec provenance from the shared mirror into the handoff shards
3009
+ - Supports filtering by `project/spec/lesson/capability/library`
3010
+ - Produces a machine-readable handoff summary for future shared-truth or upstream intake flows
3011
+
3012
+ #### `sce semantic sync-shared`
3013
+
3014
+ Sync a governed semantic shared-sync bundle from an approved source into the local shared mirror.
3015
+
3016
+ **Usage:**
3017
+ ```bash
3018
+ sce semantic sync-shared --source /path/to/latest.bundle.json --spec <spec> --json
3019
+ sce semantic sync-shared --source https://example.com/.sce/specs/<spec>/sync/semantic-shared/latest.bundle.json --source-root https://example.com --spec <spec> --json
3020
+ sce semantic sync-shared --source-name central --required-release-state approved-central --config .sce/config/semantic-shared-sources.json --spec <spec> --json
3021
+ ```
3022
+
3023
+ **Behavior:**
3024
+ - Reads shared-sync bundle + shard payloads from local file or `http(s)` source
3025
+ - Intakes valid entries into `.sce/knowledge/semantic-shared/` while preserving `project/channel/session/scene/spec` provenance
3026
+ - Can require a configured or explicit source to be in a specific governance release state such as `approved-central`
3027
+ - Skips stale or duplicate entries instead of blindly overwriting newer local mirror content
3028
+ - Blocks intake before shard import when the bundle release state does not satisfy the configured requirement
3029
+ - Writes a machine-readable intake receipt to `.sce/specs/<spec>/intake/semantic-shared/latest.json` by default when `--spec` is supplied
3030
+
3031
+ #### `sce semantic health-shared-source`
3032
+
3033
+ Validate one configured or explicit semantic shared-sync source before intake.
3034
+
3035
+ **Usage:**
3036
+ ```bash
3037
+ sce semantic health-shared-source --source /path/to/latest.bundle.json --json
3038
+ sce semantic health-shared-source --source-name central --config .sce/config/semantic-shared-sources.json --json
3039
+ sce semantic health-shared-source --source-name central --required-release-state approved-central --config .sce/config/semantic-shared-sources.json --json
3040
+ ```
3041
+
3042
+ **Behavior:**
3043
+ - Loads the bundle without writing to the local mirror
3044
+ - Verifies shard resolution and shard payload health
3045
+ - Reports bundle release-state compliance when a required release-state policy is configured or explicitly requested
3046
+ - Reports warnings/errors separately, plus shard counts and total entry count
3047
+
3048
+ #### `sce semantic list-shared-sources`
3049
+
3050
+ List configured semantic shared sources from `.sce/config/semantic-shared-sources.json`.
3051
+
3052
+ **Usage:**
3053
+ ```bash
3054
+ sce semantic list-shared-sources --json
3055
+ sce semantic list-shared-sources --config .sce/config/semantic-shared-sources.json --json
3056
+ ```
3057
+
3058
+ **Behavior:**
3059
+ - Reads the project semantic shared source config
3060
+ - Emits the configured sources sorted by name
3061
+ - Surfaces `bundle`, `enabled`, and `required_release_state` for operator review
3062
+
3063
+ #### `sce semantic set-shared-source`
3064
+
3065
+ Upsert one semantic shared source into `.sce/config/semantic-shared-sources.json`.
3066
+
3067
+ **Usage:**
3068
+ ```bash
3069
+ sce semantic set-shared-source --name central --bundle https://example.com/.sce/specs/143-13/registry/semantic-shared/published/latest.bundle.json --root https://example.com --required-release-state approved-central --json
3070
+ sce semantic set-shared-source --name backup --bundle /path/to/latest.bundle.json --enabled false --json
3071
+ sce semantic set-shared-source --input-file .sce/specs/<spec>/registry/semantic-shared/published/source-descriptor.json --json
3072
+ ```
3073
+
3074
+ **Behavior:**
3075
+ - Creates the semantic shared source config when it does not exist yet
3076
+ - Upserts one named source instead of duplicating entries
3077
+ - Can read a governed source descriptor and then apply explicit CLI overrides on top
3078
+ - Persists optional `root`, `enabled`, and `required_release_state` alongside the bundle reference
3079
+
3080
+ #### `sce semantic connect-shared-source`
3081
+
3082
+ Consume one approved source descriptor, register it, run health gate, and sync it into the local mirror.
3083
+
3084
+ **Usage:**
3085
+ ```bash
3086
+ sce semantic connect-shared-source --input-file .sce/specs/<spec>/registry/semantic-shared/published/source-descriptor.json --json
3087
+ sce semantic connect-shared-source --spec <spec> --json
3088
+ sce semantic connect-shared-source --input-file /path/to/source-descriptor.json --no-sync-now --json
3089
+ ```
3090
+
3091
+ **Behavior:**
3092
+ - Reads a governed source descriptor and rejects non-`approved-central` descriptors by default
3093
+ - Upserts the source config before running health and sync
3094
+ - Runs `health-shared-source` and then `sync-shared` in one governed flow unless explicitly disabled
3095
+ - Keeps `--allow-non-approved` as an explicit escape hatch instead of silently relaxing governance
3096
+
3097
+ #### `sce semantic merge-shared`
3098
+
3099
+ Merge multiple governed semantic shared-sync bundles into one central/shared-truth candidate bundle.
3100
+
3101
+ **Usage:**
3102
+ ```bash
3103
+ sce semantic merge-shared --source /path/to/bundle-a.json --source /path/to/bundle-b.json --spec <spec> --json
3104
+ sce semantic merge-shared --sources /path/to/a.json,/path/to/b.json --spec <spec> --json
3105
+ ```
3106
+
3107
+ **Behavior:**
3108
+ - Reads multiple governed bundle sources and their shard payloads
3109
+ - Applies a central merge gate before deduplication: entries whose `publication.publish_state` is not `published-shared`, or that already carry blocked governance metadata, are rejected instead of entering the candidate bundle
3110
+ - Deduplicates by `target_library + capability_id`, keeping the latest `published_at`
3111
+ - Emits one merged bundle/index/receipt/shard set under `.sce/specs/<spec>/registry/semantic-shared/` by default
3112
+ - Records superseded duplicates in the merge receipt for governance review
3113
+
3114
+ #### `sce semantic publish-shared-registry`
3115
+
3116
+ Promote one merged semantic shared candidate bundle into the approved central registry after release gates pass.
3117
+
3118
+ **Usage:**
3119
+ ```bash
3120
+ sce semantic publish-shared-registry --spec <spec> --json
3121
+ sce semantic publish-shared-registry --spec <spec> --min-sources 2 --min-entries 10 --json
3122
+ sce semantic publish-shared-registry --input-file .sce/specs/<spec>/registry/semantic-shared/latest.bundle.json --out-file .sce/specs/<spec>/registry/semantic-shared/published/latest.bundle.json --json
3123
+ sce semantic publish-shared-registry --spec <spec> --source-name central --public-bundle https://example.com/.sce/specs/<spec>/registry/semantic-shared/published/latest.bundle.json --public-root https://example.com --json
3124
+ ```
3125
+
3126
+ **Behavior:**
3127
+ - Reads the merged candidate bundle produced by `sce semantic merge-shared`
3128
+ - Applies release gates for minimum source count, minimum merged entry count, and optional zero-blocked enforcement
3129
+ - Re-checks candidate shard entries before approval so non-`published-shared` or already-blocked entries cannot bypass governance by skipping merge-time validation
3130
+ - Emits one approved bundle/index/receipt/shard set under `.sce/specs/<spec>/registry/semantic-shared/published/` by default
3131
+ - Emits a governed `source-descriptor.json` alongside the approved bundle so downstream terminals can register the source without retyping parameters
3132
+ - Marks the result as `approved-central` or `publish-blocked` without writing SQLite or local terminal mirrors
3133
+
3134
+ ---
3135
+
2759
3136
  ## See Also
2760
3137
 
2761
3138
  - [Multi-Repository Management Guide](./multi-repo-management-guide.md)
@@ -21,8 +21,8 @@ Document governance ensures your project follows these rules:
21
21
 
22
22
  1. **Root Directory** - Only 4 markdown files allowed: `README.md`, `README.zh.md`, `CHANGELOG.md`, `CONTRIBUTING.md`
23
23
  2. **Spec Structure** - Each Spec must have `requirements.md`, `design.md`, `tasks.md`
24
- 3. **Artifact Organization** - Spec artifacts must be in subdirectories, except approved Spec-root metadata such as `requirements.md`, `design.md`, `tasks.md`, and `collaboration.json`
25
- 4. **No Temporary Files** - Temporary documents (like `*-SUMMARY.md`, `SESSION-*.md`) must be deleted after use
24
+ 3. **Artifact Organization** - Agent-generated artifacts, debug logs, test scripts, reports, and analysis notes must stay in the active Spec subdirectories, except approved Spec-root metadata such as `requirements.md`, `design.md`, `tasks.md`, and `collaboration.json`
25
+ 4. **No Temporary Files** - Temporary documents (like `*-SUMMARY.md`, `SESSION-*.md`) must live under the active Spec while in use and must be deleted after use
26
26
 
27
27
  ### Why Use Document Governance?
28
28
 
@@ -31,6 +31,7 @@ Document governance ensures your project follows these rules:
31
31
  - ✅ **Automate Cleanup** - Remove temporary files automatically
32
32
  - ✅ **Prevent Violations** - Git hooks block non-compliant commits
33
33
  - ✅ **Track Compliance** - Statistics and reports over time
34
+ - ✅ **Keep Agent Output Scoped** - Prevent debug logs, notes, and helper scripts from spreading outside the active Spec
34
35
 
35
36
  ---
36
37