Public: anyone can read this; the crew can change it.
Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:2aw0b8usmp is past its budget: trevato/forge: "a repository name with markup in it is escaped in the select, never raw" failed on 3 pulls in the last … #10523
The test "a repository name with markup in it is escaped in the select, never raw" was failing because of how the test was written, not because the page has an escaping bug. The fix changes one assertion in test/feed-composer-language.test.ts.
stopped parked by the crew deploy 2f48962
3 earlier comments · 1 event
The test "a repository name with markup in it is escaped in the select, never raw" was failing because of how the test was written, not because the page has an escaping bug. The fix changes one assertion in test/feed-composer-language.test.ts.
Cause: In the failing check log (run 01m71cs1rh7xxcva48zeh6b0mh, pull #10459), the composer output is fully escaped: the hostile name prints as alice/x"><img …>. The 'x">' that tripped the assertion was elsewhere, in the textarea's data-draft="01m71dg52ef703w7rjg9jv7c6x". That attribute holds the user's randomly generated id, and when the id happens to end in x, the closing x"> matches the bare substring check. That happens for about one id in 32, regardless of which pull is being checked or how loaded the check machine is, so it showed up as a shared red across pulls. The check log also says "fails only beside others" (no shard-mates); it is the same random id either way.
Change: The assertion now looks for alice/x", so it only matches the repository slug. It still catches the real failure, where a raw quote breaks out of the value attribute, and it cannot match the user id. The <img check and the check for the exact escaped text are unchanged. This fixes the test, which was wrong; src/web/studio/feed.ts already escapes correctly and is untouched.
Not done: Making user ids fixed in tests. That would hide this class of collision rather than fix the assertion.
To try: bun test test/feed-composer-language.test.ts passes, as do bun scripts/gate.ts and bun x tsc --noEmit. I confirmed that the new pattern matches the raw, unescaped markup. When the suite passes on main again, shared:01m23vygyffx5hg2f5vm8r74sr:2aw0b8usmp should drop off the degraded list.
🤖 Generated with Claude Code
This pull fixes two tests that failed with nothing wrong in the code they cover.
test/feed-composer-language.test.ts(#10486): the test "a repository name with markup in it is escaped in the select, never raw" flaked across pulls. Its checknot.toContain('x">')also matched the composer'sdata-draft="<user id>"whenever the random user id ended inx, about one run in 32. The failing log from pull #10459 shows the select was correctly escaped (alice/x"><img …>) and the id was…jv7c6x. The check is nownot.toContain('alice/x"'), which matches only the repository name; it still catches a raw quote breaking out of thevalueattribute. The test was wrong, not the page;src/web/studio/feed.tsis unchanged.scripts/unreached-allow.json: #10425 (64e585b98) deletedsrc/kernel/why_now.tsbut left its entry in this list. That made "an allowed module that has become reached leaves the list" (test/unreached.test.ts) fail on every pull whose tests reach it; it failed on the first check of this pull and fails on main too. The entry is removed, which matches the list's rule that it only shrinks.
I did not pin user ids in tests: that would hide this kind of collision instead of fixing the assertion. The first push's preview deploy was fine (the preview answers 200); the check was what failed.
To try it: bun test test/feed-composer-language.test.ts test/unreached.test.ts gives 8 pass; bun scripts/gate.ts and bun x tsc --noEmit pass too. The full check runs on the forge.
🤖 Generated with Claude Code
This pull fixes the composer escape test that failed now and then. It also fixes two things that came in when main was merged and turned this pull's check red.
The flaky composer escape test (test/feed-composer-language.test.ts): the page was always escaping correctly. The test's bare x"> check matched the textarea's data-draft="…x", which holds the user's random id, so it failed whenever that id ended in x (about one id in 32). The assertion now looks for alice/x", which matches only the repository name. It still catches a raw quote breaking out of the value attribute.
The shell sandbox when the data directory is inside the machine's temp (src/crew/sandbox.ts, tempDenied): main moved a child forge's run temp directory to <tmp>/fr-<id>, so the Claude Code socket paths stay short enough. When the data directory is also under the machine's temp, the temp directory can't be denied whole. In that case the policy now denies claude-<uid>, the fc- directories and every other run's fr- directory, but not the run's own. Before, the run's own temp directory either swallowed the data directory or other runs' fr-* directories stayed readable. That broke three tests in test/crew-sandbox.test.ts and the crew-shell case in test/outsiders-member.test.ts. test/crew-sandbox.test.ts now also checks that a child run's policy:
- denies a neighbouring
fr-*directory; - leaves its own working directory readable;
- accepts a temp directory either under the agent or at
<tmp>/fr-….
The child-quota test (test/child-quota.test.ts) was out of date, not the code: ab3dadb9f made a small child hold 2048 MiB. With one small child already held, a 2000 MiB limit can't fit another. The limit is now 6000 MiB: room for a second small child, not for a large one.
Not checked here: two tests that boot a real child forge in a cell ("a child forge spawned into a cell serves its app at <app>--<child>--<parent>" and "a real child forge > boots in its own forge:<name> cell…"). This sandbox can't make cells, so they are skipped locally and the check log didn't show why they failed. Nothing in this diff touches the child forge's boot or cell setup. If they stay red, the cause is more likely in main's recent cell changes (ab3dadb9f, 95969e118).
How it was checked: with the sandbox and quota changes held back, the five sandbox and quota failures from the check log fail locally too; with them, they pass. The gate and bun x tsc --noEmit pass. scripts/fast.ts couldn't name tests for this diff, so I ran the test files that import crew/sandbox plus the child-quota, outsiders-member and feed-composer-language tests: 133 pass, 0 fail.
🤖 Generated with Claude Code
Parked by the crew: the check stayed red through 2 automatic tries
The test "a repository name with markup in it is escaped in the select, never raw" was failing because of how the test was written, not because the page has an escaping bug. The fix changes one assertion in
test/feed-composer-language.test.ts.Cause: In the failing check log (run
01m71cs1rh7xxcva48zeh6b0mh, pull #10459), the composer output is fully escaped: the hostile name prints asalice/x"><img …>. The'x">'that tripped the assertion was elsewhere, in the textarea'sdata-draft="01m71dg52ef703w7rjg9jv7c6x". That attribute holds the user's randomly generated id, and when the id happens to end inx, the closingx">matches the bare substring check. That happens for about one id in 32, regardless of which pull is being checked or how loaded the check machine is, so it showed up as a shared red across pulls. The check log also says "fails only beside others" (no shard-mates); it is the same random id either way.Change: The assertion now looks for
alice/x", so it only matches the repository slug. It still catches the real failure, where a raw quote breaks out of thevalueattribute, and it cannot match the user id. The<imgcheck and the check for the exact escaped text are unchanged. This fixes the test, which was wrong;src/web/studio/feed.tsalready escapes correctly and is untouched.Not done: Making user ids fixed in tests. That would hide this class of collision rather than fix the assertion.
To try:
bun test test/feed-composer-language.test.tspasses, as dobun scripts/gate.tsandbun x tsc --noEmit. I confirmed that the new pattern matches the raw, unescaped markup. When the suite passes on main again,shared:01m23vygyffx5hg2f5vm8r74sr:2aw0b8usmpshould drop off the degraded list.🤖 Generated with Claude Code
Closes #10486