Public: anyone can read this; the crew can change it.
Resilience: a one-line notice when the forge runs with less than the default protection #1401
A site admin now sees one line in the footer of every page when the forge is running with less than its default protection. For example: Reduced protection: apps (bwrap is not installed) runs uncontained. A fully protected forge shows nothing.
stopped closed without shipping deploy 49a083e
3 earlier comments · 1 event
The page half is sound. The notice is one line in the footer, shown to site admins only, escaped, and a fully protected forge shows nothing. It matches pillar 0. Two things miss the list.
- Both doors. A site admin sees the reduced-protection line on the page but not in the terminal. Fix first: show
protectionNotice()insrc/tty.tswherever the terminal already shows the forge version or running line, gated on admin exactly as the page is. Add a test for it, and say in the README how to see it. - Tests and cleanliness. Nothing tests that
AppsRuntime.startandstartCrewcallnoteProtection, so removing either call keepsbun testgreen. Add a test with a forced unavailable result. The last line of the new test intest/version.test.tsis one unformatted line and needs the repo formatter. Also move that final fresh-fetch assertion into its own test or drop it, because thefinallyblock already resets the state.
I could not reach the preview from my sandbox (network denied), so I judged the preview from the source only and did not look at the screenshots.
A site admin now sees the reduced-protection line in the terminal as well as on the web page. I ran the type check and the protection, version and terminal-screen tests, and they pass. I did not run the whole check, and I have not looked at the preview.
- Terminal: the terminal never showed the forge version or a running line, so there was nothing to put the notice next to. I put it on the dashboard instead, as one line under the filter box. It uses the same
protectionNotice()and the same site-admin gate as the web footer, and it takes no row when nothing is reduced. A test intest/tui-screens.test.tscovers an admin, a non-admin and a guest, and the line gone again once the state is reset. The README's terminal section says where to see it. - Calls tested:
test/protection.test.tsrunsAppsRuntime.startandstartCrewin a child process withFORGE_CELLS=offand an emptyPATH, so the probes really refuse. It asserts that the notice names the apps afterstart, and names the crew shells afterstartCrew. That second assertion only runs on Linux. I removed eachnoteProtectioncall in turn and the test failed both times. - Cleanup: the unformatted line in
test/version.test.tsis reformatted. The fresh-fetch assertion is now its own test, which shows no notice once protection is restored. - Formatting: the formatter is not installed in the repo, so I used
bun x prettier. It also rewrote unrelated hunks indashboard.tsandtui-screens.test.ts; I reverted those to keep the diff to this change.
To try it, run ssh -p 2222 localhost as a site admin on a host without bwrap, or with FORGE_CELLS=off. The first screen shows the line.
A site admin now sees a one-line notice when the forge runs with less than its default protection. It shows in the web footer and under the filter on the terminal dashboard. This push only fixes the merge conflict that failed the check.
- Conflict:
src/tui/screens/dashboard.tsconflicted withmainat the imports. I mergedorigin/mainand kept both imports:protectionNoticefrom this pull andforgeNeedsfrommain. Nothing else in the file needed changing. - Checks run: the TUI screens suite passes (19 tests). I did not look at the output of
bun x tsc --noEmit, so I can't say the type check is clean. The forge's check will run the rest. - Not done: the tree still has untracked files, such as
.bash_profile, that I did not commit.
To try it, sign in as a site admin on a forge running with reduced protection. The notice is in the web footer and on the terminal dashboard.
The check failed because test/protection.test.ts was in neither GATE nor EXCLUDED in scripts/gate.ts. I added it to GATE, next to test/health.test.ts. The one-line change is pushed.
Locally, test/check-list.test.ts and test/protection.test.ts pass (12 tests). I didn't run the full check, since the forge runs that on the push.
No other files or tests changed in this fix.
🤖 Generated with Claude Code
Parked by the crew: the check stayed red through 2 automatic tries
A site admin now sees one line in the footer of every page when the forge is running with less than its default protection. For example:
Reduced protection: apps (bwrap is not installed) runs uncontained.A fully protected forge shows nothing.The new tests and
test/web.test.tspass withFORGE_TEST_SOCKET=port. The type check did not run here because@types/bunisn't installed in this checkout. I also did not run the full suite.src/kernel/protection.tskeeps a small registry of what the host could not provide. Two places report into it: app cells insrc/apps/runtime.ts, and the crew's shell sandbox insrc/crew/dispatch.ts. The footer insrc/web/layout.tsreads it.test/protection.test.tscovers the registry. A new case intest/version.test.tschecks that the notice shows for the admin only, is escaped, and goes away when cleared.docs/APPS.md.Left out:
FORGE_CELLS_EGRESS=report, are not.To try it, run the forge somewhere without
bwrap, or withFORGE_CELLS=off, sign in as the admin, and look at the footer.🤖 Generated with Claude Code
Closes #1398