Skip to content

feat(SDD-012): backlog-integrity guard for vault task files#183

Merged
mlorentedev merged 1 commit into
mainfrom
feat/sdd-012-tasks-integrity-guard
May 31, 2026
Merged

feat(SDD-012): backlog-integrity guard for vault task files#183
mlorentedev merged 1 commit into
mainfrom
feat/sdd-012-tasks-integrity-guard

Conversation

@mlorentedev
Copy link
Copy Markdown
Owner

What

Ships the root-fix for backlog drift: a guard that enforces one ticket = one entry so 11-tasks.md can't silently re-diverge after a cleanup. Sibling of SDD-006 (check-md-escapes.sh) — same incident→guard shape.

The drift it prevents: a sprint-overview view was layered on top of the older detailed entries, so 34 ticket IDs appeared 2+ times and the views disagreed (e.g. IDEAS-007/SDD-004 marked both open and done; the count read 63 open vs ~35 real).

How

  • scripts/check-backlog-integrity.sh — takes <tasks-file>..., flags per file: DUPLICATE (same ID on 2+ entry lines) and CONTRADICTION (same ID marked both [ ] and [x]). Exit 0/1/2. No Obsidian dep. Portable (sed -nE + plain awk, no gawk-only features). Greedy [a-z]? keeps WIN-002a distinct from WIN-002.
  • scripts/vault.sh — new vault check-tasks <path>... dispatch.
  • scripts/vault-health.sh — new GUI-independent section 7/7 Backlog Integrity scanning every 10_projects/*/11-tasks.md, so the drift auto-surfaces at SessionStart.
  • tests/check-backlog-integrity.bats — 6 fixture tests (dup, contradiction, clean+sub-id, usage, missing, dispatcher).

Verification

  • bats tests/check-backlog-integrity.bats1..6 all ok
  • shellcheck + bash -n clean on all 3 scripts
  • Real-data smoke: run against the live 11-tasks.md → exit 1, 30 duplicates + 3 contradictions correctly identified (proves it works on production data, not just fixtures)

Acceptance criteria

  • AC1 duplicate IDs flagged · [x] AC2 status contradictions flagged · [x] AC3 clean passes + sub-ids safe · [x] AC4 wired (dispatcher + vault-health section)
  • AC5 (real backlog consolidated to green) — deferred follow-up (vault checkout was busy with a parallel session). Today the guard intentionally exits 1 on the real file: that IS it surfacing the drift to be consolidated.

SDD

  • Spec: specs/SDD-012-tasks-integrity-guard/ (scaffolded with --force-no-vault — vault busy; the SDD-012 backlog entry + consolidation land in the AC5 follow-up, tracked in the spec, not skipped)
  • Sibling precedent: specs/archive/SDD-006-vault-integrity-check/

Add check-backlog-integrity.sh: flags duplicate ticket IDs and status contradictions (same ID marked both open and done) in 11-tasks.md, enforcing one-ticket-one-entry. Wired into the vault.sh dispatcher (check-tasks) and a GUI-independent vault-health.sh section so drift auto-surfaces at SessionStart. Sibling of SDD-006 check-md-escapes.sh (incident->guard). Portable sed+awk, fixture-tested. The 11-tasks.md consolidation to green is a tracked follow-up (AC5).
@mlorentedev mlorentedev merged commit b6607e6 into main May 31, 2026
6 checks passed
@mlorentedev mlorentedev deleted the feat/sdd-012-tasks-integrity-guard branch May 31, 2026 02:01
mlorentedev added a commit that referenced this pull request May 31, 2026
Doc-only move: specs/SDD-012-tasks-integrity-guard/ -> specs/archive/ + status flip to archived. Mirrors the SDD-011 archive (#182). The 11-tasks.md consolidation (AC5) remains a tracked vault follow-up.
mlorentedev added a commit that referenced this pull request May 31, 2026
…or number reuse (#185)

The number-only match false-positived two different tickets sharing a number (e.g. BUG-020-pwsh-profile vs BUG-020-splitpath). Match DUPLICATE/CONTRADICTION by the full bold id instead; report number reuse across different tickets as an advisory NOTE that does not fail. Parsing moved fully into awk (portable, no sed/tab). Follow-up to #183; refines the archived SDD-012 guard.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant