Repository navigation
feat(benchmark): give an arm a clone that deploys the team's recall - #1728
Conversation
A workflow clone has always turned recall off: it adds files a step did not ask for. A benchmark arm that measures declared relations needs it on, because recall is the only path a relation takes to a session — without it the arms would differ only in the `related:` text a tool receives unchanged, and the measurement Tencent#1564 describes cannot be run at all. An arm may now set `recall: true`. It reaches `CloneTeam` as an optional field, which `installTeam` reads in place of the hard-coded `false`; every other workflow clone keeps its behaviour because the field is absent and `team.recall ?? false` is what it always was. It is deliberately not a matrix key: it is the measurement's control, not a value the page compares one arm over, so `changedKeys` still ignores it and a suite cannot cross it into a comparison that would mean nothing. Refs Tencent#1564 🤖 Generated with [Claude Code](https://claude.com/claude-code)
No other confident findings in the scoped diff. Nothing from the PR was run, built, or installed. |
SaulMoro
left a comment
There was a problem hiding this comment.
This was generated by AI during triage.
The wiring makes sense. recall goes from the arm, through PlannedArm and cloneTeamOf, into CloneTeam, and installTeam reads team.recall ?? false, so every clone that does not ask stays as it was. Keeping recall out of ArmValuesSchema keeps it out of the matrix and out of the "changes one defaults key" check, which fits its role as the measurement's control. I read the code only; I did not build or run it.
CI review. It flagged one [P1 blocking]: no real-CLI record. I agree. The tests stop at the planned step definition (workspace.clone.team.recall), and nothing shows a trial clone actually getting the team's recall deployment. A record of one teamai benchmark run with an arm recall: true would close it. It should show the files recall delivers inside the trial clone, and their absence for an arm without it.
[P2 non-blocking] recall is also a new workflow key, and no doc mentions it. CloneTeamSchema is part of ClonePlaceSchema, and src/workflow/parse.ts parses a step's workspace: { clone: … } through it. So a team's own workflow can now write team: { …, recall: true } as well as a suite arm. Neither key is in the guides. The arm key belongs in the key table and arm sections of docs/guide/benchmarks.md and docs/guide/zh-CN/benchmarks.md. docs/guide/workflow-advanced.md (and its zh-CN page) documents that workspace: { clone: { commit, repo?, team } } key by key, listing { revision, selection, treatment }, so recall needs a line there as well. Or, if teams aren't meant to write it, the parse should keep it to the benchmark's compiled steps.
[P2 non-blocking] cloneTeamOf drops its exhaustive switch. The old version ended with a never check, so a new ArmTeam kind failed to compile until it was handled. The nested ternary sends anything that is not none, pulled or ref to the without shape. Today that only compiles because paths exists on without alone. The change isn't needed for recall, since the old switch could spread recall the same way. Keeping the switch keeps the diff to the feature.
[P3 nit] recallOf in the new test casts step?.workspace to a hand-written shape. ClonePlaceSchema.safeParse would read it without the cast.
@jeff-r2026 your call on this one: it adds a suite key, and through the shared clone schema also a workflow key, for #1564's measurement.
Review on Tencent#1728: the nested ternary in `cloneTeamOf` sent an unhandled ArmTeam kind into the `without` shape, where only `paths` existing made it compile — the exhaustive `never` check was the point, and it is back. `recall` stays a workflow key, because the compiled benchmark steps a run stores are read back through the same schema a team's YAML parses with, and no narrower written-form schema can tell them apart. It is documented as such: the arm key table and a new section in both benchmarks guides, and the clone-place key in both workflow-advanced guides, where the reviewer asked for a line. The plan test reads the run's clone place through `ClonePlaceSchema` instead of a hand-written cast. Co-Authored-By: Claude Code <[email protected]>
|
c7cf3cd addresses the three findings; the P1 is not closed yet. The exhaustive switch (P2). Restored — the The workflow key (P2). I tried to keep it benchmark-only first, with a narrower written-form schema in The cast (P3). The real-CLI record (P1). Still owed. A
|
Nothing from the PR was run, built, or installed. |
SaulMoro
left a comment
There was a problem hiding this comment.
This was generated by AI during triage.
Thanks for the round. c7cf3cd closes the three earlier findings:
cloneTeamOfis aswitchagain with theneverbranch, andaskedaddsrecallwithout touching thenoneshape.- The arm key is in the key table and has its own section in
docs/guide/benchmarks.mdand the zh-CN page, and theworkspace: { clone }paragraph indocs/guide/workflow-advanced.md(both languages) now namesrecall: true. - The test reads the step through
ClonePlaceSchema.parse, so the cast is gone.
[P1 blocking] Still open: the real-CLI record. As your comment says, nothing yet shows a trial clone actually receiving the recall deployment. One teamai benchmark run showing the recall files inside the clone of an arm with recall: true, and their absence for an arm without it, closes it.
[P2 non-blocking] The new example in "Arms that run with recall" is a suite the CLI refuses. I agree with the CI review here. In docs/guide/benchmarks.md (and the zh-CN copy) the arms with-relations (recall: true) and baseline (recall: false) set no defaults key, so changedKeys returns [] for both, and the suite check in src/benchmark/suite.ts rejects the second with arm "baseline" changes none of the defaults keys, and neither does arm "with-relations"; at most one arm changes none. Even if it parsed, dimensionOf in history.ts would find no dimension between them, so the page would never compare them. Your PR body says the same thing ("a suite whose arms differ only in recall is refused"), and so does the comment on ArmFileSchema.recall: a suite that measures relations sets recall on every arm and varies something else. The example should show that, e.g. both arms recall: true, one with team: { without: [<the relations file>] }. The opening question ("Does the team's recall help a task at all") would then read better as what the suite actually answers: whether the declared relations help, with recall on in both arms.
@jeff-r2026 your call on this one: it adds a suite key, and through the shared clone schema also a workflow key, for #1564's measurement.
The plan test stops at the step definition; nothing showed a trial clone actually getting the team's recall deployment. This runs the suite for real: two arms, one with `recall: true`, one without, and reads the files of each trial's clone from what the fake tool recorded in its cwd. The arm that asked for it gets the recall agent, the recall rule and the context rule; the arm that did not gets none of them. Without the feature the suite does not even parse, so the case fails there rather than on the assertion. Co-Authored-By: Claude Code <[email protected]>
|
c7cf3cd and 4bacfa3 close the P1 with a real run.
The recall agent, the recall rule and the context rule are in the arm that asked for them and in none of the other. Both arms ran the same task on the same tool. Without the feature the suite does not parse — One suite detail worth knowing: a suite needs at most one arm that changes no |
Neither earlier finding is resolved. No other confident findings in the scoped diff. Nothing from the PR was run, built, or installed. |
SaulMoro
left a comment
There was a problem hiding this comment.
This was generated by AI during triage.
Thanks, 4bacfa3 closes the P1. I built the head and ran benchmark-recall.test.ts: it passes, and the trial clones hold what your comment lists. The recall agent and both recall rules are in with-recall's clone and in none of baseline's. I added that run to the PR body under "Real-CLI verification", since the CI review reads the body. Two non-blocking points are left.
[P2 non-blocking] The test still passes when every clone gets recall. without is the first launch that lacks teamai-recall.md. If both clones have it, without is undefined, and expect(undefined).not.toEqual(expect.arrayContaining(recallFiles)) passes. I checked by replacing team.recall ?? false with true in src/workflow/place/clone.ts: the case still passes. So it guards against the arm missing recall, but not against recall reaching the baseline, which is the half that keeps every other workflow clone as it was. Asserting that the baseline exists and holds none of the files closes it:
expect(without, 'no clone ran without recall').toBeDefined();
expect(without?.paths.filter((file) => recallFiles.includes(file))).toEqual([]);[P2 non-blocking] Still open from the last round: the example in "Arms that run with recall" is refused. 4bacfa3 only adds the test, and docs/guide/benchmarks.md and its zh-CN page still show two arms that differ only in recall. As the new test's own comment says, a suite needs a defaults key that differs between the arms, and the test gives baseline a model for that reason. The example would work with recall: true on both arms and team: { without: [...] } on one.
@jeff-r2026 your call on this one: it adds a suite key, and through the shared clone schema also a workflow key, for #1564's measurement.
The case found the first launch without the recall agent and asserted it held none of the recall files. When every clone had recall, that launch did not exist, the assertion was against undefined, and the case passed — so it guarded the arm that asked for recall but not the one that did not, which is the half that keeps every other workflow clone as it was. It now asserts the clone without recall exists, and that it holds none of the files. Replacing `team.recall ?? false` with `true` in src/workflow/place/clone.ts fails the case, as it should. The doc example was refused by the suite's own rules: two arms differing only in `recall` change no `defaults` key, and at most one arm may do that. Both arms now run with recall and differ in their `team` instead, which is the comparison the section is about. Co-Authored-By: Claude Code <[email protected]>
|
3de8101 addresses both. The test that passed when every clone got recall. You were right, and I checked it the way you did — replacing The case now asserts the clone without recall exists, and that it holds none of the recall files: expect(without, 'no clone ran without recall').toBeDefined();
expect(without?.paths.filter((file) => recallFiles.includes(file))).toEqual([]);With The doc example the suite refuses. Right — two arms differing only in arms:
- name: with-relations
recall: true
- name: without-relations
team: { without: [rules/payments.md] }
recall: trueI checked the example parses: |
|
No confident new findings in the scoped diff. Both earlier findings are resolved:
Nothing from the PR was run, built, or installed during this review. |
SaulMoro
left a comment
There was a problem hiding this comment.
This was generated by AI during triage.
Thanks, 3de8101 closes both points, and nothing is open on my side.
- Test. The case now requires a clone without recall and checks that it holds none of the three files. A change that gives every clone recall fails it, as your run shows.
- Docs. In the new example,
with-relationschanges nodefaultskey andwithout-relationschanges onlyteam, sochangedKeysaccepts the suite and the page compares the two arms onteam, with recall on in both. That's the comparison the section describes. The zh-CN page matches.
I'll lift my request for changes once CI is green on this head; CI passed on 4bacfa3, and this push only touches the test and the docs.
@jeff-r2026 your call on this one: it adds a suite key, and through the shared clone schema also a workflow key, for #1564's measurement.
Resolved at 3de8101: the real-CLI record is in the description and both earlier points are fixed. Leaving the merge to @jeff-r2026.
SaulMoro
left a comment
There was a problem hiding this comment.
This was generated by AI during triage.
Everything from the earlier rounds is resolved at 3de8101: the exhaustive switch, the docs in both languages, the test that now requires a clone without recall, and the real-CLI record in the description. CI is green. Approving.
`#1728` gave an arm `recall: true` and the run wrote it onto the record's arms, which are the plan's arms. `BenchmarkRecordSchema.arms` had no `recall`, and a record is read back through that schema, so zod dropped it: the file on disk said an arm ran with recall and every reader saw an arm that never had. The results gain a Recall column (`on`/`off`) once any arm runs with it, the shape the Role column already has, and the guides say the record keeps it. #1564 asks the run record to show recall was on; this is that field. Co-authored-by: Claude Code <[email protected]>
What
A benchmark arm may now set
recall: true, and its trial clones get the team's recall deployment.ArmValuesSchemakeeps its keys;ArmFileSchemagainsrecall?: boolean.CloneTeamas an optional field andinstallTeamreads it in place of the hard-codedrecallEnabled: false.team.recall ?? falseis what it always was.Why
src/workflow/place/clone.tshas always setrecallEnabled: falsefor a workflow clone, which is right — it adds files a step did not ask for.It is wrong for a benchmark measuring declared relations. Recall is the only path a relation takes to a session:
docs,learningsandwikiare never written into a tool's own directory, and the relation graph stays in the team clone. Without recall on, the two arms of the suite #1564 describes would differ only in therelated:text a tool receives unchanged, and the measurement could not be run at all.Before this change
src/benchmark/did not mention recall anywhere, so #1564 — the number #1552 promises — had no way to be measured.Not a matrix key
recallis the measurement's control, not a value the page compares one arm over, so it is deliberately outsideArmValuesSchema.changedKeysstill ignores it, and a suite cannot cross it into a comparison that would mean nothing. The tests show both sides: a suite whose arms differ only inrecallis refused like any two arms that change no defaults key.Verification
vitest run src/__tests__/benchmark-plan.test.ts src/__tests__/benchmark-suite.test.ts src/__tests__/workflow-clone-place.test.ts— 176 passed.The new plan case reads the run's own step definition:
Without the fixture change the first is
undefined, which is how the gap surfaced: the test helper rebuilds each planned arm field by field and was droppingrecallthe same waycloneTeamOfwould have.npm run typecheckandnpm run lintpass.Limitations
installTeam's recall setting is wired. A clone's other disabled features (contributeHintEnabled,mrHintEnabled, …) stay off, because nothing measures them.recallEnabledvalue is written where the clone's config is built; no run record reports it yet. [feat] Measure declared relations on the task bank, then decide on delivery beyond recall #1564 asks the run record to show recall was on, which needs its own change.Refs #1564
🤖 Generated with Claude Code
Real-CLI verification at 4bacfa3 (added by a reviewer)
Built the head (
npm ci && npm run build) and rannpx vitest run --config vitest.e2e.config.ts src/__tests__/e2e/benchmark-recall.test.ts, which runsteamai benchmark run fixwith the built CLI and a fake Claude tool that records the files of each trial's clone: 1 passed.The
.claude/files the two trial clones held:The recall agent and both recall rules reach only the clone of the arm with
recall: true.