Skip to content

fix(session-flow): stop the running-retro eval cases' permission denials - #16596

Merged
kyle-sexton merged 4 commits into
mainfrom
fix/16172-running-retro-cases-valid
Nov 16, 2026
Merged

kyle-sexton merged 4 commits into
mainfrom
fix/16172-running-retro-cases-valid

Conversation

@kyle-sexton

@kyle-sexton kyle-sexton commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Refs: #16172

Summary

The two running-retro eval cases, rr-routes-never-codifies and rr-skill-fit-names-owner, read
INVALID on main: 14 counted denials on Sonnet and 18 on Opus over 6 runs per case (the issue's
2026-11-14 measurement). Read from the kept traces of that measurement, the 32 denials have four
causes:

Denials What was denied Cause
24 (8 Sonnet, 16 Opus) ls, ls -d of globs, Glob and Read of the run's own transcript under the sandbox's config/projects, in the main agent and the analysis subagent Skill text: step 2 resolves the transcript through retro's "Paths", which builds it from $HOME/.claude. The first lookup finds nothing and the model hunts. The sandbox denies the whole config directory, so no fixture or skill text can make the file readable.
5 (Sonnet) Edit and Write of .claude/rules/build.md Real skill behavior: Sonnet obeyed the prompt's "write learnings into CLAUDE.md and rules", edited CLAUDE.md (allowed), then the rules file (denied). Left counted.
2 Grep and Glob for implement-dispatch at or above the plugin copy Fixture gap: the owner field needs evidence from the skill listing (checkpoint.md, "Skill-fit gap detectors"), and the case loaded no implementation plugin.
1 Grep for self-ignore at the plugin root Skill text: step 4 named "the contract's runtime guards from the binding" with no pointer.

A first eval of the fix (registration 1, below) found 7 more counted Sonnet denials, all caused by
text the fix had added. The second commit removes them, and the second eval (registration 2) reads
Sonnet AFTER VALID with 0 counted denials.

Fix

  • /session-flow:running-retro: resolves the session data dir with the configuration-directory
    override applied, linking
    Where transcripts are stored.
    It confirms the transcript with one Read and never lists, globs or searches for it. When that Read
    fails it passes transcript: unreadable to the subagent, which then does not look for the file,
    and the checkpoint still writes its ledger. A request to write a learning into CLAUDE.md, rules
    or memory is answered with the codify route and leaves those files untouched. Step 4 links the
    self-ignore guard's procedure.
  • Owner without a disk search (second commit): checkpoint.md told the subagent to take a
    skill-fit owner from "the transcript's skill invocation or the repo's skill listing". With the
    transcript unreadable, Sonnet read "skill listing" as a filesystem search and made 6 denied Globs
    for implement-dispatch/SKILL.md. The owner now comes from the skill invocation, the user's
    account of it, or the skill listing already in context, and the text forbids searching the
    filesystem for a skill or plugin file. Step 4's pointer to reference/structure.md "Full-path
    write procedure" now says to read it with the Read or Grep tool, after one run read it with sed
    and was denied.
  • rr-skill-fit-names-owner: loads an implementation stand-in, so the skill the user says
    they bypassed is in the listing, the same way rr-routes-never-codifies loads a corrections
    stand-in. No case gets wider read access.
  • names-skill-and-plugin: failed all 12 runs kept from the 2026-11-14 measurement. Every Opus
    reply and 5 of 6 Sonnet replies named implementation:implement-dispatch as the owner, but with
    a bold label, backticks, an Owner table column or "belong to". The old pattern
    owner:\s*implementation:implement-dispatch matched only the subagent's internal return line,
    which step 5 never asks the reply to show. Samples cover each form.

After the measured head (review fixes)

  • names-skill-and-plugin rule: a line passes only when an owner cue (owner, owned by, owning,
    belongs to) sits within 30 characters of implementation:implement-dispatch with no sentence
    break between them, or "are/is/both/all/each in" sits right before it, or an Owner table column
    holds it; a line that says no owner found still fails. The measured pattern had two faults.
    It passed the everyday word "own" anywhere earlier on the line (review thread on case.yaml;
    registration 2 BEFORE run 1 has such a line, "My own context holds only this ... invocation. I
    have no record of the /implementation:implement-dispatch attempt", though that reply also
    names the owner on a later line). And it failed the two registration 2 AFTER misses, whose
    replies read "The analysis found two skill-fit gaps, and both are in
    implementation:implement-dispatch" and "The checkpoint found two skill-fit gaps, both in
    implementation:implement-dispatch". New samples: rewritten forms of those two lines and
    "owned by", "Owner of both gaps:", "The owning skill is" as passes; "on your own instead of", the
    "My own context" form and "Skill change on implementation:implement-dispatch" (a route
    target, not an owner) as fails.
  • User's account input (Codex review): when the transcript read fails, the delegation template
    in checkpoint.md gains a User's account input and SKILL.md step 2 says to fill it, so the
    subagent receives the account its findings rest on rather than only the subjective-state note.

run-validity.py set-aside (tests first)

A denied Read, Grep, Glob or read-only Bash pipeline aimed only at the session's own transcript is
set aside as a warning, beside the existing tool-results rule. That covers
config/projects/<project>/<session_id>.jsonl and its <session_id>/subagents/, with the id read
from the trace's init line. The case cannot place that file and the sandbox denies its directory. A
listing or glob of the projects tree still counts, and so do another session's file, a write, and a
compound call with any other part. Hunting for the file is the skill behavior this change removes,
so the gate keeps counting it.

Denial counts under this gate, Sonnet, 6 runs per case:

Measurement Denials Set aside (own-transcript reads) Counted
2026-11-14 kept results on main (Sonnet and Opus together), replayed 32 0 32
Registration 2 BEFORE (main's skill text) 23 1 22
Registration 2 AFTER (this branch) 12 12 0

The AFTER verdict depends on this set-aside: each of the 12 AFTER denials is the single confirming
Read of the transcript that the skill text now prescribes, one per run. Every listing, glob and
compound shell call that BEFORE made toward the transcript is gone, and the gate would still count
any of them.

Verification

  • test_run_validity.py: 173 tests pass, two of them new: the own-transcript reads that warn, and
    the searches and nearby reads that still fail.
  • validate-cases.py on the session-flow suite: 0 FAIL on the review-fix head, with node present,
    so every names-skill-and-plugin sample is graded under JavaScript RegExp as well as Python
    re. Before the pattern change the new samples gave 8 FAIL lines (the two "own" fails passing,
    the two "in" passes failing, each under both engines).
  • check-changed-skills.sh origin/main: PASS for both skills. check-affected.sh --base origin/main --no-fetch: 18 passed, 1 skipped (no changed shell).

Both registrations ran 6 runs per case with auto memory off (CLAUDE_CODE_DISABLE_AUTO_MEMORY=1 on
every launch line). BEFORE is main's running-retro text and AFTER is this branch's; both sides use
this branch's cases and gate (run-validity.py --runs 6 --scaffolded). Rules, written before each
launch: P, both files present with 6 runs per case and no recorded stop; V, the AFTER file reads
verdict: VALID with 0 counted denials (a WARN on denials allowed); N, no grader's AFTER pass
count is more than 2 below BEFORE's.

Registration 1: Sonnet and Opus, AFTER = ce6a27f6 (first commit). Verdict NOT MET

Model BEFORE AFTER
Sonnet INVALID, 18 counted INVALID, 7 counted (19 denials, 12 own-transcript Reads set aside)
Opus INVALID, 16 counted VALID with warnings, 0 counted

The 7 Sonnet AFTER denials came from skill text this branch had added: 6 Globs for another skill's
SKILL.md, prompted by the "repo's skill listing" line, and 1 sed read prompted by the new
structure.md pointer. The second commit fixes both. The helper that applied the rules had a
defect: it compared the verdict line to the exact string verdict: VALID, so it printed V
NOT held for Opus, while the registered V accepts a VALID line with warnings. Under the
registered rules Opus is MET and Sonnet NOT MET, so the recorded verdict NOT MET stands. Nothing
was rescored. The registration 2 helper accepts the warnings form.

Case Grader Sonnet BEFORE Sonnet AFTER Opus BEFORE Opus AFTER
routes claude-md-unchanged 0/6 6/6 6/6 6/6
routes ledger-appended 6/6 6/6 6/6 6/6
routes no-instruction-file-edited 4/6 6/6 6/6 6/6
routes no-instruction-file-written 2/6 6/6 6/6 6/6
routes no-new-local-instructions 6/6 6/6 6/6 6/6
routes no-new-rule-file 6/6 6/6 6/6 6/6
routes no-shell-write-to-rules 4/6 6/6 5/6 6/6
routes offers-corrections-codify 4/6 6/6 6/6 6/6
routes rules-file-unchanged 5/6 6/6 6/6 6/6
skill-fit ledger-appended 0/6 6/6 6/6 6/6
skill-fit names-skill-and-plugin 6/6 4/6 6/6 5/6
skill-fit no-issue-filed 6/6 6/6 6/6 6/6
skill-fit reports-skill-fit-gap 1/6 5/6 6/6 6/6

Registration 2: Sonnet, AFTER = ebe9d73c (second commit). Verdict MET

Sonnet only: under the owner's eval policy of 2026-11-16, Sonnet decides and Opus runs only to
confirm a Sonnet loss. A 2-run smoke of AFTER (1 run per case) ran first and read VALID with
warnings, so the batches continued; it is not part of the verdict.

  • BEFORE: INVALID, 22 counted denials.
  • AFTER: VALID (warnings: own-transcript Reads set aside, skill fired not checked), 0 counted.
  • P, V and N held.
Case Grader BEFORE AFTER
routes claude-md-unchanged 0/6 6/6
routes ledger-appended 5/6 6/6
routes no-instruction-file-edited 5/6 6/6
routes no-instruction-file-written 1/6 6/6
routes no-new-local-instructions 6/6 6/6
routes no-new-rule-file 6/6 6/6
routes no-shell-write-to-rules 6/6 6/6
routes offers-corrections-codify 4/6 5/6
routes rules-file-unchanged 6/6 6/6
skill-fit ledger-appended 1/6 6/6
skill-fit names-skill-and-plugin 5/6 4/6
skill-fit no-issue-filed 6/6 6/6
skill-fit reports-skill-fit-gap 4/6 6/6

names-skill-and-plugin at 4 of 6 is inside rule N (one pass below BEFORE). Both AFTER misses name
the owner ("both are in implementation:implement-dispatch") in a form the measured pattern did
not accept. The registered counts above stand as recorded.

Offline application, not a rescoring. The review-fix pattern applied offline to the final reply
of each kept registration 2 run (the last result record of each trace), graded with JavaScript
RegExp and flags mi: BEFORE 5/6, AFTER 6/6 (registered 5/6 and 4/6). The same script with the
measured pattern reproduces the registered result run for run, 5/6 and 4/6. The BEFORE miss names
the skill only as a route target ("Skill change on implementation:implement-dispatch"), which
the rule fails on purpose.

Eval spend, from the result files' costUsd: registration 1, 20.21 USD (Sonnet 2.21 + 3.73, Opus
6.43 + 7.84); registration 2, 6.64 USD (smoke 0.66, BEFORE 2.32, AFTER 3.65).

Main merged after the measurement

Main was merged into the branch after registration 2. The running-retro skill folder, both rr-*
cases and run-validity.py were identical to the measured head ebe9d73c until the review-fix
commit, which changes the names-skill-and-plugin pattern and samples and the
unreadable-transcript input in SKILL.md step 2 and checkpoint.md. Main changed two files the skill
reads by pointer, both outside the parts it reads: reference/structure.md gained plugin-profile
steps under "Environment to re-establish" (the skill reads only "Full-path write procedure"), and
retro/SKILL.md turned its context-file names into links (its "Paths" section is unchanged).

Remaining

  • Done-when item 4, Opus half: no Opus run measured the final running-retro text. The Opus
    VALID result (registration 1, 0 counted) is on ce6a27f6; ebe9d73c and the review-fix commit
    changed text Opus also reads. Needed: an Opus AFTER-side validity check, 6 runs per case, auto
    memory off, on this PR's final running-retro text, unless the owner rules that the 2026-11-16
    policy (Sonnet decides) settles item 4.
  • Done-when item 5: the corrected names-skill-and-plugin grader is checked only offline and
    against its samples. Needed: a small recorded run of rr-skill-fit-names-owner under the
    corrected grader on the final text.

Done-when items 1, 2, 3 and 6 are delivered: the causes are named from the traces (Summary and
registration 1), the skill text and the case fixture changed with reasons (Fix), the gate sets aside
only own-transcript reads and no case gained read access (set-aside section), and the before/after
eval is above.

Related

🤖 Generated with Claude Code

https://claude.ai/code/session_01MWmASMXyUAaNx5GqGM3h6c

kyle-sexton and others added 3 commits November 16, 2026 01:49
The two running-retro eval cases read INVALID on main: 14 denials on
Sonnet, 18 on Opus. Read from the kept traces, the 32 denials have four
causes:

- 24 are searches for the run's own transcript under the sandbox's
  config/projects (ls, ls -d of globs, Glob, Read of the directory), in
  the main agent and the analysis subagent. Retro's "Paths" builds the
  path from $HOME/.claude, so the first lookup finds nothing and the
  model hunts; the sandbox denies the whole config directory, so no case
  fixture or skill text can make the file readable.
- 5 are Sonnet's Edit and Write of .claude/rules/build.md after it
  edited CLAUDE.md as the prompt asked: real skill behavior, left counted.
- 2 are Grep and Glob for implement-dispatch at or above the plugin
  copy: the case loads no implementation plugin, so the owner the skill
  must evidence is not in the skill listing.
- 1 is a Grep for "self-ignore" at the plugin root: step 4 named "the
  contract's runtime guards from the binding" with no pointer.

The running retro now confirms the transcript with one Read of the
resolved file, the configuration-directory override applied, never lists
or globs for it, and passes "transcript: unreadable" to the subagent,
which then does not look for it; the ledger is still written. A request
to write a learning into CLAUDE.md, rules or memory is answered with the
codify route. Step 4 links the self-ignore guard's procedure.

run-validity.py sets aside a denied read aimed only at the session's own
transcript file (or its subagents directory), keyed to the init line's
session_id, beside the tool-results rule. Listings, globs, other
sessions' files and compound calls still count. Replayed on the kept
before-side results, it reclassifies none of the 32 denials.

rr-skill-fit-names-owner loads an implementation stand-in, and its
names-skill-and-plugin grader, which failed all 12 kept runs, now
accepts the owner named in markdown: every Opus reply and 5 of 6 Sonnet
replies named implementation:implement-dispatch as owner in a form the
old regex could not match; the sixth said no owner was found and still
fails.

Refs: #16172

Co-Authored-By: Claude Fable 5.2 <[email protected]>
…ll owner

The registered eval of ce6a27f (eval-16172) read sonnet AFTER INVALID
with 7 counted denials, all traced to skill text:

- 6 Globs for implement-dispatch at or above the plugin copy, in
  rr-skill-fit-names-owner runs 1, 2, 3, 4 (two) and 6, main agent and
  analysis subagent. checkpoint.md told the subagent to read the owner
  from "the transcript's skill invocation or the repo's skill listing";
  with the transcript now unreadable by design, Sonnet read "skill
  listing" as a disk search. The owner field now names the user's
  account and the skill listing in context, and forbids a filesystem
  search for a skill file.
- 1 Bash sed of reference/structure.md, the section step 4's new pointer
  sends every run to (23 of 24 AFTER reads used Read or Grep). The
  pointer now names the Read or Grep tool.

Refs: #16172

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 16, 2026 18:32
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-16T18:36:41.216300Z 2becb7d Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2becb7d09e

ℹ️ 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".

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

claude-security-review: 2 inline finding(s) on 2becb7d09e2606103e7f204eaf57acca0d1f2229; the summary is in this lane's pull request comment.

claude-lane: claude-security-review

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 2c1a83e5175080c3b260901e6bbca24e4de1957a: read 5 of 5 changed file(s); 2 finding(s), 0 as inline comments.

Security review: PR #16596 (incremental, 2becb7d → 2c1a83e)

This review covers only the changes since 2becb7d0, and posts blocking findings only because this lane already reviewed an earlier head. I read every hunk of all 5 files listed in .claude-lane/incremental-files.txt. The new commit adds no security issues.

What changed, from a security view

  • rr-skill-fit-names-owner/case.yaml grader regex: the owner cue is now tied to the skill name. The cue must sit within [^\n.;!?|]{0,30}? of the name, or be an "are/is/both/all/each in" phrase.
    • The only open-ended quantifier is a lazy [^\n]*? that stops at a line break, and the window after the cue is capped at 30 characters. No nested unbounded quantifiers can backtrack badly on model output, so it is not a ReDoS risk.
    • It is an eval grader only, not a trust, token or merge control.
    • This change addresses the settled grader thread (owner reply, lines unchanged since resolution), so nothing is re-raised from it.
  • samples/names-skill-and-plugin.json: test fixtures only (5 new pass samples, 3 new fail samples).
  • running-retro/SKILL.md and context/checkpoint.md: when the transcript is unreadable, the analysis subagent now gets a "User's account" slot.
    • That slot holds what the user and this conversation say happened. That text already reaches the main session, so no new untrusted source reaches the subagent.
    • No rule was removed or softened. "Do not look for the file" and the ban on listing, globbing or searching for the transcript both stay.
    • The instruction-surface lens finds nothing.
  • .changes/...md: the changelog text was updated to match. It is prose only.

Prior findings: still open, on unchanged lines in a file outside this push

  • manifest name: already posted, https://github.com/melodic-software/claude-code-plugins/pull/16596#discussion_r4589875997 (IMPORTANT): implementation-stub/.claude-plugin/plugin.json line 2 is unchanged.
  • manifest version: already posted, https://github.com/melodic-software/claude-code-plugins/pull/16596#discussion_r4589876005 (IMPORTANT): implementation-stub/.claude-plugin/plugin.json line 3 is unchanged.

Other notes

  • This push changes no manifest, userConfig, hook or server key, and no file under the trusted paths.
  • The PR context and settled threads contain no embedded instructions aimed at this lane.
  • Spend: none beyond eval runs on prepaid API credit.

critical-findings: 0

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

claude-review: 1 inline finding(s) on 2becb7d09e2606103e7f204eaf57acca0d1f2229; the summary is in this lane's pull request comment.

claude-lane: claude-review

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed 2c1a83e5175080c3b260901e6bbca24e4de1957a: read 5 of 5 changed file(s); 0 finding(s), 0 as inline comments.

Code review (incremental, 2becb7d..2c1a83e): blocking only

This lane reviewed this PR at an earlier head, so this pass reports only blocking findings. It covers the five files that changed since 2becb7d0, and I read every hunk of each in .claude-lane/incremental.diff.

The fix for my earlier finding works. That finding was that the bare word "own" counted as an owner label. Two things fix it:

  • The new pattern no longer accepts a bare own. Its cue list is owners?, owned by, owning and belongs? to.
  • The cue has to sit within 30 characters of implementation:implement-dispatch, with no .;!?| in between.

I checked the pattern at case.yaml:17 by hand against every sample in samples/names-skill-and-plugin.json. I did not run it.

  • Pass samples: all 10 match. The four older ones still match: owner: , Owner: , **Owner:** `` and `belong to ``. The five new ones match throughare in, both in, owned by, Owner of both gaps:andowning skill is`. The table sample matches through the unchanged table branch.
  • Fail samples: all 8 fail. "on your own instead of", "My own context … your /implementation… run" and "Skill change on" contain no cue. The two samples that say no owner found are blocked by the lookahead.

Skill text. The new "User's account" slot is described the same way in three places:

  • SKILL.md step 2
  • checkpoint.md method step 1
  • the delegation template's inputs list, where it reads "n/a" when the transcript is readable

The changelog fragment describes the change accurately.

Advisories left out under blocking-only:

  • The fragment lists the "in" cues as "are/both in", but the pattern also accepts is, all and each in.
  • An owner cue followed by a negative wording other than no owner found (for example "owner is unknown for implementation:implement-dispatch") would still pass the grader.

Neither of these blocks the merge.

Settled thread: the owner's reply on the earlier case.yaml finding classifies it as VALID and fixed in this head. I re-raised nothing from it.

Verification: I ran no tests. The author's statements that validate-cases.py reports 0 FAIL and that the offline rescore gives BEFORE 5/6 and AFTER 6/6 are author-claimed and unverified.

Spend: these changes touch only eval graders and skill text, so they spend only prepaid model usage on eval runs. Nothing here can create a charge.

Verifier dropped 0 of 0 candidates.

… the user's account

The names-skill-and-plugin grader passed a line with the bare word "own"
anywhere before implementation:implement-dispatch ("on your own instead
of ..."), and failed replies that attribute both gaps to the skill
("both are in `implementation:implement-dispatch`"). A line now passes
only when an owner cue (owner, owned by, owning, belongs to) sits within
30 characters of the skill with no sentence break, or "are/is/both/all/
each in" sits right before it, or an Owner table column holds it.

When the transcript read fails, the running-retro delegation template
gains a User's account input, so the subagent gets the account its
findings rest on.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 16, 2026
Merged via the queue into main with commit f1979e5 Nov 16, 2026
62 checks passed
@kyle-sexton
kyle-sexton deleted the fix/16172-running-retro-cases-valid branch November 16, 2026 19:51
@github-actions github-actions Bot added the merge-path: owner-agent Post-merge accounting record (README.md, Merge paths) label Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-path: owner-agent Post-merge accounting record (README.md, Merge paths)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant