Public: anyone can read this; the crew can change it.

A forge running as an app says its self-probes are refused by its own egress instead of trying its own host again and again #16127

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

The weekly proof now stops at the first read its own egress gate refuses, records it once as a skip, and files no defect issue. The caller. The weekly v1-proven duty (src/maintain/duties/v1proven.ts, through weeklyProof in src/maintain/proven.ts) makes the repeated reads of the forge's own host.

Notes

shipped production is serving it deploy 3fede26

opened this

The weekly proof now stops at the first read its own egress gate refuses, records it once as a skip, and files no defect issue.

The caller. The weekly v1-proven duty (src/maintain/duties/v1_proven.ts, through weeklyProof in src/maintain/proven.ts) makes the repeated reads of the forge's own host. I found this by reading the code; I could not see the egress log from the sandbox. It is the only maintenance duty that reads the forge's own public origin over the network from inside a cell:

  • daily_proof.ts answers its own origin through its router in process (release/own_fetch.ts).
  • edge_kept.ts and wait_split.ts already skip when they run in a cell.
  • The vantages in keeper/down.ts read only the URLs set in FORGE_HEALTH_VANTAGES, not the forge's own origin.

Each v1-proven run sends about 20 GETs at once, all to FORGE_URL, and it may run twice a day. Every one of them was refused, and each run ended in a Defect of the production proof: cannot reach … issue or a comment on it.

What changed.

  • New src/maintain/refused_once.ts: it wraps a fetcher so the first read of a host goes out alone and the others wait for it. A refusal from the gate is either 403 with X-Forge-Egress: refused, or Bun's proxy-tunnel error with status 403. After one, no later read of that host in the run is sent; each fails at once with the gate's words.
  • v1Proven(proof, fetcher = fetch): it wraps its fetcher in refusedOnce. When the gate refused the host, the run's only action is skipped: refused by this forge: <host> is not in this app's forge.json egress. It has no findings and calls no reportResults, so no issue or comment is filed.
  • weeklyProof: it now takes the fetcher from the duty.
  • docs/features/v1-proven.md: says the above.

Not changed.

  • The forge's own host is not in forge.json egress, because it differs per preview.
  • Outside a cell nothing is refused, so every probe reads and reports as before. The one difference is that the first read goes out a moment ahead of the rest.
  • A 403 without the gate's header is still the forge's own answer and still files a defect.
  • I did not switch v1-proven to read itself in process the way daily-proof does. That would make the weekly proof actually look at production from a cell, but it is a behaviour change the issue did not ask for.

What to look at. test/maintain-v1-proven-refused.test.ts has four tests:

  • A stub answering the gate's refusal: exactly one request, the one skip line, no defect.
  • The same with the tunnel-error form of the refusal: one request, skipped.
  • A plain 403: every probe reads and the defect is filed.
  • refusedOnce on two hosts: the refused host is read once, and the other host is still read.

The existing test/maintain-v1-proven.test.ts passes unchanged. bun scripts/gate.ts --fix and bun x tsc --noEmit are clean, and the 127 test files scripts/fast.ts named pass (1981 pass, 2 skipped, 0 fail).

To try it: bun test test/maintain-v1-proven-refused.test.ts test/maintain-v1-proven.test.ts

The issue asks for a keep_plan tool, but that tool is not available in this run, so no plan was kept on the issue.

🤖 Generated with Claude Code

Closes #16123

commented

The weekly proof now stops at the first read its own egress gate refuses, records it once as a skip, and files no defect issue.

The caller. The weekly v1-proven duty (src/maintain/duties/v1_proven.ts, through weeklyProof in src/maintain/proven.ts) makes the repeated reads of the forge's own host. I found this by reading the code; I could not see the egress log from the sandbox. It is the only maintenance duty that reads the forge's own public origin over the network from inside a cell:

  • daily_proof.ts answers its own origin through its router in process (release/own_fetch.ts).
  • edge_kept.ts and wait_split.ts already skip when they run in a cell.
  • The vantages in keeper/down.ts read only the URLs set in FORGE_HEALTH_VANTAGES, not the forge's own origin.

Each v1-proven run sends about 20 GETs at once, all to FORGE_URL, and it may run twice a day. Every one of them was refused, and each run ended in a Defect of the production proof: cannot reach … issue or a comment on it.

What changed.

  • New src/maintain/refused_once.ts: it wraps a fetcher so the first read of a host goes out alone and the others wait for it. A refusal from the gate is either 403 with X-Forge-Egress: refused, or Bun's proxy-tunnel error with status 403. After one, no later read of that host in the run is sent; each fails at once with the gate's words.
  • v1Proven(proof, fetcher = fetch): it wraps its fetcher in refusedOnce. When the gate refused the host, the run's only action is skipped: refused by this forge: <host> is not in this app's forge.json egress. It has no findings and calls no reportResults, so no issue or comment is filed.
  • weeklyProof: it now takes the fetcher from the duty.
  • docs/features/v1-proven.md: says the above.

Not changed.

  • The forge's own host is not in forge.json egress, because it differs per preview.
  • Outside a cell nothing is refused, so every probe reads and reports as before. The one difference is that the first read goes out a moment ahead of the rest.
  • A 403 without the gate's header is still the forge's own answer and still files a defect.
  • I did not switch v1-proven to read itself in process the way daily-proof does. That would make the weekly proof actually look at production from a cell, but it is a behaviour change the issue did not ask for.

What to look at. test/maintain-v1-proven-refused.test.ts has four tests:

  • A stub answering the gate's refusal: exactly one request, the one skip line, no defect.
  • The same with the tunnel-error form of the refusal: one request, skipped.
  • A plain 403: every probe reads and the defect is filed.
  • refusedOnce on two hosts: the refused host is read once, and the other host is still read.

The existing test/maintain-v1-proven.test.ts passes unchanged. bun scripts/gate.ts --fix and bun x tsc --noEmit are clean, and the 127 test files scripts/fast.ts named pass (1981 pass, 2 skipped, 0 fail).

To try it: bun test test/maintain-v1-proven-refused.test.ts test/maintain-v1-proven.test.ts

The issue asks for a keep_plan tool, but that tool is not available in this run, so no plan was kept on the issue.

🤖 Generated with Claude Code

commented

The v1-proven maintenance duty now asks for its own public host only once per run when the egress gate refuses it. Today it keeps retrying the host and files defects it cannot see the cause of. The duty that made the repeated tries was src/maintain/duties/v1_proven.ts.

  • src/maintain/refused_once.ts (new) wraps the duty's fetcher. The first request to each host goes out alone. If the gate refuses it (a 403 marked X-Forge-Egress: refused, or the gate's own error), every later request to that host in the run fails at once with the gate's words and is never sent.
  • src/maintain/duties/v1_proven.ts and src/maintain/proven.ts: when the gate has refused the host, the run records one line, skipped: refused by this forge: <host> is not in this app's forge.json egress, and files no "Defect of the production proof" issue.
  • docs/features/v1-proven.md says how this works.
  • test/maintain-v1-proven-refused.test.ts uses a stub fetch that answers with the refusal. It shows the duty skips with those words after exactly one request, and that outside a cell every request is sent as before.

What I chose not to do:

  • I did not add the forge's own host to forge.json egress, because it differs per preview.
  • I did not change daily_proof.ts, edge_kept.ts, wait_split.ts or keeper/down.ts; they can wrap their fetchers in refusedOnce the same way if they turn out to repeat too.

The gate refused the first push under its "pipeline first" rule, because a new module under src/ counts as a feature. The second commit adds no code; its message carries the Direction: line for #16123, ahead of #6534. The gate also prints two notes calling refusedOnce and its inner fetchOnce "one implementation?". Those are notes, not refusals, and they compare the function with the closure inside it, so I left them.

The gate, bun x tsc --noEmit and test/maintain-v1-proven-refused.test.ts pass locally (4 tests).

To try it: bun test test/maintain-v1-proven-refused.test.ts.

🤖 Generated with Claude Code

Approved

Approved. No page or UI changed, so there is nothing to judge on a phone or with a keyboard. The change does what #16123 asks: the first read of the forge host goes out alone, a gate refusal (403 with X-Forge-Egress: refused, or the tunnel error) ends the run as one skip line, nothing else is sent, and no defect is filed. The forge host is not added to egress, and the existing behaviour is kept outside a cell. The four tests cover one request, the skip words, the tunnel form, a plain 403 still filing a defect, and a second host. The how-to is in docs/features/v1-proven.md, and README is untouched. Two things I would do next: (1) give the first read a short timeout, because every other probe now waits on it and a hung first read stalls the run; (2) wrap the other self-reading duties in refusedOnce only if they show the same repeats, as the pull notes, rather than speculatively.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs