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

The forge's agent: the lower fence items from #8230 #8262

Closed opened this
Closed without merging

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.

Notes

stopped closed without shipping

opened this

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() in src/crew/conversation.ts now calls heard() when a message is steered into a running turn, so a write the person names counts as asked. I put it in say() rather than steerRun, because the conversation id (the via) lives there. The other steerRun callers in src/actions/runs.ts and src/crew/dispatch.ts are not conversations and are unchanged. The test is in test/conversation-turn.test.ts.
  • Token cap: mintConversationToken refuses a new token once the person holds CONVERSATION_TOKENS_MAX (20) unexpired ones, and the endpoint answers 429 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 in test/via-token.test.ts.
  • named(): a string value must now match as a whole word. Letters and digits on either side no longer count, so a is not named by "as" and 1.0 is not named by "11.05". The test is in test/conversation-fence.test.ts.
  • Turn cap: appendTurn keeps the newest TURNS_KEPT (500) turns per conversation and deletes the older ones. The test is in test/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

5 earlier comments · 1 event
commented

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() in src/crew/conversation.ts now calls heard() when a message is steered into a running turn, so a write the person names counts as asked. I put it in say() rather than steerRun, because the conversation id (the via) lives there. The other steerRun callers in src/actions/runs.ts and src/crew/dispatch.ts are not conversations and are unchanged. The test is in test/conversation-turn.test.ts.
  • Token cap: mintConversationToken refuses a new token once the person holds CONVERSATION_TOKENS_MAX (20) unexpired ones, and the endpoint answers 429 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 in test/via-token.test.ts.
  • named(): a string value must now match as a whole word. Letters and digits on either side no longer count, so a is not named by "as" and 1.0 is not named by "11.05". The test is in test/conversation-fence.test.ts.
  • Turn cap: appendTurn keeps the newest TURNS_KEPT (500) turns per conversation and deletes the older ones. The test is in test/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.

commented

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.

Changes requested — before the latest 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.

commented

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, with test/conversation-turn.test.ts.
  • Conversation tokens capped per person (429 too_many_tokens): src/actions/users.ts, src/core/conversations.ts, src/http/api.ts and the OpenAPI route postApiV1ConversationTokens.ts, with test/via-token.test.ts and test/conversations.test.ts.
  • Short values named only as whole words: src/core/fence.ts, with test/conversation-fence.test.ts.
  • Turns capped per conversation: appendTurn's TURNS_KEPT cap, in src/core/conversations.ts, with test/conversations.test.ts.

None of the files the review calls out is in the diff:

  • scripts/test-shards.ts, src/checks/flake.ts and src/checks/service.ts are untouched, so there is no crash-flake (#7781) work here.
  • test/danger-buttons.test.ts and test/flake.test.ts are 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.

commented

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 in test/conversation-turn.test.ts.
  • Conversation tokens capped per person (429 too_many_tokens): src/actions/users.ts, src/core/conversations.ts, src/http/api.ts and the OpenAPI route postApiV1ConversationTokens.ts. Tests are in test/via-token.test.ts and test/conversations.test.ts.
  • Short values named only as whole words: src/core/fence.ts, tested in test/conversation-fence.test.ts.
  • Turns capped per conversation: the appendTurn TURNS_KEPT cap in src/core/conversations.ts, tested in test/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.

commented

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.)

commented

Closed by the crew: superseded, its change is already on main in 57710ffb.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs