/cad-why: read the corpus back at a file and line #192
Labels
No labels
already-shipped
bug
documentation
duplicate
enhancement
external-review
good first issue
help wanted
in progress
invalid
needs-decision
proposal
question
security
wontfix
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: crenshawdev/cadence-archived#192
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The problem
The
.planning/corpus can already answer "why is this code like this" andnothing surfaces it.
Everything needed is on disk: the phase SUMMARY names what shipped and its
commits, the plan names the task, CONTEXT names the numbered decision behind it,
the deviation record names where the plan was wrong, the review artifacts name
what an adversarial pass objected to, and
trace.jsonlnames what it all cost.A file path plus a commit is enough to walk all of it, and there is no command
that does.
That is the product's single best answer to its own value claim, sitting unread.
The proposal
A reader, not a writer:
Resolves through
git logfor the commits touching that path, then joins each toits phase, its plan task, the
D-NNthat decided it, any deviation that refutedthat decision, and any review finding that survived triage against it.
Output is a short chain, newest first, with the record's own words. No model
judgment, no summarization pass. It is a join, and it should be a deterministic
seam script for exactly that reason.
Why this is worth building before anything else on the list
It is the only item here that is a demo. Cadence currently has no artifact that
produces a win in the first ten minutes, and the README has to argue the value
instead of showing it. "Point at any line and it tells you which decision put it
there, and which later phase proved that decision wrong" is thirty seconds and
needs no argument.
It also has a second-order effect: it is the first thing that makes the corpus
READ, which surfaces immediately whether the write-side care has been worth it.
Cost
Low relative to the others. It writes nothing, gates nothing, and can fail
gracefully on any phase whose record is incomplete. The hard part is the join
across renamed and pruned phases, and the honest answer there is to report the
gap rather than guess.
Shipped in v3.6.0 as WHY-01.
/cad-why [:] resolves the commits touching a path and joins each to six record edges: phase, plan task, the D-NN that decided it, the deviation that refuted that decision, the review finding that survived triage, and the declaring task. Deterministic seam, no model judgment, no summarization pass.
The hard part this issue named, the join across renamed and pruned phases, answers rather than guesses. Run against lib/why-corpus.mjs right after the v3.6.0 close pruned phase 3, the chain still resolves it: 'phase: v3.6.0 phase 3 (recovered from a40f7fcf:.planning/phases/3)'. Where no tier answers, it names the gap in words instead of returning an empty chain.
Three limits are named in the CHANGELOG rather than hidden, and are v3.6.1's scope: the bare-path arm inherits git's default history simplification (7 of 10 commits measured on lib/release-decision.mjs), the renderer's entry cap of 10 carries a byte reason measured false at 15,637 B, and closeOver compares timestamps as strings.