Repository navigation
Description
What happened
GateFaultWords and GateFaultHandover in internal/revision/judge.go take a fault string and never read it. Both return a constant, so a faulted gate's journal row, the door's last line and the handover note all say the same thing whatever went wrong:
the review could not be read, so this delivery was never checked
I'm handing this over unchecked: the review of it could not be read, so nothing has confirmed this is what you asked for.
The caller has the real reason and throws it away. faulted (internal/revision/judge.go, search func faulted) builds "the gate answered with nothing this could read: " + firstLine(err.Error()) onto Judgment.Fault, and err is the part that differs run to run — unparsable answer, schema violation, empty body, unreachable checker. cmd/aforge/chat.go (search revision.GateFaultWords) passes gate.Fault into both functions and gets a sentence that could have been written before the run started. This is the same information loss #514 closes on the unjudged path; the faulted path is one branch over in the same if (shaped.Unreadable(err) → faulted, else → unjudged) and still has it.
Base: dev@4aaac923.
Replication
Deterministic (no model). No test asserts the composed sentence today — TestADeliveryWhoseGateFaultedIsNotWhole in cmd/aforge/shaped_test.go hardcodes the constant rather than calling GateFaultWords, so it passes either way. Write TestAFaultedGateRowSaysWhy in internal/revision: call GateFaultWords("the gate answered with nothing this could read: unexpected end of JSON input") and GateFaultHandover with the same string, and assert each result contains unexpected end of JSON input. Today both fail — the returned string never mentions it. Then drive it end to end: a stub gate client whose answer is unreadable, through aforge do --json, and assert the delivery gate row's gap carries the reason and the door's last line does too.
Field (real models). aforge do on deepseek/deepseek-v4-flash (OPENROUTER_API_KEY) with the gate pointed at an unreachable checker, or any run whose judge answers unparsably. Roughly one leaf, a few minutes, cents. Fires on any run where shaped.Unreadable(err) is true at the gate.
Where
GateFaultWordsandGateFaultHandoverininternal/revision/judge.go— searchfunc GateFaultWords.faultedin the same file, the one placeJudgment.Faultis composed — searchfunc faulted.- The only two callers, in
cmd/aforge/chat.go— searchrevision.GateFaultWordsandrevision.GateFaultHandover. - The readers that print it:
gateStandingincmd/aforge/do.go(finding = firstLine(strings.TrimSpace(gate.Gap))) and the gap clause ininternal/resident/findings.go.
The fix
Compose the sentence from the fault at the one place the row is written — inside GateFaultWords and GateFaultHandover, which already receive it. The words keep saying what did NOT happen (nothing was found, so nothing may be alleged about the work) and add the reason:
- row:
the review could not be read, so this delivery was never checked — <fault> - handover:
I'm handing this over unchecked: the review of it could not be read (<fault>), so nothing has confirmed this is what you asked for.
An empty or blank fault falls back to today's exact constants, so no caller learns a special case and cmd/aforge/chat.go is untouched. No caller-side composition.
Acceptance
- e2e:
go test -tags e2e ./internal/e2e/— a run whose gate answers unreadably ends PARTIAL (non-zero exit) and the door's last line contains the fault's own words, not only the constant prefix. - e2e: the control — a run whose gate passes still ends
okwith no gate-fault sentence anywhere. - Unit:
go test -run TestAFaultedGateRowSaysWhy ./internal/revision/— both functions echo a non-empty fault, and both return the unchanged constants for"". - The manual page covering gate outcomes (
internal/manual/chat/) quotes the new wording, and the change entry'sinvalidatesnames the belief that a faulted gate row is one fixed sentence.
Drafted with CodeAF · reviewed and owned by the author
Activity
revision: a faulted gate's row and handover name the fault that happe…