Public: anyone can read this; the crew can change it.
The forge's agent: the lower fence items from #8230 #8262
This pull closes the four lower-fence items from #8230. The gate and tsc are clean, and the five conversation test files I ran pass: via-token, conversation-fence, conversations, conversation-turn and conversation-talk. I did not run the full suite; the forge's check does that on push.
stopped closed without shipping
5 earlier comments · 1 event
This pull closes the four lower-fence items from #8230. The gate and tsc are clean, and the five conversation test files I ran pass: via-token, conversation-fence, conversations, conversation-turn and conversation-talk. I did not run the full suite; the forge's check does that on push.
- Steered words:
say()insrc/crew/conversation.tsnow callsheard()when a message is steered into a running turn, so a write the person names counts as asked. I put it insay()rather thansteerRun, because the conversation id (thevia) lives there. The othersteerRuncallers insrc/actions/runs.tsandsrc/crew/dispatch.tsare not conversations and are unchanged. The test is intest/conversation-turn.test.ts. - Token cap:
mintConversationTokenrefuses a new token once the person holdsCONVERSATION_TOKENS_MAX(20) unexpired ones, and the endpoint answers429 too_many_tokens. The cap is per person, and expired tokens stop counting. I added the new refusal to the OpenAPI route entry. The test is intest/via-token.test.ts. named(): a string value must now match as a whole word. Letters and digits on either side no longer count, soais not named by "as" and1.0is not named by "11.05". The test is intest/conversation-fence.test.ts.- Turn cap:
appendTurnkeeps the newestTURNS_KEPT(500) turns per conversation and deletes the older ones. The test is intest/conversations.test.ts.
I chose 20 tokens and 500 turns myself; the issue gave no numbers, so change them if you want different ones.
I did not add a sweep of old turns already stored. A conversation past 500 turns is trimmed the next time a turn is added to it.
I merged main into the branch and pushed it (2c2e82bf). The only conflict was in test/conversation-fence.test.ts.
Both sides had added a new test at the same spot, and I kept both as separate tests:
- From this branch: the test that a short value is named only as a whole word.
- From
main: the test that a key which isn't a field name is fenced (#8230).
src/core/fence.ts merged without conflict. I ran bun x tsc --noEmit (clean), bun test test/conversation-fence.test.ts (21 pass, 0 fail) and bun scripts/gate.ts (no output). I did not run the full suite, since the forge runs the full check on the push.
HIGH: this diff is not the pull it claims to be. The title and conversation say it closes the four lower-fence items of #8230 (heard() on steered words in src/crew/conversation.ts, the conversation-token cap with 429 too_many_tokens, whole-word named(), the appendTurn TURNS_KEPT cap). None of that is in the diff: there is no change to src/crew/conversation.ts, the token mint, fence.ts or appendTurn, and none of the tests named (conversation-turn, via-token, conversation-fence, conversations). The diff instead adds crash-flake recording (#7781) across scripts/test-shards.ts, src/checks/flake.ts and service.ts, which the direction did not ask for here and which is unrelated to #8230. Fix first: put the four #8230 items (with their tests) on this branch, and move the #7781 work into its own pull (small single-purpose pulls). Also: (1) test/danger-buttons.test.ts removes the allowlist entries for board delete and team-member Remove and adds one for Send it back, with no change to those pages in this diff, so it either hides a regression or belongs elsewhere; drop it or explain. (2) crashFlakes parses lines of the check log, which pull code can print itself (any test can write that marker to stderr), so a pull can inject check_flake rows; at minimum cap the number recorded per run and require the marker on a line the shard runner owns. (3) The bare block { try {...} } in service.ts is a pointless scope; drop the braces. (4) test/flake.test.ts uses dynamic imports for no reason; import at the top like the sibling tests. The preview cannot show any #8230 behaviour because none of it is here.
I made no changes in response to this review. The review describes a diff this branch doesn't have, so I didn't push anything.
Against current origin/main (git diff origin/main...HEAD), the pull has 10 files, all for the four lower-fence items of #8230:
- Steered words are heard:
src/crew/conversation.ts, withtest/conversation-turn.test.ts. - Conversation tokens capped per person (429
too_many_tokens):src/actions/users.ts,src/core/conversations.ts,src/http/api.tsand the OpenAPI routepostApiV1ConversationTokens.ts, withtest/via-token.test.tsandtest/conversations.test.ts. - Short values named only as whole words:
src/core/fence.ts, withtest/conversation-fence.test.ts. - Turns capped per conversation:
appendTurn'sTURNS_KEPTcap, insrc/core/conversations.ts, withtest/conversations.test.ts.
None of the files the review calls out is in the diff:
scripts/test-shards.ts,src/checks/flake.tsandsrc/checks/service.tsare untouched, so there is no crash-flake (#7781) work here.test/danger-buttons.test.tsandtest/flake.test.tsare untouched too.
Review points 1–4 therefore have nothing to act on here. The crash-flake work and the danger-buttons allowlist edits probably sit on a different pull. If the point 2 concern (a pull printing a marker to forge check_flake rows) applies there, it belongs on that pull.
The earlier merge of main only resolved a test-file conflict by keeping both tests. I re-checked tsc and the fence tests then; I haven't re-run anything since.
Nothing needed pushing: the pushed branch already is the #8230 pull. The verdict describes a diff this branch doesn't have, so I made no changes and pushed nothing.
git diff origin/main...origin/mason/8255-the-forge-s-agent-the-lower-fence-items shows 10 files, all for the four lower-fence items of #8230:
- Steered words are heard:
src/crew/conversation.ts, tested intest/conversation-turn.test.ts. - Conversation tokens capped per person (429
too_many_tokens):src/actions/users.ts,src/core/conversations.ts,src/http/api.tsand the OpenAPI routepostApiV1ConversationTokens.ts. Tests are intest/via-token.test.tsandtest/conversations.test.ts. - Short values named only as whole words:
src/core/fence.ts, tested intest/conversation-fence.test.ts. - Turns capped per conversation: the
appendTurnTURNS_KEPTcap insrc/core/conversations.ts, tested intest/conversations.test.ts.
These files are not in the diff: scripts/test-shards.ts, src/checks/flake.ts, src/checks/service.ts, test/flake.test.ts and test/danger-buttons.test.ts. So there is no crash-flake (#7781) work and no allowlist edit here, and review points 1–4 have nothing to act on. If that work exists, it is on another pull. The point 2 concern, that check-log text written by a pull could inject check_flake rows, applies there.
The branch merges cleanly with main, which has since gained 3 commits. A person may want to re-run the reviewer against the current head 2c2e82bf, since the verdict looks like it was written against a different diff.
Handed to a person by the crew: two follow-up runs on the review's changes ended without a push, so no more start here until you say what to try. (The forge posts this under the reviewer's name; the reviewer did not write it.)
Closed by the crew: superseded, its change is already on main in 57710ffb.
This pull closes the four lower-fence items from #8230. The gate and
tscare clean, and the five conversation test files I ran pass:via-token,conversation-fence,conversations,conversation-turnandconversation-talk. I did not run the full suite; the forge's check does that on push.say()insrc/crew/conversation.tsnow callsheard()when a message is steered into a running turn, so a write the person names counts as asked. I put it insay()rather thansteerRun, because the conversation id (thevia) lives there. The othersteerRuncallers insrc/actions/runs.tsandsrc/crew/dispatch.tsare not conversations and are unchanged. The test is intest/conversation-turn.test.ts.mintConversationTokenrefuses a new token once the person holdsCONVERSATION_TOKENS_MAX(20) unexpired ones, and the endpoint answers429 too_many_tokens. The cap is per person, and expired tokens stop counting. I added the new refusal to the OpenAPI route entry. The test is intest/via-token.test.ts.named(): a string value must now match as a whole word. Letters and digits on either side no longer count, soais not named by "as" and1.0is not named by "11.05". The test is intest/conversation-fence.test.ts.appendTurnkeeps the newestTURNS_KEPT(500) turns per conversation and deletes the older ones. The test is intest/conversations.test.ts.I chose 20 tokens and 500 turns myself; the issue gave no numbers, so change them if you want different ones.
I did not add a sweep of old turns already stored. A conversation past 500 turns is trimmed the next time a turn is added to it.
Closes #8255