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

The egress gate refuses the forge's own public host zero times: every self-call goes through kernel/outbound #15359

Merged opened this

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

Merged

The hourly edge-kept duty no longer fetches the forge's own public host from a cell. That fetch is the one source of own-host egress refusals I found. What I moved src/maintain/duties/edgekept.ts – this was the bare fetch.

Notes

shipped production is serving it deploy b03b44b

opened this

The hourly edge-kept duty no longer fetches the forge's own public host from a cell. That fetch is the one source of own-host egress refusals I found.

What I moved

  • src/maintain/duties/edge_kept.ts – this was the bare fetch. Every hour it fetched config.url + / and /explore directly. In a cell, that call goes out to the parent's gate and is refused, once for each page. The refused answer made the duty skip the second read, so that's 2 refusals an hour. It now checks cellProxy() first, the way wait_split.ts already does. In a cell it returns one line, "skipped: this forge runs in a cell and does not call its own host …; the edge goes unread (#15350)", and makes no request. The inner check is injectable (edgeKept(read, inCell)) so a test can set it.
  • I did not switch it to outboundFetch with self: true. That would route the call to the local listener, and the duty exists to measure the edge, so the local answer would always read as "no edge header". Skipping in a cell gets the same result without making a request. Outside a cell it still reads the public URL as before.

Callers the issue named, left as they are

  • src/snapshot/drill.ts:217 and src/release/small_forge.ts:172 only fetch a forge they started on loopback.
  • src/spawn/live.ts:32 probes a child forge's own address, which is never this forge's host.
  • src/chaos/report.ts:49 and src/snapshot/verdict.ts:189 are commands an operator runs. They don't run in the forge's process.
  • wait_split.ts was already skipped in a cell.
  • apps/parity_probe.ts goes through outboundFetch without self. That is correct, since a person picks the platform side's host. If that host is the forge's own, it is refused inside the forge, before any request is made.

Tests

  • test/outbound-sweep.test.ts adds "a bare fetch of the forge's own public URL is never made from a cell". Every file that fetches the own public URL on purpose (wait_split.ts, edge_kept.ts) must call both cellProxy() and inCell(). Any entry in the own-host list described as "on purpose" must also be on that list. It failed before the change to edge_kept.ts and passes after.
  • test/maintain-edge-kept.test.ts adds a case: in a cell the duty makes no request and returns the skip line.
  • bun scripts/gate.ts --fix and bun x tsc --noEmit came back clean. The 122 test files scripts/fast.ts named all pass (1742 pass, 0 fail).

Still to do after release

  • The 24-hour check has not happened yet. After release, the refused-hosts note for this app should no longer list lab--forge-trevato-apps.open-platform.sh. On production, the edge-kept run on /maintenance should show the skip line.
  • I didn't have the keep_plan and estimate tools in this run, so I kept no plan on the issue and give no time estimate.

Try it: bun test test/outbound-sweep.test.ts test/maintain-edge-kept.test.ts.

🤖 Generated with Claude Code

Closes #15350

1 earlier comment · 1 event
commented

The hourly edge-kept duty no longer fetches the forge's own public host from a cell. That fetch is the one source of own-host egress refusals I found.

What I moved

  • src/maintain/duties/edge_kept.ts – this was the bare fetch. Every hour it fetched config.url + / and /explore directly. In a cell, that call goes out to the parent's gate and is refused, once for each page. The refused answer made the duty skip the second read, so that's 2 refusals an hour. It now checks cellProxy() first, the way wait_split.ts already does. In a cell it returns one line, "skipped: this forge runs in a cell and does not call its own host …; the edge goes unread (#15350)", and makes no request. The inner check is injectable (edgeKept(read, inCell)) so a test can set it.
  • I did not switch it to outboundFetch with self: true. That would route the call to the local listener, and the duty exists to measure the edge, so the local answer would always read as "no edge header". Skipping in a cell gets the same result without making a request. Outside a cell it still reads the public URL as before.

Callers the issue named, left as they are

  • src/snapshot/drill.ts:217 and src/release/small_forge.ts:172 only fetch a forge they started on loopback.
  • src/spawn/live.ts:32 probes a child forge's own address, which is never this forge's host.
  • src/chaos/report.ts:49 and src/snapshot/verdict.ts:189 are commands an operator runs. They don't run in the forge's process.
  • wait_split.ts was already skipped in a cell.
  • apps/parity_probe.ts goes through outboundFetch without self. That is correct, since a person picks the platform side's host. If that host is the forge's own, it is refused inside the forge, before any request is made.

Tests

  • test/outbound-sweep.test.ts adds "a bare fetch of the forge's own public URL is never made from a cell". Every file that fetches the own public URL on purpose (wait_split.ts, edge_kept.ts) must call both cellProxy() and inCell(). Any entry in the own-host list described as "on purpose" must also be on that list. It failed before the change to edge_kept.ts and passes after.
  • test/maintain-edge-kept.test.ts adds a case: in a cell the duty makes no request and returns the skip line.
  • bun scripts/gate.ts --fix and bun x tsc --noEmit came back clean. The 122 test files scripts/fast.ts named all pass (1742 pass, 0 fail).

Still to do after release

  • The 24-hour check has not happened yet. After release, the refused-hosts note for this app should no longer list lab--forge-trevato-apps.open-platform.sh. On production, the edge-kept run on /maintenance should show the skip line.
  • I didn't have the keep_plan and estimate tools in this run, so I kept no plan on the issue and give no time estimate.

Try it: bun test test/outbound-sweep.test.ts test/maintain-edge-kept.test.ts.

🤖 Generated with Claude Code

Approved

Approved. The duty no longer fetches its own public host from a cell, which removes the 2 hourly refusals. Skipping is the right call here, since a self fetch would measure the local listener and not the edge. Two things I would do next: (1) move the cellProxy import in edge_kept.ts up to sit with the other ../../apps and ../../core imports in path order; (2) the new sweep test checks for the text cellProxy() and inCell() in a hardcoded two-file list, which a comment would satisfy. Derive the list from the OWN_HOST entries whose reason says on purpose, and assert the guard precedes the fetch. After release, read production egress refusals for its own host for 24h and put the count in the pull.

commented

Left #15350 open: 2 unticked items remain (Every runtime fetch whose URL can be the forge's own public origin goes through outbound with self: true.; The pull names each caller it moved. After release, production's egress refusals for its own host stay at 0 for 24 h, and the pull says how that was read.).

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs