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

Every file the /security page cites as the enforcer exists, and a test fails when one is renamed away #13895

Merged opened this

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

Merged

/security's claims already lived in one table, CLAIMS and REPORTCLAIMS in src/view/security.ts, which both the page and the terminal screen draw. Each row had a source file, a text needle and a proof test.

Notes

shipped production is serving it deploy 4adf612

opened this

/security's claims already lived in one table, CLAIMS and REPORT_CLAIMS in src/view/security.ts, which both the page and the terminal screen draw. Each row had a source file, a text needle and a proof test. This pull adds a symbol field to each row: a function, const or class that the cited file must still export (openCell, sandboxPolicy, protectionNotice, setCookie, originGate, securityFloor, canSeeSealed, buildRouter, proxyApp, and so on).

The new test/security-citations.test.ts checks every row: the source path exists, it still declares the symbol as an export, it still contains the needle, and the proof test file exists. It also checks the controls page, where each keptBy in CONTROLS (src/checks/controls.ts) that is a repository path must exist. A control marked as tested must name a file in this repository; "Pod security", which isn't tested here, may still point to the cluster's own source. Each failure names its row, for example "Repository code": src/apps/contain.ts no longer exports openCellGone. Further cases in the same file feed in made-up files to show each kind of failure, and that a longer name, a comment or an import does not count as the export.

No cited path was stale, so nothing needed fixing. The existing check in test/security-page.test.ts is unchanged, and the page, its words and the security floor are untouched.

What I chose not to do: I didn't check symbols by importing each module. Reading the source text tests exactly what the issue asks for ("still in that file") and loads none of those modules.

Try it: bun test test/security-citations.test.ts test/security-page.test.ts passes, as do bun scripts/gate.ts --fix and bun x tsc --noEmit. To see it fail, change any symbol or source in src/view/security.ts and run the first test again.

I couldn't call the keep_plan tool because it wasn't available in this session, so the issue has no plan posted.

🤖 Generated with Claude Code

Closes #13887

commented

/security's claims already lived in one table, CLAIMS and REPORT_CLAIMS in src/view/security.ts, which both the page and the terminal screen draw. Each row had a source file, a text needle and a proof test. This pull adds a symbol field to each row: a function, const or class that the cited file must still export (openCell, sandboxPolicy, protectionNotice, setCookie, originGate, securityFloor, canSeeSealed, buildRouter, proxyApp, and so on).

The new test/security-citations.test.ts checks every row: the source path exists, it still declares the symbol as an export, it still contains the needle, and the proof test file exists. It also checks the controls page, where each keptBy in CONTROLS (src/checks/controls.ts) that is a repository path must exist. A control marked as tested must name a file in this repository; "Pod security", which isn't tested here, may still point to the cluster's own source. Each failure names its row, for example "Repository code": src/apps/contain.ts no longer exports openCellGone. Further cases in the same file feed in made-up files to show each kind of failure, and that a longer name, a comment or an import does not count as the export.

No cited path was stale, so nothing needed fixing. The existing check in test/security-page.test.ts is unchanged, and the page, its words and the security floor are untouched.

What I chose not to do: I didn't check symbols by importing each module. Reading the source text tests exactly what the issue asks for ("still in that file") and loads none of those modules.

Try it: bun test test/security-citations.test.ts test/security-page.test.ts passes, as do bun scripts/gate.ts --fix and bun x tsc --noEmit. To see it fail, change any symbol or source in src/view/security.ts and run the first test again.

I couldn't call the keep_plan tool because it wasn't available in this session, so the issue has no plan posted.

🤖 Generated with Claude Code

commented

Every claim in src/view/security.ts now names one exported symbol that its source file must still declare. A new test, test/security-citations.test.ts, checks each claim's source, symbol, needle and proof test, plus each control's keptBy path. When a citation goes stale, for example because a file was renamed away, the test fails and names that row. The text of /security doesn't change; only the data behind each claim and the check on it do.

The earlier push failed the gate's "say how to try it on the preview" rule because no commit message had a Try: line. Force pushes aren't allowed, so instead of rewriting that commit I added an empty follow-up commit that carries the line. The gate passes against this branch's merge-base with main. bun x tsc --noEmit is clean, and test/security-citations.test.ts and test/security-page.test.ts pass (11 tests).

Try: open /security on the preview and check that every claim still names its source file and proving test. Then run bun test test/security-citations.test.ts, and rename one cited file or export to see the failure name its row.

🤖 Generated with Claude Code

Approved

Clean. Each claim row now carries one exported symbol. A test fails naming the row when the source, symbol, needle or proof is gone, and it also checks the controls table. The symbol match is anchored to a real export declaration, so a longer name, a comment or an import does not count. The synthetic-failure cases cover each failure kind. This is test and data only, with no new surface, dependency or security exposure. It adds no feature, so the TUI and docs/features rules do not apply, and README is untouched. I did not fetch the preview or run the tests. This verdict rests on the diff and the green check.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs