design: Try another round keeps the round's request
Final review M2 (Fable 5). After a More options or More like this
round used its automatic fix rounds, Try another round
(POST /tasks/{id}/round) made a step with no design_ask, so it and
its later rounds no longer knew what was asked.
The new step carries roundAsk(steps), as the automatic fix rounds do;
with the same request it continues the round (no new fix-round base,
so the fix round line says the person asked for it).
Test (RED first):
go test ./internal/equipo/chat/ -run TestTryAnotherRoundKeepsAsk
RED: "Try another round's request \"\", the round's
\"{\"kind\":\"more\",...}\""
GREEN: ok; also -run 'Round|Copy'
Mutation: dropping DesignAsk from the step is the RED above.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 files changed,
+37
−1
internal/equipo/chat/direction_options_test.go+34 −0internal/equipo/chat/triage.go+3 −1
diff --git a/internal/equipo/chat/direction_options_test.go b/internal/equipo/chat/direction_options_test.go| index 1a69ba9f..a8282228 100644 |
| --- a/internal/equipo/chat/direction_options_test.go |
| +++ b/internal/equipo/chat/direction_options_test.go |
| @@ -553,3 +553,37 @@ func TestRoundBase(t *testing.T) { |
| } |
| } |
| } |
| + |
| +// TestTryAnotherRoundKeepsAsk (final review, M2 / Fable 5): after a |
| +// More options round has used its fix rounds, Try another round's step |
| +// carries the round's request (design_ask), so it and a fresh session |
| +// still know what was asked; it is the person's round, not a new one. |
| +func TestTryAnotherRoundKeepsAsk(t *testing.T) { |
| + r, l, task, second := moreRounds(t) |
| + prev, at := second, thirdSHA |
| + for i, sha := range []string{"e0e0e00000000000000000000000000000000004", "f0f0f00000000000000000000000000000000005", ""} { |
| + r.doneWith(l, prev, at, []wire.DesignOption{r.option39(l, prev, 1, "Loud", 1), r.option39(l, prev, 2, "Louder", 1)}) |
| + if sha == "" { |
| + break |
| + } |
| + if fix := r.makerStep(task); fix.ID == prev.ID { |
| + t.Fatalf("no fix round %d", i+1) |
| + } |
| + prev, at = r.startRound(l, task, sha), sha |
| + } |
| + if need := r.needs(task); need != wire.NeedsFixRounds { |
| + t.Fatalf("needs %q", need) |
| + } |
| + if _, err := r.s.RoundTask(r.ctx, paul, task); err != nil { |
| + t.Fatal(err) |
| + } |
| + next := r.makerStep(task) |
| + if next.ID == prev.ID || next.DesignAsk == "" || next.DesignAsk != second.DesignAsk { |
| + t.Fatalf("Try another round's request %q, the round's %q", next.DesignAsk, second.DesignAsk) |
| + } |
| + var steps []stepRecord |
| + r.must(r.s.db.G.Where("task_id = ?", task).Order("idx").Find(&steps).Error) |
| + if p := progressFor(r.load(task), steps); p.base != second.Round { |
| + t.Fatalf("Try another round started a new round: base %d", p.base) |
| + } |
| +} |
diff --git a/internal/equipo/chat/triage.go b/internal/equipo/chat/triage.go| index c0be2cdd..7bfd0446 100644 |
| --- a/internal/equipo/chat/triage.go |
| +++ b/internal/equipo/chat/triage.go |
| @@ -729,7 +729,9 @@ func (s *Store) RoundTask(ctx context.Context, person, id string) (attempt int64 |
| var st stepRecord |
| switch p.needsYou(k) { |
| case wire.NeedsFixRounds: |
| - st = stepRecord{Specialist: wire.SpecialistEngineering, Person: p.eng.Person, Round: max(k.RepairRound, p.eng.Round) + 1, BaseSHA: p.candidate} |
| + // The round's request (More options or More like this) goes |
| + // on, as on its automatic fix rounds. |
| + st = stepRecord{Specialist: wire.SpecialistEngineering, Person: p.eng.Person, Round: max(k.RepairRound, p.eng.Round) + 1, BaseSHA: p.candidate, DesignAsk: roundAsk(steps)} |
| case wire.NeedsMergeConflict: |
| st = stepRecord{Specialist: wire.SpecialistEngineering, Person: p.eng.Person, Round: p.eng.Round, Rebase: true, FromBase: k.BaseSHA, FromCandidate: p.candidate} |
| default: |