rent-fails-clean: rent-error shows raw DigitalOcean 404 instead of stage="provision" message #674

Closed
opened 2026-08-22 17:43:21 +00:00 by matou-build-agent · 3 comments

Failure

The only leg in this drive, rent-fails-clean, went RED on the final content assertion (not the visibility one):

Locator: locator('[data-status="rent-error"]')
Expected pattern: /provision/i
Received string:  "broker: DigitalOcean refused: Not Found: {\"id\":\"not_found\",\"message\":\"The resource you were accessing could not be found.\"}Retry"

The screenshot (test-failed-1.png) confirms it: the rent card is still up, "Choose a different option" is visible, but the yellow callout body reads the raw DigitalOcean API JSON verbatim instead of a provision-stage message.

What the leg is supposed to prove

From the test source (tests/e2e/journey.rented.spec.ts, harvested in error-context.md, the comment above s4aRentExpectFail):

"the rehearsal fault slug makes the broker Destroy the droplet after a real Create and return a 502 stage provision (ADR 0047 — no half-rented server). The card must stay in place with a retriable rent-error naming the stage..."

So the fault-injection contract is: real Create → broker deliberately Destroys the droplet → the next poll/GET against that droplet ID legitimately 404s at DigitalOcean → the broker is supposed to recognize that shape and synthesize a friendly 502 whose message names the provision stage. Instead the raw DigitalOcean 404 body ("Not Found": {"id":"not_found",...}) is forwarded straight through to the UI.

Corroboration from harvested state

  • logs/founding-state.log: "founded": false, draft.step": "access" — the draft genuinely never advanced past S4, matching the test's own "draft untouched" assertions (those passed; only the message-content assertion failed). Rules out a harness/selector problem — the UI's control flow behaved correctly.
  • All logs/guest-*.log files are empty and logs/qemu.log / guest-unit*.log show no process/unit ever existed — expected, since the droplet was destroyed by design before any provisioning telemetry could exist. Not itself an anomaly.
  • No "Live droplet" section was supplied for this run, so there's no box to SSH into for a live check; this diagnosis rests entirely on the harvested artifacts above.

Suspected layer: product (broker)

This is not the known own-VPS pairing-never-flips carrier frontier — that fault isn't referenced anywhere in this run's legs.json, which has exactly one leg and no skip entries. This looks like a gap in the same seam the last two commits touched:

  • 09fcf2b (#671) stamped the rent-fails-clean slug per-drive so a poisoned broker claim can't wedge the leg.
  • b415707 (#672) made broker pollActive retry a transient post-create droplet-GET 404 "instead of masking the rent-fails-clean fault."

#672's own description implies the broker now distinguishes a transient post-create 404 (retry) from the fault-injected post-destroy 404 (which should surface as the synthesized provision-stage 502). This run shows the fault-injected 404 case is falling through to the generic "broker: DigitalOcean refused: " error formatter rather than being mapped to the expected stage: "provision" message — i.e. the retry-vs-synthesize branch added in #672 either isn't matching this 404 shape, or the synthesis step that should follow it was never wired up.

What plugging it needs

In the broker's rent/provision error path (wherever the DigitalOcean 404 from the post-fault-Destroy poll is caught), add/fix the branch that recognizes "droplet no longer exists after a Create we ourselves issued" and raises the ADR-0047 502 with a message containing provision, instead of letting the generic DigitalOcean-error passthrough formatter (broker: DigitalOcean refused: <raw JSON>) handle it. A swarm agent can act on this directly: locate the post-#672 pollActive / create-then-destroy fault path in the broker, confirm it currently falls into the raw-passthrough branch for this 404 shape, and route it to the existing provision-stage error constructor instead.

drive 20260822T173839Z red at rent-fails-clean: expect(locator).toContainText(expected) failed Locator: locator('[data-status="rent-error"]') Expected pattern: /provision/i Received string: "broker: DigitalOcean refused: Not Found: {\"id\":\"not_fo
evidence: test-results/…/20260822T173839Z/ on matou-workstation (legs.json, droplet-journal.txt, trace) — a representative screenshot is attached here if one was captured (#596)

**Failure** The only leg in this drive, `rent-fails-clean`, went RED on the final content assertion (not the visibility one): ``` Locator: locator('[data-status="rent-error"]') Expected pattern: /provision/i Received string: "broker: DigitalOcean refused: Not Found: {\"id\":\"not_found\",\"message\":\"The resource you were accessing could not be found.\"}Retry" ``` The screenshot (`test-failed-1.png`) confirms it: the rent card is still up, "Choose a different option" is visible, but the yellow callout body reads the raw DigitalOcean API JSON verbatim instead of a `provision`-stage message. **What the leg is supposed to prove** From the test source (`tests/e2e/journey.rented.spec.ts`, harvested in `error-context.md`, the comment above `s4aRentExpectFail`): > "the rehearsal fault slug makes the broker Destroy the droplet after a real Create and return a 502 stage `provision` (ADR 0047 — no half-rented server). The card must stay in place with a retriable rent-error naming the stage..." So the fault-injection contract is: real Create → broker deliberately Destroys the droplet → the next poll/GET against that droplet ID legitimately 404s at DigitalOcean → the broker is supposed to recognize that shape and synthesize a friendly 502 whose message names the `provision` stage. Instead the raw DigitalOcean 404 body (`"Not Found": {"id":"not_found",...}`) is forwarded straight through to the UI. **Corroboration from harvested state** - `logs/founding-state.log`: `"founded": false`, `draft.step": "access"` — the draft genuinely never advanced past S4, matching the test's own "draft untouched" assertions (those passed; only the message-content assertion failed). Rules out a harness/selector problem — the UI's control flow behaved correctly. - All `logs/guest-*.log` files are empty and `logs/qemu.log` / `guest-unit*.log` show no process/unit ever existed — expected, since the droplet was destroyed by design before any provisioning telemetry could exist. Not itself an anomaly. - No "Live droplet" section was supplied for this run, so there's no box to SSH into for a live check; this diagnosis rests entirely on the harvested artifacts above. **Suspected layer: product (broker)** This is not the known own-VPS pairing-never-flips carrier frontier — that fault isn't referenced anywhere in this run's `legs.json`, which has exactly one leg and no skip entries. This looks like a gap in the same seam the last two commits touched: - `09fcf2b` (#671) stamped the rent-fails-clean slug per-drive so a poisoned broker claim can't wedge the leg. - `b415707` (#672) made broker `pollActive` retry a transient post-create droplet-GET 404 "instead of masking the rent-fails-clean fault." #672's own description implies the broker now distinguishes a transient post-create 404 (retry) from the fault-injected post-destroy 404 (which should surface as the synthesized `provision`-stage 502). This run shows the fault-injected 404 case is falling through to the generic "broker: DigitalOcean refused: <raw body>" error formatter rather than being mapped to the expected `stage: "provision"` message — i.e. the retry-vs-synthesize branch added in #672 either isn't matching this 404 shape, or the synthesis step that should follow it was never wired up. **What plugging it needs** In the broker's rent/provision error path (wherever the DigitalOcean 404 from the post-fault-Destroy poll is caught), add/fix the branch that recognizes "droplet no longer exists after a Create we ourselves issued" and raises the ADR-0047 502 with a message containing `provision`, instead of letting the generic DigitalOcean-error passthrough formatter (`broker: DigitalOcean refused: <raw JSON>`) handle it. A swarm agent can act on this directly: locate the post-#672 `pollActive` / create-then-destroy fault path in the broker, confirm it currently falls into the raw-passthrough branch for this 404 shape, and route it to the existing `provision`-stage error constructor instead. drive `20260822T173839Z` red at `rent-fails-clean`: `expect(locator).toContainText(expected) failed Locator: locator('[data-status="rent-error"]') Expected pattern: /provision/i Received string: "broker: DigitalOcean refused: Not Found: {\"id\":\"not_fo` evidence: `test-results/…/20260822T173839Z/` on matou-workstation (legs.json, droplet-journal.txt, trace) — a representative screenshot is attached here if one was captured (#596) <!-- rehearsal-sig: dcd9de7c3e06 -->
Author
Member

swarm-claim host=matou-dev-server-01 run=8923
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=matou-dev-server-01 run=8923 (automated multi-host claim — lowest live claim id works this ticket)
Author
Member

Already fixed by #673 (on origin/main) — no new code change

Traced the full fault-line chain against origin/main. The rent-fails-clean red in drive 20260822T173839Z (17:38:39Z) is a timing artifact, not a live code gap:

  • #673 (6a1b0cb9, committed 17:40:36Z — 2 minutes after this drive) makes BrokerError.Error() compose the failure as "{stage} — {message}". Any create-path rent failure now opens the fault-line with provision — …, so /provision/i (and the tightened /^\s*provision\s+—\s/i) match regardless of the raw DigitalOcean text.
  • The broker has set Stage: "provision" on every create-path failure since #647 (8585a954, 04:32Z) — rentals.go &ProvisionError{Stage: "provision", Err: createErr} and the rehearsal-fault return. So the app's #673 prefix always has a stage to compose; no broker redeploy is even needed for the leg to go green.
  • #672 (b4157077, 17:32Z) additionally stops a transient post-create read-after-write 404 from masking the fault (pollActive retries within budget, never returns a raw refusal). The live broker binary carrying #672 was blocked on the mail-droplet SSH door (ready-for-human residue), but that only affects whether the underlying message is the rehearsal-fault text vs a wrapped DO error — the provision — stage prefix from #673 makes the leg pass either way.

Full chain, verified on origin/main:
broker provisionErrorBody{Stage:"provision"} → brokerclient.brokerErr → founding.BrokerError{Stage,Message} → Error() = "provision — broker: DigitalOcean refused: Not Found: …" → helper fail() Response.Error → founding.ts:1025 throw new Error(resp.error) → FoundingAccess.vue:294 rentError = e.message → <p data-field="fault-line">. Matches the anchored fixture assertion in s4aRentExpectFail.

Seam tests (all green on origin/main): TestBrokerError_ErrorCarriesStage, TestRent_ProviderFailureAfterCreateDestroysAndLeavesNoRecord (the #674 shape: Create returns Server{ID}+error → Stage:"provision" + destroy + no ledger record), TestRentFailHostIsDestroyedAndErrors, TestDO_CreateRetriesTransientPollNotFound, TestDO_CreateFailsLoudWhenPollNeverRecovers.

The issue's speculated fix — a broker branch that synthesizes a provision message from the post-destroy 404 — is unnecessary and would contradict #672's accepted retry design: the stage is already set structurally and the app already surfaces it. The next rehearsal drive (rebuilt from origin/main with #673) will render provision — … and pass.

Closing as already-resolved (no new code required). Signature dcd9de7c3e06 is shared with #671/#672/#673 — the same recurring leg, now closed in code.

## Already fixed by #673 (on `origin/main`) — no new code change Traced the full fault-line chain against `origin/main`. The `rent-fails-clean` red in drive `20260822T173839Z` (17:38:39Z) is a **timing artifact**, not a live code gap: - **#673** (`6a1b0cb9`, committed **17:40:36Z** — 2 minutes *after* this drive) makes `BrokerError.Error()` compose the failure as `"{stage} — {message}"`. Any create-path rent failure now opens the fault-line with `provision — …`, so `/provision/i` (and the tightened `/^\s*provision\s+—\s/i`) match regardless of the raw DigitalOcean text. - The broker has set `Stage: "provision"` on every create-path failure since **#647** (`8585a954`, 04:32Z) — `rentals.go` `&ProvisionError{Stage: "provision", Err: createErr}` and the rehearsal-fault return. So the app's `#673` prefix always has a stage to compose; **no broker redeploy is even needed** for the leg to go green. - **#672** (`b4157077`, 17:32Z) additionally stops a transient post-create read-after-write 404 from masking the fault (`pollActive` retries within budget, never returns a raw refusal). The live broker binary carrying #672 was blocked on the mail-droplet SSH door (ready-for-human residue), but that only affects whether the underlying message is the rehearsal-fault text vs a wrapped DO error — the `provision — ` **stage prefix from #673 makes the leg pass either way.** **Full chain, verified on `origin/main`:** `broker provisionErrorBody{Stage:"provision"}` → `brokerclient.brokerErr` → `founding.BrokerError{Stage,Message}` → `Error()` = `"provision — broker: DigitalOcean refused: Not Found: …"` → helper `fail()` `Response.Error` → `founding.ts:1025 throw new Error(resp.error)` → `FoundingAccess.vue:294 rentError = e.message` → `<p data-field="fault-line">`. Matches the anchored fixture assertion in `s4aRentExpectFail`. **Seam tests (all green on `origin/main`):** `TestBrokerError_ErrorCarriesStage`, `TestRent_ProviderFailureAfterCreateDestroysAndLeavesNoRecord` (the #674 shape: `Create` returns `Server{ID}`+error → `Stage:"provision"` + destroy + no ledger record), `TestRentFailHostIsDestroyedAndErrors`, `TestDO_CreateRetriesTransientPollNotFound`, `TestDO_CreateFailsLoudWhenPollNeverRecovers`. The issue's speculated fix — a broker branch that *synthesizes* a `provision` message from the post-destroy 404 — is unnecessary and would contradict #672's accepted retry design: the stage is already set structurally and the app already surfaces it. The next rehearsal drive (rebuilt from `origin/main` with #673) will render `provision — …` and pass. Closing as already-resolved (no new code required). Signature `dcd9de7c3e06` is shared with #671/#672/#673 — the same recurring leg, now closed in code.
Author
Member

close-report for #674 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 674,
  "status": "success",
  "commits": [],
  "changed_files": [],
  "tests": [
    {
      "command": "go test ./internal/founding/ ./internal/brokerclient/",
      "exit_code": 0
    },
    {
      "command": "go test ./broker/internal/broker/ -run 'TestRent_ProviderFailureAfterCreate|TestRentFailHost|TestDO_CreateRetries|TestDO_CreateFailsLoud'",
      "exit_code": 0
    }
  ],
  "criteria": {
    "The S4a rent-error fault-line names the provision stage instead of the raw DigitalOcean 404": "Already satisfied by #673 (6a1b0cb9, on origin/main): BrokerError.Error() composes '{stage} — {message}', so the fault-line opens with 'provision — broker: DigitalOcean refused: …'; broker sets Stage:'provision' on every create-path failure since #647. Verified end-to-end: broker provisionErrorBody.Stage -> brokerclient.brokerErr -> founding.BrokerError.Error() -> helper fail() Response.Error -> founding.ts throw new Error(resp.error) -> FoundingAccess.vue rentError -> [data-field=fault-line]. Matches anchored fixture /^\\s*provision\\s+—\\s/i in s4aRentExpectFail.",
    "The rent card stays in place, retriable, draft untouched at S4": "Unchanged and covered: TestRent_ProviderFailureAfterCreateDestroysAndLeavesNoRecord (destroy + no ledger record, no half-rented box, ADR 0047); FoundingAccess.vue renders the retry button + choose-a-different-option on data-status=rent-error."
  },
  "summary": "rent-fails-clean fault-line already names the provision stage on origin/main (#673); the failing drive ran 2 minutes before #673 landed, so no new code is warranted.",
  "reason": "The drive 20260822T173839Z (17:38:39Z) predates #673 (6a1b0cb9, 17:40:36Z) by two minutes. #673 makes BrokerError.Error() compose 'provision — {message}', and the broker has carried Stage:'provision' on create-path failures since #647 — so the fault-line now opens with the stage token and matches both the old /provision/i and the tightened anchored assertion, regardless of the raw DigitalOcean text. #672 additionally stops a transient read-after-write 404 masking the fault. The full app<-broker chain and all seam tests (TestBrokerError_ErrorCarriesStage, TestRent_ProviderFailureAfterCreateDestroysAndLeavesNoRecord, TestRentFailHostIsDestroyedAndErrors, TestDO_CreateRetriesTransientPollNotFound, TestDO_CreateFailsLoudWhenPollNeverRecovers) are green on origin/main. The issue's speculated broker-side 'synthesize provision' branch is redundant and would contradict #672's accepted retry design.",
  "blockers": [],
  "no_code_change": "Already fixed by #673 (6a1b0cb9), reachable from origin/main, which landed 2 minutes after the drive that filed this ticket. The seam and full DOM chain are verified green; adding code would duplicate the stage the broker already sets."
}
**close-report** for #674 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 674, "status": "success", "commits": [], "changed_files": [], "tests": [ { "command": "go test ./internal/founding/ ./internal/brokerclient/", "exit_code": 0 }, { "command": "go test ./broker/internal/broker/ -run 'TestRent_ProviderFailureAfterCreate|TestRentFailHost|TestDO_CreateRetries|TestDO_CreateFailsLoud'", "exit_code": 0 } ], "criteria": { "The S4a rent-error fault-line names the provision stage instead of the raw DigitalOcean 404": "Already satisfied by #673 (6a1b0cb9, on origin/main): BrokerError.Error() composes '{stage} — {message}', so the fault-line opens with 'provision — broker: DigitalOcean refused: …'; broker sets Stage:'provision' on every create-path failure since #647. Verified end-to-end: broker provisionErrorBody.Stage -> brokerclient.brokerErr -> founding.BrokerError.Error() -> helper fail() Response.Error -> founding.ts throw new Error(resp.error) -> FoundingAccess.vue rentError -> [data-field=fault-line]. Matches anchored fixture /^\\s*provision\\s+—\\s/i in s4aRentExpectFail.", "The rent card stays in place, retriable, draft untouched at S4": "Unchanged and covered: TestRent_ProviderFailureAfterCreateDestroysAndLeavesNoRecord (destroy + no ledger record, no half-rented box, ADR 0047); FoundingAccess.vue renders the retry button + choose-a-different-option on data-status=rent-error." }, "summary": "rent-fails-clean fault-line already names the provision stage on origin/main (#673); the failing drive ran 2 minutes before #673 landed, so no new code is warranted.", "reason": "The drive 20260822T173839Z (17:38:39Z) predates #673 (6a1b0cb9, 17:40:36Z) by two minutes. #673 makes BrokerError.Error() compose 'provision — {message}', and the broker has carried Stage:'provision' on create-path failures since #647 — so the fault-line now opens with the stage token and matches both the old /provision/i and the tightened anchored assertion, regardless of the raw DigitalOcean text. #672 additionally stops a transient read-after-write 404 masking the fault. The full app<-broker chain and all seam tests (TestBrokerError_ErrorCarriesStage, TestRent_ProviderFailureAfterCreateDestroysAndLeavesNoRecord, TestRentFailHostIsDestroyedAndErrors, TestDO_CreateRetriesTransientPollNotFound, TestDO_CreateFailsLoudWhenPollNeverRecovers) are green on origin/main. The issue's speculated broker-side 'synthesize provision' branch is redundant and would contradict #672's accepted retry design.", "blockers": [], "no_code_change": "Already fixed by #673 (6a1b0cb9), reachable from origin/main, which landed 2 minutes after the drive that filed this ticket. The seam and full DOM chain are verified green; adding code would duplicate the stage the broker already sets." } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Matou/idss#674
No description provided.