A timed-out commit that fails to push is never republished
Astra round 3 on the branch (one P1, one P2): - P1: a timed-out step's commit whose push failed was reported push_failed, and the person's Retry republished it; a runner rolled back to protocol 30 would publish it as finished. Such a push failure now stops step_timeout: the step is tried afresh, never republished. - P2: a narrow fix round (say, formatting) cleared the unfinished mark before anyone judged the missing work. The mark now stays through fix rounds until a Review has judged unfinished work and a round after it finished.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5 files changed,
+59
−21
.rastrillo/budgets.txt+2 −2internal/equipo/chat/review.go+15 −8internal/equipo/chat/unfinished_test.go+13 −9internal/runner/thin/engineer.go+10 −2internal/runner/thin/engineer_time_test.go+19 −0
diff --git a/.rastrillo/budgets.txt b/.rastrillo/budgets.txt| index 1c6a1c89..afe99bd3 100644 |
| --- a/.rastrillo/budgets.txt |
| +++ b/.rastrillo/budgets.txt |
| @@ -38,7 +38,7 @@ time internal/runner/provider 15s Plan 3 CI repair measured 10.346s for the full |
| perf GET /releases/* skip Verified runner release file downloads, not browser GET screens. |
| perf GET /install.sh skip Mac runners: the one-line bootstrap a terminal pipes to sh, not a browser screen. |
| time internal/runner/containment 15s Plan 3 loaded CI measured 10.817s; |
| -size internal/runner/thin 28906 23651 Protocol 30 tools, merge credential (2026-11-26); step limit, kept timed-out work, shell use, CI unit shares (2026-11-26); measured 28906/23651. |
| +size internal/runner/thin 28914 23670 Protocol 30 tools, merge credential (2026-11-26); step limit, kept timed-out work, shell use, CI unit shares (2026-11-26); measured 28914/23670. |
| time internal/thintest 240s Thin contract and page tests, the Assistant's and the models' included, share one harness. Measured 202s on a shared 16 CPU box (2026-11-13); CI runs two lanes. |
| time internal/runner/mac 30s Mac runners (Darwin worker): real process groups killed after a grace and proven gone (SIGTERM, SIGKILL, the marker sweep), and the probes run end to end with fake srt and xcodebuild, P6 killing. |
| time internal/runner/thin 45s Thin v1 slice 4 review: real git repositories for the merge and squash checks, a stalled fetch, and a 16 MiB candidate streamed through the review diff and the checks pack (about 5s). |
| @@ -56,7 +56,7 @@ perf GET /api/v1/tasks/{id} skip Thin v1 person API: bearer-only JSON for device |
| perf GET /api/v1/assistant/snapshot skip Assistant person API: bearer-only JSON for Base's chat, not a browser screen. |
| perf GET /api/v1/assistant/messages skip Assistant person API: bearer-only JSON for Base's chat, not a browser screen. |
| perf GET /api/v1/assistant/events skip Assistant event stream (Server-Sent Events), bearer-only and long-lived; not a screen. |
| -size internal/equipo/chat 34980 9743 Native task projection, no-access merges; unfinished candidates, free shell-less rounds, CI unit feedback (2026-11-26); measured 34980/9743. |
| +size internal/equipo/chat 34987 9747 Native task projection, no-access merges; unfinished candidates, free shell-less rounds, CI unit feedback (2026-11-26); measured 34987/9747. |
| perf GET /api/v1/questions/{id} skip Thin v1 person API: bearer-only JSON for devices; the browser reads questions on /tasks/{id}. |
| perf GET /api/v1/steps/{id}/log skip Thin v1 person API: bearer-only JSON for devices; the browser shows the log tail on /tasks/{id}. |
| perf GET /api/v1/connections/preference skip Connections slice 1 person API: bearer-only JSON for devices; the browser shows the preference on /conversation/connections. |
diff --git a/internal/equipo/chat/review.go b/internal/equipo/chat/review.go| index b30f23e5..276781b4 100644 |
| --- a/internal/equipo/chat/review.go |
| +++ b/internal/equipo/chat/review.go |
| @@ -44,8 +44,9 @@ type progress struct { |
| // automatic rounds (freeRound). |
| free int |
| // unfinishedWork: the candidate holds the work of an Engineering step |
| - // that ran out of time, with any Copy commit or rebase on top. |
| - unfinishedWork bool |
| + // that ran out of time, with any Copy commit, rebase or fix round on |
| + // top; unfinishedJudged, that a Review has judged such a candidate. |
| + unfinishedWork, unfinishedJudged bool |
| } |
| // freeRound: s is a pushed fix round without a working shell |
| @@ -103,10 +104,14 @@ func progressOfKind(steps []stepRecord, kind string) progress { |
| p.eng = s |
| if s.Pushed && s.CandidateSHA != "" { |
| p.candidate, p.checks, p.review, p.merge = s.CandidateSHA, nil, nil, nil |
| - // A rebase only puts the work on the new tip (and never |
| - // keeps timed-out work): the mark stays as it was. |
| - if !s.Rebase { |
| - p.unfinishedWork = s.State == wire.StepDone && s.Reason == reasonUnfinished |
| + // The mark stays through a rebase (it only puts the work on |
| + // the new tip) and through fix rounds, until an Engineering |
| + // round finishes after a Review judged the unfinished work. |
| + switch { |
| + case s.State == wire.StepDone && s.Reason == reasonUnfinished: |
| + p.unfinishedWork, p.unfinishedJudged = true, false |
| + case !s.Rebase && p.unfinishedJudged: |
| + p.unfinishedWork, p.unfinishedJudged = false, false |
| } |
| } |
| case wire.SpecialistCopy: |
| @@ -120,6 +125,9 @@ func progressOfKind(steps []stepRecord, kind string) progress { |
| case wire.SpecialistReview: |
| if p.candidate != "" && s.CandidateSHA == p.candidate && counts(s, kind) { |
| p.review = s |
| + if p.unfinishedWork && s.State == wire.StepDone { |
| + p.unfinishedJudged = true |
| + } |
| } |
| case wire.SpecialistMerge: |
| if p.candidate != "" && s.CandidateSHA == p.candidate { |
| @@ -512,8 +520,7 @@ func (t *txn) stepBrief(k taskRecord, s stepRecord) (string, error) { |
| const reasonUnfinished = "step_timeout" |
| // unfinished: the candidate is the work of an Engineering step that ran |
| -// out of time before it finished (a Copy commit or a rebase on top keeps |
| -// it so). |
| +// out of time before it finished (see progress.unfinishedWork). |
| func unfinished(p progress) bool { return p.candidate != "" && p.unfinishedWork } |
| // unfinishedReview is Review's part of the brief for such a candidate |
diff --git a/internal/equipo/chat/unfinished_test.go b/internal/equipo/chat/unfinished_test.go| index 4b0e090a..484b832a 100644 |
| --- a/internal/equipo/chat/unfinished_test.go |
| +++ b/internal/equipo/chat/unfinished_test.go |
| @@ -7,24 +7,28 @@ import ( |
| ) |
| // A candidate is unfinished when the Engineering step that made it ran |
| -// out of time; a Copy commit on top keeps it unfinished (Review is still |
| -// told), and the next Engineering round that finishes clears it. |
| +// out of time; a Copy commit, a rebase or a fix round on top keeps it |
| +// unfinished (Review is still told), until a Review has judged unfinished |
| +// work and an Engineering round after it finished. |
| func TestUnfinishedSurvivesCopy(t *testing.T) { |
| timedOut := stepRecord{Specialist: wire.SpecialistEngineering, State: wire.StepDone, Pushed: true, CandidateSHA: "eng", Reason: "step_timeout"} |
| copied := stepRecord{Specialist: wire.SpecialistCopy, State: wire.StepDone, Pushed: true, CandidateSHA: "copy"} |
| finished := stepRecord{Specialist: wire.SpecialistEngineering, State: wire.StepDone, Pushed: true, CandidateSHA: "fix", Round: 1} |
| + reviewed := stepRecord{Specialist: wire.SpecialistReview, State: wire.StepDone, CandidateSHA: "copy", Verdict: wire.VerdictChanges} |
| rebased := stepRecord{Specialist: wire.SpecialistEngineering, State: wire.StepDone, Pushed: true, CandidateSHA: "rebased", Rebase: true} |
| for name, c := range map[string]struct { |
| steps []stepRecord |
| want bool |
| }{ |
| - "timed out": {[]stepRecord{timedOut}, true}, |
| - "copy on top": {[]stepRecord{timedOut, copied}, true}, |
| - "finished after": {[]stepRecord{timedOut, copied, finished}, false}, |
| - "finished": {[]stepRecord{finished}, false}, |
| - "copy on a finished": {[]stepRecord{finished, copied}, false}, |
| - "rebased": {[]stepRecord{timedOut, copied, rebased}, true}, |
| - "rebased, finished": {[]stepRecord{finished, rebased}, false}, |
| + "timed out": {[]stepRecord{timedOut}, true}, |
| + "copy on top": {[]stepRecord{timedOut, copied}, true}, |
| + "fixed, not yet reviewed": {[]stepRecord{timedOut, copied, finished}, true}, |
| + "reviewed, then fixed": {[]stepRecord{timedOut, copied, reviewed, finished}, false}, |
| + "reviewed, not fixed": {[]stepRecord{timedOut, copied, reviewed}, true}, |
| + "finished": {[]stepRecord{finished}, false}, |
| + "copy on a finished": {[]stepRecord{finished, copied}, false}, |
| + "rebased": {[]stepRecord{timedOut, copied, rebased}, true}, |
| + "rebased, finished": {[]stepRecord{finished, rebased}, false}, |
| } { |
| if got := unfinished(progressOf(c.steps)); got != c.want { |
| t.Errorf("%s: unfinished %v, want %v", name, got, c.want) |
diff --git a/internal/runner/thin/engineer.go b/internal/runner/thin/engineer.go| index 19de3961..ef67ae85 100644 |
| --- a/internal/runner/thin/engineer.go |
| +++ b/internal/runner/thin/engineer.go |
| @@ -404,9 +404,17 @@ func (e *Engineer) Exec(ctx context.Context, r stepRow, progress func(wire.StepR |
| } |
| // withCommitReason is a publish's report with the reason its commit's |
| -// phase carries, once pushed. |
| +// phase carries, once pushed. A timed-out step's commit that could not |
| +// be pushed stops step_timeout, not push_failed: it is tried afresh, |
| +// never republished, so no runner (an older one, rolled back, included) |
| +// can publish it as finished work. |
| func withCommitReason(rep wire.StepReport, phase string) wire.StepReport { |
| - if reason := committedReason(phase); reason != "" && rep.Pushed { |
| + reason := committedReason(phase) |
| + switch { |
| + case reason == "": |
| + case rep.Pushed: |
| + rep.Reason = reason |
| + case phase == phaseCommittedUnfinished && rep.State == wire.StepFailed: |
| rep.Reason = reason |
| } |
| return rep |
diff --git a/internal/runner/thin/engineer_time_test.go b/internal/runner/thin/engineer_time_test.go| index 265317ee..b7fe475f 100644 |
| --- a/internal/runner/thin/engineer_time_test.go |
| +++ b/internal/runner/thin/engineer_time_test.go |
| @@ -162,3 +162,22 @@ func TestRepublishKeepsHowTheStepFinished(t *testing.T) { |
| } |
| } |
| } |
| + |
| +// A timed-out step's commit that could not be pushed stops step_timeout, |
| +// not push_failed: it is tried afresh, never republished, so no runner |
| +// (an older one included) can publish it as finished work. |
| +func TestUnfinishedPushFailureIsATimeout(t *testing.T) { |
| + rep := wire.StepReport{State: wire.StepFailed, Reason: "push_failed", LogTail: "git: refused"} |
| + if got := withCommitReason(rep, phaseCommittedUnfinished); got.State != wire.StepFailed || got.Reason != "step_timeout" || got.LogTail != rep.LogTail { |
| + t.Fatalf("unfinished: %+v", got) |
| + } |
| + for _, phase := range []string{phaseCommitted, phaseCommittedNoShell} { |
| + if got := withCommitReason(rep, phase); got.Reason != "push_failed" { |
| + t.Fatalf("%s: %+v", phase, got) |
| + } |
| + } |
| + conflict := wire.StepReport{State: wire.StepFailed, Reason: "push_conflict"} |
| + if got := withCommitReason(conflict, phaseCommittedUnfinished); got.Reason != "step_timeout" { |
| + t.Fatalf("conflict: %+v", got) |
| + } |
| +} |