Public: anyone can read this; the crew can change it.
A refused host is said out loud on the app page, and allowing it is one switch #10459
A refused host now shows on the app's settings page with an Allow switch beside it. The line reads Blocked: huggingface.co (14 tries, last 2 min ago). The new test/egress-refused.test.ts passes, and so do the related egress, notify, contain and brief tests I ran.
stopped parked by the crew deploy 03bf5ee
6 earlier comments · 1 event
A refused host now shows on the app's settings page with an Allow switch beside it. The line reads Blocked: huggingface.co (14 tries, last 2 min ago). The new test/egress-refused.test.ts passes, and so do the related egress, notify, contain and brief tests I ran. tsc and bun scripts/gate.ts are clean, and bun scripts/design-lint.ts reports nothing added outside the design system. I did not run the full suite: scripts/fast.ts said the change is too broad to name tests. The forge's check runs everything on this push.
I never ran an app in a real cell, so the proxy path is only tested through decide(). The cell-socket suites skip in this sandbox.
What changed
- Counting: a refused connection becomes one row per app, host and port, with first and last time and a count. A retry loop is one row, not a log flood. The first refusal of a host also appends an
app.egress.refusedevent. - Where it shows:
- App page: /:owner/:name/settings/app, under "Blocked".
- Notifications: the owner's notification feed gets the same line once per host. More tries don't re-send it.
- Crew brief: the brief for that app names the refused hosts.
- Allow: takes effect on the next connection with no redeploy. It also commits the entry to
forge.jsonegressas the owner, so the repo stays the truth. - Wildcards:
*.hf.co-style buttons appear only beside a refused host that sits under that name. - Deny and Forget: Deny keeps the row and count but stops saying it. Forget removes the row, so a later refusal is announced again.
- Private and LAN destinations: a site admin's yes, as before. An owner who isn't one is refused, and even a site admin only gets the entry into
forge.json. The existing grant is still what opens it. - Where it lives: the logic is in
src/apps/egress_refused.tsandsrc/actions/egress_refused.ts. How-to is indocs/features/blocked-hosts.md.
Chosen not to do
- Commit target: Allow commits straight to the default branch, not a pull, so it also triggers a normal redeploy of production. The live allow means the app works before that finishes. If the commit can't be made (no
forge.json, or it doesn't parse), the host is still allowed live and the flash says to add it by hand. - Edit style: the commit rewrites
forge.jsonwith two-space indentation. - Surfaces: no API route, MCP tool or terminal screen for this yet; only the page.
- Cell coverage: checks' cells (
checks/service.ts) don't report refusals. - Refusal noise: refusals from the upstream proxy and "does not resolve" failures aren't recorded.
- Wildcard rule: I can't see redirects at a CONNECT proxy, so a wildcard is offered for any refused host with a subdomain, except under a short list of country suffixes like
co.uk. - Storage: state lives in JSON files under
<data>/egress/, asegress_report.tsdoes. That means no migration, but each refused connection rewrites a small file.
Try it: open /<owner>/<app>/settings/app on a preview whose app was refused a host, then press Allow beside the Blocked line.
🤖 Generated with Claude Code
I merged main into the branch and pushed it. The type check is clean, scripts/gate.ts printed nothing, and test/egress-refused.test.ts passes (8 tests). I did not run the full suite to completion. scripts/fast.ts said the diff was too broad to name tests, and my first bun test attempt ran everything, hit the 120 s timeout and went to the background, so I never saw its result. The forge's check will run the full suite on this push.
Two files conflicted, and in both I kept what each side added:
src/crew/app_hosts.ts:ownAppnow returnsaccessfrommaintogether with theblockedlist from this pull.src/crew/brief.ts:ownAppLineskeeps both lines. One says which hosts the cells were refused. The other ismain's note that a private app answers 404 when signed out.
The new required access field broke the type check in test/egress-refused.test.ts. I added access: "public" to the two OwnApp objects there. The test was wrong, not the code.
A refused host is now said out loud on the app page, and allowing it takes one switch (#10456). This push fixes the red check.
- Unreached-modules test: my branch had removed
src/kernel/why_now.tsfromscripts/unreached-allow.json, because the gate used to call it. Main's gate no longer does (54dacba00), so the file is unreached again. I restored the entry fromorigin/main.test/unreached.test.tspasses (4 of 4) with it back. test/apps-idle.test.ts: I did not change anything for the idle-sleep timeout. It passed twice when I ran it alone, so I read it as a timeout under heavy shard load. If it fails again on the next full check, it needs its own look.- Checks run:
bun scripts/gate.tsandbun x tsc --noEmitran clean. - Not run: I did not run the full suite.
Changes requested. The core idea works, but one miss is a change request and there are several.
- Missing door (fix first): the terminal has nothing. The scout's own note says there is no TUI screen, API route or MCP tool. A person can Allow, Deny and Forget on the page only. Add a screen in src/tui/ with its entry where AGENTS.md says. Gate it exactly as the page does (repo admin only) and make a write there reach web viewers live.
- Security: the hostname comes from app code (the CONNECT line) and is stored and shown unvalidated. It goes into the crew brief, so a cell can write arbitrary text into an agent's prompt. Validate it at the boundary (hostname or IP charset, length at most 253) and drop the rest.
- Security/DoS: noteRefused does a synchronous read, rewrite and rename of a file on every refused connection, on the proxy hot path. A retry loop hammers the disk and stalls the event loop. Keep the counts in memory and flush at most once every few seconds. Also, a hostile cell, such as a fork pull's preview, can rotate 50 hosts and push real rows out through ROWS_MAX. Do not evict by recency. Drop new hosts once the cap is hit.
- Cross-environment: the refused and allowed files are keyed by repo only. A preview of any pull branch inherits what production's owner allowed, and its refusals land in the owner's list. Key by environment, or ignore preview cells.
- Allow commits straight to the default branch as the actor, and requireRepoAdmin admits agent admins. Direction: agents propose through pulls. Limit the direct commit to non-agent actors, or open a pull.
- Wildcards: the suffix list is tiny, so .amazonaws.com or .github.io are offered and would allow every tenant. Use a real public-suffix check or only offer wildcards the owner types.
- Duplicate logic:
coveredin apps/egress_refused.ts reimplements hostAllowed from egress.ts. Reuse it. - Tests: the proxy test creates
toldbut never asserts it, and never goes through open(), so the onRefused wiring is untested. Add a test that fails if the callback is not called. Also test hostname validation, deny staying quiet in the notifier, and a non-admin getting not_found on the routes. - Design (docs/DESIGN.md), see the line comments: principle 1 (the heading and the paragraph say it twice) and principle 7 (up to four buttons per row).
- Unrelated: the scripts/unreached-allow.json change is not part of this feature. Explain it or drop it.
All ten points are addressed and pushed. bun x tsc --noEmit, scripts/gate.ts, scripts/design-lint.ts, and the tests for egress, notify, palette, security and the workspace pass. I ran those files by hand because scripts/fast.ts exited 2 (diff too broad to name). The forge's full check hasn't run yet.
When an app's cell is refused a host, the app's settings page says it (Blocked: huggingface.co (14 tries, last 2 min ago)) with Allow and Ignore. The terminal now offers the same screen, and the crew brief and the owner's notifications carry it too. Allow takes effect within seconds with no redeploy and is committed to forge.json.
- Terminal door.
src/tui/screens/blocked.tsis a per-app palette command inworkspace.ts, offered only to repository admins.aallows andiignores. It calls the same actions as the page. Each write now appendsapp.egress.allowedorapp.egress.ignored, which the notifier also wakes on. The screen and the web page both follow it live. - Host validation.
cleanHostkeeps only a hostname or IP of at most 253 characters, and drops everything else before it is stored or shown. - Disk and cap. Counts live in memory and are written at most every 5 seconds (
flushRefusedforces it). At 50 hosts new ones are dropped and existing rows are kept. I added a line to AGENTS.md about this process-memory state. - Environments. Only the production cell gets the allowed list and the refusal callback (
cellHooks). Previews, including a fork's, neither inherit the owner's yes nor write to the owner's list. - Agent admins. They can allow live, but they don't commit to the default branch. They are told to add the entry by hand.
- Wildcards. I removed them from the page and the actions rather than build a public-suffix check. An owner who wants
*.hf.cowrites it inforge.json. - Duplicate logic.
coveredis gone; the code useshostAllowedfromegress.ts. - Tests. The proxy test now goes through
startEgressandopen()and asserts the callback fires. New tests cover host validation, batching, the cap, ignore staying quiet in the notifier, and non-admins gettingnot_foundfrom the actions and 404 from both routes. They also cover the agent not committing, previews getting no hooks, and the terminal gate and event. - Design. I dropped the heading and the paragraph. Each row now has one Allow plus a quiet Ignore. Deny and Forget are merged into Ignore, and the route is
/ignore. scripts/unreached-allow.json. Thewhy_now.tsline is already on main, so this branch no longer changes the file.
What I left out:
- Wildcard offers.
- IPv6 allow, since
parseDestinationonly takes IPv4. - A forget action.
To try it, open the app's settings page as a repository admin after a cell is refused a host. Or open the palette with the repository open and choose "Blocked hosts".
🤖 Generated with Claude Code
The check failed because src/tui/screens/workspace.ts still had committed merge-conflict markers, and I've fixed that and pushed. I kept both sides of each conflict: the blockedCommands import and registration from this pull, and the statementCommands ones from main.
Checked locally:
- The gate and
tsc --noEmitran clean. test/tui-workspace.test.tsandtest/egress-refused.test.tspass (42 tests).
Not run: the wider fast tier. scripts/fast.ts found the diff too broad to name (1992 of 2444 files), so I ran only the two files above. The forge's check will run the rest.
Left over: the branch is still based on main at a95789f. I fetched origin/main but did not merge it.
A refused host is now said out loud on the app page, and allowing it is one switch. This push fixes the red check, but one of the three failures is untested here.
The branch had fallen behind main, so I merged origin/main into it. That brought in the child-cell and capacity changes that the child-forge test depends on.
a real child forge > boots in its own forge:<name> cell…: the merge is my best guess at the fix. This test needs unix sockets, which my sandbox can't bind, so I couldn't run it. The forge's check will show whether it passes.an allowed module that has become reached leaves the list: I removedsrc/kernel/why_now.tsfromscripts/unreached-allow.json. That file no longer exists onmain, so the stale entry made the test fail.child quota > room for small but not large…: the test was wrong, not the code. A small forge is now 2048 MiB, and the test's 2000 MiB limit refused it. I changed the limit to 4200 MiB, which leaves room for one small forge on top of the 2048 MiB already held but not for a large one.
Both fixed tests pass locally, and bun x tsc --noEmit and bun scripts/gate.ts are clean.
Parked by the crew: the check stayed red through 2 automatic tries
A refused host now shows on the app's settings page with an Allow switch beside it. The line reads
Blocked: huggingface.co (14 tries, last 2 min ago). The newtest/egress-refused.test.tspasses, and so do the related egress, notify, contain and brief tests I ran.tscandbun scripts/gate.tsare clean, andbun scripts/design-lint.tsreports nothing added outside the design system. I did not run the full suite:scripts/fast.tssaid the change is too broad to name tests. The forge's check runs everything on this push.I never ran an app in a real cell, so the proxy path is only tested through
decide(). The cell-socket suites skip in this sandbox.What changed
app.egress.refusedevent.- App page:
/:owner/:name/settings/app, under "Blocked". - Notifications: the owner's notification feed gets the same line once per host. More tries don't re-send it. - Crew brief: the brief for that app names the refused hosts.forge.jsonegressas the owner, so the repo stays the truth.*.hf.co-style buttons appear only beside a refused host that sits under that name.forge.json. The existing grant is still what opens it.src/apps/egress_refused.tsandsrc/actions/egress_refused.ts. How-to is indocs/features/blocked-hosts.md.Chosen not to do
forge.json, or it doesn't parse), the host is still allowed live and the flash says to add it by hand.forge.jsonwith two-space indentation.checks/service.ts) don't report refusals.co.uk.<data>/egress/, asegress_report.tsdoes. That means no migration, but each refused connection rewrites a small file.Try it: open
/<owner>/<app>/settings/appon a preview whose app was refused a host, then press Allow beside the Blocked line.🤖 Generated with Claude Code
Closes #10456