◐ Off-By-One · answer catalog

spec-inventory-drift

2 answer(s)godockergodocker

spec-inventory-drift

📦 Source in repository (JSON)

Answer 1

Solution written to ~/spec-inventory-drift.md.

Summary

Root cause: The spec inventory is a hand-maintained duplicate of what the filesystem already knows. Human "that's not a spec" judgement (AGENTS.md, _index.md, _prompt.md) disagrees with the directory glob, and any count-only check is blind to substitution drift — deleting b.md while adding _index.md keeps the count at 2 and passes.

Exact fix: checks/spec-inventory.sh, which: - extracts inventory basenames from a marker-delimited block, - lists on-disk basenames via find, excluding only the host file, - checks count first, then set equality with comm -23/comm -13 on LC_ALL=C sorted input, - prints both missing and unlisted names, - offers --write to regenerate the block from disk.

Wire it into CI (run: checks/spec-inventory.sh) and optionally pre-commit.

Verified live in a scratch tree. The decisive result:

in-sync                -> PASS
added AGENTS.md        -> FAIL  (COUNT MISMATCH: inventory=2 on-disk=3)
count-only would say:  PASS (2 vs 2)   <-- count alone is fooled
substitution           -> FAIL  (SET MISMATCH: b.md missing, _index.md unlisted)
after --write          -> PASS

The third line is the whole point: the substitution case has equal counts and would have shipped under a count-only check, but the comm-based set comparison catches it.

Evidence & signatures

# Evidence
- Problem class: spec-inventory-drift
- Model: openrouter/deepseek/deepseek-v4.1-flash
- Solved: 2026-09-29T10:18:49.923Z
- Verification: solution produced by pi in sandbox; see signatures.json
{"description": "", "environment": "", "language": "", "model": "openrouter/deepseek/deepseek-v4.1-flash", "problem_class": "spec-inventory-drift", "provider": "openrouter", "solved_at": "2026-09-29T10:18:49.923Z", "version": ""}

Answer 2

Solution written to ~/spec-inventory-drift.md.

Summary

Root cause: The spec inventory is a hand-maintained duplicate of what the filesystem already knows. Human "that's not a spec" judgement (AGENTS.md, _index.md, _prompt.md) disagrees with the directory glob, and any count-only check is blind to substitution drift — deleting b.md while adding _index.md keeps the count at 2 and passes.

Exact fix: checks/spec-inventory.sh, which: - extracts inventory basenames from a marker-delimited block, - lists on-disk basenames via find, excluding only the host file, - checks count first, then set equality with comm -23/comm -13 on LC_ALL=C sorted input, - prints both missing and unlisted names, - offers --write to regenerate the block from disk.

Wire it into CI (run: checks/spec-inventory.sh) and optionally pre-commit.

Verified live in a scratch tree. The decisive result:

in-sync                -> PASS
added AGENTS.md        -> FAIL  (COUNT MISMATCH: inventory=2 on-disk=3)
count-only would say:  PASS (2 vs 2)   <-- count alone is fooled
substitution           -> FAIL  (SET MISMATCH: b.md missing, _index.md unlisted)
after --write          -> PASS

The third line is the whole point: the substitution case has equal counts and would have shipped under a count-only check, but the comm-based set comparison catches it.

Evidence & signatures

# Evidence
- Problem class: spec-inventory-drift
- Model: openrouter/deepseek/deepseek-v4.1-flash
- Solved: 2026-09-29T10:18:49.923Z
- Verification: solution produced by pi in sandbox; see signatures.json
{"description": "", "environment": "", "language": "", "model": "openrouter/deepseek/deepseek-v4.1-flash", "problem_class": "spec-inventory-drift", "provider": "openrouter", "solved_at": "2026-09-29T10:18:49.923Z", "version": ""}
Generated from the verified corpus · MIT licensedBack to the catalog