From the three-lens deep review (review-remediation). Theme: floor Short ID allocation. Conforms to ADR-0006.
Problem
ADR-0006 says Short IDs are "monotonically increasing... never reused." createTask (src/store.ts:88-102) reads next_id from meta.yaml verbatim with no floor against the real max. Any drift (bad merge, partial restore, manual edit) yields a duplicate-id file; findTask returns the first match, so show/mv/set/rm/link silently operate on the wrong task. doctor detects none of it.
Slices
6. Short ID allocation floored against the real maximum (finding #4 — allocation)
Allocate next_id = max(metaNextId, maxExistingId(live ∪ archived) + 1) with a pre-write uniqueness check.
7. doctor reports duplicate Short IDs (finding #4 — detection)
Teach tasks doctor to detect and report tasks sharing a Short ID.
Open question
Flooring next_id scans live ∪ archived on every create — confirm the cost is negligible at expected human/agent task volumes.
Method
TDD outside-in at the CLI boundary. One commit per green. Both slices can start immediately.
From the three-lens deep review (review-remediation). Theme: floor Short ID allocation. Conforms to ADR-0006.
Problem
ADR-0006 says Short IDs are "monotonically increasing... never reused."
createTask(src/store.ts:88-102) readsnext_idfrommeta.yamlverbatim with no floor against the real max. Any drift (bad merge, partial restore, manual edit) yields a duplicate-id file;findTaskreturns the first match, soshow/mv/set/rm/linksilently operate on the wrong task.doctordetects none of it.Slices
6. Short ID allocation floored against the real maximum (finding #4 — allocation)
Allocate
next_id = max(metaNextId, maxExistingId(live ∪ archived) + 1)with a pre-write uniqueness check.meta.yaml'snext_idseeded below the real max,tasks newnever creates a duplicate Short ID.tasks newstill yields monotonic, never-reused ids.newthat would collide picks the floored id instead.7.
doctorreports duplicate Short IDs (finding #4 — detection)Teach
tasks doctorto detect and report tasks sharing a Short ID.doctorflags the duplication and names the colliding id(s).Open question
Flooring
next_idscanslive ∪ archivedon every create — confirm the cost is negligible at expected human/agent task volumes.Method
TDD outside-in at the CLI boundary. One commit per green. Both slices can start immediately.