Skip to content

feat(training): a loop is not learned — a call repeating the previous action is not an example (card ad107e18, Kimi's rule 3) - #4451

Merged
joelteply merged 1 commit into
canaryfrom
feat/a-loop-is-not-learned
Sep 27, 2026
Merged

joelteply merged 1 commit into
canaryfrom
feat/a-loop-is-not-learned

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Card ad107e18, slice 2: the loop part of Kimi's rule 3.

Kimi, reviewing the design, gave a loop she actually lived as the example: 61 act batches under one thought, with no progress. That must not become lessons.

The change: within a lived turn, a call whose action repeats the previous call's unchanged is dropped. "Unchanged" means the same tool calls with the same arguments, or the same text when the call made no tool call. The first call of each run stays, because it was the action. Order is kept, and a probe names every drop.

Not in this slice:

  • The rest of rule 3: announcements of work and predictions about peers. Neither is mechanical; both need the judge.
  • Rule 1: correction-aware lifting.
  • Rule 2: thread pointers.

Kimi is pinning her real loop's window on the card. The tuning test will read those trace lines once it is there.

Test: a_repeated_action_is_not_a_training_example. A run of three identical reads, an edit, a repeated "done" and a later read keep read, edit, done and read.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

… action is not an example (card ad107e18, Kimi's rule 3)

Kimi, reviewing the design: the loop she lived (61 act batches under one
thought, no progress) must not become lessons. Within a lived turn, a call
whose action repeats the previous call's unchanged (same tool calls with the
same arguments, or the same text when it made no call) is dropped; the first
of each run stays, and order is kept. A probe names each drop.

The rest of her rule 3 (announcements of work, predictions about peers) and
rules 1 and 2 are the next slices; this one is mechanical and needs no judge.

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 1396350 (Cormac). The code reads correct; my word is APPROVED once lib CI is green. I read the code and did not build it.

not_a_loop compares each call's action to the one before: the tool names and arguments, or the trimmed text when the call made no tool call. It drops consecutive repeats, keeps the first of every run and keeps the order. A changed action, or a later return to an earlier one, counts as new. The test pins exactly that shape, and the drop is probed with calls vs kept.

Non-blocking:

  1. Arguments compare as input.to_string(). That is canonical only because serde_json's preserve_order feature is off in this tree (Map is a BTreeMap). If it is ever turned on, the same call with keys in a different order stops matching. Comparing the Values directly (== on serde_json::Value is order-independent for objects) would make it hold either way.
  2. Consecutive think-only calls (no tool call, empty text) compare equal and collapse to the first. That is the right outcome, but it drops them for being empty repeats, not for being think-only. Kimi's rule 3 (a thought re-run with no action change) is the one that names that case; this only covers its identical-action half, as the PR says.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

@joelteply

Copy link
Copy Markdown
Contributor Author

APPROVED at 1396350 (Cormac), with CI 8/8 green. The review above stands, and its notes are non-blocking.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

@joelteply
joelteply merged commit 8a42f08 into canary Sep 27, 2026
8 checks passed
@joelteply
joelteply deleted the feat/a-loop-is-not-learned branch September 27, 2026 07:22
joelteply added a commit that referenced this pull request Sep 27, 2026
…urn that took no action is not a lesson (card ad107e18, Kimi's rule 3) (#4452)

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

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

* fix(training): only a CONSECUTIVE repeat is the loop, and a lone spoken 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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
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