Repository navigation
03: coverage floor and direct tests for the fence - #13
Merged
Merged
Conversation
This was referenced Oct 13, 2026
T-Crypt
marked this pull request as ready for review
October 13, 2026 16:21
This was referenced Oct 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Coverage is reported, and the prompt-injection boundary now has a test that can fail.
What changed
npm run coveragerunsnode --test --experimental-test-coveragewith a floor of 60 line coverage on the run total.test/fence.test.tsassertsdefang,quoted, andattributeagainst literal expected strings, and pins every category of invisible character thatINVISIBLE_CLASSnames.test/entry-format.test.tspins the entry kind names and the[from: …]marker. The names are stored data that the web app reads, so that file is a contract, not a behavior check.Proof
The new test in
test/fence.test.tsputs 81 of one representative character between<and/, so the 80-character alternative inCLOSERcannot defang the tag and onlyINVISIBLE_CLASScan. There are ten representatives, one per category the class names: a control character, a format character, a lone surrogate, a private-use character, an unassigned code point, a variation selector supplement, the braille blank, the two Hangul fillers, and the combining grapheme joiner. Each is a\uescape, so the file stays ASCII.Narrowing
INVISIBLE_CLASSto\p{Cc}\p{Cf}in a scratch copy, which is the mistake the class guards against:Eight of the ten representatives stop being defanged, everything except the control and the format character, which the narrowed class still names. With the class restored the same run is 7 pass, exit 0, and
src/server/fence.tsis unchanged.Coverage measured on this branch: run total 64.34 lines with the browser tests running, 66.62 with them skipped, against a floor of 60. The new tests add no coverage, because both files were already at 100 through
test/hooks.test.ts. Their value is the direct assertion. The floor is on the run total, not per file.npm test638 pass, exit 0.npm run check,npm run lint,npm run format:checkexit 0.Open
test/visible-models-ui.test.ts, whose model menu races the picker's Routers group: it failed one run here and passed on reruns. 01: CI runs the repo's checks on push and PR #11 makes that test deterministic.--test-coverage-lineson Node 22.19 is unchecked here, because this machine runs Node 26. Node's CLI documentation lists the flag as added in v22.8.0, so theenginesminimum is covered.node --help | grep test-coverage-lineson a 22 leg is the proof to collect there.Ticket 03. This run's report:
~/handoffs/oh-my-pocket/2026-10-13-pr11-13-rerun/implement-03-coverage-tests.md.