@thedecipherist/mdd 1.5.12 → 1.6.1
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/commands/mdd-audit.md +27 -5
- package/commands/mdd-build.md +12 -0
- package/commands/mdd-plan.md +14 -2
- package/package.json +1 -1
package/commands/mdd-audit.md
CHANGED
|
@@ -31,10 +31,18 @@ A completed audit exists from <date>.
|
|
|
31
31
|
|
|
32
32
|
[F] Full audit — regenerate manifest from all source files
|
|
33
33
|
Use when: significant new code added, want a clean baseline, or last audit was >2 weeks ago
|
|
34
|
-
[I] Incremental — manifest contains only files
|
|
34
|
+
[I] Incremental — manifest contains only files whose content changed since last audit
|
|
35
35
|
Use when: applied fixes and want to verify them, or auditing only a new feature
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
+
For incremental scope, use git to detect truly changed files — not mtime, which is unreliable:
|
|
39
|
+
```bash
|
|
40
|
+
git diff --name-only <last-audit-commit> # files changed since audit commit
|
|
41
|
+
git ls-files --others --exclude-standard # untracked new files
|
|
42
|
+
```
|
|
43
|
+
If no audit commit is recorded, fall back to files modified after `audits/MANIFEST-<date>.md` mtime.
|
|
44
|
+
Store the current HEAD commit in the job folder (`job-commit.txt`) so future incremental audits have an exact reference point. Files modified and then reverted will NOT appear in the diff — correct behaviour.
|
|
45
|
+
|
|
38
46
|
**Agent scaling:**
|
|
39
47
|
|
|
40
48
|
| Files in scope | Agents |
|
|
@@ -129,6 +137,9 @@ Manifest: .mdd/jobs/audit-<date>/MANIFEST.md
|
|
|
129
137
|
- Feature has `depends_on` entries with `integration_contracts` but `satisfies_contracts` is empty
|
|
130
138
|
- Security module's `integration_contracts` specifies a caller that has no `satisfies_contracts` entry
|
|
131
139
|
- Missing test cases for documented business rules
|
|
140
|
+
- CLI command missing any of the universal flags (--env, --cwd, --verbose, --strict, --silent) — check all commands against the CLI feature doc's universal flags requirement
|
|
141
|
+
- `file.*` filesystem helpers or path-resolving functions accept arbitrary paths without confinement to a documented jailRoot
|
|
142
|
+
- Silent error swallow: catch block returns empty/undefined without pushing to warnings array
|
|
132
143
|
|
|
133
144
|
### P4 Low
|
|
134
145
|
- Code style inconsistencies
|
|
@@ -263,11 +274,22 @@ Fix all now? (yes / review report first / fix only P1+P2)
|
|
|
263
274
|
|
|
264
275
|
If user says yes (or selects a subset):
|
|
265
276
|
|
|
266
|
-
**Fix loop:**
|
|
267
|
-
|
|
277
|
+
**Fix loop:**
|
|
278
|
+
|
|
279
|
+
Detect test runner once from `package.json` scripts (look for `test:unit`, `test`, `vitest`, `jest`, `pytest`, `go test`). Identify the file-scope flag for that runner:
|
|
280
|
+
- Vitest / Jest: `pnpm test:unit -- <path/to/file.test.ts>`
|
|
281
|
+
- pytest: `pytest <path/to/test_file.py>`
|
|
282
|
+
- Go: `go test ./<package>/...`
|
|
283
|
+
|
|
284
|
+
For each finding to fix:
|
|
285
|
+
1. Read the specific source file(s)
|
|
268
286
|
2. Apply the fix
|
|
269
|
-
3. Write or update
|
|
270
|
-
4. Run
|
|
287
|
+
3. Write or update the corresponding test file(s)
|
|
288
|
+
4. Run ONLY the test file(s) that cover the changed source — not the full suite.
|
|
289
|
+
Derive test path from source path by convention (e.g. `src/foo/bar.ts` → `tests/unit/foo/bar.test.ts`).
|
|
290
|
+
If the mapping is ambiguous, grep for imports of the changed file to find the right test.
|
|
291
|
+
|
|
292
|
+
After ALL findings are fixed: run the full test suite once as a regression check.
|
|
271
293
|
|
|
272
294
|
Report progress per finding. Update documentation `known_issues` to remove fixed items. Update `mdd_version` to current on every `.mdd/docs/*.md` file that is edited during fixes.
|
|
273
295
|
|
package/commands/mdd-build.md
CHANGED
|
@@ -638,6 +638,18 @@ Quality gates passing does not mean the feature works. This phase verifies actua
|
|
|
638
638
|
□ Confirm no unintended side effects on unrelated files or state
|
|
639
639
|
```
|
|
640
640
|
|
|
641
|
+
**Spec invariants — applies when the feature doc references spec language like "cannot be overridden", "always blocked", "immutable", "confinement", or "required":**
|
|
642
|
+
```
|
|
643
|
+
□ Every spec-stated invariant must be verifiably enforced in code:
|
|
644
|
+
"cannot be overridden" → Object.freeze() on arrays/objects + readonly type
|
|
645
|
+
"always blocked" → the block path runs BEFORE any allow logic
|
|
646
|
+
"confinement" → an actual path check exists at every entry point, not just a gate module
|
|
647
|
+
"required" → ParseError or equivalent thrown for missing values (no silent empty string)
|
|
648
|
+
□ Run grep for the invariant keyword in source — verify it appears in a test assertion, not just prose
|
|
649
|
+
□ If the spec says module X enforces Y, verify X is actually CALLED at the relevant call site
|
|
650
|
+
(building a security module is not the same as wiring it)
|
|
651
|
+
```
|
|
652
|
+
|
|
641
653
|
**Ownership Default — applies to ALL feature types:**
|
|
642
654
|
|
|
643
655
|
```
|
package/commands/mdd-plan.md
CHANGED
|
@@ -278,8 +278,20 @@ For each feature in the wave's feature table, in dependency order, skipping `com
|
|
|
278
278
|
4. Update the wave doc's `Doc` column with the feature doc path (once created in MDD Phase 3).
|
|
279
279
|
5. Run full MDD Build Mode (Phases 1–7) for the feature, at the chosen interaction level.
|
|
280
280
|
- Feature doc is auto-numbered from `.mdd/docs/` and gets `initiative`, `wave`, `wave_status` fields added.
|
|
281
|
-
6.
|
|
282
|
-
|
|
281
|
+
6. **PE3 Completion Gate** — run these checks BEFORE marking `[x]`. This is a hard gate, not advisory.
|
|
282
|
+
|
|
283
|
+
**a. source_files existence check** — read `source_files` from the feature doc. For each file listed, verify it exists on disk:
|
|
284
|
+
```bash
|
|
285
|
+
# For each file in source_files:
|
|
286
|
+
test -f <path> && echo "OK: <path>" || echo "MISSING: <path>"
|
|
287
|
+
```
|
|
288
|
+
If any file is missing: mark the feature `[!]` in MANIFEST with the list of missing files. Do NOT proceed to step 7 — implement the missing files or explicitly document them as deferred in `known_issues`.
|
|
289
|
+
|
|
290
|
+
**b. satisfies_contracts verification** — read `satisfies_contracts` from the feature doc. If any entry is still `status: pending`, the security/integration contract was never wired. Find the call site, wire it, update to `verified: <file>:<line>`. A feature cannot be `[x]` with pending contracts.
|
|
291
|
+
|
|
292
|
+
**c. Doc status write** — confirm `status: complete` is in the feature doc frontmatter. Phase 7c should have written this. If it is missing (still `draft` or `in_progress`), write it now along with `last_synced: <today>` and `phase: all`. This is NOT optional — a missing status write means the doc audit will flag the feature as incomplete on the next run.
|
|
293
|
+
|
|
294
|
+
7. Mark the feature `[x]` in `MANIFEST.md`. If the completion gate blocked (step 6a or 6b failed), mark `[!]` with a one-line note listing what was missing.
|
|
283
295
|
8. Ask: *"Feature N done ✓. Start Feature N+1? (yes / pause here)"*
|
|
284
296
|
|
|
285
297
|
**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.
|