scene-capability-engine 3.6.37 → 3.6.39
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 +30 -0
- package/docs/command-reference.md +27 -0
- package/docs/document-governance.md +22 -2
- package/docs/releases/README.md +2 -0
- package/docs/releases/v3.6.38.md +19 -0
- package/docs/releases/v3.6.39.md +24 -0
- package/docs/state-migration-reconciliation-runbook.md +76 -0
- package/docs/state-storage-tiering.md +104 -0
- package/docs/steering-governance.md +112 -0
- package/docs/zh/releases/README.md +2 -0
- package/docs/zh/releases/v3.6.38.md +19 -0
- package/docs/zh/releases/v3.6.39.md +24 -0
- package/lib/commands/docs.js +8 -2
- package/lib/commands/scene.js +78 -18
- package/lib/commands/watch.js +10 -1
- package/lib/governance/config-manager.js +16 -0
- package/lib/governance/diagnostic-engine.js +2 -1
- package/lib/governance/validation-engine.js +3 -2
- package/lib/runtime/session-store.js +8 -0
- package/lib/state/sce-state-store.js +265 -0
- package/lib/state/state-migration-manager.js +27 -2
- package/lib/state/state-storage-policy.js +179 -0
- package/lib/watch/action-executor.js +10 -1
- package/lib/watch/event-debouncer.js +3 -0
- package/lib/watch/file-watcher.js +51 -10
- package/lib/watch/watch-manager.js +10 -1
- package/lib/workspace/takeover-baseline.js +11 -0
- package/package.json +8 -2
- package/template/.sce/config/state-storage-policy.json +165 -0
- package/template/.sce/steering/CORE_PRINCIPLES.md +21 -211
- package/template/.sce/steering/CURRENT_CONTEXT.md +9 -27
- package/template/.sce/steering/ENVIRONMENT.md +18 -32
- package/template/.sce/steering/RULES_GUIDE.md +16 -44
- package/template/.sce/steering/manifest.yaml +50 -0
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,36 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [3.6.39] - 2026-03-13
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- Added state storage tiering policy artifacts and guidance in `docs/state-storage-tiering.md`, `docs/state-migration-reconciliation-runbook.md`, `.sce/config/state-storage-policy.json`, and `template/.sce/config/state-storage-policy.json`.
|
|
14
|
+
- Added append-only evidence projection and audit tooling via `scripts/interactive-approval-event-projection.js`, `scripts/state-storage-tiering-audit.js`, and the `audit:state-storage` / `report:state-storage` package scripts.
|
|
15
|
+
- Added scene command coverage and helper fixtures for the expanded `scene` subcommand surface, including publish/install/info/diff/validate/owner/tag/stats/lock/contribute/version and related property tests.
|
|
16
|
+
- Added release-facing closeout evidence for the scene command specs and the quality hardening master spec under `.sce/specs/*/custom/`.
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
- Expanded `lib/commands/scene.js` to cover the newer scene command flows and stabilized JSON summary output so CLI JSON mode preserves edge-case numeric payloads such as `-0`.
|
|
20
|
+
- Hardened state migration and storage behavior in `lib/state/sce-state-store.js`, `lib/state/state-migration-manager.js`, `lib/runtime/session-store.js`, and related governance/config plumbing while keeping file sources canonical.
|
|
21
|
+
- Completed the `115-00-sce-quality-hardening-program` integration closeout, including `watch logs --follow` completion, open-handle governance follow-through, and master/sub-spec status convergence.
|
|
22
|
+
- Updated `docs/command-reference.md`, `docs/document-governance.md`, and multiple Spec task ledgers to reflect the shipped command surface and governance posture.
|
|
23
|
+
|
|
24
|
+
### Fixed
|
|
25
|
+
- Removed the remaining `forceExit` dependency from the validated Jest path and confirmed `npm run test:handles` passes without open-handle leakage.
|
|
26
|
+
- Stabilized watch/integration helper timing and watcher cleanup paths so `test:smoke`, `test:full`, and `test:handles` can run cleanly in sequence.
|
|
27
|
+
|
|
28
|
+
## [3.6.38] - 2026-03-12
|
|
29
|
+
|
|
30
|
+
### Added
|
|
31
|
+
- Added `scripts/steering-content-audit.js` to audit steering content budgets, stale history, checklist leakage, stable-layer spec leakage, and non-canonical governance aliases.
|
|
32
|
+
- Added weekly scheduled workflow `.github/workflows/steering-hygiene.yml` and project guidance in `docs/steering-governance.md` for recurring steering review and cleanup.
|
|
33
|
+
- Added Spec `119-00-steering-self-governance` to document the steering self-governance model, audit scope, and CI rollout.
|
|
34
|
+
|
|
35
|
+
### Changed
|
|
36
|
+
- Refactored `.sce/steering/` and `template/.sce/steering/` so baseline steering content stays lean, layered, and free of long history or task-state drift.
|
|
37
|
+
- Extended steering manifest governance metadata with file budgets, relocation targets, review cadence, and canonical mechanism rules.
|
|
38
|
+
- Wired `npm run audit:steering` into CI and `prepublishOnly`, making steering hygiene part of normal validation and release flow.
|
|
39
|
+
|
|
10
40
|
## [3.6.37] - 2026-03-12
|
|
11
41
|
|
|
12
42
|
### Added
|
|
@@ -876,6 +876,29 @@ Runtime read preference:
|
|
|
876
876
|
- `sce state doctor --json` now includes:
|
|
877
877
|
- `summary` aggregate (`pending_components`, `total_record_drift`, `blocking_count`, `alert_count`)
|
|
878
878
|
- runtime read diagnostics (`runtime.timeline`, `runtime.scene_session`) with read-source/read-preference and consistency status
|
|
879
|
+
- hardened severity model:
|
|
880
|
+
- `blocking`: `sqlite-unavailable`, `source-parse-error`, `sqlite-ahead`, `sqlite-only`
|
|
881
|
+
- `alert`: `pending-migration`, `missing-source`, runtime `pending-sync`
|
|
882
|
+
- current release guidance:
|
|
883
|
+
- treat `sqlite-ahead` and `sqlite-only` as anomalies requiring repair before release
|
|
884
|
+
- treat `pending-migration` as repairable drift, not a steady-state
|
|
885
|
+
- only allow `missing-source` to persist when the component is intentionally out of scope for the project
|
|
886
|
+
|
|
887
|
+
State storage tiering policy:
|
|
888
|
+
- Policy file: `.sce/config/state-storage-policy.json`
|
|
889
|
+
- Audit command: `npm run audit:state-storage`
|
|
890
|
+
- Machine-readable report: `npm run report:state-storage`
|
|
891
|
+
- Tier meanings:
|
|
892
|
+
- `file-source`: canonical evidence, audit, recovery payloads, and low-cardinality personal state
|
|
893
|
+
- `sqlite-index`: query-oriented registry/index layer with files still canonical
|
|
894
|
+
- `derived-sqlite-projection`: rebuildable SQLite projection for append-only stream queries
|
|
895
|
+
- Explicit non-candidates for SQLite source replacement:
|
|
896
|
+
- `~/.sce/workspace-state.json`
|
|
897
|
+
- `.sce/reports/**/*.jsonl`
|
|
898
|
+
- `.sce/audit/**/*.jsonl`
|
|
899
|
+
- Supporting docs:
|
|
900
|
+
- `docs/state-storage-tiering.md`
|
|
901
|
+
- `docs/state-migration-reconciliation-runbook.md`
|
|
879
902
|
|
|
880
903
|
Write lease model (optional, policy-driven, SQLite-backed):
|
|
881
904
|
- Policy file: `.sce/config/authorization-policy.json`
|
|
@@ -1836,6 +1859,10 @@ Interactive approval workflow helper (script-level stage-B approval state machin
|
|
|
1836
1859
|
- `node scripts/interactive-approval-workflow.js --action <init|submit|approve|reject|execute|verify|archive|status> [--plan <path>] [--state-file <path>] [--audit-file <path>] [--actor <id>] [--actor-role <name>] [--role-policy <path>] [--comment <text>] [--password <text>] [--password-hash <sha256>] [--password-hash-env <name>] [--password-required] [--password-scope <csv>] [--json]`: maintain approval lifecycle state for interactive change plans and append approval events to JSONL audit logs.
|
|
1837
1860
|
- Default state file: `.sce/reports/interactive-approval-state.json`
|
|
1838
1861
|
- Default audit file: `.sce/reports/interactive-approval-events.jsonl`
|
|
1862
|
+
- `node scripts/interactive-approval-event-projection.js --action <rebuild|doctor|query> [--input <path>] [--read-source <auto|file|projection>] [--workflow-id <id>] [--actor <id>] [--approval-action <name>] [--event-type <type>] [--blocked|--not-blocked] [--limit <n>] [--fail-on-drift] [--fail-on-parse-error] [--json]`: build and inspect a rebuildable SQLite projection for `interactive-approval-events.jsonl` while keeping raw JSONL as canonical evidence.
|
|
1863
|
+
- `rebuild` clears and rebuilds the projection for the target audit file
|
|
1864
|
+
- `doctor` compares raw file count vs projection count and flags `projection-missing`, `pending-projection`, `projection-ahead`, or parse errors
|
|
1865
|
+
- `query` discloses `read_source=file|projection`
|
|
1839
1866
|
- `init` requires `--plan`; high-risk plans are marked as `approval_required=true`.
|
|
1840
1867
|
- Password authorization can be required per plan (`plan.authorization.password_required=true`) or overridden in `init`.
|
|
1841
1868
|
- `execute` is blocked (exit code `2`) when approval is required but current status is not `approved`.
|
|
@@ -21,7 +21,7 @@ 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
|
|
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
25
|
4. **No Temporary Files** - Temporary documents (like `*-SUMMARY.md`, `SESSION-*.md`) must be deleted after use
|
|
26
26
|
|
|
27
27
|
### Why Use Document Governance?
|
|
@@ -128,7 +128,7 @@ sce docs diagnose
|
|
|
128
128
|
- Root directory for non-allowed markdown files
|
|
129
129
|
- Root directory for temporary documents
|
|
130
130
|
- Spec directories for missing required files
|
|
131
|
-
- Spec directories for misplaced artifacts
|
|
131
|
+
- Spec directories for misplaced artifacts outside approved Spec-root metadata
|
|
132
132
|
- Spec directories for temporary documents
|
|
133
133
|
|
|
134
134
|
**Output:**
|
|
@@ -240,6 +240,7 @@ sce docs validate [options]
|
|
|
240
240
|
**What it validates:**
|
|
241
241
|
- Root directory has only allowed markdown files
|
|
242
242
|
- Spec directories have required files (requirements.md, design.md, tasks.md)
|
|
243
|
+
- Spec root contains only approved metadata files plus governed subdirectories
|
|
243
244
|
- Spec subdirectories follow naming conventions
|
|
244
245
|
- No misplaced artifacts
|
|
245
246
|
|
|
@@ -443,6 +444,7 @@ sce docs config [options]
|
|
|
443
444
|
|
|
444
445
|
**Configuration keys:**
|
|
445
446
|
- `root-allowed-files` - Allowed markdown files in root
|
|
447
|
+
- `spec-allowed-root-files` - Allowed files at Spec root before artifact warnings apply
|
|
446
448
|
- `spec-subdirs` - Recognized Spec subdirectories
|
|
447
449
|
- `temporary-patterns` - Patterns for temporary files
|
|
448
450
|
|
|
@@ -467,6 +469,12 @@ Spec Subdirectories:
|
|
|
467
469
|
• results
|
|
468
470
|
• docs
|
|
469
471
|
|
|
472
|
+
Spec Allowed Root Files:
|
|
473
|
+
• requirements.md
|
|
474
|
+
• design.md
|
|
475
|
+
• tasks.md
|
|
476
|
+
• collaboration.json
|
|
477
|
+
|
|
470
478
|
Temporary Patterns:
|
|
471
479
|
• *-SUMMARY.md
|
|
472
480
|
• SESSION-*.md
|
|
@@ -724,6 +732,12 @@ The default configuration is:
|
|
|
724
732
|
"CHANGELOG.md",
|
|
725
733
|
"CONTRIBUTING.md"
|
|
726
734
|
],
|
|
735
|
+
"specAllowedRootFiles": [
|
|
736
|
+
"requirements.md",
|
|
737
|
+
"design.md",
|
|
738
|
+
"tasks.md",
|
|
739
|
+
"collaboration.json"
|
|
740
|
+
],
|
|
727
741
|
"specSubdirs": [
|
|
728
742
|
"reports",
|
|
729
743
|
"scripts",
|
|
@@ -749,6 +763,11 @@ The default configuration is:
|
|
|
749
763
|
sce docs config --set root-allowed-files "README.md,README.zh.md,CHANGELOG.md,CONTRIBUTING.md,LICENSE.md,SECURITY.md"
|
|
750
764
|
```
|
|
751
765
|
|
|
766
|
+
**Allow additional Spec-root metadata:**
|
|
767
|
+
```bash
|
|
768
|
+
sce docs config --set spec-allowed-root-files "requirements.md,design.md,tasks.md,collaboration.json"
|
|
769
|
+
```
|
|
770
|
+
|
|
752
771
|
**Add custom subdirectories:**
|
|
753
772
|
```bash
|
|
754
773
|
sce docs config --set spec-subdirs "reports,scripts,tests,results,docs,diagrams,examples"
|
|
@@ -768,6 +787,7 @@ You can also edit this file directly:
|
|
|
768
787
|
```json
|
|
769
788
|
{
|
|
770
789
|
"rootAllowedFiles": ["README.md", "CUSTOM.md"],
|
|
790
|
+
"specAllowedRootFiles": ["requirements.md", "design.md", "tasks.md", "collaboration.json"],
|
|
771
791
|
"specSubdirs": ["reports", "scripts", "custom"],
|
|
772
792
|
"temporaryPatterns": ["*-TEMP.md"]
|
|
773
793
|
}
|
package/docs/releases/README.md
CHANGED
|
@@ -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.39 release notes](./v3.6.39.md)
|
|
13
|
+
- [v3.6.38 release notes](./v3.6.38.md)
|
|
12
14
|
- [v3.6.37 release notes](./v3.6.37.md)
|
|
13
15
|
- [v1.46.2 release notes](./v1.46.2.md) (historical)
|
|
14
16
|
- [v1.46.2 validation report](./v1.46.2-validation.md) (historical)
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# v3.6.38 Release Notes
|
|
2
|
+
|
|
3
|
+
Release date: 2026-03-12
|
|
4
|
+
|
|
5
|
+
## Highlights
|
|
6
|
+
|
|
7
|
+
- Added a steering self-governance audit that checks content budgets, stale history, checklist leakage, stable-layer Spec leakage, and non-canonical governance aliases.
|
|
8
|
+
- Refactored the live steering baseline and template steering files so they stay lean, layered, and easier to refresh over time.
|
|
9
|
+
- Added recurring steering hygiene enforcement in normal CI, `prepublishOnly`, and a weekly GitHub Actions schedule.
|
|
10
|
+
|
|
11
|
+
## Verification
|
|
12
|
+
|
|
13
|
+
- `npm run audit:steering`
|
|
14
|
+
- `npx jest tests/unit/steering/steering-compliance-checker.test.js tests/unit/scripts/steering-content-audit.test.js tests/unit/scripts/git-managed-gate.test.js --runInBand`
|
|
15
|
+
|
|
16
|
+
## Release Notes
|
|
17
|
+
|
|
18
|
+
- Steering is now expected to self-correct through recurring audit rather than rely on ad hoc cleanup.
|
|
19
|
+
- Stable steering layers should remain short-lived in content size but long-lived in principle quality.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# v3.6.39 Release Notes
|
|
2
|
+
|
|
3
|
+
Release date: 2026-03-13
|
|
4
|
+
|
|
5
|
+
## Highlights
|
|
6
|
+
|
|
7
|
+
- Added a canonical state-storage tiering policy, reconciliation runbook, and audit/report tooling so SQLite remains a scoped index layer rather than a silent source-of-truth replacement.
|
|
8
|
+
- Expanded and hardened the `sce scene` command surface with broader command coverage, stronger property tests, and JSON summary output that preserves edge-case numeric payloads.
|
|
9
|
+
- Closed the `115-00-sce-quality-hardening-program` integration loop, including `watch logs --follow` completion and Jest open-handle governance without relying on `forceExit`.
|
|
10
|
+
|
|
11
|
+
## Verification
|
|
12
|
+
|
|
13
|
+
- `node bin/sce.js collab status 115-00-sce-quality-hardening-program --graph`
|
|
14
|
+
- `npm run test:smoke`
|
|
15
|
+
- `npm run test:skip-audit`
|
|
16
|
+
- `npm run test:brand-consistency`
|
|
17
|
+
- `npm run test:full`
|
|
18
|
+
- `npm run test:handles`
|
|
19
|
+
|
|
20
|
+
## Release Notes
|
|
21
|
+
|
|
22
|
+
- State persistence is now explicitly tiered: evidence and operator-facing files remain canonical, while SQLite stays limited to rebuildable index/projection use cases.
|
|
23
|
+
- The scene command family is substantially more release-ready, with dedicated tests and closeout artifacts across publish/install/info/diff/validate/owner/tag/stats/lock/contribute/version flows.
|
|
24
|
+
- Quality hardening gates should be executed in sequence for release validation; `test:full` and `test:handles` are both green when run serially.
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# State Migration Reconciliation Runbook
|
|
2
|
+
|
|
3
|
+
Use this runbook when working with the current file-to-SQLite migration surface.
|
|
4
|
+
|
|
5
|
+
## Normal Flow
|
|
6
|
+
|
|
7
|
+
1. Inspect scope
|
|
8
|
+
- `sce state plan --json`
|
|
9
|
+
2. Diagnose drift
|
|
10
|
+
- `sce state doctor --json`
|
|
11
|
+
3. Apply repair
|
|
12
|
+
- `sce state reconcile --all --apply --json`
|
|
13
|
+
4. Re-check gate posture
|
|
14
|
+
- `node scripts/state-migration-reconciliation-gate.js --fail-on-blocking --fail-on-pending --json`
|
|
15
|
+
|
|
16
|
+
## Severity Model
|
|
17
|
+
|
|
18
|
+
### Blocking
|
|
19
|
+
|
|
20
|
+
Treat these as release-blocking anomalies:
|
|
21
|
+
|
|
22
|
+
- `sqlite-unavailable`
|
|
23
|
+
- `source-parse-error`
|
|
24
|
+
- `sqlite-ahead`
|
|
25
|
+
- `sqlite-only`
|
|
26
|
+
- runtime `sqlite-ahead`
|
|
27
|
+
- runtime `sqlite-only`
|
|
28
|
+
|
|
29
|
+
Typical meaning:
|
|
30
|
+
|
|
31
|
+
- `sqlite-ahead`: SQLite contains index rows that are no longer represented by canonical files
|
|
32
|
+
- `sqlite-only`: canonical file source disappeared but SQLite rows still exist
|
|
33
|
+
|
|
34
|
+
### Alert
|
|
35
|
+
|
|
36
|
+
Treat these as repairable but non-steady-state conditions:
|
|
37
|
+
|
|
38
|
+
- `pending-migration`
|
|
39
|
+
- `missing-source`
|
|
40
|
+
- runtime `pending-sync`
|
|
41
|
+
|
|
42
|
+
Typical meaning:
|
|
43
|
+
|
|
44
|
+
- `pending-migration`: file source has more records than SQLite index
|
|
45
|
+
- `missing-source`: the project does not currently have that source artifact
|
|
46
|
+
|
|
47
|
+
## Operator Decisions
|
|
48
|
+
|
|
49
|
+
### When `pending-migration`
|
|
50
|
+
|
|
51
|
+
- Run `sce state reconcile --all --apply --json`
|
|
52
|
+
- Re-run `sce state doctor --json`
|
|
53
|
+
- If it persists, inspect source parser assumptions and source file health
|
|
54
|
+
|
|
55
|
+
### When `sqlite-ahead`
|
|
56
|
+
|
|
57
|
+
- Treat as anomaly first, not optimization
|
|
58
|
+
- Inspect whether source artifacts were deleted, rotated, or never written
|
|
59
|
+
- Rebuild or re-sync from canonical file source before release
|
|
60
|
+
|
|
61
|
+
### When `sqlite-only`
|
|
62
|
+
|
|
63
|
+
- Confirm whether the file source was removed accidentally
|
|
64
|
+
- Restore canonical files when possible
|
|
65
|
+
- Do not normalize this into a permanent state for current migration-scope components
|
|
66
|
+
|
|
67
|
+
### When `missing-source`
|
|
68
|
+
|
|
69
|
+
- If the component is intentionally unused in the current project, keep it advisory
|
|
70
|
+
- If the component should exist for this workflow, generate or restore the source artifact and reconcile
|
|
71
|
+
|
|
72
|
+
## Related Commands
|
|
73
|
+
|
|
74
|
+
- `npm run gate:state-migration-reconciliation`
|
|
75
|
+
- `npm run audit:state-storage`
|
|
76
|
+
- `npm run report:interactive-approval-projection`
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# State Storage Tiering
|
|
2
|
+
|
|
3
|
+
SCE uses a selective SQLite strategy.
|
|
4
|
+
|
|
5
|
+
The operating rule is:
|
|
6
|
+
|
|
7
|
+
- keep canonical evidence, audit, recovery payloads, and low-cardinality personal state in files
|
|
8
|
+
- use SQLite for registry/index workloads with real query pressure
|
|
9
|
+
- allow SQLite projections for append-only streams only when they are rebuildable from files
|
|
10
|
+
|
|
11
|
+
## Tiers
|
|
12
|
+
|
|
13
|
+
### `file-source`
|
|
14
|
+
|
|
15
|
+
Use this tier when:
|
|
16
|
+
|
|
17
|
+
- the file is the canonical evidence or audit artifact
|
|
18
|
+
- the resource is a small personal or local configuration object
|
|
19
|
+
- manual inspection, Git diff, and recovery are more important than indexed querying
|
|
20
|
+
|
|
21
|
+
Examples:
|
|
22
|
+
|
|
23
|
+
- `~/.sce/workspace-state.json`
|
|
24
|
+
- `.sce/reports/**/*.jsonl`
|
|
25
|
+
- `.sce/audit/**/*.jsonl`
|
|
26
|
+
- `.sce/timeline/snapshots/**`
|
|
27
|
+
- `.sce/session-governance/sessions/**`
|
|
28
|
+
|
|
29
|
+
### `sqlite-index`
|
|
30
|
+
|
|
31
|
+
Use this tier when:
|
|
32
|
+
|
|
33
|
+
- the canonical content still lives in files
|
|
34
|
+
- the resource behaves like a registry or index
|
|
35
|
+
- repeated filtering, sorting, and cross-run queries justify an index
|
|
36
|
+
|
|
37
|
+
Current active scope:
|
|
38
|
+
|
|
39
|
+
- `collab.agent-registry` -> `.sce/config/agent-registry.json`
|
|
40
|
+
- `runtime.timeline-index` -> `.sce/timeline/index.json`
|
|
41
|
+
- `runtime.scene-session-index` -> `.sce/session-governance/scene-index.json`
|
|
42
|
+
- `errorbook.entry-index` -> `.sce/errorbook/index.json`
|
|
43
|
+
- `errorbook.incident-index` -> `.sce/errorbook/staging/index.json`
|
|
44
|
+
- `governance.spec-scene-overrides` -> `.sce/spec-governance/spec-scene-overrides.json`
|
|
45
|
+
- `governance.scene-index` -> `.sce/spec-governance/scene-index.json`
|
|
46
|
+
- `release.evidence-runs-index` -> `.sce/reports/release-evidence/handoff-runs.json`
|
|
47
|
+
- `release.gate-history-index` -> `.sce/reports/release-evidence/release-gate-history.json`
|
|
48
|
+
|
|
49
|
+
### `derived-sqlite-projection`
|
|
50
|
+
|
|
51
|
+
Use this tier only when:
|
|
52
|
+
|
|
53
|
+
- the source remains append-only files
|
|
54
|
+
- the projection can be deleted and rebuilt
|
|
55
|
+
- reads clearly disclose when SQLite projection is used
|
|
56
|
+
|
|
57
|
+
This tier is for query acceleration, not source-of-truth replacement.
|
|
58
|
+
|
|
59
|
+
## Admission Rubric
|
|
60
|
+
|
|
61
|
+
A resource should only enter SQLite scope when all of the following are true:
|
|
62
|
+
|
|
63
|
+
1. Cross-run or cross-session query pressure is real.
|
|
64
|
+
2. File scans are materially weaker than indexed filtering/sorting.
|
|
65
|
+
3. SQLite rows are rebuildable from a canonical file or stream.
|
|
66
|
+
4. Diagnostics, reconcile behavior, and operator guidance are defined up front.
|
|
67
|
+
|
|
68
|
+
Reject SQLite source migration when any of the following are true:
|
|
69
|
+
|
|
70
|
+
1. The resource is raw audit or evidence.
|
|
71
|
+
2. The resource is low-cardinality workspace or preference state.
|
|
72
|
+
3. Human-readable recovery and Git diff matter more than query speed.
|
|
73
|
+
4. The change would silently cut over the source of truth.
|
|
74
|
+
|
|
75
|
+
## Current Classification
|
|
76
|
+
|
|
77
|
+
| Resource | Tier | Why |
|
|
78
|
+
| --- | --- | --- |
|
|
79
|
+
| `~/.sce/workspace-state.json` | `file-source` | Atomic personal state; no meaningful query pressure |
|
|
80
|
+
| `.sce/reports/**/*.jsonl` | `file-source` | Canonical append-only governance/evidence streams |
|
|
81
|
+
| `.sce/audit/**/*.jsonl` | `file-source` | Canonical audit evidence |
|
|
82
|
+
| `.sce/timeline/index.json` | `sqlite-index` | Index-like query workload |
|
|
83
|
+
| `.sce/session-governance/scene-index.json` | `sqlite-index` | Registry-like query workload |
|
|
84
|
+
| `.sce/errorbook/index.json` | `sqlite-index` | Filtered status/quality lookup |
|
|
85
|
+
| `.sce/errorbook/staging/index.json` | `sqlite-index` | Incident triage lookup |
|
|
86
|
+
| `.sce/spec-governance/*.json` indexes | `sqlite-index` | Governance registry lookup |
|
|
87
|
+
| `.sce/reports/release-evidence/handoff-runs.json` | `sqlite-index` | Historical release summary lookup |
|
|
88
|
+
| `.sce/reports/release-evidence/release-gate-history.json` | `sqlite-index` | Gate history lookup |
|
|
89
|
+
| `.sce/timeline/snapshots/**` | `file-source` | Recovery payloads |
|
|
90
|
+
| `.sce/session-governance/sessions/**` | `file-source` | Session payload archives |
|
|
91
|
+
|
|
92
|
+
## Operator Rules
|
|
93
|
+
|
|
94
|
+
- Do not propose blanket sqlite-ization.
|
|
95
|
+
- Before adding a new SQLite candidate, update `.sce/config/state-storage-policy.json`.
|
|
96
|
+
- Run `npm run audit:state-storage` after changing state storage behavior.
|
|
97
|
+
- If the resource is append-only evidence, prefer a projection pilot over source migration.
|
|
98
|
+
|
|
99
|
+
## Related Assets
|
|
100
|
+
|
|
101
|
+
- Policy file: `.sce/config/state-storage-policy.json`
|
|
102
|
+
- Audit command: `npm run audit:state-storage`
|
|
103
|
+
- Machine-readable report: `npm run report:state-storage`
|
|
104
|
+
- State migration commands: `sce state plan|doctor|migrate|reconcile`
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# Steering 治理与净化
|
|
2
|
+
|
|
3
|
+
## 目标
|
|
4
|
+
|
|
5
|
+
让 `.sce/steering/` 长期保持三种品质:
|
|
6
|
+
|
|
7
|
+
- 健壮:长期规则稳定,不被短期任务污染
|
|
8
|
+
- 活力:随着项目演进持续校正,不靠历史惯性堆积
|
|
9
|
+
- 节制:只保留最小必要上下文,其他内容迁回更合适的位置
|
|
10
|
+
|
|
11
|
+
## 分层标准
|
|
12
|
+
|
|
13
|
+
| 位置 | 应放什么 | 不应放什么 |
|
|
14
|
+
|------|---------|-----------|
|
|
15
|
+
| `.sce/steering/CORE_PRINCIPLES.md` | 长期原则、跨 Spec 仍成立的默认行为 | 任务项、历史版本、阶段流水、短期战术 |
|
|
16
|
+
| `.sce/steering/ENVIRONMENT.md` | 项目环境、目录约定、发布触发方式、长期运行约束 | Spec 进度、问题清单、临时 workaround |
|
|
17
|
+
| `.sce/steering/CURRENT_CONTEXT.md` | 当前阶段最小必要上下文、近期优先级 | 长历史、完整日志、旧阶段总结 |
|
|
18
|
+
| `.sce/steering/RULES_GUIDE.md` | 职责边界、迁移规则、审计入口 | 详细制度、示例、长篇解释 |
|
|
19
|
+
| `.sce/specs/<spec>/` | 任务、证据、诊断、阶段记录、报告 | 不应再回写到 steering 的长历史 |
|
|
20
|
+
| `docs/` | 详细制度、示例、方法论、治理说明 | 当前 session 的即时状态 |
|
|
21
|
+
|
|
22
|
+
## 审查周期
|
|
23
|
+
|
|
24
|
+
- 每周一次
|
|
25
|
+
- 每次发布前一次
|
|
26
|
+
- 每次重大 Spec 收尾后一次
|
|
27
|
+
- 接管老项目或大规模文档迁移后,再补一次
|
|
28
|
+
|
|
29
|
+
## 审查动作
|
|
30
|
+
|
|
31
|
+
每次审查只做四类决定:
|
|
32
|
+
|
|
33
|
+
1. 保留
|
|
34
|
+
条件:内容长期有效,且放在当前层是正确的
|
|
35
|
+
2. 合并
|
|
36
|
+
条件:多条规则表达同一个约束,只是换了说法
|
|
37
|
+
3. 迁移
|
|
38
|
+
条件:内容有效,但层级错了
|
|
39
|
+
4. 删除
|
|
40
|
+
条件:短期价值已结束、已有现成机制承接、或已经被文档/系统能力覆盖
|
|
41
|
+
|
|
42
|
+
## 防腐重点
|
|
43
|
+
|
|
44
|
+
### 1. 不允许平行机制
|
|
45
|
+
|
|
46
|
+
steering 不能因为“想提醒 AI”就再造一套并行机制。
|
|
47
|
+
|
|
48
|
+
典型案例:
|
|
49
|
+
|
|
50
|
+
- 缺陷经验、临时兜底、发布阻断:统一复用 `errorbook`
|
|
51
|
+
- Scene / session 生命周期:复用现有 close-loop / scene 运行时
|
|
52
|
+
- release gate:复用现有 release workflow 与 gate 脚本
|
|
53
|
+
|
|
54
|
+
如果某条 steering 规则本质上是在说“再搞一套模式”,应先问两件事:
|
|
55
|
+
|
|
56
|
+
1. 现有 SCE 是否已经有能力承接?
|
|
57
|
+
2. 这条内容应该写成机制引用,而不是重新定义机制吗?
|
|
58
|
+
|
|
59
|
+
### 2. 不允许长历史驻留
|
|
60
|
+
|
|
61
|
+
历史记录、阶段流水、版本脚注、完成纪要不应长期留在 steering。
|
|
62
|
+
|
|
63
|
+
迁移目标:
|
|
64
|
+
|
|
65
|
+
- 当前阶段以外的推进历史 -> 对应 Spec `custom/` 或 `reports/`
|
|
66
|
+
- 发布历史 -> `CHANGELOG.md` / `docs/releases/`
|
|
67
|
+
- 详细治理说明 -> `docs/steering-governance.md`
|
|
68
|
+
|
|
69
|
+
### 3. 不允许任务态混入
|
|
70
|
+
|
|
71
|
+
steering 不是待办清单。
|
|
72
|
+
|
|
73
|
+
以下内容应迁出:
|
|
74
|
+
|
|
75
|
+
- checklist
|
|
76
|
+
- “下一个动作”
|
|
77
|
+
- 具体执行命令流水
|
|
78
|
+
- 某个 Spec 的进行中任务状态
|
|
79
|
+
|
|
80
|
+
### 4. 不允许错层
|
|
81
|
+
|
|
82
|
+
判断标准很简单:
|
|
83
|
+
|
|
84
|
+
- 跨项目、跨阶段仍成立?放 `CORE_PRINCIPLES.md`
|
|
85
|
+
- 仅对当前项目成立?放 `ENVIRONMENT.md`
|
|
86
|
+
- 仅对当前阶段成立?放 `CURRENT_CONTEXT.md`
|
|
87
|
+
- 需要示例和长解释?放 `docs/`
|
|
88
|
+
|
|
89
|
+
## 审计入口
|
|
90
|
+
|
|
91
|
+
本项目提供自动审计:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
npm run audit:steering
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
当前会检查:
|
|
98
|
+
|
|
99
|
+
- 文件预算是否超线
|
|
100
|
+
- 长期层是否混入历史版本脚注
|
|
101
|
+
- 长期层是否混入 Spec 引用
|
|
102
|
+
- steering 中是否混入 checklist / 任务态
|
|
103
|
+
- `CURRENT_CONTEXT.md` 是否与当前包版本脱节
|
|
104
|
+
- 是否出现“错题 / 错题本”这类非规范机制别名
|
|
105
|
+
|
|
106
|
+
## 通过标准
|
|
107
|
+
|
|
108
|
+
- `CORE_PRINCIPLES.md` 能在短时间读完并说明默认行为
|
|
109
|
+
- `CURRENT_CONTEXT.md` 不依赖长历史也能让 Agent 开工
|
|
110
|
+
- steering 中不再出现任务态和阶段流水
|
|
111
|
+
- 已有机制统一复用,不再出现平行命名
|
|
112
|
+
- 周期性审计可稳定通过
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# v3.6.38 发布说明
|
|
2
|
+
|
|
3
|
+
发布日期:2026-03-12
|
|
4
|
+
|
|
5
|
+
## 重点变化
|
|
6
|
+
|
|
7
|
+
- 新增 steering 自治理审计,检查内容预算、历史堆积、checklist 泄漏、稳定层 Spec 泄漏,以及非规范治理别名。
|
|
8
|
+
- 重构了当前 steering 基线和模板 steering,使其长期保持精简、分层明确、便于刷新。
|
|
9
|
+
- 将 steering 卫生检查接入常规 CI、`prepublishOnly` 和每周 GitHub Actions 定时任务。
|
|
10
|
+
|
|
11
|
+
## 验证
|
|
12
|
+
|
|
13
|
+
- `npm run audit:steering`
|
|
14
|
+
- `npx jest tests/unit/steering/steering-compliance-checker.test.js tests/unit/scripts/steering-content-audit.test.js tests/unit/scripts/git-managed-gate.test.js --runInBand`
|
|
15
|
+
|
|
16
|
+
## 发布说明
|
|
17
|
+
|
|
18
|
+
- steering 现在通过周期审计持续自我净化,而不是靠人工想起来时再清理。
|
|
19
|
+
- 稳定层应保持“原则长期有效、内容尽量精简”的状态,避免再回到大而杂的历史堆积。
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# v3.6.39 发布说明
|
|
2
|
+
|
|
3
|
+
发布日期:2026-03-13
|
|
4
|
+
|
|
5
|
+
## 重点变化
|
|
6
|
+
|
|
7
|
+
- 新增规范化的状态存储分层策略、迁移对账 runbook,以及配套 audit/report 工具,明确 SQLite 只承担受控索引层,不替代文件真源。
|
|
8
|
+
- 扩展并加固了 `sce scene` 命令族,补齐多类命令覆盖、性质测试和 JSON summary 输出边界处理。
|
|
9
|
+
- 完成 `115-00-sce-quality-hardening-program` 主 Spec 的集成收口,包含 `watch logs --follow` 补完,以及不依赖 `forceExit` 的 Jest open-handle 治理。
|
|
10
|
+
|
|
11
|
+
## 验证
|
|
12
|
+
|
|
13
|
+
- `node bin/sce.js collab status 115-00-sce-quality-hardening-program --graph`
|
|
14
|
+
- `npm run test:smoke`
|
|
15
|
+
- `npm run test:skip-audit`
|
|
16
|
+
- `npm run test:brand-consistency`
|
|
17
|
+
- `npm run test:full`
|
|
18
|
+
- `npm run test:handles`
|
|
19
|
+
|
|
20
|
+
## 发布说明
|
|
21
|
+
|
|
22
|
+
- 状态持久化现在有了明确分层:证据、审计和操作员可读文件继续保持 canonical,SQLite 仅用于可重建索引或投影。
|
|
23
|
+
- `scene` 命令面已经更接近稳定发布状态,publish/install/info/diff/validate/owner/tag/stats/lock/contribute/version 等流都有专门测试和 closeout 证据。
|
|
24
|
+
- 质量门禁建议串行执行;`test:full` 与 `test:handles` 在串行场景下均已验证通过。
|
package/lib/commands/docs.js
CHANGED
|
@@ -301,6 +301,12 @@ async function handleConfigDisplay(configManager, reporter) {
|
|
|
301
301
|
console.log(` • ${dir}`);
|
|
302
302
|
});
|
|
303
303
|
console.log();
|
|
304
|
+
|
|
305
|
+
console.log(chalk.bold('Spec Allowed Root Files:'));
|
|
306
|
+
(config.specAllowedRootFiles || []).forEach(file => {
|
|
307
|
+
console.log(` • ${file}`);
|
|
308
|
+
});
|
|
309
|
+
console.log();
|
|
304
310
|
|
|
305
311
|
console.log(chalk.bold('Temporary Patterns:'));
|
|
306
312
|
config.temporaryPatterns.forEach(pattern => {
|
|
@@ -350,10 +356,10 @@ async function handleConfigSet(configManager, reporter, options) {
|
|
|
350
356
|
const camelKey = key.replace(/-([a-z])/g, (g) => g[1].toUpperCase());
|
|
351
357
|
|
|
352
358
|
// Validate key
|
|
353
|
-
const validKeys = ['rootAllowedFiles', 'specSubdirs', 'temporaryPatterns'];
|
|
359
|
+
const validKeys = ['rootAllowedFiles', 'specAllowedRootFiles', 'specSubdirs', 'temporaryPatterns'];
|
|
354
360
|
if (!validKeys.includes(camelKey)) {
|
|
355
361
|
reporter.displayError(`Invalid configuration key: ${key}`);
|
|
356
|
-
console.log(chalk.gray('Valid keys: root-allowed-files, spec-subdirs, temporary-patterns\n'));
|
|
362
|
+
console.log(chalk.gray('Valid keys: root-allowed-files, spec-allowed-root-files, spec-subdirs, temporary-patterns\n'));
|
|
357
363
|
return 2;
|
|
358
364
|
}
|
|
359
365
|
|