CI: contract the thin merge route; wait for the task's link in 3_engineering
The route coverage test lists thin routes contracted by fixtures; the headless scenario read the task before its own event arrived.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 files changed,
+5
−1
internal/headless/engineering_test.go+4 −0internal/plan3test/person_api_contract_test.go+1 −1
CI failed — run details
Intent
diff --git a/internal/headless/engineering_test.go b/internal/headless/engineering_test.go| index 4fb7dcb8..5e5eef5a 100644 |
| --- a/internal/headless/engineering_test.go |
| +++ b/internal/headless/engineering_test.go |
| @@ -93,6 +93,10 @@ func scenarioEngineering(t *testing.T, env *Env) { |
| id := s.taskOf(t, sent.Turn.ID) |
| noted := time.Since(start) |
| step := s.step(t, id, 25*time.Minute, wire.StepDone, wire.StepFailed, wire.StepCancelled) |
| + // The task's own event (with its link) may follow the step's. |
| + if step.Pushed { |
| + s.wait(t, "the task's link", 30*time.Second, func(c *thintest.Conversation) bool { return c.Tasks[id].URL != "" }) |
| + } |
| var task wire.Task |
| var stages []string |
| s.conv.Locked(func(c *thintest.Conversation) { task, stages = c.Tasks[id], c.Stages[id] }) |
diff --git a/internal/plan3test/person_api_contract_test.go b/internal/plan3test/person_api_contract_test.go| index 72e379ca..700c20bf 100644 |
| --- a/internal/plan3test/person_api_contract_test.go |
| +++ b/internal/plan3test/person_api_contract_test.go |
| @@ -56,7 +56,7 @@ func personAPIContractCoverage(t *testing.T) { |
| f := newFixture(t) |
| registered := map[string]bool{} |
| // Thin v1 conversation routes are contracted by internal/wire fixtures. |
| - thin := map[string]bool{"GET /messages": true, "POST /messages": true, "GET /turns/{id}": true, "POST /turns/{id}/cancel": true, "GET /snapshot": true, "GET /events": true, "DELETE /projects/{id}": true, "POST /cards/{id}/answer": true, "GET /notebook": true, "POST /notebook/reset": true, "POST /tasks/{id}/retry": true, "POST /tasks/{id}/thread": true, "GET /steps/{id}/log": true, "POST /tasks/{id}/questions": true, "POST /questions/{id}/cancel": true} |
| + thin := map[string]bool{"GET /messages": true, "POST /messages": true, "GET /turns/{id}": true, "POST /turns/{id}/cancel": true, "GET /snapshot": true, "GET /events": true, "DELETE /projects/{id}": true, "POST /cards/{id}/answer": true, "GET /notebook": true, "POST /notebook/reset": true, "POST /tasks/{id}/retry": true, "POST /tasks/{id}/merge": true, "POST /tasks/{id}/thread": true, "GET /steps/{id}/log": true, "POST /tasks/{id}/questions": true, "POST /questions/{id}/cancel": true} |
| must(t, chi.Walk(f.Store.PersonAPIHandler().(chi.Routes), func(method, path string, _ http.Handler, _ ...func(http.Handler) http.Handler) error { |
| if thin[method+" "+path] { |
| return nil |