@thedecipherist/mdd 1.5.4 → 1.5.5

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.
@@ -8,6 +8,21 @@ Reads one or more large spec or prompt documents — the kind produced by extend
8
8
 
9
9
  ### Phase IS1 — Read Spec Files
10
10
 
11
+ **Stale job detection (runs first):** Check `.mdd/jobs/` for any existing `import-*/` folder.
12
+ - If found: read its `MANIFEST.md` and count written vs total files. Present to user:
13
+ ```
14
+ Found interrupted import job from <date>.
15
+ MANIFEST shows <done>/<total> files written.
16
+ Written: <list of [x] paths>
17
+ Remaining: <list of [ ] paths>
18
+
19
+ [R] Resume — skip already-written files, continue from where it left off
20
+ [D] Discard — delete job, start the full import from scratch
21
+ ```
22
+ - **Resume:** skip IS1–IS3, go directly to IS4 writing only the `[ ]` entries. IS5 runs normally after.
23
+ - **Discard:** delete the `import-<date>/` folder, proceed normally.
24
+ - If no stale job: proceed normally.
25
+
11
26
  Parse file path(s) from the arguments following `import-spec`. Multiple files may be space-separated or specified as a glob.
12
27
 
13
28
  For each file path:
@@ -316,6 +331,31 @@ Is the build order correct? Does each wave's demo-state make sense?
316
331
 
317
332
  **Do not proceed to IS4 until the user explicitly approves.**
318
333
 
334
+ **After approval — create the job folder and MANIFEST before writing any file:**
335
+
336
+ Create `.mdd/jobs/import-<YYYY-MM-DD>/MANIFEST.md`:
337
+
338
+ ```markdown
339
+ # Import Spec Job Manifest
340
+ # Job: import-<YYYY-MM-DD>
341
+ # Source: <filename(s)>
342
+ # Started: <ISO timestamp>
343
+ # Files: <N total>
344
+ # Status: IN PROGRESS
345
+ #
346
+ # States: [ ] pending [~] writing [x] written [!] error
347
+
348
+ ## Files to create
349
+ [ ] .mdd/initiatives/<slug>.md
350
+ [ ] .mdd/waves/<slug>-wave-1.md
351
+ [ ] .mdd/waves/<slug>-wave-2.md
352
+ [ ] .mdd/docs/01-<slug>.md
353
+ [ ] .mdd/docs/02-<slug>.md
354
+ ...
355
+ ```
356
+
357
+ List every file that will be written in the order it will be written. Nothing proceeds until this file exists on disk.
358
+
319
359
  ---
320
360
 
321
361
  ### Phase IS4 — Write Files
@@ -518,6 +558,8 @@ known_issues: []
518
558
  3. Tags: 4–8 domain-concept keywords. NOT file paths or spec section names.
519
559
  4. `depends_on`: populate from the build order analysis. COMPONENT docs list the SPEC docs they implement. SPEC docs list other SPECs they depend on (e.g. the expression system spec is depended on by the filter spec).
520
560
 
561
+ **For every file written:** mark it `[~]` in MANIFEST before writing, then `[x]` immediately after. If writing fails, mark `[!]` with a one-line error note. This ensures the MANIFEST is always an accurate snapshot of what exists on disk — a resume after interruption will never re-write a file that was already successfully written.
562
+
521
563
  **Progress report as you write:**
522
564
  ```
523
565
  Writing files...
@@ -550,6 +592,8 @@ Read all `.mdd/docs/*.md` (excluding `archive/`) — frontmatter only (id, title
550
592
  - **Warnings:** broken `depends_on` refs (target doesn't exist), circular dependencies, docs missing `path`.
551
593
  - **Write** `.mdd/connections.md` with YAML frontmatter (`generated: <today>`, `doc_count: <N>`, `connection_count: <N>`, `overlap_count: <N>`) and four sections: Path Tree, Dependency Graph (Mermaid), Source File Overlap, Warnings.
552
594
 
595
+ **Clean up job folder:** Delete `.mdd/jobs/import-<date>/` entirely — the written files are the authoritative record.
596
+
553
597
  Then report:
554
598
 
555
599
  ```
@@ -569,6 +613,7 @@ Structure:
569
613
 
570
614
  Startup: .mdd/.startup.md rebuilt
571
615
  Connections: .mdd/connections.md updated
616
+ Job: .mdd/jobs/import-<date>/ deleted
572
617
 
573
618
  Next steps:
574
619
  /mdd plan-execute <slug>-wave-1 — start building Wave 1
@@ -210,14 +210,28 @@ DIRTY=$(git status --porcelain)
210
210
  Follow the same (a)/(b)/(c) logic as mdd-build.md Phase 0.
211
211
  - **Never proceed on main.** This is a hard block regardless of clean/dirty state.
212
212
 
213
- 1. Parse `<wave-slug>` — hard stop *"Wave does not exist"* if `waves/<wave-slug>.md` not found.
213
+ 1. Parse `<wave-slug>` — hard stop *"Wave does not exist"* if `.mdd/waves/<wave-slug>.md` not found.
214
214
  2. Read the wave doc.
215
215
  3. Derive and read the parent initiative — hard stop if not found.
216
216
  4. **Hash check:** verify both initiative and wave file hashes. Hard stop on any mismatch: *"File has been manually edited since last sync. Run `/mdd plan-sync` first."*
217
217
  5. **Depends-on gate:** if wave's `depends_on` is not `none`, verify that wave is `complete`. Hard stop if not.
218
- 6. **Feature ordering check (Gap 4):** build dependency graph of features within the wave. If any ordering violation found → hard stop, explain exact conflict, offer auto-reorder.
219
-
220
- ### Phase PE2 Interaction mode
218
+ 6. **Feature ordering check:** build dependency graph of features within the wave. If any ordering violation found → hard stop, explain exact conflict, offer auto-reorder.
219
+ 7. **Stale job detection:** Check `.mdd/jobs/` for any existing `wave-<wave-slug>/` folder.
220
+ - If found: read its `MANIFEST.md` and count entries by state (`[ ]`, `[~]`, `[x]`, `[!]`). Present to user:
221
+ ```
222
+ Found interrupted wave job from <date>.
223
+ MANIFEST shows <done>/<total> features complete.
224
+ Features done: <list of [x] slugs>
225
+ Remaining: <list of [ ] and [~] slugs>
226
+
227
+ [R] Resume — continue from where it left off
228
+ [D] Discard — delete job and start wave from scratch
229
+ ```
230
+ - **Resume:** skip PE2, skip to PE3 starting from the first `[ ]` or `[~]` entry. Features marked `[x]` are already complete — do not re-run them.
231
+ - **Discard:** delete the `wave-<wave-slug>/` folder, proceed to PE2 normally.
232
+ - If no stale job exists: proceed to PE2 normally.
233
+
234
+ ### Phase PE2 — Interaction mode + Job Setup
221
235
 
222
236
  Ask:
223
237
  ```
@@ -230,24 +244,51 @@ How do you want to run this wave?
230
244
 
231
245
  **Interactive:** full Phase 2 gate, Phase 5 plan confirmation, green gate iteration prompts on every feature.
232
246
 
247
+ **After the interaction mode is chosen — create the job folder and MANIFEST (nothing proceeds until this exists on disk):**
248
+
249
+ Create `.mdd/jobs/wave-<wave-slug>/MANIFEST.md`:
250
+
251
+ ```markdown
252
+ # Wave Job Manifest
253
+ # Job: wave-<wave-slug>
254
+ # Wave: .mdd/waves/<wave-slug>.md
255
+ # Initiative: <initiative-slug>
256
+ # Started: <ISO timestamp>
257
+ # Mode: <automated | interactive>
258
+ # Features: <N>
259
+ # Status: IN PROGRESS
260
+ #
261
+ # States: [ ] planned [~] in_progress [x] complete [!] error
262
+
263
+ ## Features (in build order)
264
+ [ ] <feature-slug-1> .mdd/docs/<NN>-<slug>.md
265
+ [ ] <feature-slug-2> .mdd/docs/<NN>-<slug>.md
266
+ [ ] <feature-slug-3> .mdd/docs/<NN>-<slug>.md
267
+ ```
268
+
269
+ List every feature from the wave's Features table in order. Features already marked `complete` in the wave doc get `[x]` from the start.
270
+
233
271
  ### Phase PE3 — Execute features
234
272
 
235
273
  For each feature in the wave's feature table, in dependency order, skipping `complete` features:
236
274
 
237
275
  1. Tell user: *"Starting Feature N: <feature-slug>"*
238
- 2. Flip `wave_status: active` for this feature in the wave doc immediately.
239
- 3. Update the wave doc's `Doc` column with the feature doc path (once created in MDD Phase 3).
240
- 4. Run full MDD Build Mode (Phases 1–7) for the feature, at the chosen interaction level.
276
+ 2. Mark the feature `[~]` in `MANIFEST.md` immediately (before any other work).
277
+ 3. Flip `wave_status: active` for this feature in the wave doc immediately.
278
+ 4. Update the wave doc's `Doc` column with the feature doc path (once created in MDD Phase 3).
279
+ 5. Run full MDD Build Mode (Phases 1–7) for the feature, at the chosen interaction level.
241
280
  - Feature doc is auto-numbered from `.mdd/docs/` and gets `initiative`, `wave`, `wave_status` fields added.
242
- 5. After Phase 7 verify: flip `wave_status: complete` in wave doc AND confirm `status: complete` is written to the feature doc frontmatter (Phase 7c should have done this — verify it, write it if missing).
243
- 6. Ask: *"Feature N done ✓. Start Feature N+1? (yes / pause here)"*
281
+ 6. After Phase 7 verify: flip `wave_status: complete` in wave doc AND confirm `status: complete` is written to the feature doc frontmatter (Phase 7c should have done this — verify it, write it if missing).
282
+ 7. Mark the feature `[x]` in `MANIFEST.md`. If an error occurred that prevented completion, mark `[!]` with a one-line note.
283
+ 8. Ask: *"Feature N done ✓. Start Feature N+1? (yes / pause here)"*
244
284
 
245
- **Resume behaviour (Gap 2):** if re-run on a partially complete wave, read each feature's `wave_status`. Skip `complete`. Resume at first `active` or `planned`. If `active` but no doc exists restart from Phase 1.
285
+ **Resume behaviour:** if re-run on a partially complete wave, stale job detection in PE1 handles resume. MANIFEST is the authoritative progress record it is always written before and after each feature so an interrupted session can pick up at the exact right point.
246
286
 
247
287
  ### Phase PE4 — Wave completion
248
288
 
249
289
  When all features are `complete`:
250
- 1. Show the demo-state: *"Wave complete. Demo-state: '<demo-state>'. Have you verified this?"*
290
+ 1. Update `MANIFEST.md` set `# Status: COMPLETE` in the header.
291
+ 2. Show the demo-state: *"Wave complete. Demo-state: '<demo-state>'. Have you verified this?"*
251
292
  2. User confirms → flip wave `status: complete` in both `waves/<slug>.md` AND the waves table in `initiatives/<slug>.md`.
252
293
  3. **Cascade status to feature docs** — for every feature listed in this wave, read its `.mdd/docs/<NN>-<slug>.md` and check `status:`. For any doc that is NOT already `complete` or `deprecated`, write:
253
294
  - `status: complete`
@@ -272,6 +313,8 @@ Read all `.mdd/docs/*.md` (excluding `archive/`) — frontmatter only (id, title
272
313
  - **Warnings:** broken `depends_on` refs (target doesn't exist), circular dependencies, docs missing `path`.
273
314
  - **Write** `.mdd/connections.md` with YAML frontmatter (`generated: <today>`, `doc_count: <N>`, `connection_count: <N>`, `overlap_count: <N>`) and four sections: Path Tree, Dependency Graph (Mermaid), Source File Overlap, Warnings.
274
315
 
316
+ **Clean up job folder:** Delete `.mdd/jobs/wave-<wave-slug>/` entirely. The wave doc and feature docs are the authoritative completion record — the job folder is ephemeral tracking only.
317
+
275
318
  ---
276
319
 
277
320
  ## PLAN-SYNC MODE — `/mdd plan-sync`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thedecipherist/mdd",
3
- "version": "1.5.4",
3
+ "version": "1.5.5",
4
4
  "description": "MDD — Manual-Driven Development workflow for Claude Code",
5
5
  "type": "module",
6
6
  "bin": {