Skip to content

An owed proof runs its routes, and the sandbox reaches the team's own app hosts - #927

Merged
coderhelm[bot] merged 2 commits into
mainfrom
proof-routes-own-hosts
Nov 30, 2026
Merged

coderhelm[bot] merged 2 commits into
mainfrom
proof-routes-own-hosts

Conversation

@nambok

@nambok nambok commented Nov 30, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

A test fix's own review asked for one thing: the test passing a set number of times in a row with retries off. The sandbox couldn't reach the team's staging site or the pull request's preview, because its network allowlist held only hosts typed into Settings. The fix round then stopped, asked a person to widen CoderHelm's allowlist or run the command, and called a repeat on CI "a CI change outside this ticket". The findings had already had their round on that head, so nothing picked the pull request up again.

This pull request fixes the shape, not the one host:

  • The team's own hosts, derived safely. Where the team's apps are served is read from the default branch only: its end-to-end config (baseURL, *_BASE_URL), env templates (never a real .env), workflow environments (url:, templates like pr-${{ github.event.number }}.preview… read as their domain) and the default branch's deploys. A pull request's head is never read for hosts, so a change can't add a host for the sandbox to send data to. A derived host is allowed only when it falls under a domain the team verified in Settings (its web domains, the store check_url already uses). A domain the default branch names that isn't verified yet comes back as suggested_web_domains on the reviewer settings, for an admin to confirm once; from then on every host under it is automatic. Shared hosting suffixes (vercel.app, cloudfront.net, a bare co.uk) are never suggested. Every derived host is kept with its source and the verified domain it falls under.
  • A repeat proof is a plan with routes. "This test passes N times" is tried in order, each route recorded with its own result: the sandbox against the preview, the sandbox against staging, the sandbox against the app started from the repository's own dev or start script (no outside page host needed), then CI. On CI the end-to-end workflow is started with its repeat input when it has one, else started once per run needed (a few at a time), else its run on the head is re-run, and the results are read from the workflow's runs. A route that ran the test gives the result, pass or fail. The plan says it couldn't only after every route failed, with each route's reason.
  • Never a person's step. The fix round's rules and the unblock instruction say a repeat run and the allowlist are CoderHelm's own, and proving the fix is the ticket's work. The test fix's ready check no longer tells a person to run the test or add a workflow input; it runs the routes. The flaky-test fix note says how CoderHelm proves it instead.
  • Already stuck pull requests. The pull request watch picks up a pull request whose own review asks for changes on its head, whose findings already had their round there, and one of which is a repeat proof the sandbox couldn't reach. It runs the routes one step per look and hands the result to the review of the head as the round it reads, so the pull request is proven and moves on, or is held on a real result, with nobody commenting. This includes pull requests that were already waiting before this change.

This is the first of two pull requests; the second covers typed hand-offs, a feasibility check before a blocking finding on CoderHelm's own pull request, a stall detector, and hand-off counts.

Link with #928 (the evidence-led test fix). #928 measures a test's failure rate and turns it into the number of runs a proof needs (e2e::fix_evidence::repeats_for). This pull request chooses the plan's count in one place, proof_routes::repeat_count(asked, measured), where measured is that number; until #928 merges it is passed as None and the review's own count is used. Each route's result goes back as counts through Plan::tally(): runs that passed or failed on the page, and routes that never reached it, which are never failures (the same rule as #928's RunResult::NotReached). Whichever of the two merges second rebases onto the other and wires repeats_for into repeat_count and tally() into the evidence's Measure.

Changes

  • common::agent_policy::repo_hosts (new): reads app addresses from default-branch files and deploys, sorts them against verified domains into allowed (with source) and suggested.
  • agent::policy::learn_repo_hosts (new) keeps them per repository on the team's settings, read again only when the default branch moves; sandbox_egress includes the allowed ones. Called before a run's sandbox is built and before each sandbox proof route.
  • Reviewer settings GET returns suggested_web_domains with each domain's source.
  • common::e2e::proof_routes (new): the plan, its routes, the sandbox outcome reader, the local app from a package's own scripts, how a workflow repeats a test on CI, and the CI step.
  • passes::proof_routes (new): runs one route (or one CI step) per call and keeps the plan on the run.
  • proof_routes::repeat_count and Plan::tally (the seam with A failing test is fixed from its evidence, or not changed at all #928).
  • pr_watch: proof_due and Act::ProveOwed, with the ledger's owed proofs and the plan on the candidate.
  • own_review_ledger: owed_proofs, proof_given, and the round rules and unblock instruction updated.
  • test_fix::ready_gate and the flaky-test fix note go through the routes instead of a person's instruction.
  • Incident case xc_owed_proof_runs_its_routes with its page.

Verification

  • cargo fmt --all --check, rustfmt --check --edition 2021 worker/src/passes/incidents/*.rs
  • cargo clippy -p common -p worker -p gateway --all-targets -- -D warnings
  • cargo test -p common -p worker -p gateway
  • brand_spelling.py, domain_examples.py
  • New tests (invented bookstore replays): the preview host from default-branch config is allowed under a verified domain and the repeat proof runs; with the sandbox blocked the proof goes through CI starts and the review reads the result; neither the allowlist nor CI repeats ever becomes a person's step; an already-stuck pull request is picked up by the sweep, and left alone once its result is handed over.

… app hosts

A test fix's own review asked for a repeat run the sandbox couldn't make:
the team's staging site and preview were refused by the sandbox's network,
because its allowlist held only hosts typed into Settings. The round asked a
person to widen the allowlist or run the command, called a CI repeat outside
the ticket, and nothing picked the pull request up again.

- Where the team's apps are served is read from the default branch only
  (end-to-end config, env templates, workflow environments, deploys), kept
  per repository with its source, and allowed under a verified domain; an
  unverified domain is suggested once in Settings.
- A repeat proof is a plan with routes tried in order: the sandbox against
  the preview, staging, the app started from the repository's own script,
  then CI (repeat input, one start per run needed, or re-runs).
- The fix round's rules, the test fix's ready check and the flaky-test note
  never hand a repeat run or the allowlist to a person.
- The pull request watch picks up pull requests whose own review asks for a
  proof the sandbox couldn't reach, runs the routes and hands the result to
  the review of the head.
- Incident case xc_owed_proof_runs_its_routes.
@nambok nambok added the ch-review CoderHelm reviews this pull request label Nov 30, 2026
coderhelm[bot]
coderhelm Bot previously requested changes Nov 30, 2026

@coderhelm coderhelm Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Approved with notes c545583 (merged)

Comment thread services/worker/src/passes/pr_watch.rs Resolved
Comment thread services/worker/src/agent/policy.rs Resolved
Comment thread services/worker/src/agent/policy.rs Resolved
.and_then(|v| v.as_l().ok())
.map(|l| l.iter().filter_map(|v| v.as_s().ok().cloned()).collect())
.unwrap_or_default();
let suggested = suggested_web_domains(&state, &claims.team_id, &web_domains).await;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💬 FYI: A parallel structure next to an existing one (scope, not verified)

services/gateway/src/routes/reviewer.rs adds suggested_web_domains next to the existing web_domains_from. Extend the existing one (add the entries or the parameter there) and remove the new one. If the ticket truly needs it, say why on a line Wider than the ticket: services/gateway/src/routes/reviewer.rs: <why>.

FYI, not a block: on the whole picture this is not a named correctness, security or data-loss problem to hold the merge on.

coderhelm[bot]

This comment was marked as outdated.

@coderhelm
coderhelm Bot dismissed their stale review November 30, 2026 23:16

Superseded by CoderHelm's latest review

@coderhelm

coderhelm Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

💚 Post-merge health check passed: the deploy of 6b6b58f completed and stayed green for the full 15-minute watch window (no new failures vs. the pre-merge baseline).
Auto-merge

  • ✅ CoderHelm approved
  • ✅ CI green
    The rest is in the pull request description.

@coderhelm coderhelm Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Approved with notes d2666b9 (merged)

@coderhelm
coderhelm Bot merged commit 6b6b58f into main Nov 30, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ch-review CoderHelm reviews this pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant