magic-spec 1.5.71 → 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
@@ -5,259 +5,217 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
- ## [1.5.70] - 2026-03-30
8
+ ## [1.5.132] - 2026-04-04
9
9
 
10
10
  ### Changed
11
11
 
12
- - **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.
13
-
14
- ### Meta
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).
15
14
 
16
- - **Automated Update**: Engine version bumped to `1.5.70`, history updated, and checksums regenerated (C14).
15
+ ## [1.5.131] - 2026-04-04
17
16
 
18
- ## [1.5.71] - 2026-03-26
17
+ ### Changed
19
18
 
20
- ### Added
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
21
 
22
- - **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.
22
+ ## [1.5.130] - 2026-04-04
23
23
 
24
24
  ### Changed
25
25
 
26
- - **Stack & Structure**: Refined the initial scan step to build the high-level project map only *after* applying gitignore filters.
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.
27
29
 
28
30
  ### Meta
29
31
 
30
- - **Automated Update**: Engine version bumped to `1.5.71`, history updated, and checksums regenerated (C14).
31
-
32
- ## [1.5.50] - 2026-03-26
33
-
34
- ### Added
32
+ - **Automated Update**: Engine version bumped to `1.5.130`, history updated, and checksums regenerated (C14).
35
33
 
36
- - **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.
37
- - **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).
38
- - **Non-Blocking Dispatch Notice**: Reframed "Notice of Intent" as a statement of action rather than a question to prevent infinite loops.
34
+ ## [1.5.129] - 2026-04-03
39
35
 
40
36
  ### Changed
41
37
 
42
- - **Analysis Mode Scope**: Strictly limited the "do not modify specs/registry" prohibition to `Project Analysis Delegation` mode, allowing normal `Dispatch` to proceed without friction.
43
- - **Workflow Wrapper**: Updated `.agents/workflows/magic.spec.md` to align with the new non-blocking exploration logic.
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.
44
40
 
45
41
  ### Meta
46
42
 
47
- - **Automated Update**: Engine version bumped to `1.5.50`, history updated, and checksums regenerated (C14).
43
+ - **Automated Update**: Engine version bumped to `1.5.129`, history updated, and checksums regenerated (C14).
48
44
 
49
- ## [1.5.49] - 2026-03-25
45
+ ## [1.5.128] - 2026-04-03
50
46
 
51
- ### Added
47
+ ### Fixed
52
48
 
53
- - **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.
54
- - **Init Workflow**: Added Config Drift Advisory sub-step to pre-flight check (show diff / proceed / restore options).
55
- - **Test Suite**: Added cognitive tests T168-T170 for config drift detection (drift present, no git, workspace C22). Suite version bumped to 1.9.51.
56
- - **Engine Spec**: New `config-drift-guard.md` specification (Stable, L1) in engine workspace.
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).
57
51
 
58
- ## [1.5.48] - 2026-03-24
52
+ ## [1.5.126] - 2026-04-03
59
53
 
60
54
  ### Added
61
55
 
62
- - **Publish Workflow**: Restored `.agents/workflows/publish.md` for engine maintenance and registry publishing.
63
- - **History Tracking**: Initialized history for `magic.analyze` and `magic.dev.simulate` wrappers to ensure full auditability.
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.
64
59
 
65
- ### Changed
60
+ ## [1.5.120] - 2026-04-03
66
61
 
67
- - **Version Synchronization**: Unified project version to `1.5.71` across all manifests (`package.json`, `pyproject.toml`, `__init__.py`) and the `.magic/.version` engine core.
68
- - **Instruction Density**: Refined `.magic/simulate.md` (Context Bleed Warning) to remove vague qualifiers ("high-confidence" -> "strictly unbiased"), reaching a density score of 10/10.
69
- - **Engine Integrity**: Optimized `generate-checksums.js` to exclude the `.checksums` file from its own mapping, preventing confusion and unstable hash values.
62
+ ### Added
70
63
 
71
- ### Fixed
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.
72
70
 
73
- - **Testing Logic**: Corrected `run_tests.py` to properly set `PYTHONPATH` for Python installer subprocesses and fixed an `os.environ` access bug.
74
- - **Sandbox Cleanup**: Removed dev-only `simulate.md` from installer test sandbox.
75
- - **RULES Template**: Added missing conventions C18-C23 to `init.js` RULES.md generator.
76
- - **Python Installer**: Fixed `_resolve_package_version()` to read actual package version.
77
- - **Engine Scripts**: Deduplicated `workspace.json` reads in `executor.js`.
78
- - **History Cleanup**: Removed legacy `audit.md` and `docs.md` files from `.magic/history/`.
79
-
80
- ## [1.5.30] - 2026-03-24
71
+ ## [1.5.115] - 2026-04-02
81
72
 
82
- ### Fixed
73
+ ### Added
83
74
 
84
- - **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.
85
- - **CONTEXT.md**: Regenerated stale context file (was 9 days old).
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.
86
79
 
87
- ## [1.5.29] - 2026-03-16
80
+ ## [1.5.114] - 2026-04-02
88
81
 
89
- ### Added
82
+ ### Changed
90
83
 
91
- - **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.
92
- - **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.
93
- - **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).
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.
94
86
 
95
- ### Changed
87
+ ### Meta
96
88
 
97
- - **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`).
98
- - **`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`).
89
+ - **Automated Update**: Engine version bumped to `1.5.114`, history updated, and checksums regenerated (C14).
99
90
 
100
- ## [1.4.162] - 2026-03-12
91
+ ## [1.5.112] - 2026-04-02
101
92
 
102
93
  ### Added
103
94
 
104
- - **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.
105
- - **Multi-Workspace Support (C22)**: Enhanced `check-prerequisites.js` and `init.js` to support nested workspaces with inherited root rules.
106
- - **Model-Aware History**: Updated engine history schema to include AI Model information, improving auditability of generated code.
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).
107
99
 
108
- ### Changed
100
+ ### Fixed
109
101
 
110
- - **Task Checklist Logic**: Consolidated implementation checklists into `TASKS.md` for better execution tracking and status reporting.
111
- - **Gitignore Resilience**: Improved installers to automatically manage `.gitignore` entries for `.magic/` and `.agents/` directories with idempotent updates.
112
- - **Onboarding Safety**: Added production data collision guards to `onboard.md` to prevent accidental overwrites of existing project plans.
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.
113
105
 
114
- ### Fixed
106
+ ### Meta
115
107
 
116
- - **Error Reporting**: Enhanced `check-prerequisites.js` with structured, actionable JSON error suggestions.
117
- - **Path Handling**: Fixed Windows-specific path issues in installer scripts.
108
+ - **Automated Update**: Engine version bumped to `1.5.112`, history updated, and checksums regenerated (C14).
118
109
 
119
- ## [1.4.162] - 2026-03-03
110
+ ## [1.5.105] - 2026-03-31
120
111
 
121
- ### Added
112
+ ### Fixed
122
113
 
123
- - **Regression Test T85**: Verifies mandatory engine integrity HALT when `.magic/` files are tampered (C1 enforcement).
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.
124
116
 
125
- ### Changed
117
+ ### Meta
118
+
119
+ - **Automated Update**: Engine version bumped to `1.5.104`, history entries consolidated, and checksums regenerated.
126
120
 
127
- - **Engine Integrity Halt**: Upgraded `check-prerequisites.js` to set `ok: false` on checksum mismatches, ensuring a hard HALT during pre-flight checks.
128
- - **History Auto-Heal**: Enhanced `executor.js` to automatically recreate the `.magic/history/` directory and missing history files if deleted.
121
+ ## [1.5.72] - 2026-03-30
129
122
 
130
123
  ### Fixed
131
124
 
132
- - **Resilient Logic**: Improved `check-prerequisites.js` to distinguish between critical engine integrity (HALT) and project data drift (WARNING), preserving self-healing capabilities.
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.
133
126
 
134
- ## [1.4.162] - 2026-03-02
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
135
132
 
136
133
  ### Changed
137
134
 
138
- - **Executor Refactor**: Improved `executor.js` structure by replacing global `return` with an `else` block for better readability and standard Node.js practices.
139
- - **Test Suite Cleanup**: Removed duplicate T54 "Spec Rename History Immutability" scenario from `suite.md`.
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.
140
136
 
141
137
  ### Meta
142
138
 
143
- - **Automated Update**: Sequential patch bump, history update, and checksum regeneration via `update-engine-meta`.
139
+ - **Automated Update**: Engine version bumped to `1.5.70`, history updated, and checksums regenerated (C14).
144
140
 
145
- ## [1.4.5] - 2026-03-01
141
+ ## [1.5.132] - 2026-03-26
146
142
 
147
143
  ### Added
148
144
 
149
- - **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`).
150
- - **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.
151
- - **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.).
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.
152
146
 
153
147
  ### Changed
154
148
 
155
- - **Installer Configuration**: Optimized `installers/config.json` to exclude history files from distribution and prioritize Node.js scripts.
156
- - **Engine Security**: `generate-checksums.js` and `executor.js` now explicitly skip history files to prevent non-functional changes from triggering integrity warnings.
157
- - **Template System**: `init.js` now automatically injects the new C14 protocol into target project constitution files (`RULES.md`).
149
+ - **Stack & Structure**: Refined the initial scan step to build the high-level project map only *after* applying gitignore filters.
158
150
 
159
- ### Fixed
151
+ ### Meta
160
152
 
161
- - **Syntax Hygiene**: Cleaned up redundant markdown artifacts (terminal backticks) in core workflow files.
162
- - **Workflow Integrity**: Fixed accidental history duplication in `spec.md`.
153
+ - **Automated Update**: Engine version bumped to `1.5.132`, history updated, and checksums regenerated (C14).
163
154
 
164
- ## [1.4.3] - 2026-03-01
155
+ ## [1.5.50] - 2026-03-26
165
156
 
166
157
  ### Added
167
158
 
168
- - **Smart Adapter Updates**: Both Python and Node.js installers now seamlessly verify and update adapter `.mdc`/`.toml` wrapper files during `--update`.
169
- - **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.
170
-
171
- ### Fixed
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.
172
162
 
173
- - **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.
174
- - **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".
163
+ ### Changed
175
164
 
176
- ## [1.4.1] - 2026-03-01
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.
177
167
 
178
- ### Fixed
168
+ ### Meta
179
169
 
180
- - **Localization**: Translated remaining Russian text in `README.md` Mermaid diagrams to English.
170
+ - **Automated Update**: Engine version bumped to `1.5.50`, history updated, and checksums regenerated (C14).
181
171
 
182
- ## [1.4.0] - 2026-03-01
172
+ ## [1.5.49] - 2026-03-25
183
173
 
184
174
  ### Added
185
175
 
186
- - **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.
187
- - **Manual Rename Rescue** in `spec.md`: Protocol to globally update references (INDEX, PLAN, TASKS) when a specification file is moved/renamed, preserving task progress.
188
- - **Regression Tests (T48–T51)**: Added coverage for Engine Integrity guards, Analysis Depth Control, and Smart Sync mechanisms.
189
-
190
- ### Changed
191
-
192
- - **Test Suite Synchronization**: The `suite.md` version is now synchronized with the core engine version to prevent metadata confusion.
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.
193
180
 
194
- ## [1.3.2] - 2026-02-28
181
+ ## [1.5.48] - 2026-03-24
195
182
 
196
183
  ### Added
197
184
 
198
- - **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.
199
- - **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.
200
- - **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.
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.
201
187
 
202
188
  ### Changed
203
189
 
204
- - 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.
205
-
206
- ## [1.3.1] - 2026-02-27### Added
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.
207
193
 
208
- - **Workflow Test Suite** (`.magic/tests/suite.md`): 16 predefined regression test scenarios covering all 8 engine workflows. Run via `/magic.dev.simulate test`.
209
- - **Test Suite mode** in `simulate.md`: reads `suite.md` and reports PASS/FAIL for each scenario.
210
- - **Template directory** (`.magic/templates/`): extracted inline templates from core workflow files:
211
- - `specification.md` — Specification Template (from `spec.md`)
212
- - `plan.md` — PLAN.md Template (from `task.md`)
213
- - `tasks.md` — TASKS.md + phase-{n}.md Templates (from `task.md`)
214
- - `retrospective.md` — RETROSPECTIVE.md Template (from `retrospective.md`)
194
+ ### Fixed
215
195
 
216
- ### Changed
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/`.
217
202
 
218
- - **AOP Optimization**: Compressed verbose prose in `spec.md` (Post-Update Review, Audit/Consistency Reports). ~17% token reduction across core workflows.
219
- - **Stress-test hardening** across all workflows:
220
- - `spec.md`: Intra-input self-contradiction guard, Deprecation Cascade (scan Related Specs for stale refs)
221
- - `task.md`: Circular Dependency Guard, Phantom Done-task preservation (Archive not Cancel), Deprecated Done-task preservation, Convention Sync wording fix
222
- - `run.md`: Mode Guard — HALT if execution mode not in RULES.md §7
223
- - `rule.md`: Duplication Guard, convention-not-found handler, Workflow Dependency Check in Remove Impact Analysis
224
- - `simulate.md`: Checksums mismatch upgraded to HALT, Checksum Rule (generate after approval only)
225
- - `onboard.md`: Production collision HALT with backup/cancel, re-entry checks production PLAN.md
226
- - `init.md`: Expanded post-init verification to all 5 artifacts, Maintainer Note for hardcoded RULES.md sync
203
+ ## [1.5.30] - 2026-03-24
227
204
 
228
205
  ### Fixed
229
206
 
230
- - Template references now explicitly point to `.magic/templates/*.md` in creation steps of `spec.md`, `task.md`, `retrospective.md`, and `onboard.md`.
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).
231
209
 
232
- ## [1.3.0] - 2026-02-25
210
+ ## [1.5.29] - 2026-03-16
233
211
 
234
212
  ### Added
235
213
 
236
- - **Full support for abstract environment templates** with automatic resolution (`{ARGUMENTS}`) across all CLIs.
237
- - **Introduced `.magicrc`** for persistence of selected environments and their auto-detection.
238
- - **Two-level automatic Changelog generation** (by accumulating `Changes` blocks within tasks).
239
- - **Added new CLI commands:** `info`, `--check`, `--list-envs`, and `--eject`.
240
- - **Introduced core version tracking** within the project via the `.magic/.version` file.
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).
241
217
 
242
218
  ### Changed
243
219
 
244
- - **Architecture:** Restructured the repository into a two-level model (root = source of truth + installers), and removed the `core/` folder to eliminate duplication.
245
- - **Node Installer:** Completely overhauled the installation mechanism (it now uses compiled files from NPM instead of downloading them from GitHub, eliminating Path Traversal vulnerabilities).
246
- - **Python Installer:** Implemented an isolated package based on `hatchling` (via shared-data) without external dependencies on GitHub.
247
- - **Documentation:** Separated `README.md` strategies (different focuses for GitHub, NPM package, and PyPI package).
248
- - **Update Logic:** Improved `.magic` update logic to be safer (old folders are now moved to `.magic/archives/` rather than simply deleted).
249
-
250
- ## [1.3.0] - 2026-02-23
251
-
252
- ### Added
253
-
254
- - **Handoff integrations** (`magic.*.md`): Introduced explicit handoff blocks across all agent workflow wrappers to guide next-steps effortlessly.
255
- - **Task Engine Enhancement:** Integrated User Stories generation parsing into `.magic/task.md` and suppressed user priority prompts using `RULES.md C4`.
256
- - **System Automation Hooks:** Added `generate-context` script hooks into `task.md` and `run.md` post-write triggers.
257
- - **Context Automation Script:** Created `generate-context.sh` and `generate-context.ps1` to assemble `CONTEXT.md` from PLAN, workspace trees, and changelogs.
258
- - **Spec Engine Protections:** Added strict Explore Mode Safety rules and Delta Editing constraints for spec updates over 200 lines to `.magic/spec.md`.
259
- - **Explore Hints:** Updated `.agents/workflows/magic.spec.md` UI wrapper with tips to use Delta Constraints and strict read-only explore mode.
260
- - **CLI Doctor Command (Node/Python):** Implemented `--doctor` and `--check` parsing in installers, executing the prerequisite script and outputting a formatted terminal validation report.
261
- - **Interactive Onboarding Script:** Created `.magic/onboard.md` to guide new developers through building a toy "console logger" specification.
262
- - **Onboarding Wrapper:** Added `.agents/workflows/magic.onboard.md` to trigger the interactive onboarding tutorial seamlessly.
263
- - **Prerequisite Validation:** Created `check-prerequisites.sh` and `check-prerequisites.ps1` parsing `INDEX.md` and returning valid JSON results.
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
  ```
@@ -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.71",
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",