You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add validation and duplicate-target protection before writes #15
Add a validation workflow that detects unsafe or ambiguous Markdown code-block mappings before mdcode writes files. Users should receive a clear report and a non-zero exit status instead of silent data loss or partial synchronization.
Acceptance criteria
Validation detects duplicate target files that do not have an unambiguous merge strategy.
Validation detects missing, mismatched, or invalid regions and missing referenced source files.
Validation detects unsafe file paths and reports the affected block and document.
Strict mode can require file metadata for every selected block.
The report is available in both readable and machine-readable formats and is covered by tests.
Category: enhancement Summary: Validate Markdown code-block mappings before writes to prevent ambiguity, unsafe paths, and partial synchronization.
Current behavior:
Extraction groups blocks by target path but, for a duplicate target without all blocks having regions, writes only the first block. Region reads do not require a unique, well-formed matching region. Metadata paths and source-read errors are not uniformly validated before operations begin.
Desired behavior:
A read-only validate command analyzes the selected operation before it writes. It reports every unsafe, missing, ambiguous, or malformed mapping in readable and structured form. Extract and update run the same validation before mutation.
Duplicate target rule — multiple selected blocks may share a target only when every block has a non-empty, unique region name and every block has the same language. Every other duplicate target is an error.
Region rule — a referenced region must occur exactly once and have a matching closing marker; missing, duplicate, malformed, and language-mismatched regions are errors.
Redefining path containment or the shared JSON envelope.
Verification status:
Confirmed: duplicate extraction currently can write only the first block, and region/source failures are not uniformly preflighted. This issue is blocked by #5 and #7.
Activity
adrianbrowning commentedon Aug 8, 2026
Agent Brief
Category: enhancement
Summary: Validate Markdown code-block mappings before writes to prevent ambiguity, unsafe paths, and partial synchronization.
Current behavior:
Extraction groups blocks by target path but, for a duplicate target without all blocks having regions, writes only the first block. Region reads do not require a unique, well-formed matching region. Metadata paths and source-read errors are not uniformly validated before operations begin.
Desired behavior:
A read-only validate command analyzes the selected operation before it writes. It reports every unsafe, missing, ambiguous, or malformed mapping in readable and structured form. Extract and update run the same validation before mutation.
Key interfaces:
Acceptance criteria:
Out of scope:
Verification status:
Confirmed: duplicate extraction currently can write only the first block, and region/source failures are not uniformly preflighted. This issue is blocked by #5 and #7.
feat: validate code-block mappings before extract or update writes (#15…
style: fix lint:s errors from #15 (#44)
feat: mdcode watch reports drift as you edit; --apply writes it (#18) (…