test: make the demo release-path GET deterministic
internal/console/demo_live_test.go+15 −1
Intent
<task-notification> <task-id>by4irofgt</task-id> <tool-use-id>toolu_01MGSRLpo4ZcZrFXmuMCV4Bq</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/cd1b6de2-ac77-426f-a77d-fc5436969c88/tasks/by4irofgt.output</output-file> <status>completed</status> <summary>Background command "Wait for Task 7 fix, then start Task 8 continuation" completed (exit code 0)</summary> </task-notification>
<task-notification> <task-id>a59676e0a311ceae8</task-id> <tool-use-id>toolu_012vwijKEQc2jFcKGhnoK3LV</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/cd1b6de2-ac77-426f-a77d-fc5436969c88/tasks/a59676e0a311ceae8.output</output-file> <status>completed</status> <summary>Agent "Re-review Task 7 fix round 2" finished</summary> <note>A task-notification fires each time this agent stops with no live background children of its own. The user can send it another message and resume it, so the same task-id may notify more than once.</note> <result>Round-2 findings, one line each (line numbers at c52d9553): - **P1-1:** ADDRESSED (demo_publish.go:418-431, :469). Rollback now targets the highest earlier generation that reached `published`, and a job only gets that state after a ready GET inside its window. With no such generation, the job fails plainly and frees its slot. - **P2-1:** ADDRESSED (demo_publish.go:302-305, :314-318, :321-324, :432-438). Per-job settlement, completion and probe errors are logged and the pass continues to later jobs. - **P3 status:** ADDRESSED (apidemo.go:521-529, :544-546). - **P3 policy attempt:** ADDRESSED (demo_publish.go:477-481, :506). The attempt is released before the restore probe. - **P3 channel bound:** ADDRESSED (demo_jobs.go:60; demo_publish.go:363-385). A durable `settlement_until` is set once and never renewed. **Slot bound:** no unbounded path is left in the diff. The worst case is the 60 s starting window plus a separate 60 s settlement window, about 120 s, and longer only while SQL is down. R20 says "the same 60 s starting bound". You need to confirm the second window is what R20 meant. Sharing one deadline would mean a settlement triggered by a timeout always starts already expired and can never roll back. **Rollback target:** only a generation that passed readiness. If the channel's previous version (History[0]) is not that generation, the rollback is refused and the job fails plainly at the bound. **Isolation:** one job's failure no longer stalls others. Each restoring job still costs one serial 5 s probe per tick, but only within its 60 s window. New findings in the fix diff (no P1, no P2): - **P3-1:** apidemo.go:521-523 with :536. During settlement the status says "failed, submit another update" for up to 60 s while the slot is still held, so the update is refused with DEMO-UPDATE. Fault family: status truthfulness and the update loop. - **P3-2:** demo_publish.go:379-381. A rollback confirmed in the last 5 s before the bound is reported as a plain failure instead of "rolled back". Fault family: status truthfulness. - **P3-3:** demo_publish.go:460. When History[0] is not the last ready generation, the doomed rollback is retried every tick for 60 s instead of being refused at once. This needs an earlier settlement to have timed out. Fault family: object-store request cost. - **P3-4:** demo_publish.go:422 vs :445. The same timeout before shipping gives DEMO-BUILD-TIMEOUT for generation 2 and later but the plain failure message for generation 1. Fault family: status consistency. **Census:** no new root read. No root-binary source changed, and `settlement_until` is read only by the console. ### Verdict: READY The review is at `/home/paulca/amadan.net/carlos/platform/.claude/worktrees/agent-start-demo-1/.superpowers/sdd/2026-11-02-agent-start-demo-1-anonymous-apps/task-7-review-r3.md`.</result> <usage><subagent_tokens>84495</subagent_tokens><tool_uses>12</tool_uses><duration_ms>188880</duration_ms></usage> </task-notification>
diff --git a/internal/console/demo_live_test.go b/internal/console/demo_live_test.go| index b84a73706..f0ee22a27 100644 |
| --- a/internal/console/demo_live_test.go |
| +++ b/internal/console/demo_live_test.go |
| @@ -173,7 +173,8 @@ func TestDemoUsesRealReleasePathGET(t *testing.T) { |
| if err != nil { |
| t.Fatal(err) |
| } |
| - hub.EnableTunnels(edge.NewTunnelHub("127.0.0.1", nil)) |
| + tunnels := edge.NewTunnelHub("127.0.0.1", nil) |
| + hub.EnableTunnels(tunnels) |
| if err = hub.Reload(); err != nil { |
| t.Fatal(err) |
| } |
| @@ -201,6 +202,19 @@ func TestDemoUsesRealReleasePathGET(t *testing.T) { |
| case <-time.After(5 * time.Second): |
| t.Fatal("fleet tunnel did not connect") |
| } |
| + // The client reports connected after the 101, before the hub necessarily |
| + // publishes its HTTP/2 channel. Wait for the state the GET actually uses. |
| + registered, stopWaiting := context.WithTimeout(t.Context(), 5*time.Second) |
| + defer stopWaiting() |
| + poll := time.NewTicker(time.Millisecond) |
| + defer poll.Stop() |
| + for tunnels.State(j.Fleet+"/"+j.Box) != "connected" { |
| + select { |
| + case <-registered.Done(): |
| + t.Fatal("fleet tunnel did not register at the hub") |
| + case <-poll.C: |
| + } |
| + } |
| transport := tlsHub.Client().Transport.(*http.Transport).Clone() |
| defer transport.CloseIdleConnections() |
| transport.TLSClientConfig.ServerName = "example.com" // httptest certificate, HTTP Host remains the exact demo host |