Skip to content

feat(scorers): ask a routing question per team skill of a judged session - #1650

Merged
SaulMoro merged 2 commits into
Tencent:mainfrom
kittimzhe:feat/skill-routing-questions-1469
Nov 2, 2026
Merged

SaulMoro merged 2 commits into
Tencent:mainfrom
kittimzhe:feat/skill-routing-questions-1469

Conversation

@kittimzhe

@kittimzhe kittimzhe commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Implements the routing questions of #1469 — the half its scope leaves after #1606 landed the skills evidence.

What a team does

# scorers/scoring.yaml
sessions: true        # or per-mode, as before
skill_routing: true

Every finished session the judge leases then gets one generated question per team skill its captures delivered: teamai:routing:<skill> for a root skill, teamai:routing:<namespace>:<skill> for a namespaced one. On demand the same names work whatever skill_routing says:

$ teamai score --session 7c1e… --scorer teamai:routing:ops:release --scorer teamai:routing:review-notes

How it follows the spec

  • Reserved names: : separates, so no scorer file can collide (definition.ts's token rule already forbids it in file names); pinnedDefinition reads a routing pin under the token form its name flattens to, so a leased attempt re-parses.
  • The rubric ships with teamai: fit/idle at 1, extra/missed at 0, passingScore 1, spec's wording verbatim with the skill's name filled in. The judge reads the description in skills.available in evidence.json — the rubric never quotes it — so rubric.sourceHash stays the same however the description is rewritten; a teamai release that changes the rubric changes the hash.
  • One judge call: a session's routing questions always share one launch, whatever batch says (background: their entries batch together; on demand: they group together; lease: the batch flag is set for them). A team scorer joins that call, and they join a team scorer's, only where batch puts a session's scorers together.
  • Never sampled: every finished session the judge leases gets its questions. Routing launches count toward the same daily_limit (launchesToday already counts session attempts); with batch: true a session still costs one launch.
  • skills_unknown gets none: questions come from the session's own captures via availableTeamSkills (new; the unmasked union skillsEvidence builds skills.available from), so a capture set written before [feat] Judge whether team skills load when they should, without writing a scorer #1469 asks nothing, and a session whose checkout held no team skills asks nothing with no gap.
  • skill_routing resolution: off by default; the root file turns it on; an active scorers namespace's file overrides the root key, and one that sets false turns it off (a value that is not a boolean is dropped with a problem, as batch is). It acts only where session judging is on.
  • A skill whose namespace the delivery record cannot tell (namespaceUnknown) gets no question: its name cannot be told from a same-named skill's, so judging it could judge the other.
  • On demand (scoreSession): resolves against the session's captures, only for a skill in its skills.available, else scorer_not_found naming what is available; works under a lease too (--json), where routing questions are the one exception to one-scorer-per-lease without --batch.

Tests

  • skill-routing.test.ts — name generation/parse/matching, rubric parses to the four labels with the skill named, hash stable across a description rewrite, namespaceUnknown skipped.
  • score-skill-routing.test.ts — on demand: one label kept with the generated sourceHash; two questions share one judge call (fake judge counts calls); join a session scorer only under batch; scorer_not_found for an undelivered skill and for skills_unknown. Background: skill_routing: true asks both skills' questions in one launch; off asks nothing; unknown captures ask nothing.
  • scorers-settings.test.ts — the key's parse and resolution (default off, root on, namespace overrides, namespace false wins, bad value problem).
  • Acceptance criteria 1 and 7 are the two one-launch tests; 2–4, 6 landed with feat(scorers): show the session judge the team skills it had and used #1606's capture-based evidence and are unchanged; 5's both halves are the asks-nothing tests.

Full suite locally: 19833 passed; the 5 remaining failures reproduce on main untouched by this branch (git-discovery, submodule-checkout ×2, workflow-place, workflow-workspace).

Real-CLI verification record (added after review)

Built from source at the fix head (npm ci, npm run build), isolated HOME, a stand-in Claude judge on PATH, a hand-written session capture delivering two team skills — ops:release (namespaced) and legacy with namespaceUnknown: true — and scorers/scoring.yaml with sessions: true, skill_routing: true:

teamai score --session <s1> --scorer teamai:routing:ops:release
  exit 0, judge called, label fit (score 1, passed) stored with the generated sourceHash, reasoning kept
teamai score --session <s1> --scorer teamai:routing:legacy
  scorer_not_found: "Its delivery record cannot tell the namespace of team skill legacy,
  so judging it could judge another skill of the same name: it has no routing question."
teamai score --session <s1> --scorer teamai:routing:absent
  scorer_not_found, listing the routing names that exist: teamai:routing:ops:release
  (legacy is not listed — it has no routing name)

The --json lease and the background one-launch behavior are covered by the suite's fake-judge E2E and by the reviewer's own built-CLI record.

…ion (Tencent#1469)

A team turns on skill_routing in scorers/scoring.yaml, and every
finished session its judge leases gets one generated question per team
skill the session's captures delivered: teamai:routing:<skill> for a
root skill, teamai:routing:<namespace>:<skill> for a namespaced one.
The names are reserved - a scorer file's name cannot contain ':'. The
rubric ships with teamai (fit/idle at 1, extra/missed at 0) and its
sourceHash covers the rubric with the skill name filled in but never
the description, so a rewritten description stays in the same
measurement; the judge reads the description in skills.available in
evidence.json (Tencent#1606).

A session's routing questions always share one judge call, whatever
batch says; a team scorer joins that call, and the questions join a
team scorer's, only where batch puts a session's scorers together.
Routing launches count toward the same daily_limit, and with batch on
a session still costs one launch. Nothing is sampled: every finished
session the judge leases gets its questions, and a capture set that
recorded no descriptions (skills_unknown) gets none. On demand,
score --session --scorer teamai:routing:... resolves whatever
skill_routing says, only for a skill in that session's
skills.available, else scorer_not_found.

skill_routing resolves as sessions' team files do: off by default, the
root file turns it on, an active scorers namespace's file overrides
the root key, and one that sets false turns it off.
@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
  • [P1 blocking] Missing real-CLI verification record — PR description. This PR changes runtime behavior, but its testing record lists only automated tests and suite totals. The first Code Review Rules item requires an end-to-end / real-CLI verification record for runtime changes. Record one representative built-CLI run; no provider × agent matrix is required.

  • [P1 blocking] Reject namespace-unknown skills on demand — src/session-flow/scoring.ts:315. With a capture containing { name: 'legacy', namespaceUnknown: true }, --scorer teamai:routing:legacy matches because routingSkillOf checks only name and namespace. It then generates and stores a root-skill verdict even though the skill’s namespace is unknown—the ambiguity the background path explicitly skips. Reject these entries during on-demand resolution too.

  • [P2 non-blocking] Document the new user-facing behavior — src/scorers/settings.ts:75. The diff introduces skill_routing and reserved on-demand scorer names without updating any user-facing documentation. The trusted repo instructions require affected behavior documentation in both English and Chinese; add the setting and routing-name behavior to the relevant scorer guide.

Read-only review; no PR code was run, built, or installed.

@SaulMoro

SaulMoro commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Reviewed at 60f02357 against #1469, with the built CLI, hand-written session captures and a stand-in judge on an isolated home. What holds:

  • Routing names cannot collide with a scorer file (: is outside the file-name token rule).
  • The rubric's sourceHash stays the same when a skill's description is rewritten.
  • A session's routing questions share one judge launch with batch on or off.
  • A skills_unknown session asks nothing in the background pass.
  • A --json lease takes both routing questions together.
  • An undelivered name gives scorer_not_found listing the routing names that are available.

CI is green at this head.

  • [P1 blocking] On demand, a routing question is asked for a skill whose namespace the delivery record cannot tell. teamai score --session <id> --scorer teamai:routing:review-notes on a session whose skills.available marks that skill namespaceUnknown: true exits 0, makes one judge call and stores the label under the root name, while the background pass asks nothing for the same session. scoreSession (src/session-flow/scoring.ts:316) resolves the name through routingSkillOf without the !namespaceUnknown filter that routingScorers applies (src/scorers/skill-routing.ts:76). The PR's own rule ("judging it could judge the other") applies here too, so it should be scorer_not_found naming why.
  • [P2 non-blocking] The new scoring.yaml key is not in the docs. docs/guide/scorers.md (and its Chinese page) lists the scoring.yaml keys and says review --branch rejects unknown ones; skill_routing and the reserved teamai:routing:… names are a team-facing setting and scorer names, so a team learns of them only from this PR.
  • [P2 non-blocking] teamai score --session help (src/index.ts:918) and commands.md:285 still say "several --scorer need --batch" under --json; routing questions are now the exception.
  • [P3 nit] feat(benchmark): run benchmark suites as a default workflow #1379 also changes src/scorers/pin.ts, and the two conflict there; whichever merges second needs a rebase.

The description has no built-CLI run of the new behavior; ours, for reference:

Built from source at 60f02357 (npm ci, npm run build), isolated HOME, stand-in judge on PATH
scorers/scoring.yaml: sessions: true, skill_routing: true; two team skills delivered (root review-notes, ops:release)
teamai score --session <s1> --scorer teamai:routing:ops:release --scorer teamai:routing:review-notes
  exit 0, judge called once, two labels stored with the generated sourceHash
teamai score --session <s1> --scorer teamai:routing:<undelivered skill>   exit 1, scorer_not_found listing both names
background pass (score-sessions) on <s1>: one launch, both questions

@jeff-r2026 Your call once the on-demand namespaceUnknown case matches the background pass.

@kittimzhe

Copy link
Copy Markdown
Contributor Author

Thank you for the thorough review — all three are addressed at 9410a71:

  • P1: routingSkillOf now skips a namespaceUnknown skill, so the on-demand path shares the background pass's rule from one place (src/scorers/skill-routing.ts). The scorer_not_found answer names that reason when the name matches such a skill, and the list of available routing names excludes them — they have none. Your run 2 case now reads: Its delivery record cannot tell the namespace of team skill legacy, so judging it could judge another skill of the same name: it has no routing question. Regression tests in both suites (unit: matching; E2E: on-demand exit, message, no label).
  • P2 docs: skill_routing section added to docs/guide/scorers.md and the Chinese page, next to sessions; the reserved names and the on-demand resolution are in it.
  • P2 help: score --session help and commands.md now say routing questions are the one exception to several --scorer needing --batch.
  • P1 verification record: added to the description — built CLI, isolated home, stand-in judge, the namespaceUnknown and undelivered cases verbatim.
  • P3: understood; whichever of this and feat(benchmark): run benchmark suites as a default workflow #1379 merges second rebases pin.ts.

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
  • [P1 blocking] Missing real-CLI verification record — PR description. Still unresolved: this PR changes runtime behavior, but the testing section records only automated tests and suite totals. The first Code Review Rules item requires one representative end-to-end / real-CLI run after npm run build. Add the command and actual result; no provider × agent matrix is required.

Resolved

  • Namespace-unknown skills are now rejected on demand by routingSkillOf in src/scorers/skill-routing.ts:41, with regression coverage.
  • The new setting and routing-name behavior are documented in both English and Chinese at docs/guide/scorers.md:292 and docs/guide/zh-CN/scorers.md:292.

No additional confident findings in the specified diff. Read-only review; no PR code was run, built, or installed.

@SaulMoro

SaulMoro commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Read at 9410a715: all three points are addressed.

  • routingSkillOf now skips a skill whose namespace is unknown. The on-demand path and the background pass share one rule, and scorer_not_found says why for such a skill.
  • docs/guide/scorers.md and its Chinese page document skill_routing, the reserved teamai:routing:… names and on-demand resolution.
  • The score --session help and commands.md name the routing exception to --batch.

The description now carries a built-CLI record.

  • [P3 nit] The new paragraph in scorers.md says "the routing questions of #1469"; a reader of the guide gets more from a short description of what the questions ask than from an issue number in code formatting.

@jeff-r2026 Your call; whichever of this and #1379 merges second rebases src/scorers/pin.ts.

@SaulMoro

SaulMoro commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

One correction to the note above: Lint fails on all six Lint & Test jobs at 9410a715. node scripts/check-docs.mjs reports skill-data/core/references/commands.md as stale. The hand-edited line reads "except a session's teamai:routing:… questions", while the help in src/index.ts says "except for the session's …". Running node scripts/check-docs.mjs --write regenerates it.

…and document skill_routing (Tencent#1469 review)

routingSkillOf now skips a skill whose namespace the delivery record
cannot tell, so the on-demand path shares the background pass's rule
from one place: judging such a skill could judge another skill of the
same name. The scorer_not_found answer names that reason when the name
matches such a skill, and lists only the routing names that exist.

docs/guide/scorers.md and its Chinese page gain the skill_routing
section; the score --session help and commands.md say routing
questions are the one exception to several --scorer needing --batch.
@kittimzhe
kittimzhe force-pushed the feat/skill-routing-questions-1469 branch from 9410a71 to d053c96 Compare November 1, 2026 15:00
@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown

No new confident findings in the specified diff.

Resolved

  • The PR description now records a representative real-CLI run after building from source, satisfying the testing requirement.
  • routingSkillOf rejects namespace-unknown skills on demand, with regression coverage.
  • English and Chinese scorer guides document skill_routing and reserved routing names.

Read-only review; no PR code was run, built, or installed.

@SaulMoro SaulMoro left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was generated by AI during triage.

Approving at d053c96 for the routing-questions half of #1469 that this PR claims.

#1469 criterion Status
One judge launch per session for every routing question, whatever batch says Met: one call for two questions on demand and in the background (built-CLI run).
skills_unknown and namespaceUnknown sessions ask nothing Met: routingSkillOf now skips a skill with an unknown namespace on demand too, and scorer_not_found says why.
skill_routing resolution: default off, root on, a namespace override including false, a non-boolean reported Met (scorers-settings.test.ts). It acts only where session judging is on.
On-demand teamai:routing:… for an undelivered skill Met: scorer_not_found names the routing names that exist. Under --json, routing questions are the one exception to one scorer per lease.
Rubric hash stable across a description rewrite Met (built-CLI run).
Reserved names cannot collide with scorer files Met: file scorer names cannot contain :.
Privacy Nothing new leaves the machine beyond what #1606 already sends. The new judge launches go to the team's own judge, and only when the team opts in.
Docs scorers.md (EN and zh-CN) documents skill_routing, the reserved names and on-demand resolution. commands.md is regenerated, and check-docs passes.

CI is green at this head. The CI review's last pass has no findings, and its earlier P1 (the real-CLI record) is resolved by the record in the description.

The rest of #1469 is outside this PR and stays open there. That includes the example-led "Skill routing" guide section the definition of done describes (dashboard counts with precision and recall, the per-skill scorer example).

  • [P3 nit] The batch-joining and ten-skill cases (#1469 rows on batch: true with a team scorer, and ten skills with batch unset) are covered by unit tests and by reading, not by a built-CLI run.

@SaulMoro
SaulMoro merged commit 8488ee4 into Tencent:main Nov 2, 2026
18 checks passed
Walternater pushed a commit to Walternater/teamai-cli that referenced this pull request Nov 2, 2026
…ion (Tencent#1650)

A team that sets `skill_routing: true` in `scorers/scoring.yaml` gets one generated routing question per team skill a finished session was delivered (`teamai:routing:<skill>`, `teamai:routing:<namespace>:<skill>`). All of a session's questions share one judge launch. The names also resolve on demand with `teamai score --session <id> --scorer`. Skills whose namespace is unknown get no question.

Part of Tencent#1469
SaulMoro pushed a commit that referenced this pull request Nov 3, 2026
…asset (#1684)

A task's covers names the team repo paths its work is expected to need, and the results answer, per covered path, whether an arm that runs without exactly that path passes less on the tasks that cover it, and no less on the others. Builds on #1658's benchmark engine and #1650's record used fields. Closes #1605.

- Each covered path gets a table: per task, passed without and with, and for a skill the routing values it loaded with (fit, missed, extra, idle, unknown), then the paired difference over the tasks that cover it and over the others, and passed when loaded / not loaded. Pure over the record, so published records answer without a rerun. The dashboard's Compare tab shows the same tables.
- plan reads what each arm receives at its own team revision, role and without paths, and refuses a covered path no arm receives, a namespace copy that stands in for it, and two covered skills of the same bare name. An arm whose clone does not receive a covered skill records no routing for it: the skill is absent, not missed.
- Docs en/zh: the covers task field and an Asset effect section.
- A handoff test that times out on macOS on main gets 60 s.

Original work by kittimzhe; review fixes pushed to the branch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants