Repository navigation
docs: add a routing canary for Skill activation evidence - #402
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6330386947
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Two additional points in
Small fixture tests for these cases would help keep the evidence summary reliable. |
|
Addressed in Summarizer (review points 1–2)
run.sh (connector P2s)
|
|
Three-iteration stability data in Method:
Two things worth separating rather than averaging:
Also changed: OpenCode is still unmeasured: it refuses the user-level config ( |
9a79a5e to
644397a
Compare
|
OpenCode is now measured, and the summary parses its event shape ( Isolation. Its user-level Evidence. OpenCode emits a structured tool call whose result is the Skill body: {"type":"tool_use","part":{"type":"tool","tool":"skill","state":{"status":"completed",
"input":{"name":"literary-translation"},
"output":"<skill_content name=\"literary-translation\">..."}}}Two things worth recording:
Results (3 iterations).
The competing misses are the same confounder already documented for Claude Code, not a routing miss: the transcript has the The matrix row, results table and the remaining OpenCode limitation are updated in |
|
Thanks for the update. The OpenCode section formatting looks fixed. A few items remain:
|
|
Fixed the three review points on the scripts (644397a → d6bbdc5):
While testing the whitelist end-to-end I also hit a latent bug the review did not catch: under |
|
The CI wiring and updated PR description address those two items. One issue remains in the new engine allowlist: |
|
Thanks for the update. The allowlist can still be bypassed with an embedded newline: scripts/routing-canary/run.sh $'../victim\ncodex'The full argument then reaches Could you replace the regex check with an exact shell case "$engine" in
claude_code|codex|opencode) ;;
*) echo "Unsupported engine: $engine" >&2; exit 1 ;;
esacA small validation test covering unknown names, regex characters, and embedded newlines would help prevent regressions. |
zpzjzj
left a comment
There was a problem hiding this comment.
Requesting changes on d6bbdc5 for the unresolved engine validation issue detailed here. grep -qx "$engine" still interprets input as patterns, while that same input reaches artifact deletion paths. Please use exact supported-name matching before filesystem operations and test unknown, regex-like, and multiline names. The CI/documentation fixes are acknowledged; this is the remaining blocker.
|
Fixed in
Tests (
Negative control: with
|
|
Checked One small cleanup remains: It would also be useful to exercise all three supported names in |
|
Both in Temp dir. All three names. |
|
Thanks for the fix. The exact string comparison addresses the newline bypass, and all six tests pass locally. Could you also sync three details in the PR description?
|
|
Synced all three in the description:
Also folded in the earlier fix: |
|
Thanks for updating the PR description. I reran the six offline tests and they all passed. Could you clarify a few points about the evidence before merging?
|
The first step of alibaba#166 is to find out what native evidence an engine emits when it selects, loads or applies a Skill, instead of inventing a skill_activated assertion before the evidence exists. Add a small, repeatable canary: two Skills with disjoint triggers write marker files that the case expectations check, so green means the Skill body was applied rather than echoed. A runner script executes the canary per engine with --no-delete and a summary script reports the Skill-related events found in each transcript. The investigation report records what the canary observed on claude_code 2.1.317 and codex 0.166.0 (both 3/3 PASS): Claude Code emits a structured Skill tool call with a paired result, while Codex only injects a skill catalog and reads SKILL.md as an ordinary command. It also documents the engine-global skill roots that leak into the selection surface, the install name vs declared name mismatch, and why neither engine's evidence yet supports 'applied'. No schema, capability flag or assertion is added.
summarize.py now keeps cases whose transcript is missing, reports the execution status from result.json next to an explicit transcript state, and labels a SKILL.md payload as a reference rather than a read. run.sh replaces out/<engine> instead of overlaying it and exits nonzero when an engine fails, so a missing measurement cannot look like a clean result. Adds fixture tests.
… the fixture name Three iterations per engine separate two measurements the single-pass run had merged: Claude Code routed all nine cases correctly (a Skill call in every transcript that needed one), but applied the marker instruction only 1/3 in the competing case after loading the right Skill - the model translated the line itself and said the instruction looked artificial. Codex applied 3/3. The earlier fixture named the second Skill canary-decoy. One run read that name from the catalog and answered that it was a decoy rather than a real Skill, so it never applied. The fixture now uses literary-translation, a neutral name, and summarize.py follows the new marker.
…e its nested tool events
27ecb14 to
a24c776
Compare
|
All three synced, plus one code change behind them ( Claude Code wording. The test plan now separates selection from application: the Codex. Dropped the "routing 9/9" claim for Codex. It has no selection event, so the description now says selection is not measured there: all nine runs passed grading and each references the expected
|
|
Thanks for tightening the catalog evidence in |
The summarizer labelled an empty or entirely unparseable transcript as present and reported the Skill evidence as absent, but such an artifact proves nothing: the OpenCode adapter can leave an empty stdout file even when the run failed. Distinguish the transcript states now, and keep the Skill evidence unknown until a usable record exists. Two offline fixtures cover the empty and the invalid JSONL case. Co-Authored-By: Claude Code <[email protected]>
|
Fixed in The summarizer now distinguishes the transcript states instead of collapsing them into
The Skill evidence columns ( Two offline fixtures cover it: |
|
Thanks, @Walternater, for the update and for fixing the engine-name validation and distinguishing empty or wholly invalid transcripts from missing ones. I’d hold off on merging for one remaining evidence-handling case: the summarizer still treats any successfully decoded JSON value as a usable event and ignores malformed lines if anything else parses. That means a transcript containing only Could you preserve positive evidence from readable events, mark unobserved evidence as |
A decoded value that is not a JSON object or an array is not a record, so a transcript of `null` lines holds no record. A line that did not decode can hold the evidence that was in it, so a transcript that has records and a truncated tail keeps the evidence its readable events show and reports the signals those events do not show as unknown instead of absent. Two offline fixtures cover the `null` transcript and the truncated tail, and the design report's transcript-state table lists the states. Co-Authored-By: Claude Code <[email protected]>
|
Fixed in A record is a JSON object or an array. A line that decodes to A line that did not decode makes the transcript Two offline fixtures cover exactly those cases: a transcript of Verified: |
|
Thanks, @Walternater, for adding the Could you reuse that fixture in an offline summarizer test? Please keep the execution status as |
A transcript can be readable and still say the run failed: the OpenCode adapter fails on its `error` event, and the Claude Code stream ends with a `result` event flagged `is_error`. The summary called such a transcript `present` and reported the Skill evidence it never reached as absent, which reads as "the Skill was not used" for a run that never got that far. The summary now reports those transcripts as `failed`: the signals the run did not reach stay unknown (`-`), like the ones a truncated transcript cannot settle, and the evidence it did produce before it failed is kept. The two error shapes are the ones the adapters already read. Tests: the fixture of `TestOpenCodeErrorEventFailsEvenWithAssistantText` in internal/agent/opencode_test.go, as an offline summarizer test, plus one for the evidence observed before the error.
|
Fixed in A transcript that reports the run failed is A failed run says unknown, not absent. The signals the run never reached are reported as Two offline fixtures cover it:
The design report's transcript-state table now lists Verified: Disclosure: written with AI assistance (Claude Code for the original change, Codex for this follow-up), operated by wangchongfei, who is responsible for every line here. |
ab67b68 to
014239c
Compare
|
Thanks, @Walternater, for fixing the structured OpenCode error case. I rechecked One gap remains: an agent can time out after writing a valid text event without emitting a structured error event. |
…iled A run can time out after writing a valid text event without emitting a structured error event. The transcript then looks complete, so nothing in it says the run stopped early, and an unobserved catalog or SKILL.md reference was reported as `no` — absent — while `result.json` already reported `ERROR`. `summarize_case` now uses that execution status as the fallback signal: when it is `ERROR`, the signals the transcript never showed are unknown (`-`), which is exactly what the structured error path already does. Positive observations are kept — the run did reach those before it failed. Two offline fixtures: one for the downgrade (valid text event, no error event), one for the preserved positives. Both fail on 014239c.
|
Done in d7236f8. The fallback. Positives are untouched. Only "not observed" is downgraded. A Skill call or SKILL.md reference the run did reach before it stopped stays as it was — that is the second fixture. One deliberate choice worth flagging: the Fixtures (offline, no live rerun):
Both fail on |
Fixes #166
Summary
First milestone of #166: an executable, repeatable engine capability investigation
through a real repository fixture. No
SkillActivationtype, no capability flagand no catalogue claim — only what the transcript evidence supports.
Evidence rules
payload; prose like "There are no available skills" does not.
SKILL.mdpath inside a call or a result counts as a reference, which isdeliberately weaker than "read": a directory listing or a failed
catalsocontains
SKILL.md.null-only or empty transcript reportsempty; a line that did not decodereports
incomplete; a transcript reporting an OpenCodeerrorevent or aClaude Code
resultevent flaggedis_errorreportsfailed. In all threecases unobserved evidence is reported as unknown (
-) instead of absent.Changes
scripts/routing-canary/run.sh— per-engine fixture, quarantined configroots, output kept under
out/<engine>/, summary generated after the run.scripts/routing-canary/summarize.py— evidence table with execution statusfrom
result.jsonkept separate from transcript availability; failed-rundetection for the two shapes the adapters already read.
scripts/routing-canary/test_summarize.py— offline fixtures for all therules above, including the OpenCode error-event fixture from
internal/agent/opencode_test.go.examples/routing-canary/— the fixture repository and its README.docs/design/routing-canary.md— what the evidence means and how to read thesummary; the transcript-state table now lists
failed.Validation
python3 -m unittest discover -s scripts/routing-canary -p "test_*.py"— 14tests pass locally and in CI.
go test ./internal/agent/...— existing adapter tests pass; the error-eventfixture is reused as an offline summarizer test, so no live engine is needed.
Limitations
environment variables;
CODEX_HOMEalone does not remove~/.agents/skills.offline fixtures were added.
This PR was prepared with DeepSeek Harness (deepseek-v4.1-flash); the investigation runs used the engine CLIs installed on the author's machine. The follow-up commits, including the failed-run handling in
ab67b68, were prepared with Codex.Disclosure
This PR was written with AI assistance: DeepSeek Harness (deepseek-v4.1-flash)
produced the original investigation and Codex prepared the follow-up commits.
wangchongfei reviewed every line and approved each commit before it was pushed.
This is stated here and on the account profile because a maintainer should know
who — and what — they are reviewing.