magic-spec 1.4.162 → 1.5.71

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,6 +5,98 @@ 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
9
+
10
+ ### Changed
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
15
+
16
+ - **Automated Update**: Engine version bumped to `1.5.70`, history updated, and checksums regenerated (C14).
17
+
18
+ ## [1.5.71] - 2026-03-26
19
+
20
+ ### Added
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.
23
+
24
+ ### Changed
25
+
26
+ - **Stack & Structure**: Refined the initial scan step to build the high-level project map only *after* applying gitignore filters.
27
+
28
+ ### Meta
29
+
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
35
+
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.
39
+
40
+ ### Changed
41
+
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.
44
+
45
+ ### Meta
46
+
47
+ - **Automated Update**: Engine version bumped to `1.5.50`, history updated, and checksums regenerated (C14).
48
+
49
+ ## [1.5.49] - 2026-03-25
50
+
51
+ ### Added
52
+
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.
57
+
58
+ ## [1.5.48] - 2026-03-24
59
+
60
+ ### Added
61
+
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.
64
+
65
+ ### Changed
66
+
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.
70
+
71
+ ### Fixed
72
+
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
81
+
82
+ ### Fixed
83
+
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).
86
+
87
+ ## [1.5.29] - 2026-03-16
88
+
89
+ ### Added
90
+
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).
94
+
95
+ ### Changed
96
+
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`).
99
+
8
100
  ## [1.4.162] - 2026-03-12
9
101
 
10
102
  ### Added
@@ -16,7 +108,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
16
108
  ### Changed
17
109
 
18
110
  - **Task Checklist Logic**: Consolidated implementation checklists into `TASKS.md` for better execution tracking and status reporting.
19
- - **Gitignore Resilience**: Improved installers to automatically manage `.gitignore` entries for `.magic/` and `.agent/` directories with idempotent updates.
111
+ - **Gitignore Resilience**: Improved installers to automatically manage `.gitignore` entries for `.magic/` and `.agents/` directories with idempotent updates.
20
112
  - **Onboarding Safety**: Added production data collision guards to `onboard.md` to prevent accidental overwrites of existing project plans.
21
113
 
22
114
  ### Fixed
@@ -113,7 +205,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
113
205
 
114
206
  ## [1.3.1] - 2026-02-27### Added
115
207
 
116
- - **Workflow Test Suite** (`.magic/tests/suite.md`): 16 predefined regression test scenarios covering all 8 engine workflows. Run via `/magic.simulate test`.
208
+ - **Workflow Test Suite** (`.magic/tests/suite.md`): 16 predefined regression test scenarios covering all 8 engine workflows. Run via `/magic.dev.simulate test`.
117
209
  - **Test Suite mode** in `simulate.md`: reads `suite.md` and reports PASS/FAIL for each scenario.
118
210
  - **Template directory** (`.magic/templates/`): extracted inline templates from core workflow files:
119
211
  - `specification.md` — Specification Template (from `spec.md`)
@@ -164,8 +256,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
164
256
  - **System Automation Hooks:** Added `generate-context` script hooks into `task.md` and `run.md` post-write triggers.
165
257
  - **Context Automation Script:** Created `generate-context.sh` and `generate-context.ps1` to assemble `CONTEXT.md` from PLAN, workspace trees, and changelogs.
166
258
  - **Spec Engine Protections:** Added strict Explore Mode Safety rules and Delta Editing constraints for spec updates over 200 lines to `.magic/spec.md`.
167
- - **Explore Hints:** Updated `.agent/workflows/magic.spec.md` UI wrapper with tips to use Delta Constraints and strict read-only explore mode.
259
+ - **Explore Hints:** Updated `.agents/workflows/magic.spec.md` UI wrapper with tips to use Delta Constraints and strict read-only explore mode.
168
260
  - **CLI Doctor Command (Node/Python):** Implemented `--doctor` and `--check` parsing in installers, executing the prerequisite script and outputting a formatted terminal validation report.
169
261
  - **Interactive Onboarding Script:** Created `.magic/onboard.md` to guide new developers through building a toy "console logger" specification.
170
- - **Onboarding Wrapper:** Added `.agent/workflows/magic.onboard.md` to trigger the interactive onboarding tutorial seamlessly.
262
+ - **Onboarding Wrapper:** Added `.agents/workflows/magic.onboard.md` to trigger the interactive onboarding tutorial seamlessly.
171
263
  - **Prerequisite Validation:** Created `check-prerequisites.sh` and `check-prerequisites.ps1` parsing `INDEX.md` and returning valid JSON results.
package/README.md CHANGED
@@ -36,15 +36,14 @@ After running the installer, your project directory will be augmented with the f
36
36
 
37
37
  ```plaintext
38
38
  root-project/
39
- ├── .agent/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
  ```
43
43
 
44
44
  1. **`.magic/`**: Deploys the core SDD engine.
45
- 2. **`.agent/`**: Sets up workflows for your AI.
45
+ 2. **`.agents/`**: Sets up workflows for your AI.
46
46
  3. **`.design/`**: Initializes your project's workspace for Specifications, Rules, and Plans.
47
- 4. **Onboarding**: An interactive tutorial (`magic.onboard`) helps you and your AI get started smoothly.
48
47
 
49
48
  > [!TIP]
50
49
  > **Magic Workspaces**: Magic Spec supports multiple, isolated design environments within a single repository (e.g., `.design/engine/`, `.design/installers/`). This allows you to manage fundamentally different project domains without specification overlap, while sharing a single core engine. See [workspaces.md](./workspaces.md) for details.
@@ -172,7 +171,7 @@ Works perfectly with **any project** — Rust, Go, Python, JavaScript, C++, or a
172
171
  **Stable Release:**
173
172
 
174
173
  ```bash
175
- # Basic installation (defaults to .agent/ folder)
174
+ # Basic installation (defaults to .agents/ folder)
176
175
  npx magic-spec@latest
177
176
 
178
177
  # Targeted installation for Cursor
@@ -222,7 +221,7 @@ npx magic-spec@latest --cursor --copilot --windsurf
222
221
  If automated installers do not fit your environment:
223
222
 
224
223
  1. **Engine**: Download the `.magic/` folder from the [GitHub repository](https://github.com/teratron/magic-spec).
225
- 2. **Workflows**: Download command wrappers from [`.agent/workflows/`](https://github.com/teratron/magic-spec/tree/main/.agent/workflows).
224
+ 2. **Workflows**: Download command wrappers from [`workflows/`](https://github.com/teratron/magic-spec/tree/main/workflows).
226
225
  3. **Deploy**: Place files into your AI agent's instruction directory (e.g., `.cursor/commands`).
227
226
 
228
227
  ## 🔄 Updating
@@ -238,14 +237,14 @@ npx magic-spec@latest --update
238
237
  ```
239
238
 
240
239
  > [!TIP]
241
- > The update process preserves your `.design/` workspace and automatically creates backups of `.magic/` and `.agent/` 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.**
242
241
 
243
242
  ### Post-Install: `.gitignore`
244
243
 
245
- The installer automatically adds `.magic/` and the adapter directory (e.g., `.agent/`, `.cursor/rules/`) to your project's `.gitignore`. These directories are **installed dependencies** — similar to `node_modules/` — and should be reinstalled via `npx magic-spec@latest` rather than committed to version control.
244
+ The installer automatically adds `.magic/` and the adapter directory (e.g., `.agents/`, `.cursor/rules/`) to your project's `.gitignore`. These directories are **installed dependencies** — similar to `node_modules/` — and should be reinstalled via `npx magic-spec@latest` rather than committed to version control.
246
245
 
247
246
  > [!TIP]
248
- > **Vendoring**: If you prefer to commit the engine into your repository (so teammates get it without running the installer), simply remove the `.magic/` and `.agent/` entries from your `.gitignore`.
247
+ > **Vendoring**: If you prefer to commit the engine into your repository (so teammates get it without running the installer), simply remove the `.magic/` and `.agents/` entries from your `.gitignore`.
249
248
 
250
249
  ## 💬 Usage
251
250
 
@@ -289,14 +288,13 @@ You can install support for a specific adapter using the shortcut flag (e.g., `-
289
288
 
290
289
  - [**Main Documentation**](./docs/README.md) — Detailed guide on workflows, architecture, and advanced features.
291
290
  - [**Installers Guide**](./installers/README.md) — Advanced CLI options and platform specifics.
292
- - [**Contributing**](./docs/contributing.md) — How to develop, test, and extend the engine.
291
+ - [**Contributing**](./CONTRIBUTING.md) — How to develop, test, and extend the engine.
293
292
 
294
293
  ## 🛟 Support
295
294
 
296
295
  If you encounter issues or have questions:
297
296
 
298
297
  - Open an [Issue](https://github.com/teratron/magic-spec/issues) on GitHub.
299
- - Run `magic.onboard` in your agent to restart the interactive tutorial.
300
298
 
301
299
  ## 🗺️ Roadmap
302
300
 
@@ -309,7 +307,7 @@ If you encounter issues or have questions:
309
307
  ## 🏗️ Contributing
310
308
 
311
309
  We welcome contributions! Whether it's a bug fix, a new adapter, or an improvement to the workflow logic.
312
- Please see [**Contributing Guide**](./docs/contributing.md) for details.
310
+ Please see [**Contributing Guide**](./CONTRIBUTING.md) for details.
313
311
 
314
312
  ## 👥 Authors and Acknowledgments
315
313
 
@@ -1,31 +1,27 @@
1
1
  {
2
2
  "githubRepo": "teratron/magic-spec",
3
3
  "packageName": "magic-spec",
4
- "removePrefix": "magic.",
5
4
  "engineDir": ".magic",
6
- "agentDir": ".agent",
5
+ "agentDir": ".agents",
7
6
  "workflowsDir": "workflows",
7
+ "defaultExt": ".md",
8
8
  "designDir": ".design",
9
9
  "versionFile": ".version",
10
10
  "checksumsFile": ".checksums",
11
11
  "historyDir": "history",
12
- "defaultExt": ".md",
13
12
  "workflows": [
14
13
  "magic.analyze",
15
- "magic.onboard",
16
14
  "magic.rule",
17
15
  "magic.run",
18
- "magic.simulate",
19
16
  "magic.spec",
20
17
  "magic.task"
21
18
  ],
22
19
  "magicFiles": [
23
20
  "analyze.md",
24
- "onboard.md",
21
+ "init.md",
25
22
  "retrospective.md",
26
23
  "rule.md",
27
24
  "run.md",
28
- "simulate.md",
29
25
  "spec.md",
30
26
  "task.md",
31
27
  ".version",
@@ -41,39 +37,32 @@
41
37
  "templates/tasks.md"
42
38
  ],
43
39
  "download": {
44
- "timeoutMs": 60000,
45
- "tempPrefix": "magic-spec-"
40
+ "timeoutMs": 10000,
41
+ "tempPrefix": "magic-spec-tmp-"
46
42
  },
47
43
  "userAgent": {
48
- "node": "magic-spec-node",
49
- "python": "magic-spec-cli"
44
+ "python": "magic-spec-python-installer/1.0",
45
+ "node": "magic-spec-node-installer/1.0"
50
46
  },
51
47
  "eject": {
52
48
  "targets": [
53
49
  ".magic",
54
- ".agent",
55
- ".magic.bak",
56
- ".agent.bak"
50
+ ".agents",
51
+ "installers"
57
52
  ]
58
53
  },
59
54
  "publish": {
60
55
  "versionFiles": [
61
- "pyproject.toml",
62
- "installers/python/magic_spec/__init__.py",
63
56
  "package.json",
64
- ".magic/.version"
57
+ "pyproject.toml",
58
+ "installers/python/magic_spec/__init__.py"
65
59
  ],
66
60
  "docsTargets": [
67
- "README.md",
68
61
  "CHANGELOG.md"
69
- ],
70
- "docsDir": "docs"
71
- },
72
- "git": {
73
- "defaultBranch": "master"
62
+ ]
74
63
  },
75
64
  "tests": {
76
- "sandboxDir": "installers/tests/sandbox",
65
+ "sandboxDir": "tmp/sandbox",
77
66
  "adaptersJson": "installers/adapters.json",
78
67
  "pythonInstaller": "installers/python/magic_spec/__main__.py",
79
68
  "nodeInstaller": "installers/node/index.js",
@@ -297,7 +297,7 @@ function installAdapter(sourceRoot, env, adapters, conflictsToSkip = []) {
297
297
  installedChecksums[relTarget] = crypto.createHash('sha256').update(finalContent).digest('hex');
298
298
  }
299
299
 
300
- // Copy other files in .agent if any
300
+ // Copy other files in .agents if any
301
301
  const srcEng = path.join(sourceRoot, AGENT_DIR);
302
302
  if (fs.existsSync(srcEng)) {
303
303
  const items = fs.readdirSync(srcEng, { withFileTypes: true });
@@ -893,7 +893,7 @@ async function main() {
893
893
  }
894
894
  }
895
895
 
896
- // Copy other files in .agent if any (not workflows subfolder which we handled selectively)
896
+ // Copy other files in .agents if any (not workflows subfolder which we handled selectively)
897
897
  if (fs.existsSync(srcEng)) {
898
898
  const items = fs.readdirSync(srcEng, { withFileTypes: true });
899
899
  for (const item of items) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "magic-spec",
3
- "version": "1.4.162",
3
+ "version": "1.5.71",
4
4
  "description": "Magic Specification-Driven Development (SDD) Workflow",
5
5
  "author": "Oleg Alexandrov <alexandrovoleg.ru@gmail.com>",
6
6
  "license": "MIT",