inspector/scripts/lib
Repository files (latest commit first)
Filename Latest commit message Latest commit date
cliffhall 75940976f8 feat(skills): measure a skill reached from another skill (#2204)
`skills:eval` ran every case with `--max-turns 1`, so it measured one
thing: whether a skill is the model's FIRST tool call. That is right for a
skill a user reaches directly, and it leaves a whole class unmeasured — a
skill reached from inside another skill's body. `testing` tells the model
that picking a fixture is `/test-servers` and that it has to load it, and
`test-servers` scores 5/5 while every one of those five cases asks for it
by name. A skill only ever reachable through a hand-off would score a
clean 100% with the hand-off silently never firing.

An eval case is now one of two shapes, and exactly one:

  { "prompt": "…", "expect": "test-servers" }              first move, 1 turn
  { "prompt": "…", "chain": ["testing", "test-servers"] }  hand-off, 14 turns

A chain must END with the skill whose file it lives in. The case exists to
measure whether THIS skill is reachable, so the file that goes red is the
one belonging to the skill that stopped being reached; anchoring on the
first link would file a `test-servers` measurement under `testing`, where
a `test-servers` description edit would never be seen. Links are checked
against the repo's model-invoked set, which is why both `verify:skills`
and `collectCases` now validate in a second pass — `test-servers` sorts
before `testing`, so a per-directory check would reject a live chain as
unknown purely because of where the alphabet put it.

Scoring is an ordered SUBSEQUENCE, not a prefix and not a contiguous run:
the model may load something before the chain starts and something
unrelated in between, and neither changes the claim that A led to B.
`collectSkillInvocations` therefore returns an ordered array rather than a
Set — a B, A, B run has to stay distinguishable from one that never
reached B from A.

The two rates are reported in separate columns and never summed. A
hand-off is a second-hop load over many turns; a first-move rate is the
model's opening move. `CHAIN_MAX_TURNS` (14) and `CHAIN_THRESHOLD` are
their own knobs for the same reason, and `CHAIN_THRESHOLD` defaults to
**0.5** rather than inheriting 0.8: see the measurement below.

Read-only containment no longer leans on `--max-turns 1`, which was doing
much of it by itself. The deny list gains the agentic and network tools —
`Task` in particular, whose subagent the flag does not reach.

Measured, `skills:eval -- test-servers`:

  First move (1 turn)     7/7 at 100%, unchanged
  Hand-off (14 turns)     67% and 33% at RUNS=3

So the hand-off is real and unreliable — which is the fact nothing could
observe before this change, and the reason 0.5 rather than 0.8 is the
default bar: at 0.8 both committed cases are red no matter how strongly
the first skill points at the second, and the column stops carrying
signal. A `["pr-flow", "test-servers"]` probe measured 0% and was dropped
rather than kept: `pr-flow` says nothing about fixtures, so the case had
no lever short of broadening a description onto another skill's ground.
Both findings are written up in `docs/skill-authoring.md`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ABdTnqyBodw6mHVVkGehqe
Signed-off-by: cliffhall <cliff@futurescale.com>
2026-09-04 19:07:26 -04:00
..
announced-child.mjs chore(scripts): rename the local pre-push gate off ci, and guard it out of CI (#2146) 2026-08-26 23:56:34 -04:00
announced-child.test.mjs chore(scripts): rename the local pre-push gate off ci, and guard it out of CI (#2146) 2026-08-26 23:56:34 -04:00
child-cleanup.mjs fix(scripts): await the pack:verify web child's exit before removing its work dir (#1895) 2026-08-01 19:50:00 -04:00
child-cleanup.test.mjs fix(scripts): await the pack:verify web child's exit before removing its work dir (#1895) 2026-08-01 19:50:00 -04:00
claude-cli.mjs chore: address Copilot review round 17 2026-08-29 04:54:04 -04:00
claude-cli.test.mjs chore: address Copilot review round 7 (Windows .cmd shims) 2026-08-29 02:32:30 -04:00
deep-link-connect.mjs chore(web): connected-flow smoke for the Tools, Resources and Prompts tabs 2026-08-26 23:09:44 -04:00
deep-link-connect.test.mjs chore(web): connected-flow smoke for the Tools, Resources and Prompts tabs 2026-08-26 23:09:44 -04:00
ensure-test-servers.mjs docs(scripts): correct the deleted-source caveat — it is silent, not loud 2026-08-25 01:37:40 -04:00
ensure-test-servers.test.mjs fix(scripts): pin the tsbuildinfo inside build/, assert on cache hits 2026-08-25 01:11:10 -04:00
headless-browser.mjs fix(smoke): assert the requested engine is the one launched; fix the remedy 2026-08-26 09:33:21 -04:00
headless-browser.test.mjs fix(smoke): assert the requested engine is the one launched; fix the remedy 2026-08-26 09:33:21 -04:00
mcp-app-flow.mjs chore(web): connected-flow smoke for the Tools, Resources and Prompts tabs 2026-08-26 23:09:44 -04:00
mcp-app-flow.test.mjs Merge branch 'v2/main' into v2/chore/2003-pack-verify-app-render 2026-08-24 09:05:53 -04:00
npm-scripts.mjs chore: address Copilot review round 20 2026-08-29 05:32:12 -04:00
npm-scripts.test.mjs test(cli,tui): typecheck the __tests__ dirs (#1791) (#1799) 2026-07-27 12:05:35 -04:00
prod-web-server.mjs test(smoke): cover loadBrowser's failure branches; fix a stale helper comment 2026-08-25 22:42:06 -04:00
prod-web-server.test.mjs fix(smoke): pin the teardown ordering, and correct a docblock the test refuted 2026-08-11 15:17:56 -04:00
pty.mjs fix(scripts): address Copilot review round 2 on #2147 2026-08-26 21:36:40 -04:00
pty.test.mjs fix(scripts): address Copilot review round 2 on #2147 2026-08-26 21:36:40 -04:00
render-smoke.mjs fix(scripts): make the test stubs drain, and the raw-mode guard testable (#2147) 2026-08-26 22:13:35 -04:00
render-smoke.test.mjs test(scripts): anchor the render-smoke overlap paint to the parent's clock 2026-08-27 23:51:36 -04:00
resolve-node-bin.mjs fix(scripts): keep the resolver local, complete the cmd.exe quoting 2026-08-17 00:18:40 -04:00
resolve-node-bin.test.mjs fix(scripts): keep the resolver local, complete the cmd.exe quoting 2026-08-17 00:18:40 -04:00
skill-manifest.mjs feat(skills): measure a skill reached from another skill (#2204) 2026-09-04 19:07:26 -04:00
skill-manifest.test.mjs feat(skills): measure a skill reached from another skill (#2204) 2026-09-04 19:07:26 -04:00
tsc-program.mjs fix(scripts): validate the bin name and that its file exists 2026-08-16 23:43:24 -04:00
tsc-program.test.mjs chore(scripts): compare only the copies a program actually met 2026-08-16 12:35:38 -04:00
win-shell-args.mjs fix(scripts): keep the resolver local, complete the cmd.exe quoting 2026-08-17 00:18:40 -04:00
win-shell-args.test.mjs fix(scripts): keep the resolver local, complete the cmd.exe quoting 2026-08-17 00:18:40 -04:00
workflow-gate.mjs chore(scripts): cover PowerShell's Env: drive, and correct two stale scope summaries (#2146) 2026-08-27 02:44:41 -04:00
workflow-gate.test.mjs chore(scripts): cover PowerShell's Env: drive, and correct two stale scope summaries (#2146) 2026-08-27 02:44:41 -04:00