Repository navigation
Description
internal/store/gate.go refuses a failing delivery gate whose gap is empty:
if !gate.Pass && gate.Gap == "" {
return fmt.Errorf("record delivery gate: %w: a failed gate must name the gap", ErrInvalid)
}and until #496 the one caller that judges a delivery discarded that error
(cmd/aforge/chat.go, _ = graph.RecordDeliveryGate(node.ID, evidence)). So a
gate that really failed but produced no gap sentence vanished from the ledger
with nothing anywhere saying a delivery had been judged.
#496 fixes the caller — the write is checked and a failure is logged — so the
loss is now visible. It does not fix the loss itself, deliberately.
Why the obvious fix is wrong
Filling Gap with a sentinel (no gap named) is two lines and breaks a third
thing: every reader of DeliveryGate.Gap treats a non-empty gap as a defect the
run must repair.
| Reader | What a sentinel becomes |
|---|---|
cmd/aforge/do.go:1589,1645 |
printed to a person as gate: fail — no gap named |
internal/resident/findings.go:135,207-208 |
filed under "What the last review found missing" |
internal/resident/progress.go:276-278 |
converted into a shortfall |
internal/resident/resident.go:2819 |
handed to the distiller as "the gate caught this missing element: no gap named" |
That is machinery vocabulary on a person's screen and a finding nobody made,
fed back as evidence to repair against. It was tried on #496's branch and
reverted for exactly this reason.
The shape that works
The row is recorded, Gap stays empty, and the fact rides its own field on
store.DeliveryGate — so Whole() and the four readers above can tell failed,
and nobody wrote why from failed, and here is why. Two facts, two fields.
Both are things a reader needs and neither is recoverable from the silence.
Replication
// internal/store, against a fresh graph
err := graph.RecordDeliveryGate("job", store.DeliveryGate{Quote: "every part"})
// today: err is ErrInvalid and nothing is written.
// wanted: nil, one row, Pass false, Gap "", and the new field saying the
// judgement arrived without a reason.Acceptance
- A failing gate with no gap is recorded and survives
Rebuild. DeliveryGate.Whole()answers the same as it does today for that row.- None of the four readers above renders the fact as a gap, a finding, a
shortfall, or a missing element — a test per reader, named. - The person-facing sentence, wherever it lands, is checked against the
no-machinery-vocabulary law.
Drafted with CodeAF · reviewed and owned by the author
Activity
exec: the landing accounts for its own change, on every belt
exec: the landing accounts for its own change, on every belt (#496)