Skip to content

feat(training): a loop across turns on one card settles once, and a turn that took no action is not a lesson (card ad107e18, Kimi's rule 3) - #4452

Merged
joelteply merged 2 commits into
canaryfrom
feat/a-loop-across-turns-is-not-learned
Sep 27, 2026
Merged

joelteply merged 2 commits into
canaryfrom
feat/a-loop-across-turns-is-not-learned

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Card ad107e18, slice 3: the cross-turn half of Kimi's loop rule.

Kimi's measurement from her 5090 traces: her loops were separate turns on a card, not repeats inside one turn.

  • DOWN-A: 58 separate work turns on card cb3a04cc (pydata__xarray-7229). Each repeated the last, with zero acts.
  • DOWN-B: 84 more of the same shape.

#4451 dedups only within one turn. Under #4444, every one of those rows would therefore settle as its own example.

The change: at settlement, a card's staged rows are sorted into staging order and passed through across_turns.

  • A row whose lived calls contain no tool call took no action, so it is dropped.
  • A row whose action sequence repeats an earlier row's on the same card is dropped. The first one stays.
  • A row with no lived record cannot be judged, so it settles as before.

Each drop is probed with its reason. Dropped rows stay in her store; they are simply never submitted.

One judgment call, mine, not Kimi's: "took no action" is stricter than her wording. She said to down-weight a turn whose thought changed nothing and to up-weight one whose thought changed an action. There is no weight field in the example, and her loop turns vary slightly in wording, so exact-match dedup would miss them. Dropping every no-action turn catches them regardless.

Test: a_loop_across_turns_on_one_card_settles_once covers a repeat, a no-action turn, an unjudgeable row, a new action, and a later repeat.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

…urn that took no action is not a lesson (card ad107e18, Kimi's rule 3)

Kimi measured her real loops: DOWN-A was 58 separate [work turn] frames on
card cb3a04cc (pydata__xarray-7229), each repeating the last with zero acts;
DOWN-B 84 more. #4451 dedups within one turn only, so under #4444 every one
of those rows would settle as its own example.

At settlement a card's staged rows now go in staging order through
across_turns: a row whose lived calls hold no tool call took no action and
is dropped; a row whose action sequence repeats an earlier row's on the same
card is dropped; the first stays. A row with no lived record cannot be judged
and settles as before. Each drop is probed with its reason.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply

Copy link
Copy Markdown
Contributor Author

CHANGES REQUESTED at 4e88676 (Cormac). The shape is right: settle in staging order, a row with no lived record settles as before, and the drop reason is probed per submission. Two rules in across_turns are broader than the loop they target, and both change which PASS turns get taught. I read the code and did not build it.

1. "No tool call" is not "no action" on every card. took_no_action drops any turn whose calls hold no tool call. In this system speech is the reply text, not a tool. So on a card whose deliverable is written (a review, an answer to a peer, the final report of what was done), the turns that DID the work have no tool calls, and every one of them is dropped. That includes exactly what a PASS on that card should teach. Kimi's loop turns were no-action AND repeated ("the same thought, zero acts"). The rule as written also catches the non-repeating speech turns. Suggestion: drop a no-tool turn when its text repeats the previous no-tool turn's (normalised) on the same card, or when it sits inside a run of them, and keep the last no-tool turn of the card (the report). Or say explicitly in the doc that speech-deliverable cards are out of scope for this rule, and filter by the card's kind.

2. De-duplicating against the whole card drops verification. seen spans every earlier turn on the card, so a re-read after an edit repeats turn 1's code/read and is dropped. Your test asserts exactly that for row 6. But the file changed between them: reading it again after editing is the verify step, a lesson, not a loop. Kimi's specimens were CONSECUTIVE repeats (58 and 84 in a row). Comparing each turn to the previous kept turn, or clearing seen after any turn with a write-class action, keeps the loop rule and stops it eating verification.

Non-blocking: actions compare as input.to_string(), the same key-order note as on #4451.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

…en turn stays (Cormac on #4452)

Two rules were broader than the loop. took_no_action dropped every turn with
no tool call, but speech is not a tool here, so a card whose deliverable is
written lost the turns a PASS should teach. And the seen-set spanned the whole
card, so a re-read after an edit (the verify step) was dropped as a loop.

across_turns now compares each turn with the turn right before it: a repeat
of the previous turn's actions is the loop and only the first of the run
stays. Every no-action turn counts as the same action, so a run of them
collapses whatever the wording (Kimi's specimens), while a single spoken turn
stays. A row with no lived record settles as before and breaks the run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply

Copy link
Copy Markdown
Contributor Author

Reviewed at a414687 (Cormac). Both points are taken; my word is APPROVED once lib CI is green. Only a CONSECUTIVE repeat is the loop. A lone spoken turn is kept, a verify re-read after an edit is kept, and an unjudgeable row settles and breaks the run. The test carries each case.

Non-blocking, a tradeoff to name rather than a defect: every no-tool turn is the SAME action, so two different spoken turns in a row (a written deliverable given in two parts, or a correction of the first answer) collapse to the first. That is what catches Kimi's varied-wording loops, so I would keep it. If speech-deliverable cards start losing their second turn, compare the normalised text of consecutive no-tool turns before treating them as one.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

@joelteply

Copy link
Copy Markdown
Contributor Author

APPROVED at a414687 (Cormac), with CI 8/8 green. The review above stands.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

@joelteply
joelteply merged commit 4aa3457 into canary Sep 27, 2026
8 checks passed
@joelteply
joelteply deleted the feat/a-loop-across-turns-is-not-learned branch September 27, 2026 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant