magic-spec 1.5.48 → 1.5.132

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,213 +1,221 @@
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.48] - 2026-03-24
9
-
10
- ### Added
11
-
12
- - **Publish Workflow**: Restored `.agents/workflows/publish.md` for engine maintenance and registry publishing.
13
- - **History Tracking**: Initialized history for `magic.analyze` and `magic.dev.simulate` wrappers to ensure full auditability.
14
-
15
- ### Changed
16
-
17
- - **Version Synchronization**: Unified project version to `1.5.47` across all manifests (`package.json`, `pyproject.toml`, `__init__.py`) and the `.magic/.version` engine core.
18
- - **Instruction Density**: Refined `.magic/simulate.md` (Context Bleed Warning) to remove vague qualifiers ("high-confidence" -> "strictly unbiased"), reaching a density score of 10/10.
19
- - **Engine Integrity**: Optimized `generate-checksums.js` to exclude the `.checksums` file from its own mapping, preventing confusion and unstable hash values.
20
-
21
- ### Fixed
22
-
23
- - **Testing Logic**: Corrected `run_tests.py` to properly set `PYTHONPATH` for Python installer subprocesses and fixed an `os.environ` access bug.
24
- - **Sandbox Cleanup**: Removed dev-only `simulate.md` from installer test sandbox.
25
- - **RULES Template**: Added missing conventions C18-C23 to `init.js` RULES.md generator.
26
- - **Python Installer**: Fixed `_resolve_package_version()` to read actual package version.
27
- - **Engine Scripts**: Deduplicated `workspace.json` reads in `executor.js`.
28
- - **History Cleanup**: Removed legacy `audit.md` and `docs.md` files from `.magic/history/`.
29
-
30
- ## [1.5.30] - 2026-03-24
31
-
32
- ### Fixed
33
-
34
- - **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.
35
- - **CONTEXT.md**: Regenerated stale context file (was 9 days old).
36
-
37
- ## [1.5.29] - 2026-03-16
38
-
39
- ### Added
40
-
41
- - **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.
42
- - **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.
43
- - **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).
44
-
45
- ### Changed
46
-
47
- - **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`).
48
- - **`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`).
49
-
50
- ## [1.4.162] - 2026-03-12
51
-
52
- ### Added
53
-
54
- - **Session Isolation Rule (C17)**: Formalized the requirement for "New Chat" sessions between major workflow transitions (Spec → Task → Run) to prevent context bleed-over and hallucinations.
55
- - **Multi-Workspace Support (C22)**: Enhanced `check-prerequisites.js` and `init.js` to support nested workspaces with inherited root rules.
56
- - **Model-Aware History**: Updated engine history schema to include AI Model information, improving auditability of generated code.
57
-
58
- ### Changed
59
-
60
- - **Task Checklist Logic**: Consolidated implementation checklists into `TASKS.md` for better execution tracking and status reporting.
61
- - **Gitignore Resilience**: Improved installers to automatically manage `.gitignore` entries for `.magic/` and `.agents/` directories with idempotent updates.
62
- - **Onboarding Safety**: Added production data collision guards to `onboard.md` to prevent accidental overwrites of existing project plans.
63
-
64
- ### Fixed
65
-
66
- - **Error Reporting**: Enhanced `check-prerequisites.js` with structured, actionable JSON error suggestions.
67
- - **Path Handling**: Fixed Windows-specific path issues in installer scripts.
68
-
69
- ## [1.4.162] - 2026-03-03
70
-
71
- ### Added
72
-
73
- - **Regression Test T85**: Verifies mandatory engine integrity HALT when `.magic/` files are tampered (C1 enforcement).
74
-
75
- ### Changed
76
-
77
- - **Engine Integrity Halt**: Upgraded `check-prerequisites.js` to set `ok: false` on checksum mismatches, ensuring a hard HALT during pre-flight checks.
78
- - **History Auto-Heal**: Enhanced `executor.js` to automatically recreate the `.magic/history/` directory and missing history files if deleted.
79
-
80
- ### Fixed
81
-
82
- - **Resilient Logic**: Improved `check-prerequisites.js` to distinguish between critical engine integrity (HALT) and project data drift (WARNING), preserving self-healing capabilities.
83
-
84
- ## [1.4.162] - 2026-03-02
85
-
86
- ### Changed
87
-
88
- - **Executor Refactor**: Improved `executor.js` structure by replacing global `return` with an `else` block for better readability and standard Node.js practices.
89
- - **Test Suite Cleanup**: Removed duplicate T54 "Spec Rename History Immutability" scenario from `suite.md`.
90
-
91
- ### Meta
92
-
93
- - **Automated Update**: Sequential patch bump, history update, and checksum regeneration via `update-engine-meta`.
94
-
95
- ## [1.4.5] - 2026-03-01
96
-
97
- ### Added
98
-
99
- - **Engine Versioning Protocol (C14)**: Established a mandatory convention requiring a patch version bump in `.magic/.version` whenever core engine files are modified. Integrated checkpoints into all primary workflows (`run.md`, `spec.md`, `rule.md`).
100
- - **History Refactoring**: Extracted "Document History" from core workflow markdown files into a dedicated `.magic/history/` directory. This significantly reduces token consumption during agentic operations while preserving audit trials.
101
- - **Node.js Script Transition**: Fully replaced legacy `.sh` and `.ps1` initialization and utility scripts with cross-platform Node.js implementations (`init.js`, `generate-context.js`, etc.).
102
-
103
- ### Changed
104
-
105
- - **Installer Configuration**: Optimized `installers/config.json` to exclude history files from distribution and prioritize Node.js scripts.
106
- - **Engine Security**: `generate-checksums.js` and `executor.js` now explicitly skip history files to prevent non-functional changes from triggering integrity warnings.
107
- - **Template System**: `init.js` now automatically injects the new C14 protocol into target project constitution files (`RULES.md`).
108
-
109
- ### Fixed
110
-
111
- - **Syntax Hygiene**: Cleaned up redundant markdown artifacts (terminal backticks) in core workflow files.
112
- - **Workflow Integrity**: Fixed accidental history duplication in `spec.md`.
113
-
114
- ## [1.4.3] - 2026-03-01
115
-
116
- ### Added
117
-
118
- - **Smart Adapter Updates**: Both Python and Node.js installers now seamlessly verify and update adapter `.mdc`/`.toml` wrapper files during `--update`.
119
- - **Smart Update Conflict Resolution**: When users manually modify `.cursor/rules/*` wrapper files in their project, the `--update` command now detects the modifications. Users can intelligently choose to skip updates for specific conflicting adapter files, preserving their changes while updating the core `.magic` engine logic.
120
-
121
- ### Fixed
122
-
123
- - **Updater Integrity**: Modified files that are bypassed during an update via `[s] Skip modified files` now persist their original hashes so they don't get silently overwritten in subsequent updates.
124
- - **Testing Logic**: Fixed an issue in the `run_tests.py` exhaustive test suite section where failures during adapter testing cycles were mistakenly swallowed, reporting a false "All tests completed successfully".
125
-
126
- ## [1.4.1] - 2026-03-01
127
-
128
- ### Fixed
129
-
130
- - **Localization**: Translated remaining Russian text in `README.md` Mermaid diagrams to English.
131
-
132
- ## [1.4.0] - 2026-03-01
133
-
134
- ### Added
135
-
136
- - **Smart Sync Optimization (AOP)** in `analyze.md`: Automated detection of manual renames during project re-analysis. If an orphaned specification matches a new uncovered directory (>80% similarity or title match), it triggers a `[RESCUE]` action instead of delete/create cycle.
137
- - **Manual Rename Rescue** in `spec.md`: Protocol to globally update references (INDEX, PLAN, TASKS) when a specification file is moved/renamed, preserving task progress.
138
- - **Regression Tests (T48–T51)**: Added coverage for Engine Integrity guards, Analysis Depth Control, and Smart Sync mechanisms.
139
-
140
- ### Changed
141
-
142
- - **Test Suite Synchronization**: The `suite.md` version is now synchronized with the core engine version to prevent metadata confusion.
143
-
144
- ## [1.3.2] - 2026-02-28
145
-
146
- ### Added
147
-
148
- - **Project Analysis Workflow** (`.magic/analyze.md`): Powerful reverse-engineering tool. Delegated automatically from `spec.md` or directly via `/magic.analyze`. Supports scanning existing source code to generate structured proposals with paired Layer 1 (Concept) and Layer 2 (Implementation) specifications. Features Depth Control for massive codebases.
149
- - **Bootstrapping Exemption**: Special rules added to bypass standard Draft/RFC phases and create "Stable" specs directly when adopting existing working code into the SDD system.
150
- - **Improv Mode (Live Simulation)** in `simulate.md`: Added ability for the simulation workflow to synthesize "crisis scenarios" (e.g., INDEX.md desync) and perform full SDK lifecycle stress tests end-to-end on its own, functioning as a fallback if the static test suite is missing.
151
-
152
- ### Changed
153
-
154
- - Expanded Test Suite (`.magic/tests/suite.md`) from 28 to 34 scenarios (+6), fully covering Analyze gap detection, L1/L2 generation asserts, depth control limits, and the missing test suite fallback.
155
-
156
- ## [1.3.1] - 2026-02-27### Added
157
-
158
- - **Workflow Test Suite** (`.magic/tests/suite.md`): 16 predefined regression test scenarios covering all 8 engine workflows. Run via `/magic.dev.simulate test`.
159
- - **Test Suite mode** in `simulate.md`: reads `suite.md` and reports PASS/FAIL for each scenario.
160
- - **Template directory** (`.magic/templates/`): extracted inline templates from core workflow files:
161
- - `specification.md` Specification Template (from `spec.md`)
162
- - `plan.md` — PLAN.md Template (from `task.md`)
163
- - `tasks.md` — TASKS.md + phase-{n}.md Templates (from `task.md`)
164
- - `retrospective.md` — RETROSPECTIVE.md Template (from `retrospective.md`)
165
-
166
- ### Changed
167
-
168
- - **AOP Optimization**: Compressed verbose prose in `spec.md` (Post-Update Review, Audit/Consistency Reports). ~17% token reduction across core workflows.
169
- - **Stress-test hardening** across all workflows:
170
- - `spec.md`: Intra-input self-contradiction guard, Deprecation Cascade (scan Related Specs for stale refs)
171
- - `task.md`: Circular Dependency Guard, Phantom Done-task preservation (Archive not Cancel), Deprecated Done-task preservation, Convention Sync wording fix
172
- - `run.md`: Mode Guard — HALT if execution mode not in RULES.md §7
173
- - `rule.md`: Duplication Guard, convention-not-found handler, Workflow Dependency Check in Remove Impact Analysis
174
- - `simulate.md`: Checksums mismatch upgraded to HALT, Checksum Rule (generate after approval only)
175
- - `onboard.md`: Production collision HALT with backup/cancel, re-entry checks production PLAN.md
176
- - `init.md`: Expanded post-init verification to all 5 artifacts, Maintainer Note for hardcoded RULES.md sync
177
-
178
- ### Fixed
179
-
180
- - Template references now explicitly point to `.magic/templates/*.md` in creation steps of `spec.md`, `task.md`, `retrospective.md`, and `onboard.md`.
181
-
182
- ## [1.3.0] - 2026-02-25
183
-
184
- ### Added
185
-
186
- - **Full support for abstract environment templates** with automatic resolution (`{ARGUMENTS}`) across all CLIs.
187
- - **Introduced `.magicrc`** for persistence of selected environments and their auto-detection.
188
- - **Two-level automatic Changelog generation** (by accumulating `Changes` blocks within tasks).
189
- - **Added new CLI commands:** `info`, `--check`, `--list-envs`, and `--eject`.
190
- - **Introduced core version tracking** within the project via the `.magic/.version` file.
191
-
192
- ### Changed
193
-
194
- - **Architecture:** Restructured the repository into a two-level model (root = source of truth + installers), and removed the `core/` folder to eliminate duplication.
195
- - **Node Installer:** Completely overhauled the installation mechanism (it now uses compiled files from NPM instead of downloading them from GitHub, eliminating Path Traversal vulnerabilities).
196
- - **Python Installer:** Implemented an isolated package based on `hatchling` (via shared-data) without external dependencies on GitHub.
197
- - **Documentation:** Separated `README.md` strategies (different focuses for GitHub, NPM package, and PyPI package).
198
- - **Update Logic:** Improved `.magic` update logic to be safer (old folders are now moved to `.magic/archives/` rather than simply deleted).
199
-
200
- ## [1.3.0] - 2026-02-23
201
-
202
- ### Added
203
-
204
- - **Handoff integrations** (`magic.*.md`): Introduced explicit handoff blocks across all agent workflow wrappers to guide next-steps effortlessly.
205
- - **Task Engine Enhancement:** Integrated User Stories generation parsing into `.magic/task.md` and suppressed user priority prompts using `RULES.md C4`.
206
- - **System Automation Hooks:** Added `generate-context` script hooks into `task.md` and `run.md` post-write triggers.
207
- - **Context Automation Script:** Created `generate-context.sh` and `generate-context.ps1` to assemble `CONTEXT.md` from PLAN, workspace trees, and changelogs.
208
- - **Spec Engine Protections:** Added strict Explore Mode Safety rules and Delta Editing constraints for spec updates over 200 lines to `.magic/spec.md`.
209
- - **Explore Hints:** Updated `.agents/workflows/magic.spec.md` UI wrapper with tips to use Delta Constraints and strict read-only explore mode.
210
- - **CLI Doctor Command (Node/Python):** Implemented `--doctor` and `--check` parsing in installers, executing the prerequisite script and outputting a formatted terminal validation report.
211
- - **Interactive Onboarding Script:** Created `.magic/onboard.md` to guide new developers through building a toy "console logger" specification.
212
- - **Onboarding Wrapper:** Added `.agents/workflows/magic.onboard.md` to trigger the interactive onboarding tutorial seamlessly.
213
- - **Prerequisite Validation:** Created `check-prerequisites.sh` and `check-prerequisites.ps1` parsing `INDEX.md` and returning valid JSON results.
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`).
package/README.md CHANGED
@@ -36,7 +36,7 @@ After running the installer, your project directory will be augmented with the f
36
36
 
37
37
  ```plaintext
38
38
  root-project/
39
- ├── .agents/workflows/ # Slash commands wrapper (e.g., magic.spec, magic.task)
39
+ ├── .agents/workflows/ # Slash commands wrapper (e.g., magic.spec, magic.task)
40
40
  ├── .magic/ # The SDD Engine (workflow logic and scripts - read-only)
41
41
  └── .design/ # Your Project Design Workspace (INDEX.md, RULES.md, PLAN.md)
42
42
  ```
@@ -237,7 +237,7 @@ npx magic-spec@latest --update
237
237
  ```
238
238
 
239
239
  > [!TIP]
240
- > The update process preserves your `.design/` workspace and automatically creates backups of `.magic/` and `.agents/` folders. If you have modified core engine files, the installer will detect conflicts and ask for your preference (overwrite, skip, or abort).
240
+ > The update process preserves your `.design/` workspace and automatically creates backups of `.magic/` and `.agents/` folders. If you have modified core engine files, the installer will detect conflicts and ask for your preference (overwrite, skip, or abort). **After updating Magic Spec, it is highly recommended to run the `/magic.analyze` command to ensure your project's specifications and engine metadata are fully synchronized.**
241
241
 
242
242
  ### Post-Install: `.gitignore`
243
243
 
@@ -320,4 +320,4 @@ Distributed under the [MIT License](./LICENSE).
320
320
 
321
321
  ## 📊 Project Status
322
322
 
323
- **Active Development** (v1.x). We are constantly refining the SDD engine based on real-world usage.
323
+ **Active Development** (v1.5.129). We are constantly refining the SDD engine based on real-world usage.
@@ -16,6 +16,12 @@
16
16
  "magic.spec",
17
17
  "magic.task"
18
18
  ],
19
+ "devWorkflows": [
20
+ "magic.dev.simulate"
21
+ ],
22
+ "devSkills": [
23
+ "magic.dev.simulate"
24
+ ],
19
25
  "magicFiles": [
20
26
  "analyze.md",
21
27
  "init.md",
@@ -31,11 +37,17 @@
31
37
  "scripts/generate-checksums.js",
32
38
  "scripts/generate-context.js",
33
39
  "scripts/init.js",
40
+ "scripts/sync-skills.js",
34
41
  "templates/plan.md",
35
42
  "templates/retrospective.md",
36
43
  "templates/spec.md",
37
44
  "templates/tasks.md"
38
45
  ],
46
+ "devMagicFiles": [
47
+ "simulate.md",
48
+ "tests/engine.js",
49
+ "tests/suite.md"
50
+ ],
39
51
  "download": {
40
52
  "timeoutMs": 10000,
41
53
  "tempPrefix": "magic-spec-tmp-"
@@ -48,6 +60,7 @@
48
60
  "targets": [
49
61
  ".magic",
50
62
  ".agents",
63
+ "skills",
51
64
  "installers"
52
65
  ]
53
66
  },
@@ -55,10 +68,14 @@
55
68
  "versionFiles": [
56
69
  "package.json",
57
70
  "pyproject.toml",
58
- "installers/python/magic_spec/__init__.py"
71
+ "installers/python/magic_spec/__init__.py",
72
+ ".magic/.version",
73
+ ".magic/.checksums"
59
74
  ],
60
75
  "docsTargets": [
61
- "CHANGELOG.md"
76
+ "CHANGELOG.md",
77
+ "README.md",
78
+ "docs/README.md"
62
79
  ]
63
80
  },
64
81
  "tests": {
@@ -70,12 +70,16 @@ function loadInstallerConfig() {
70
70
  const defaultExt = requireNonEmptyString(parsed.defaultExt, 'defaultExt');
71
71
  const workflows = Array.isArray(parsed.workflows) ? parsed.workflows : null;
72
72
  if (!workflows) {
73
- failConfig("field 'workflows' must be an array of strings");
73
+ failConfig("field 'workflows' must be a non-empty array");
74
74
  }
75
+ const devWorkflows = Array.isArray(parsed.devWorkflows) ? parsed.devWorkflows : [];
76
+
75
77
  const magicFiles = Array.isArray(parsed.magicFiles) ? parsed.magicFiles : null;
76
78
  if (!magicFiles) {
77
- failConfig("field 'magicFiles' must be an array of strings");
79
+ failConfig("field 'magicFiles' must be a non-empty array");
78
80
  }
81
+ const devMagicFiles = Array.isArray(parsed.devMagicFiles) ? parsed.devMagicFiles : [];
82
+ const devSkills = Array.isArray(parsed.devSkills) ? parsed.devSkills : [];
79
83
 
80
84
  const designDir = requireNonEmptyString(parsed.designDir, 'designDir');
81
85
  const versionFile = requireNonEmptyString(parsed.versionFile, 'versionFile');
@@ -95,7 +99,10 @@ function loadInstallerConfig() {
95
99
  historyDir,
96
100
  defaultExt,
97
101
  workflows,
102
+ devWorkflows,
98
103
  magicFiles,
104
+ devMagicFiles,
105
+ devSkills,
99
106
  download: { timeoutMs, tempPrefix },
100
107
  userAgent: { node: nodeUserAgent },
101
108
  ejectTargets: parsed.eject.targets
@@ -109,8 +116,11 @@ const ENGINE_DIR = INSTALLER_CONFIG.engineDir;
109
116
  const AGENT_DIR = INSTALLER_CONFIG.agentDir;
110
117
  const WORKFLOWS_DIR = INSTALLER_CONFIG.workflowsDir;
111
118
  const DEFAULT_EXT = INSTALLER_CONFIG.defaultExt;
112
- const WORKFLOWS = INSTALLER_CONFIG.workflows;
113
- const MAGIC_FILES = INSTALLER_CONFIG.magicFiles;
119
+ let WORKFLOWS = [...INSTALLER_CONFIG.workflows];
120
+ let MAGIC_FILES = [...INSTALLER_CONFIG.magicFiles];
121
+ const DEV_WORKFLOWS = INSTALLER_CONFIG.devWorkflows;
122
+ const DEV_MAGIC_FILES = INSTALLER_CONFIG.devMagicFiles;
123
+ const DEV_SKILLS = INSTALLER_CONFIG.devSkills;
114
124
  const DESIGN_DIR = INSTALLER_CONFIG.designDir;
115
125
  const VERSION_FILE = INSTALLER_CONFIG.versionFile;
116
126
  const CHECKSUMS_FILE = INSTALLER_CONFIG.checksumsFile;
@@ -130,6 +140,7 @@ const isListEnvs = args.includes('--list-envs');
130
140
  const isEject = args.includes('--eject');
131
141
  const isFallbackMain = args.includes('--fallback-main');
132
142
  const isLocal = args.includes('--local');
143
+ const isDev = args.includes('--dev');
133
144
  const autoAccept = args.includes('--yes') || args.includes('-y');
134
145
 
135
146
  function parseCsvValues(raw) {
@@ -331,24 +342,16 @@ function installAdapter(sourceRoot, env, adapters, conflictsToSkip = []) {
331
342
  }
332
343
 
333
344
  function runDoctor() {
334
- const isWindows = process.platform === 'win32';
335
- const checkScript = isWindows
336
- ? path.join(cwd, ENGINE_DIR, 'scripts', 'check-prerequisites.ps1')
337
- : path.join(cwd, ENGINE_DIR, 'scripts', 'check-prerequisites.sh');
345
+ const checkScript = path.join(cwd, ENGINE_DIR, 'scripts', 'check-prerequisites.js');
338
346
 
339
347
  if (!fs.existsSync(checkScript)) {
340
- console.error('❌ Error: SDD engine not initialized. Run magic-spec first.');
348
+ console.error('❌ Error: SDD engine not initialized or check-prerequisites.js missing. Run magic-spec first.');
341
349
  process.exit(1);
342
350
  }
343
351
 
344
352
  console.log(`🔍 ${PACKAGE_NAME} Doctor:`);
345
353
  try {
346
- let result;
347
- if (isWindows) {
348
- result = spawnSync('powershell.exe', ['-ExecutionPolicy', 'Bypass', '-File', checkScript, '-json'], { encoding: 'utf-8' });
349
- } else {
350
- result = spawnSync('bash', [checkScript, '--json'], { encoding: 'utf-8' });
351
- }
354
+ const result = spawnSync('node', [checkScript, '--json'], { encoding: 'utf-8' });
352
355
 
353
356
  if (result.error) {
354
357
  console.error('❌ Failed to run doctor prerequisite check:', result.error.message);
@@ -763,6 +766,7 @@ async function main() {
763
766
  console.log(" --env <adapter> Specify environment adapter");
764
767
  console.log(" --<adapter> Shortcut for --env <adapter> (e.g. --cursor)");
765
768
  console.log(" --update Update engine and adapter files");
769
+ console.log(" --dev Install development instruments (simulation, testing)");
766
770
  console.log(" --local Use local project files instead of GitHub");
767
771
  console.log(" --fallback-main Pull payload from main branch");
768
772
  console.log(" --yes, -y Auto-accept prompts");
@@ -775,6 +779,13 @@ async function main() {
775
779
  createBackup();
776
780
  }
777
781
 
782
+ if (isDev) {
783
+ console.log("🛠️ Development instruments enabled.");
784
+ // Append dev workflows and engine files to the active set
785
+ WORKFLOWS = [...WORKFLOWS, ...DEV_WORKFLOWS];
786
+ MAGIC_FILES = [...MAGIC_FILES, ...DEV_MAGIC_FILES];
787
+ }
788
+
778
789
  const versionToFetch = isFallbackMain ? 'main' : version;
779
790
  let sourceRoot = null;
780
791
 
@@ -912,6 +923,39 @@ async function main() {
912
923
  }
913
924
  }
914
925
 
926
+ // If `--dev` is specified during update, ensure dev tools are present
927
+ if (isUpdate && isDev) {
928
+ const srcEng = path.join(sourceRoot, AGENT_DIR);
929
+ const destEng = path.join(cwd, AGENT_DIR);
930
+
931
+ // Sync dev workflows
932
+ const srcWfDir = path.join(srcEng, WORKFLOWS_DIR);
933
+ const destWfDir = path.join(destEng, WORKFLOWS_DIR);
934
+ if (fs.existsSync(srcWfDir)) {
935
+ fs.mkdirSync(destWfDir, { recursive: true });
936
+ for (const wf of DEV_WORKFLOWS) {
937
+ const file = wf + DEFAULT_EXT;
938
+ const sf = path.join(srcWfDir, file);
939
+ if (fs.existsSync(sf)) {
940
+ fs.copyFileSync(sf, path.join(destWfDir, file));
941
+ }
942
+ }
943
+ }
944
+
945
+ // Sync dev skills
946
+ const srcSkillsDir = path.join(srcEng, 'skills');
947
+ const destSkillsDir = path.join(destEng, 'skills');
948
+ if (fs.existsSync(srcSkillsDir)) {
949
+ fs.mkdirSync(destSkillsDir, { recursive: true });
950
+ for (const sk of DEV_SKILLS) {
951
+ const ss = path.join(srcSkillsDir, sk);
952
+ if (fs.existsSync(ss) && fs.statSync(ss).isDirectory()) {
953
+ copyDir(ss, path.join(destSkillsDir, sk));
954
+ }
955
+ }
956
+ }
957
+ }
958
+
915
959
  // 3. Init script
916
960
  if (!isUpdate) {
917
961
  const isWindows = process.platform === 'win32';
@@ -954,6 +998,18 @@ async function main() {
954
998
  console.log(`✅ ${PACKAGE_NAME} updated successfully!`);
955
999
  }
956
1000
 
1001
+ // 3.5. Sync Skill Wrappers
1002
+ const syncScript = path.join(cwd, ENGINE_DIR, 'scripts', 'sync-skills.js');
1003
+ if (fs.existsSync(syncScript)) {
1004
+ console.log('🔄 Projecting Workflows to Skill Wrappers...');
1005
+ const syncResult = spawnSync('node', [syncScript], { cwd });
1006
+ if (syncResult.error || syncResult.status !== 0) {
1007
+ console.warn(`⚠️ Skill synchronization failed: ${syncResult.stderr || syncResult.error?.message}`);
1008
+ } else {
1009
+ console.log('✅ Skills synchronized.');
1010
+ }
1011
+ }
1012
+
957
1013
  // 4. Write version file - [T-2B01]
958
1014
  try {
959
1015
  const versionFileDest = path.join(cwd, ENGINE_DIR, VERSION_FILE);
@@ -963,7 +1019,7 @@ async function main() {
963
1019
  }
964
1020
 
965
1021
  // 5. Auto-update .gitignore
966
- const gitignoreEntries = [ENGINE_DIR];
1022
+ const gitignoreEntries = [ENGINE_DIR, 'skills'];
967
1023
  if (envValues.length > 0) {
968
1024
  for (const env of envValues) {
969
1025
  const adapter = ADAPTERS[env];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "magic-spec",
3
- "version": "1.5.48",
3
+ "version": "1.5.132",
4
4
  "description": "Magic Specification-Driven Development (SDD) Workflow",
5
5
  "author": "Oleg Alexandrov <alexandrovoleg.ru@gmail.com>",
6
6
  "license": "MIT",