magic-spec 1.5.132 → 1.5.206

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,221 +1,413 @@
1
- # Changelog
2
-
3
- All notable changes to this project will be documented in this file.
4
-
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
-
8
- ## [1.5.132] - 2026-04-04
9
-
10
- ### Changed
11
-
12
- - **Internationalization (En-En)**: Translated remaining Russian instructions in `docs/checksums.md` to English.
13
- - **Engine Versioning**: Synchronized all manifest files with the base version `1.5.132` (C14).
14
-
15
- ## [1.5.131] - 2026-04-04
16
-
17
- ### Changed
18
-
19
- - **Internationalization (En-En)**: Fixed remaining Russian examples in `.magic/analyze.md` that were missed in the previous version sync.
20
- - **Engine Versioning**: Synchronized all manifest files with the base version `1.5.131` (C14).
21
-
22
- ## [1.5.130] - 2026-04-04
23
-
24
- ### Changed
25
-
26
- - **Internationalization (En-En)**: Translated all remaining Russian examples and rule titles to English across the engine core (`.magic/`) to ensure a consistent, professional English-only codebase (Rule 3.1).
27
- - Translated constitutional rule titles in `RULES.md` (e.g., `C12 — Quarantine Cascade`).
28
- - Updated simulation test suite (`suite.md`) to reflect translated inputs and expected output strings.
29
-
30
- ### Meta
31
-
32
- - **Automated Update**: Engine version bumped to `1.5.130`, history updated, and checksums regenerated (C14).
33
-
34
- ## [1.5.129] - 2026-04-03
35
-
36
- ### Changed
37
-
38
- - **Structural Harmonization**: Refactored `retrospective.md` to use header-based logic. This resolves `MD029` (ordered list prefix) and `MD007` (list indentation) warnings caused by complex content and personification blocks (C24) breaking list continuity. Fixed sequential numbering (1, 2, 3, 4, 5, 2 -> 1, 2, 3, 4, 5, 6, 7).
39
- - **C24 Independent Analyst**: Upgraded the persona block in `retrospective.md` to a dedicated sub-heading for better visibility and structural compliance.
40
-
41
- ### Meta
42
-
43
- - **Automated Update**: Engine version bumped to `1.5.129`, history updated, and checksums regenerated (C14).
44
-
45
- ## [1.5.128] - 2026-04-03
46
-
47
- ### Fixed
48
-
49
- - **Markdown Lint (MD012)**: Fixed a recurring issue where `CONTRIBUTING.md` would be regenerated with multiple consecutive blank lines. Added `.trim()` to `{{workflows_table}}` placeholder in `sync-docs.js` to ensure proper spacing between the table and the following section.
50
- - **Engine Versioning**: Synchronized engine version across all manifests and documentation (C14).
51
-
52
- ## [1.5.126] - 2026-04-03
53
-
54
- ### Added
55
-
56
- - **C24 — Unified Role-Switching Gate**: Expanded the mandatory internal review system into a unified constitutional rule across all key SDD workflows (Spec, Task, Run, Retro, Analyze, Rule, Simulate).
57
- - **Workflow Personas**: Integrated 7 specialized personas (Critic, Skeptic, QA, Analyst, Auditor, Reviewer) to eliminate cognitive bias and ensure rigorous evidence-based verification before any artifact is finalized.
58
- - **Structural Harmonization**: Refactored workflow steps in `analyze.md`, `rule.md`, and `simulate.md` to use header-based logic, resolving deep-seated markdown lint errors caused by intervening non-list elements.
59
-
60
- ## [1.5.120] - 2026-04-03
61
-
62
- ### Added
63
-
64
- - **C24 Unified Role-Switching Gate**: Expanded the mandatory internal review system into a unified constitutional rule across all key SDD workflows. This forces the agent to adopt specialized personas to eliminate cognitive bias before artifacts are finalized:
65
- - **Spec Workflow**: Persona **Project Critic** (L1 tech-neutrality, invariant completeness).
66
- - **Task Workflow**: Persona **Planning Skeptic** (Optimism bias detection, dependency risk analysis).
67
- - **Run Workflow**: Persona **QA Tester** (Invariant verification, boundary condition audit).
68
- - **Workflow Integration**: Hardened `.magic/spec.md`, `.magic/task.md`, and `.magic/run.md` with explicit role-based checkpoints and updated completion checklists.
69
- - **Rules Versioning**: Updated `RULES.md` to version 1.5.126 with the expanded C24 definition.
70
-
71
- ## [1.5.115] - 2026-04-02
72
-
73
- ### Added
74
-
75
- - **Installer `--dev` Flag**: Implemented a comprehensive development mode across Node.js and Python installers.
76
- - Enabled installation/synchronization of development-specific instruments (simulation workflows, testing suites, engine scripts).
77
- - Added `devSkills` registry to `installers/config.json` for canonical tracking of dev agent skills.
78
- - Hardened update logic to ensure dev instruments are correctly synchronized when `--dev` is provided during an update.
79
-
80
- ## [1.5.114] - 2026-04-02
81
-
82
- ### Changed
83
-
84
- - **Core Invariant #2 (Prohibitions)** in `spec.md`: Refined the "No code in specs" rule to explicitly permit **Technical Contracts** (interfaces, types, API schemas) and **Reference Snippets** (marked as `[REFERENCE]`). This ensures architectural precision while maintaining the prohibition on functional implementation code before the `run` phase.
85
- - **Task Completion Checklist**: Updated to reflect the permission of contracts and references in specifications.
86
-
87
- ### Meta
88
-
89
- - **Automated Update**: Engine version bumped to `1.5.114`, history updated, and checksums regenerated (C14).
90
-
91
- ## [1.5.112] - 2026-04-02
92
-
93
- ### Added
94
-
95
- - **Anti-Fabrication Rule (Invariant 6)** in `simulate.md`: New Core Invariant that legitimizes `0 rough edges` as a valid outcome and mandates evidence-linked claims (file, line, verbatim quote, verification command) for every finding. Findings without evidence are automatically INVALID.
96
- - **Pre-flight Hard Gate** in `simulate.md`: Upgraded Pre-flight from "recommended" to a non-negotiable blocking HALT. Simulations without recorded `check-prerequisites` output are INVALID.
97
- - **Read-Before-Claim Gate** in `simulate.md`: New mandatory Grounding Phase requiring all target workflow files to be read (with line counts recorded) before any analysis begins. Claims about unread files are automatically INVALID.
98
- - **Regression Tests (T185–T189)**: 5 new scenarios covering Explore Mode write isolation (T185), Pre-flight Hard Gate enforcement (T186), Evidence-Linked Claims validation (T187), Null-Result Acceptance (T188), and Read-Before-Claim Gate (T189).
99
-
100
- ### Fixed
101
-
102
- - **Zero-Prompt Parity**: Aligned `init.md` and `analyze.md` Core Invariant #1 with the canonical cascade formula used by all other workflow files, eliminating sync risk from divergent wording.
103
- - **Script History Leak**: Fixed `executor.js` Auto-Detect creating spurious history files for scripts in `scripts/` directory (e.g., `sync-skills.md`). Scripts are now tracked via checksums but inherit the `--workflow` flag instead of getting standalone history entries.
104
- - **Orphan Cleanup**: Removed `history/sync-skills.md` — a phantom artifact created by the above bug.
105
-
106
- ### Meta
107
-
108
- - **Automated Update**: Engine version bumped to `1.5.112`, history updated, and checksums regenerated (C14).
109
-
110
- ## [1.5.105] - 2026-03-31
111
-
112
- ### Fixed
113
-
114
- - **Engine History**: Resolved a ReferenceError in `executor.js` where `automatedMsg` was used before being defined.
115
- - **Collapsing Logic**: Improved the history collapsing mechanism to correctly merge both automated and custom messages into compact version ranges.
116
-
117
- ### Meta
118
-
119
- - **Automated Update**: Engine version bumped to `1.5.104`, history entries consolidated, and checksums regenerated.
120
-
121
- ## [1.5.72] - 2026-03-30
122
-
123
- ### Fixed
124
-
125
- - **AI Hallucinations**: Rephrased the directive `auto-run .magic/init.md` to `silently execute .magic/init.md (do not prompt user)` across all engine workflows. This prevents intelligent agents from incorrectly proposing the internal `.magic/init.md` script as a user-facing `/magic.init` slash command.
126
-
127
- ### Meta
128
-
129
- - **Automated Update**: Engine version bumped to `1.5.72`, history updated, and checksums regenerated (C14).
130
-
131
- ## [1.5.70] - 2026-03-30
132
-
133
- ### Changed
134
-
135
- - **Documentation**: Updated `README.md` and `docs/README.md` to include a mandatory recommendation to run `/magic.analyze` after updating the Magic Spec engine. This ensures that specifications and engine metadata remain synchronized after a core logic update.
136
-
137
- ### Meta
138
-
139
- - **Automated Update**: Engine version bumped to `1.5.70`, history updated, and checksums regenerated (C14).
140
-
141
- ## [1.5.132] - 2026-03-26
142
-
143
- ### Added
144
-
145
- - **Gitignore Safety (Invariant 8)** in `analyze.md`: The agent now MUST scan and apply `.gitignore` patterns before any project scan or architecture inference. This prevents `node_modules`, `dist`, `.venv`, and other build artifacts from leaking into the analysis reports or coverage checks.
146
-
147
- ### Changed
148
-
149
- - **Stack & Structure**: Refined the initial scan step to build the high-level project map only *after* applying gitignore filters.
150
-
151
- ### Meta
152
-
153
- - **Automated Update**: Engine version bumped to `1.5.132`, history updated, and checksums regenerated (C14).
154
-
155
- ## [1.5.50] - 2026-03-26
156
-
157
- ### Added
158
-
159
- - **Anti-Stall Mechanism (Invariant 12)**: Solved the "AI holds specs in mind" issue (reported by user). The agent is now forced to write a `Draft` spec if it asks more than one clarifying question without file creation. Added `<!-- TBD -->` inline markers for ambiguous sections.
160
- - **Mode Transition Protocol**: Defined explicit triggers to exit `Explore Mode` and enter `Dispatch Mode` automatically (3+ topics, confirmation words, or 2nd idea exchange in Trust Mode).
161
- - **Non-Blocking Dispatch Notice**: Reframed "Notice of Intent" as a statement of action rather than a question to prevent infinite loops.
162
-
163
- ### Changed
164
-
165
- - **Analysis Mode Scope**: Strictly limited the "do not modify specs/registry" prohibition to `Project Analysis Delegation` mode, allowing normal `Dispatch` to proceed without friction.
166
- - **Workflow Wrapper**: Updated `.agents/workflows/magic.spec.md` to align with the new non-blocking exploration logic.
167
-
168
- ### Meta
169
-
170
- - **Automated Update**: Engine version bumped to `1.5.50`, history updated, and checksums regenerated (C14).
171
-
172
- ## [1.5.49] - 2026-03-25
173
-
174
- ### Added
175
-
176
- - **Config Drift Guard**: `check-prerequisites` now detects uncommitted manual changes to `RULES.md` via `git diff` and emits a non-blocking `CONFIG_DRIFT` advisory warning. Supports workspace-specific `RULES.md` per C22. Gracefully skips when git is unavailable.
177
- - **Init Workflow**: Added Config Drift Advisory sub-step to pre-flight check (show diff / proceed / restore options).
178
- - **Test Suite**: Added cognitive tests T168-T170 for config drift detection (drift present, no git, workspace C22). Suite version bumped to 1.9.51.
179
- - **Engine Spec**: New `config-drift-guard.md` specification (Stable, L1) in engine workspace.
180
-
181
- ## [1.5.48] - 2026-03-24
182
-
183
- ### Added
184
-
185
- - **Publish Workflow**: Restored `.agents/workflows/publish.md` for engine maintenance and registry publishing.
186
- - **History Tracking**: Initialized history for `magic.analyze` and `magic.dev.simulate` wrappers to ensure full auditability.
187
-
188
- ### Changed
189
-
190
- - **Version Synchronization**: Unified project version to `1.5.132` across all manifests (`package.json`, `pyproject.toml`, and installer init files) and the `.magic/.version` engine core.
191
- - **Instruction Density**: Refined `.magic/simulate.md` (Context Bleed Warning) to remove vague qualifiers ("high-confidence" -> "strictly unbiased"), reaching a density score of 10/10.
192
- - **Engine Integrity**: Optimized `generate-checksums.js` to exclude the `.checksums` file from its own mapping, preventing confusion and unstable hash values.
193
-
194
- ### Fixed
195
-
196
- - **Testing Logic**: Corrected `run_tests.py` to properly set `PYTHONPATH` for Python installer subprocesses and fixed an `os.environ` access bug.
197
- - **Sandbox Cleanup**: Removed dev-only `simulate.md` from installer test sandbox.
198
- - **RULES Template**: Added missing conventions C18-C23 to `init.js` RULES.md generator.
199
- - **Python Installer**: Fixed `_resolve_package_version()` to read actual package version.
200
- - **Engine Scripts**: Deduplicated `workspace.json` reads in `executor.js`.
201
- - **History Cleanup**: Removed legacy `audit.md` and `docs.md` files from `.magic/history/`.
202
-
203
- ## [1.5.30] - 2026-03-24
204
-
205
- ### Fixed
206
-
207
- - **Version Synchronization**: Unified project version across `package.json` (was 1.5.0), `pyproject.toml` (was 1.4.162), and `__init__.py` (was 1.4.162) to a single `1.5.30`. Previously 5 different versions existed across 5 sources.
208
- - **CONTEXT.md**: Regenerated stale context file (was 9 days old).
209
-
210
- ## [1.5.29] - 2026-03-16
211
-
212
- ### Added
213
-
214
- - **Argument Routing (A–D)** for `task.md` and `run.md`: Both workflows now accept optional arguments — workspace name, directive text, or both. Consistent with `analyze.md` pattern. Includes Workspace Fallback, Disambiguation, and Handoff Propagation rules.
215
- - **T4 Inline Guards** in `spec.md`: When spec workflow captures a standing rule via T4 trigger ("remember that..."), it now applies Tier Routing (global vs workspace RULES.md), Duplication Check (across both tiers), and Constitutional Guard (§1–6 protection) — matching `rule.md` safety guarantees without breaking T4's "Apply Immediately" semantics.
216
- - **Regression Tests (T153–T161)**: 9 new scenarios covering argument routing (scoped planning, workspace fallback, disambiguation, targeted task/phase execution, cross-workflow handoff propagation) and T4 inline guards (tier routing, duplication detection, constitutional block).
217
-
218
- ### Changed
219
-
220
- - **AGENTS.md**: Clarified C14 Enforcement scope — explicitly covers all `.magic/` content (workflows, scripts, templates, tests, config), not just workflow files. Added description of what `update-engine-meta` does (bumps `.version`, regenerates `.checksums`).
221
- - **`run.md` Argument Routing**: Detection column harmonized with `analyze.md` — accepts both quoted text and non-workspace tokens (e.g., unquoted `T-1A01` or `phase-2`).
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [1.5.206] - 2026-04-28
9
+
10
+ ### Meta
11
+
12
+ - **Engine Sync**: Final hygiene and version synchronization (C14) before global release.
13
+ - **Validation**: All 18 core tests passed on Windows environment.
14
+
15
+ ## [1.5.204] - 2026-04-25
16
+
17
+ ### Fixed
18
+
19
+ - **`sync-docs.js`**: Removed greedy global `vX.Y.Z` regex that overwrote unrelated version mentions. Removed `today's date` from `CONTRIBUTING.md` footer (now uses latest source mtime). `## Sync Note` only refreshes when the matching workflow source hash changes or the engine version actually bumps. Adds `.magic/.docs-state.json` for per-workflow content tracking.
20
+ - **`sync-manifests.js`**: Replaced greedy `(\(v?\d+\.\d+\.\d+\))/g` README sweep with anchored `**Active Development** (vX.Y.Z)` and an optional `<!-- engine-version -->...<!-- /engine-version -->` marker. Added `installers/python/magic_spec/__init__.py` to the manifest set.
21
+ - **`update-project-meta.js`**: Made idempotent via SHA-256 structural digest stored in `.magic/.project-meta-state.json` (volatile fields stripped before hashing). Bump + history append now happen only on real change. Added Smart-History dedup (same-day same-message rows collapse into a version range). Fixed history insertion to honor newest-first table convention by anchoring to the matched header's slice instead of the file's first divider.
22
+
23
+ ### Added
24
+
25
+ - **`validate-hardlinks.js`**: New script verifies `CLAUDE.md`, `GEMINI.md`, `QWEN.md`, `CODEX.md` share the same inode as `AGENTS.md`. Tolerant by default; pass `--strict` to fail on missing siblings.
26
+ - **`sync.js`**: Hardlink validation wired in as a pipeline step. New flags: `--skip-links`, `--strict-links`.
27
+
28
+ ### Changed
29
+
30
+ - **`magic.dev.sync.md` workflow**: Rewritten to describe the actual pipeline (was claiming a "Hardlink Validation" step that did not exist).
31
+ - **`update-engine-meta.js`**: `.docs-state.json` and `.project-meta-state.json` now ignored by drift detection (volatile state caches, not engine logic).
32
+
33
+ ## [1.5.198] - 2026-04-24
34
+
35
+ ### Fixed
36
+
37
+ - **Version Parity**: Synchronized metadata, documentation, and installers across the repository.
38
+ - **Hardlink Validation**: Verified agent link integrity.
39
+
40
+ ## [1.5.171] - 2026-04-24
41
+
42
+ ### Added
43
+
44
+ - **Spec Graph extraction cache** (`.magic/scripts/graph-cache.js`): Per-file SHA-256 cache of parsed spec metadata (refs, parent, conventions). Frontmatter-aware hashing for Markdown — metadata-only edits (`Version`, `Last Updated`, `Status`) do not invalidate cache. Cache lives at `$designDir/.graph-cache/` (gitignored). 100% hit rate on unchanged re-runs.
45
+ - **Spec Graph Wiki export** (`.magic/scripts/export-wiki.js`): Generates an agent-navigable Markdown wiki at `$designDir/wiki/` — `index.md` + one page per workspace + one article per spec, with Obsidian-style `[[wiki-links]]` between them. Surfaces god nodes, knowledge gaps, and implements chains. Usage: `node .magic/scripts/executor.js export-wiki [--from-file graph.json] [--out dir]`.
46
+ - **Token-budget truncation on MCP `query_graph`**: The `query_graph` tool in `serve-spec-graph.js` now accepts a `token_budget` argument (default 2000). Output is truncated at `chars = budget × 4` with an explicit sentinel, preventing unbounded responses as the graph grows.
47
+ - **Spec**: `.design/engine/specifications/l2-spec-graph-memory.md` — Layer 2 specification adapting three memory / token-economy mechanisms from the external project.
48
+
49
+ ### Changed
50
+
51
+ - **`build-spec-graph.js`**: Integrated extraction cache via `graph-cache.js`. Added `--no-cache` flag. Summary now reports cache hits/misses.
52
+ - **`.design/engine/INDEX.md`**: Registered `l2-spec-graph-memory.md` (engine registry → v1.8.0).
53
+
54
+ ### Meta
55
+
56
+ - **Engine version**: `1.5.195` `1.5.197` (C14 auto-bump: initial scripts, then post-review fixes).
57
+ - **Package version**: `1.5.170` `1.5.171`.
58
+
59
+ ## [1.5.176] - 2026-04-23
60
+
61
+ ### Added
62
+
63
+ - **Specification Knowledge Graph** (`build-spec-graph.js`): Full `extract → build → analyze → export` pipeline over `.design/` SDD artifacts. Produces workspace/spec/file/convention/phase nodes with edges. Outputs human-readable summary (default), `--json` for machine-readable, `--html` for interactive vis.js visualization. Includes God Nodes, orphaned files, missing Implements, bridge specs, and per-workspace coverage stats.
64
+ - **Community Detection** (`detect-communities.js`): Label Propagation algorithm (pure JS, no deps) on a multi-layer dependency graph (JS `require()`, Python imports, Markdown cross-references). Computes cohesion, modularity, and Jaccard alignment against `workspace.json`. Flags oversized communities with BFS-based split suggestions. Use `--include-md` for richer 8-community structure.
65
+ - **Incremental SHA256 Cache** (`cache-utils.js`): Shared cache module with atomic writes, frontmatter-stripped hashing for `.md` files, dead-entry pruning, and OS-agnostic path keys. Ready for use by any analyze script via `require('./cache-utils')`.
66
+ - **Graph Diff** (`diff-spec-graph.js`): Retrospective structural diff between two `build-spec-graph --json` snapshots. Surfaces node/edge additions and removals, degree changes, god node evolution, per-workspace coverage deltas, and orphan/convention drift.
67
+ - **MCP Server** (`serve-spec-graph.js`): stdio MCP server (JSON-RPC 2.0) exposing the SDD graph as 7 AI-agent tools: `query_graph`, `get_node`, `get_neighbors`, `find_gaps`, `shortest_path`, `get_coverage`, `god_nodes`. Builds the graph on startup via `build-spec-graph --json`.
68
+ - **Token Benchmark** (`benchmark.js`): Quantitative token efficiency measurement — raw corpus (238K tokens), spec layer (16K, 14. cheaper), BFS graph query (2.2K avg, 107. cheaper). Provides evidence of SDD's context economy.
69
+ - **Confidence Taxonomy** (`analyze-coverage.js`): Four-level file coverage classification (EXTRACTED / INFERRED / AMBIGUOUS / UNCOVERED) integrated into Mode B/C of `magic.analyze`.
70
+ - **Rationale Extraction** (`extract-rationale.js`): Scans source files for structured design markers (`NOTE`, `WHY`, `HACK`, `IMPORTANT`, `TODO`, etc.) and identifies Shadow Logic — design decisions not captured in any spec.
71
+
72
+ ### Changed
73
+
74
+ - **`magic.analyze` Mode C** (Ventilation): Added steps 6 (Specification Knowledge Graph via `build-spec-graph`) and 7 (Workspace Boundary Analysis via `detect-communities --include-md`). Updated completion checklist with two new items.
75
+ - **`magic.retrospective`**: Added Graph Snapshot (`build-spec-graph --json`) and Graph Diff (`diff-spec-graph`) to the Collect step. Updated Retrospective Completion Checklist with two new items.
76
+
77
+ ### Meta
78
+
79
+ - **Engine version**: bumped to `1.5.176` (eight new scripts auto-detected and checksummed by C14).
80
+
81
+ ## [1.5.170] - 2026-04-19
82
+
83
+ ### Fixed
84
+
85
+ - **Read-Only Invariant (sync orchestrator)**: `node .magic/scripts/executor.js sync --dry-run` previously performed real writes because `sync.js` silently ignored unknown flags and sub-scripts had no dry-run support. All sync sub-scripts (`sync-manifests`, `sync-docs`, `update-project-meta`, `update-engine-meta`, `generate-checksums`, `sync-skills`) now honor `MAGIC_DRY_RUN=1` via shared helpers in `utils.js` (`writeFileSafe`, `appendFileSafe`, `mkdirSafe`).
86
+ - **Strict CLI Contract**: `sync.js` now rejects unknown flags with exit code `2` and an explicit accepted-flags list, preventing silent-ignore regressions.
87
+
88
+ ### Added
89
+
90
+ - **`utils.js` safe-writer helpers**: `isDryRun()`, `writeFileSafe()`, `appendFileSafe()`, `mkdirSafe()` — centralize the filesystem mutation gate so future scripts inherit dry-run support by default.
91
+
92
+ ## [1.5.169] - 2026-04-18
93
+
94
+ ### Added
95
+
96
+ - **Core Workflow Documentation**: Added documentation and metadata files to `.magic/` for all core workflows.
97
+ - **Engine Hardening**: Improved engine integrity checks and metadata synchronization robustness.
98
+
99
+ ### Changed
100
+
101
+ - **Agent References**: Fixed typos and updated tool references in `.agents/` documentation.
102
+ - **Gitignore**: Added `.kilocode` to project ignore list.
103
+
104
+ ### Meta
105
+
106
+ - **Engine Sync**: Full project hygiene sync; validated engine metadata (C14 parity).
107
+
108
+ ## [1.5.160] - 2026-04-11
109
+
110
+ ### Added
111
+
112
+ - **Hierarchical History**: Organized `.magic/history` into logical subfolders (`workflows`, `scripts`, `tests`, `skills`, `.agents/workflows`).
113
+ - **Engine Core Expansion**: Updated `update-engine-meta.js` and `generate-checksums.js` to scan and track all core engine directories, including root `workflows/` and `.agents/workflows/` (C14 parity).
114
+ - **Comprehensive Tracking**: All `.md` files and scripts within engine directories now have automated hierarchical history tracking.
115
+
116
+ ### Meta
117
+
118
+ - **Engine Sync**: Performed project hygiene sync, organized history, and validated engine metadata (C14 parity).
119
+
120
+ ## [1.5.159] - 2026-04-10
121
+
122
+ ### Meta
123
+
124
+ - **Engine Sync**: Performed project hygiene sync, updated documentation, and validated engine metadata (C14 parity).
125
+
126
+ ## [1.5.143] - 2026-04-09
127
+
128
+ ### Added
129
+
130
+ - **Agent Memory (STATE.md)**: New live memory system — a ≤100-line project state digest read first in every workflow session. Tracks current position, recent decisions, blockers, and blocking constraints. Template: `.magic/templates/state.md`. Utility: `.magic/scripts/update-state.js`.
131
+ - **Session Continuity (HANDOFF.json)**: Structured cross-session handoff mechanism. Template: `.magic/templates/handoff.json`. Enables zero-prompt resume from exact position with required reading lists and constraint acknowledgment.
132
+ - **Pause Workflow (`pause.md`)**: New `/magic.pause` workflow that snapshots session state into `HANDOFF.json` and sets `STATE.md` status to `Paused`. Supports automatic trigger at POOR context tier.
133
+ - **Phase Frontmatter**: YAML dependency metadata block in `phase.md` template (`requires`, `provides`, `key_files`, `patterns_established`, `subsystem`, `duration_minutes`). Enables machine-readable inter-phase dependency tracking.
134
+ - **Canonical References**: New mandatory `## Canonical References` section in `spec.md` template. Forces downstream agents to bind to specific stable file paths instead of relying on memory. Audit checks added to `analyze.md` and `spec.md` checklists.
135
+ - **Context Quality Tiers**: Adaptive agent behaviour guidance (PEAK/GOOD/DEGRADING/POOR) based on context window utilization. Added to `task.md` workflow header.
136
+ - **Resume Detection**: Integrated into `context.md` Post-Resolution chain (Priority 3-4). Automatically detects paused sessions and resumes from recorded position.
137
+ - **Pause Propagation**: `run.md` Logic Guard that auto-saves state when all phase tasks are blocked.
138
+
139
+ ### Changed
140
+
141
+ - **`context.md`**: Extended Post-Resolution chain with STATE.md loading (Priority 3) and Resume Detection (Priority 4).
142
+ - **`init.md`**: STATE.md creation added to init steps, structure map, and completion checklist.
143
+ - **`run.md`**: Added Live Memory invariant (2.5), STATE Sync in Update step, Frontmatter Update in Phase Completion, and Pause Propagation guard.
144
+ - **`task.md`**: Added Context Quality Guidance, Phase Frontmatter generation instructions, State Init/Update step, and Dependency Read from frontmatter.
145
+ - **`analyze.md`**: Added `CANONICAL_MISSING` audit check for Stable specs without Canonical References section.
146
+ - **`spec.md`**: Added Canonical References validation to Task Completion Checklist — blocks Stable promotion if section is empty.
147
+
148
+ ## [1.5.142] - 2026-04-09
149
+
150
+ ### Changed
151
+
152
+ - **License**: Changed project license from MIT to Apache License 2.0.
153
+
154
+ ## [1.5.141] - 2026-04-08
155
+
156
+ ### Removed
157
+
158
+ - **CODEX.toml**: Completely removed `CODEX.toml` from the engine initialization scripts and placeholders as it is not required by any supported agent.
159
+
160
+ ## [1.5.140] - 2026-04-08
161
+
162
+ ### Fixed
163
+
164
+ - **Engine Init Portability**: Refactored `setup_unix.sh` to use relative symlinks and removed `realpath -m` dependency, improving compatibility with macOS and older Linux/Unix systems.
165
+ - **Git Index Integrity**: Fixed a bug in `magic.dev:init` where development workflows (`magic.dev.*`) were incorrectly removed from the git index during setup.
166
+
167
+ ## [1.5.139] - 2026-04-07
168
+
169
+ ### Added
170
+
171
+ - **Universal Skill Wrappers**: Implemented `sync-skills.js` to automatically project workflows into universal agent skills (`SKILL.md`).
172
+ - **Engine Integration**: Integrated skill synchronization into `init.js` and `update-engine-meta.js` (C14). All workflow changes now automatically update the agent's tool surface.
173
+ - **Regression Testing**: Added `T190 — Skill Projection Parity` to the test suite.
174
+
175
+ ## [1.5.136] - 2026-04-07
176
+
177
+ ### Added
178
+
179
+ - **Documentation Hygiene Pass**: Added a project-wide hygiene pass to `update-project-meta.js` that automatically fixes MD012 (multiple consecutive blank lines) in all core documentation files.
180
+ - **Robust Registry Logic**: Fixed a bug in `sync-docs.js` where the workspace registry extraction would grab trailing content (Document History) if the `## Meta` section was missing.
181
+
182
+ ## [1.5.135] - 2026-04-07
183
+
184
+ ### Meta
185
+
186
+ - **Engine Sync**: Performed project hygiene sync, updated documentation, and validated hardlink integrity (C14).
187
+
188
+ ## [1.5.134] - 2026-04-07
189
+
190
+ ### Added
191
+
192
+ - **Skill Projection Automation**: Integrated `sync-skills.js` directly into `update-engine-meta.js`. Engine core changes now automatically regenerate Skill wrappers for Claude and Gemini (C14).
193
+ - **Distribution Guide**: Created `docs/distribution.md` documenting the separation between User Bundle, Dev Instruments, and Internal Engine files.
194
+
195
+ ### Changed
196
+
197
+ - **History Reorganization**: Cleaned up and organized the `history/` directory. History files now follow a standardized naming convention and are updated with a smart condensing logic for version ranges.
198
+ - **Agent Rules (AGENTS.md)**: Updated Project Anatomy to include the `skills/` compatibility layer and corrected the hardlink integrity check (now 5 files).
199
+
200
+ ## [1.5.132] - 2026-04-04
201
+
202
+ ### Changed
203
+
204
+ - **Internationalization (En-En)**: Translated remaining Russian instructions in `docs/checksums.md` to English.
205
+ - **Engine Versioning**: Synchronized all manifest files with the base version `1.5.132` (C14).
206
+
207
+ ## [1.5.131] - 2026-04-04
208
+
209
+ ### Changed
210
+
211
+ - **Internationalization (En-En)**: Fixed remaining Russian examples in `.magic/analyze.md` that were missed in the previous version sync.
212
+ - **Engine Versioning**: Synchronized all manifest files with the base version `1.5.131` (C14).
213
+
214
+ ## [1.5.130] - 2026-04-04
215
+
216
+ ### Changed
217
+
218
+ - **Internationalization (En-En)**: Translated all remaining Russian examples and rule titles to English across the engine core (`.magic/`) to ensure a consistent, professional English-only codebase (Rule 3.1).
219
+ - Translated constitutional rule titles in `RULES.md` (e.g., `C12 — Quarantine Cascade`).
220
+ - Updated simulation test suite (`suite.md`) to reflect translated inputs and expected output strings.
221
+
222
+ ### Meta
223
+
224
+ - **Automated Update**: Engine version bumped to `1.5.130`, history updated, and checksums regenerated (C14).
225
+
226
+ ## [1.5.129] - 2026-04-03
227
+
228
+ ### Changed
229
+
230
+ - **Structural Harmonization**: Refactored `retrospective.md` to use header-based logic. This resolves `MD029` (ordered list prefix) and `MD007` (list indentation) warnings caused by complex content and personification blocks (C24) breaking list continuity. Fixed sequential numbering (1, 2, 3, 4, 5, 2 -> 1, 2, 3, 4, 5, 6, 7).
231
+ - **C24 Independent Analyst**: Upgraded the persona block in `retrospective.md` to a dedicated sub-heading for better visibility and structural compliance.
232
+
233
+ ### Meta
234
+
235
+ - **Automated Update**: Engine version bumped to `1.5.129`, history updated, and checksums regenerated (C14).
236
+
237
+ ## [1.5.128] - 2026-04-03
238
+
239
+ ### Fixed
240
+
241
+ - **Markdown Lint (MD012)**: Fixed a recurring issue where `CONTRIBUTING.md` would be regenerated with multiple consecutive blank lines. Added `.trim()` to `{{workflows_table}}` placeholder in `sync-docs.js` to ensure proper spacing between the table and the following section.
242
+ - **Engine Versioning**: Synchronized engine version across all manifests and documentation (C14).
243
+
244
+ ## [1.5.126] - 2026-04-03
245
+
246
+ ### Added
247
+
248
+ - **C24 — Unified Role-Switching Gate**: Expanded the mandatory internal review system into a unified constitutional rule across all key SDD workflows (Spec, Task, Run, Retro, Analyze, Rule, Simulate).
249
+ - **Workflow Personas**: Integrated 7 specialized personas (Critic, Skeptic, QA, Analyst, Auditor, Reviewer) to eliminate cognitive bias and ensure rigorous evidence-based verification before any artifact is finalized.
250
+ - **Structural Harmonization**: Refactored workflow steps in `analyze.md`, `rule.md`, and `simulate.md` to use header-based logic, resolving deep-seated markdown lint errors caused by intervening non-list elements.
251
+
252
+ ## [1.5.120] - 2026-04-03
253
+
254
+ ### Added
255
+
256
+ - **C24 — Unified Role-Switching Gate**: Expanded the mandatory internal review system into a unified constitutional rule across all key SDD workflows. This forces the agent to adopt specialized personas to eliminate cognitive bias before artifacts are finalized:
257
+ - **Spec Workflow**: Persona **Project Critic** (L1 tech-neutrality, invariant completeness).
258
+ - **Task Workflow**: Persona **Planning Skeptic** (Optimism bias detection, dependency risk analysis).
259
+ - **Run Workflow**: Persona **QA Tester** (Invariant verification, boundary condition audit).
260
+ - **Workflow Integration**: Hardened `.magic/spec.md`, `.magic/task.md`, and `.magic/run.md` with explicit role-based checkpoints and updated completion checklists.
261
+ - **Rules Versioning**: Updated `RULES.md` to version 1.5.126 with the expanded C24 definition.
262
+
263
+ ## [1.5.115] - 2026-04-02
264
+
265
+ ### Added
266
+
267
+ - **Installer `--dev` Flag**: Implemented a comprehensive development mode across Node.js and Python installers.
268
+ - Enabled installation/synchronization of development-specific instruments (simulation workflows, testing suites, engine scripts).
269
+ - Added `devSkills` registry to `installers/config.json` for canonical tracking of dev agent skills.
270
+ - Hardened update logic to ensure dev instruments are correctly synchronized when `--dev` is provided during an update.
271
+
272
+ ## [1.5.114] - 2026-04-02
273
+
274
+ ### Changed
275
+
276
+ - **Core Invariant #2 (Prohibitions)** in `spec.md`: Refined the "No code in specs" rule to explicitly permit **Technical Contracts** (interfaces, types, API schemas) and **Reference Snippets** (marked as `[REFERENCE]`). This ensures architectural precision while maintaining the prohibition on functional implementation code before the `run` phase.
277
+ - **Task Completion Checklist**: Updated to reflect the permission of contracts and references in specifications.
278
+
279
+ ### Meta
280
+
281
+ - **Automated Update**: Engine version bumped to `1.5.114`, history updated, and checksums regenerated (C14).
282
+
283
+ ## [1.5.112] - 2026-04-02
284
+
285
+ ### Added
286
+
287
+ - **Anti-Fabrication Rule (Invariant 6)** in `simulate.md`: New Core Invariant that legitimizes `0 rough edges` as a valid outcome and mandates evidence-linked claims (file, line, verbatim quote, verification command) for every finding. Findings without evidence are automatically INVALID.
288
+ - **Pre-flight Hard Gate** in `simulate.md`: Upgraded Pre-flight from "recommended" to a non-negotiable blocking HALT. Simulations without recorded `check-prerequisites` output are INVALID.
289
+ - **Read-Before-Claim Gate** in `simulate.md`: New mandatory Grounding Phase requiring all target workflow files to be read (with line counts recorded) before any analysis begins. Claims about unread files are automatically INVALID.
290
+ - **Regression Tests (T185–T189)**: 5 new scenarios covering Explore Mode write isolation (T185), Pre-flight Hard Gate enforcement (T186), Evidence-Linked Claims validation (T187), Null-Result Acceptance (T188), and Read-Before-Claim Gate (T189).
291
+
292
+ ### Fixed
293
+
294
+ - **Zero-Prompt Parity**: Aligned `init.md` and `analyze.md` Core Invariant #1 with the canonical cascade formula used by all other workflow files, eliminating sync risk from divergent wording.
295
+ - **Script History Leak**: Fixed `executor.js` Auto-Detect creating spurious history files for scripts in `scripts/` directory (e.g., `sync-skills.md`). Scripts are now tracked via checksums but inherit the `--workflow` flag instead of getting standalone history entries.
296
+ - **Orphan Cleanup**: Removed `history/sync-skills.md` — a phantom artifact created by the above bug.
297
+
298
+ ### Meta
299
+
300
+ - **Automated Update**: Engine version bumped to `1.5.112`, history updated, and checksums regenerated (C14).
301
+
302
+ ## [1.5.105] - 2026-03-31
303
+
304
+ ### Fixed
305
+
306
+ - **Engine History**: Resolved a ReferenceError in `executor.js` where `automatedMsg` was used before being defined.
307
+ - **Collapsing Logic**: Improved the history collapsing mechanism to correctly merge both automated and custom messages into compact version ranges.
308
+
309
+ ### Meta
310
+
311
+ - **Automated Update**: Engine version bumped to `1.5.104`, history entries consolidated, and checksums regenerated.
312
+
313
+ ## [1.5.72] - 2026-03-30
314
+
315
+ ### Fixed
316
+
317
+ - **AI Hallucinations**: Rephrased the directive `auto-run .magic/init.md` to `silently execute .magic/init.md (do not prompt user)` across all engine workflows. This prevents intelligent agents from incorrectly proposing the internal `.magic/init.md` script as a user-facing `/magic.init` slash command.
318
+
319
+ ### Meta
320
+
321
+ - **Automated Update**: Engine version bumped to `1.5.72`, history updated, and checksums regenerated (C14).
322
+
323
+ ## [1.5.70] - 2026-03-30
324
+
325
+ ### Changed
326
+
327
+ - **Documentation**: Updated `README.md` and `docs/README.md` to include a mandatory recommendation to run `/magic.analyze` after updating the Magic Spec engine. This ensures that specifications and engine metadata remain synchronized after a core logic update.
328
+
329
+ ### Meta
330
+
331
+ - **Automated Update**: Engine version bumped to `1.5.70`, history updated, and checksums regenerated (C14).
332
+
333
+ ## [1.5.132] - 2026-03-26
334
+
335
+ ### Added
336
+
337
+ - **Gitignore Safety (Invariant 8)** in `analyze.md`: The agent now MUST scan and apply `.gitignore` patterns before any project scan or architecture inference. This prevents `node_modules`, `dist`, `.venv`, and other build artifacts from leaking into the analysis reports or coverage checks.
338
+
339
+ ### Changed
340
+
341
+ - **Stack & Structure**: Refined the initial scan step to build the high-level project map only *after* applying gitignore filters.
342
+
343
+ ### Meta
344
+
345
+ - **Automated Update**: Engine version bumped to `1.5.132`, history updated, and checksums regenerated (C14).
346
+
347
+ ## [1.5.50] - 2026-03-26
348
+
349
+ ### Added
350
+
351
+ - **Anti-Stall Mechanism (Invariant 12)**: Solved the "AI holds specs in mind" issue (reported by user). The agent is now forced to write a `Draft` spec if it asks more than one clarifying question without file creation. Added `<!-- TBD -->` inline markers for ambiguous sections.
352
+ - **Mode Transition Protocol**: Defined explicit triggers to exit `Explore Mode` and enter `Dispatch Mode` automatically (3+ topics, confirmation words, or 2nd idea exchange in Trust Mode).
353
+ - **Non-Blocking Dispatch Notice**: Reframed "Notice of Intent" as a statement of action rather than a question to prevent infinite loops.
354
+
355
+ ### Changed
356
+
357
+ - **Analysis Mode Scope**: Strictly limited the "do not modify specs/registry" prohibition to `Project Analysis Delegation` mode, allowing normal `Dispatch` to proceed without friction.
358
+ - **Workflow Wrapper**: Updated `.agents/workflows/magic.spec.md` to align with the new non-blocking exploration logic.
359
+
360
+ ### Meta
361
+
362
+ - **Automated Update**: Engine version bumped to `1.5.50`, history updated, and checksums regenerated (C14).
363
+
364
+ ## [1.5.49] - 2026-03-25
365
+
366
+ ### Added
367
+
368
+ - **Config Drift Guard**: `check-prerequisites` now detects uncommitted manual changes to `RULES.md` via `git diff` and emits a non-blocking `CONFIG_DRIFT` advisory warning. Supports workspace-specific `RULES.md` per C22. Gracefully skips when git is unavailable.
369
+ - **Init Workflow**: Added Config Drift Advisory sub-step to pre-flight check (show diff / proceed / restore options).
370
+ - **Test Suite**: Added cognitive tests T168-T170 for config drift detection (drift present, no git, workspace C22). Suite version bumped to 1.9.51.
371
+ - **Engine Spec**: New `config-drift-guard.md` specification (Stable, L1) in engine workspace.
372
+
373
+ ## [1.5.48] - 2026-03-24
374
+
375
+ ### Added
376
+
377
+ - **Publish Workflow**: Restored `.agents/workflows/publish.md` for engine maintenance and registry publishing.
378
+ - **History Tracking**: Initialized history for `magic.analyze` and `magic.dev.simulate` wrappers to ensure full auditability.
379
+
380
+ ### Changed
381
+
382
+ - **Version Synchronization**: Unified project version to `1.5.132` across all manifests (`package.json`, `pyproject.toml`, and installer init files) and the `.magic/.version` engine core.
383
+ - **Instruction Density**: Refined `.magic/simulate.md` (Context Bleed Warning) to remove vague qualifiers ("high-confidence" -> "strictly unbiased"), reaching a density score of 10/10.
384
+ - **Engine Integrity**: Optimized `generate-checksums.js` to exclude the `.checksums` file from its own mapping, preventing confusion and unstable hash values.
385
+
386
+ ### Fixed
387
+
388
+ - **Testing Logic**: Corrected `run_tests.py` to properly set `PYTHONPATH` for Python installer subprocesses and fixed an `os.environ` access bug.
389
+ - **Sandbox Cleanup**: Removed dev-only `simulate.md` from installer test sandbox.
390
+ - **RULES Template**: Added missing conventions C18-C23 to `init.js` RULES.md generator.
391
+ - **Python Installer**: Fixed `_resolve_package_version()` to read actual package version.
392
+ - **Engine Scripts**: Deduplicated `workspace.json` reads in `executor.js`.
393
+ - **History Cleanup**: Removed legacy `audit.md` and `docs.md` files from `.magic/history/`.
394
+
395
+ ## [1.5.30] - 2026-03-24
396
+
397
+ ### Fixed
398
+
399
+ - **Version Synchronization**: Unified project version across `package.json` (was 1.5.0), `pyproject.toml` (was 1.4.162), and `__init__.py` (was 1.4.162) to a single `1.5.30`. Previously 5 different versions existed across 5 sources.
400
+ - **CONTEXT.md**: Regenerated stale context file (was 9 days old).
401
+
402
+ ## [1.5.29] - 2026-03-16
403
+
404
+ ### Added
405
+
406
+ - **Argument Routing (A–D)** for `task.md` and `run.md`: Both workflows now accept optional arguments — workspace name, directive text, or both. Consistent with `analyze.md` pattern. Includes Workspace Fallback, Disambiguation, and Handoff Propagation rules.
407
+ - **T4 Inline Guards** in `spec.md`: When spec workflow captures a standing rule via T4 trigger ("remember that..."), it now applies Tier Routing (global vs workspace RULES.md), Duplication Check (across both tiers), and Constitutional Guard (§1–6 protection) — matching `rule.md` safety guarantees without breaking T4's "Apply Immediately" semantics.
408
+ - **Regression Tests (T153–T161)**: 9 new scenarios covering argument routing (scoped planning, workspace fallback, disambiguation, targeted task/phase execution, cross-workflow handoff propagation) and T4 inline guards (tier routing, duplication detection, constitutional block).
409
+
410
+ ### Changed
411
+
412
+ - **AGENTS.md**: Clarified C14 Enforcement scope — explicitly covers all `.magic/` content (workflows, scripts, templates, tests, config), not just workflow files. Added description of what `update-engine-meta` does (bumps `.version`, regenerates `.checksums`).
413
+ - **`run.md` Argument Routing**: Detection column harmonized with `analyze.md` — accepts both quoted text and non-workspace tokens (e.g., unquoted `T-1A01` or `phase-2`).