@thedecipherist/mdd 1.6.12 → 1.6.13

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.
@@ -158,6 +158,8 @@ Integration context: .mdd/jobs/audit-<date>/integration-context.md
158
158
  - "Immutable" rule arrays exported as plain mutable arrays — not `Object.freeze()` + `readonly`
159
159
  - Untrusted MCP/API/CLI input used without validation or sanitization
160
160
  - Data cached or stored without masking applied first
161
+ - Local reimplementation of security logic — any function named `isConfined`, `isAllowed`, `isSafe`, `isBlocked`, or similar that replicates what a documented security module already provides. Require replacement with the canonical security module function.
162
+ - Contract function undefined — if `integration_contracts` specifies a function name, grep the entire package for that name as an export. If the function does not exist anywhere, flag P1 regardless of whether call sites are present.
161
163
 
162
164
  **Note:** `satisfies_contracts status: pending` is checked by main in Phase A1, not here — agents cannot read feature docs.
163
165
 
@@ -168,7 +170,9 @@ Integration context: .mdd/jobs/audit-<date>/integration-context.md
168
170
  - File exceeds 300 lines
169
171
  - Function exceeds 50 lines
170
172
  - Transformation/substitution function handles some but not all AST/domain types (silent fallthrough for unhandled types)
173
+ - Switch on a string-union type or operation enum with no `default:` case, or where `default:` returns a value rather than throwing. Check all `switch` statements in execution, adapter, and transformation code. Approved pattern: `default: throw new Error(\`unhandled type: \${x satisfies never}\`)` — the `satisfies never` check produces a compile error when a new variant is added without updating the switch.
171
174
  - MCP-exposed function accepts untrusted params with no explicit validation
175
+ - Security parameter never passed — if a function accepts a policy param (allowedKeys, blockedDomains, securityConfig, etc.) that must come from a caller, verify the caller passes a non-empty, non-null value. If the parameter always arrives as `undefined`, `null`, or `[]`, the enforcement is a no-op.
172
176
 
173
177
  ### P3 Medium
174
178
  - TypeScript strict mode not enabled in tsconfig
@@ -176,6 +180,8 @@ Integration context: .mdd/jobs/audit-<date>/integration-context.md
176
180
  - Missing test cases for documented business rules
177
181
  - 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
178
182
  - `file.*` filesystem helpers or path-resolving functions accept arbitrary paths without confinement to a documented jailRoot
183
+ - Code that constructs a `SecurityConfig` or equivalent security object sets `jailRoot: null`. A null jailRoot disables filesystem confinement — the default should be the document's directory (`dirname(resolvedPath)`), not `null`, unless the caller explicitly provides an override.
184
+ - `String.replace()` uses a captured group reference (`$1`, `$2`, etc.) in the replacement argument where the captured value originates from untrusted input. Values containing `$1`, `$&`, `$'`, etc. are silently mangled by JavaScript's substitution semantics. Sanitize with `.replace(/\$/g, '$$$$')` before interpolating into a replacement string.
179
185
  - Silent error swallow: catch block returns empty/undefined without pushing to warnings array
180
186
  - Template/substitution function matches `{{varname}}` without spaces but not `{{ varname }}` with spaces — spec uses spaced form; use regex `\s*` not exact string
181
187
 
@@ -262,11 +262,14 @@ satisfies_contracts:
262
262
  - from: <dependency-feature-id>
263
263
  function: <function-name>(<args>)
264
264
  when: <condition — e.g. "before any file read in executeInclude">
265
- status: pending change to "verified: <file>:<line>" during Phase 6
265
+ status: pending # change to done during Phase 6
266
+ verified_at: "" # set to "path/to/file.ts:lineN" when status is done
266
267
  ```
267
268
 
268
269
  **Leaving `satisfies_contracts` empty when a dependency has mandatory `integration_contracts` is a build error.** Do not proceed past Phase 3a until all applicable contracts are acknowledged.
269
270
 
271
+ **Before marking any `satisfies_contracts` entry `status: done`:** run `grep -rn '<function-name>'` across the entire package. Every call site must invoke the contract function — not just the one currently in focus. If the function is only wired in one layer (e.g. dispatcher) but not another (e.g. executor), the contract is not satisfied. Set `verified_at` to the confirmed call site before updating status.
272
+
270
273
  **Cross-cutting concerns that always require contract resolution:**
271
274
  - Any dependency tagged with `security`, `auth`, `masking`, `filesystem`, `audit`, `immutable` — its contracts are always mandatory
272
275
  - Any dependency that provides a "check before X" or "enforce Y" function — that function must be in your `satisfies_contracts`
@@ -339,6 +342,8 @@ describe('<Feature Name>', () => {
339
342
  - If BOTH unit AND E2E tests are needed → launch 2 parallel `general-purpose` agents. Each receives: the full MDD doc content, the skeleton template above, project testing conventions, and the exact output file path. Agent A writes `tests/unit/<feature-name>.test.ts`, Agent B writes `tests/e2e/<feature-name>.spec.ts`. These are different files — no write conflict is possible.
340
343
  - If only unit tests needed → generate directly in the main conversation (no agent overhead for a single file).
341
344
 
345
+ **CLI feature additional check:** If the feature adds or modifies CLI commands, add a skeleton that invokes each new command with `--help` and asserts all five universal flags (`--env`, `--cwd`, `--verbose`, `--strict`, `--silent`) appear in the output. This catches missing `universalOptions()` wiring before implementation begins.
346
+
342
347
  **E2E skeleton template (if applicable):**
343
348
  ```typescript
344
349
  import { test, expect } from '@playwright/test';
@@ -530,6 +535,8 @@ Execute blocks in dependency layer order (Layer 1 → 2 → 3 → 4). Within the
530
535
 
531
536
  **For sequential blocks:** read the MDD doc, read the relevant test skeletons, implement, run the Green Gate loop below.
532
537
 
538
+ **Directive/constant change ripple rule:** If this block changes any directive syntax, canonical header string, config key, or other string constant that other parts of the codebase may consume (e.g. language grammars, test fixtures, snippets, detection code), run `grep -rn 'old_string'` across the entire repo before marking the block complete. Update every consumer found — tmLanguage files, E2E fixtures, snippets, and any hardcoded string comparisons — in the same block, not as a follow-up.
539
+
533
540
  #### Step 6b — Green Gate loop (per block)
534
541
 
535
542
  After each block's implementation (sequential or parallel), run the Green Gate:
@@ -678,7 +685,8 @@ where the agent patches the wrong thing because it accepted an external excuse t
678
685
 
679
686
  1. **Contract verification gate** — before marking complete, check the feature doc's `satisfies_contracts`:
680
687
  - Any entry still `status: pending` means the integration was never wired
681
- - For each pending entry: locate the call site in the implementation, verify it exists, update to `verified: <file>:<line>`
688
+ - For each entry: run `grep -rn '<function-name>'` across the entire package. Every call site must invoke the contract function not just the one originally in scope. If a layer (e.g. executor vs dispatcher) is missing the call, the contract is not satisfied.
689
+ - Update each confirmed entry to `status: done` and `verified_at: "path/to/file.ts:lineN"` pointing to the confirmed call site.
682
690
  - If the call site is missing: implement it now (do not mark complete without it)
683
691
  - **A feature with any `pending` contract cannot be marked `status: complete`**
684
692
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thedecipherist/mdd",
3
- "version": "1.6.12",
3
+ "version": "1.6.13",
4
4
  "description": "MDD — Manual-Driven Development workflow for Claude Code",
5
5
  "type": "module",
6
6
  "bin": {