mirror of
https://github.com/bitbaum/loki.git
synced 2026-12-05 13:37:18 +01:00
"The feedback run delivered #757, but its record ended as partial. Shipping and outcome reporting still disagree." They were not disagreeing. They were answering different questions, and Control only ever asked one of them. A run's `outcome` grades the AGENT'S ATTEMPT and is stamped once, at close — necessarily before the pull request is merged and the box redeployed. The fix ledger (`payload.fix`) grades the CHANGE, and keeps moving after the run is closed: pr_open -> merged -> deploying -> deployed. Both records were right. Control rendered the first and never read the second, so a run that closed `partial` and then merged and deployed read on the card as unfinished work — while the Feedback row, two surfaces away, already said "PR #757 · merged". The ledger was already there and already correct: `runFinishedWell` includes `partial`, so partial runs have been tracked through merge and deploy all along. Nothing needed reconciling; the control plane just never carried the field. `serializeLatestRun` now passes it, validated the same way `evidence.kind` is — an unknown state drops the block rather than printing a raw enum at the operator. One consequence worth calling out: the card's "no commit" warning is read off the run's own handoff, and a merged, deployed pull request outranks it. Before this, a run whose handoff forgot the SHA showed "no commit" directly beside "merged and deployed". NOT a closure-policy change, deliberately. Promoting `partial` to `success` after the fact would be the obvious move and it is wrong: a merged pull request does not prove the run's definition-of-done bar was met, and `partial` is non-failing, so an undeserved upgrade silently cancels the escalation ladder. The verdict stands; the card now also reports where the change is. The long-form copy for these states stays in feedback/work-phase.ts — that is the Feedback row's voice. This is the short form for a card with one line to spend, reading the same FIX_SHIP_STATE constants so a new state cannot appear in one and not the other. Tests: 8 cases, proved by mutation — returning null for DEPLOYED (the old silence) fails "a run that shipped says so, whatever its outcome was". tsc clean, lint 0 errors, test:unit 202/202. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>