Skip to content

docs(evals): keep plugin-eval runs attached until they exit - #7112

Merged
kyle-sexton merged 3 commits into
mainfrom
docs/6333-plugin-eval-attached
Oct 13, 2026
Merged

kyle-sexton merged 3 commits into
mainfrom
docs/6333-plugin-eval-attached

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

Requested by Kyle · project thread

Closes #6333

Summary

Before: /evals:plugin-eval said one thing about backgrounding, in its Run step: "Never background the CLI from a headless -p session". It said nothing about running several suites, or about when the session may end. On 2026-10-04 a headless session backgrounded three suites, said they were running, and exited. All three ended partial: true, interrupted, INVALID.

After: the Run step has a "Stay attached until every run exits" rule. In a claude -p or other non-interactive session, each suite's CLI call runs in the foreground, one suite after another (-j adds concurrency inside a suite), and there is no final answer while a run is in flight. In an interactive session, a run goes to the background only as a harness-tracked task that is waited for and read. The headless gotcha now records the 2026-10-04 recurrence as its observed-stumble evidence. A new eval case fails a plan that backgrounds the runs and ends.

Fix

  • plugins/evals/skills/plugin-eval/SKILL.md: a new paragraph in Run step 3. The existing headless gotcha now also records the 2026-10-04 recurrence. The issue's dollar spend figures are left out, per .claude/rules/cost-claims.md.

  • plugins/evals/evals/headless-stay-attached/: the case prompt is a headless nightly-script setup that asks for parallel runs. It has two graders:

    • an llm grader, stays-attached, which passes foreground runs, -j inside a suite, or one foreground command that waits for all three, and fails backgrounding and ending;
    • the plugin's standard skill-fired indicator.

    The stays-attached samples (3 pass, 4 fail) are written by hand, not taken from transcripts.

  • A changelog fragment for evals (patch).

Choices I made:

  • The case is tagged [run-mechanics, headless], not hard or regression-guard, because no blind base answers were recorded to judge which it is.
  • The prompt is natural language, not the slash command, so the skill-fired grader can fire (see case-authoring.md).

Verification

  • python3 plugins/evals/skills/validate/scripts/validate-cases.py plugins/evals/evals: exit 0. The new case's only line is the standard "sample answers need judge calibration" WARN. The deterministic skill-fired grader grades its samples cleanly.
  • scripts/affected-tests.sh --base origin/main --run --jobs 4: 3/3 shell suites passed (validate-cases.test.sh, calibrate-judge.test.sh, check-summary-reader-parity.test.sh). The 2 Python suites it listed passed under python3 -m unittest (32 and 66 tests OK); pytest is not installed here.
  • scripts/check-changelog-fragments.sh --check and --check-required origin/main: OK. scripts/check-changelog-parity.sh --check-bump origin/main: OK.
  • markdownlint-cli2 on the 4 changed or added markdown files: 0 issues.
  • Not run: claude plugin eval on the new case (a metered run). The judge rubric is uncalibrated, as the WARN says.

Related

🤖 Generated with Claude Code

https://claude.ai/code/session_01L8KdG7fWg2YrErVYWtohmR


Generated by Claude Code

A headless `claude -p` session that backgrounds `claude plugin eval`
and ends kills the runs. On 2026-10-04 three suites backgrounded this
way all ended partial and interrupted, and the validity gate marked
them INVALID. The Run step now says: in a non-interactive session, run
each suite in the foreground, one after another (-j for concurrency
inside a suite), and give no final answer while a run is in flight.
An interactive session backgrounds a run only as a harness-tracked
task. The headless gotcha records the recurrence, and the new eval case
headless-stay-attached fails a plan that backgrounds the runs and ends.

Closes #6333

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01L8KdG7fWg2YrErVYWtohmR

Copy link
Copy Markdown
Member Author

ci-status is red because this PR is a draft, not because of the change. On a draft every lint and test lane skips (lint-repo, test-bash, test-node, test-python, check-skills, check-plugins), and the aggregate counts a skip as not passing. See .github/workflows/pr-require-checks.yml:507-513.

The lanes run once the PR is marked ready. That flip waits for Kyle, because it also starts the review lanes. Until then, the local runs listed under Verification in the PR body are the signal.


Generated by Claude Code

@kyle-sexton
kyle-sexton marked this pull request as ready for review October 13, 2026 04:25
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T04:27:56.339704Z dfc1923 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.

@claude

claude Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 4m 43s —— View job


Claude's code review

  • Gather context (PR diff, SKILL.md change, eval case files)
  • Check skip gate — PR is open, not a draft, meaningful content change
  • Review Run-step wording change in plugin-eval/SKILL.md
  • Review new eval case (headless-stay-attached) against case-authoring.md and the validator's field rules
  • Review changelog fragment
  • Post findings

Scope. 7 files, all in plugins/evals/ + one changelog fragment: a doc-only addition to plugin-eval/SKILL.md's Run step and Gotchas, plus one new eval case (headless-stay-attached). No code execution paths, no security surface — security findings don't apply here.

What I checked

  • The new "Stay attached until every run exits" paragraph and the extended 2026-10-04 gotcha entry against the surrounding ## Run step and ## Gotchas content for consistency (field names like partial/partialReason/verdict: INVALID match the terms used elsewhere in the file).
  • .claude/rules/cost-claims.md compliance: neither the SKILL.md addition nor the changelog fragment states a dollar figure; "the spend bought no measurement" names no price, matching the dual-exception rule.
  • The new case against plugins/evals/skills/plugin-eval/reference/case-authoring.md: it pairs one result grader (stays-attached, llm, arm: both) with one process grader (skill-fired, tool_used on Skill, the plugin's standard with-only indicator) — exactly the pairing the checklist asks for. skill-fired.md's regex is byte-for-byte the same pattern used by existing cases in this plugin (e.g. ci-pin-models/graders/skill-fired.md), and the prompt is phrased in natural language rather than the slash command, consistent with the case-authoring.md note about tool_used: Skill failing on slash-invoked cases.
  • Frontmatter bounds (runs: 3, max_turns: 10, allowed_tools all read-only) against the validator's constants in validate-cases.py (BOUNDS, READ_ONLY_TOOLS, GRADER_FIELDS, GRADER_COMMON which does allow arm on an llm grader) — nothing here would fail the static validator.
  • .claude/rules/eval-case-transcripts.md: the prompt's description narrates the 2026-10-04 incident in the author's own words, not a raw transcript excerpt.
  • I was not able to independently run validate-cases.py myself in this sandbox (Bash denied the python3 invocation), so the PR body's validator/test output is author-claimed and unverified by me, not confirmed.

Finding posted inline (Suggestion, non-blocking): the new "Stay attached until every run exits" paragraph in plugin-eval/SKILL.md (lines 239–244) restates the same core claim as the existing sentence five lines above it ("Never background the CLI from a headless -p session: the run ends with the session.") — both say a backgrounded run dies with a non-interactive session's exit. Worth folding the new content (multi-suite scope, the interactive-session exception, "don't answer while a run is in flight") into the existing sentence rather than restating it, per this repo's concise-prose.md standard on repeated restatements.

No correctness, design, or test-coverage issues found beyond that one prose suggestion.

claude-lane-summary: lane=claude-review sha=dfc1923fb37f264a5c50bad7cbb27b3c3c21cfba run=38346346629

@claude

claude Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 52s —— View job


Security review complete

  • Gather context (PR diff, changed files)
  • Apply skip gate
  • Review changed files for security issues
  • Check instruction-surface deletions against protected classes
  • Report findings

Scope: git diff origin/main...HEAD (7 files, +151/-2): a changelog fragment, a new eval case
(plugins/evals/evals/headless-stay-attached/{prompt.md,graders/*.md,samples/*.json}), and an
addition to plugins/evals/skills/plugin-eval/SKILL.md's Run step and headless gotcha.

Instruction-surface check: The SKILL.md edit only adds text — a new "Stay attached until
every run exits" paragraph in Run step 3
(blob)
and more detail in the existing headless-backgrounding gotcha
(blob).
The prior standing instruction, "Never background the CLI from a headless -p session," is kept
verbatim; nothing is deleted, narrowed, or softened. No instruction-exception-register class
applies.

Other files: the eval case's grader regex
(plugins/evals/evals/headless-stay-attached/graders/skill-fired.md) is a fixed, non-user-controlled
pattern with no catastrophic-backtracking shape. prompt.md and the samples/*.json files are
static test fixtures consumed by the eval harness, not data from an untrusted external source, and
introduce no injection or credential-handling surface. The changelog fragment is prose only.

Result: No security issues found. This PR is documentation- and eval-fixture-only; it has no
security-relevant surface (command execution, auth, secrets, injection points) beyond the
instruction-surface check above, which found no weakening.

claude-lane-summary: lane=claude-security-review sha=dfc1923fb37f264a5c50bad7cbb27b3c3c21cfba run=38346346636

@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review has reviewed this pull request through 26d04ce; a later push is reviewed from there.

@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: dfc1923fb3

ℹ️ 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 commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

claude-review has reviewed this pull request through 26d04ce; a later push is reviewed from there.

… cap

- Fold the new paragraph into the existing step 3 sentence instead of
  restating it, and point the 2026-10-04 recurrence at #6333 instead of
  restating its run details, which brings SKILL.md back under the
  500-line hard cap.
- Make the grader match the rule: a foreground wrapper that backgrounds
  the three runs and waits now fails, and its sample moves to fail.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01W6SjPvY7DmXBGzboeCq8nj
@claude

claude Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 2m 25s —— View job


Claude's code review

  • Gather context (PR state, incremental diff, custom instructions)
  • Read .claude-lane/incremental.diff and the 3 changed files
  • Review the grader fix, sample fix, and SKILL.md fix
  • Post findings

Scope (incremental). This lane last reviewed dfc1923. Since then, the fix commit addresses all three findings raised against that commit — Codex's two (grader/wrapper gap, volatile restated observation) and my own (redundant paragraph) — across the 3 files in .claude-lane/incremental.diff:

  1. graders/stays-attached.md: FAIL now explicitly covers backgrounding "even inside one foreground command that waits for them," closing the gap the &...wait wrapper exploited. PASS criterion 1 no longer carves out that wrapper as an exception.
  2. samples/stays-attached.json: the wrapper sample moved from pass to fail (now F-wrapper), consistent with the tightened grader and with prompt.md's unchanged expected_outcome (one suite at a time in the foreground).
  3. SKILL.md:
    • Run step 3's new paragraph is folded into the existing "Never background..." sentence rather than restating it — confirmed no duplicate claim remains in the step, and the file is back to 499 lines (under the 500-line check-skills cap).
    • The headless-backgrounding gotcha (line 472-473) drops the restated run-detail observations (partialReason, elapsed range, validity result) and points at #6333 instead, per .claude/rules/skill-bodies-state-current-rules.md.

I checked the updated grader against all 7 samples (2 pass, 5 fail) by hand and each verdict matches the tightened PASS/FAIL text; no remaining inconsistency with prompt.md's expected_outcome (unchanged, out of scope here). I was not able to run validate-cases.py myself in this sandbox (Bash denied the python3 invocation), so I didn't independently re-confirm the validator's exit code for this incremental change — that part of the author's verification is author-claimed and unverified by me.

No new issues found in this incremental pass.

claude-lane-summary: lane=claude-review sha=26d04ce3f35bb64d0e5479d168276e7b1acbf4be run=38347122625

@claude

claude Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 1m 5s —— View job


Security review (incremental)

  • Gather context (incremental diff, lane scope)
  • Invoke /review:security-review and follow it for the three changed files
  • Report findings

Scope: incremental, reviewed only the delta since dfc1923 (read from .claude-lane/incremental.diff), in:

  • plugins/evals/evals/headless-stay-attached/graders/stays-attached.md
  • plugins/evals/evals/headless-stay-attached/samples/stays-attached.json
  • plugins/evals/skills/plugin-eval/SKILL.md

What changed: this is the fix commit for the three "VALID (fix now)" review comments from Codex and the earlier claude-review lane. The grader now fails backgrounding a run even inside a single foreground wrapper that waits on it (closing the P2 gap Codex flagged), the matching sample moved from pass to fail, and SKILL.md folds the duplicate "Stay attached until every run exits" paragraph into the existing step-3 sentence and trims the headless gotcha's literal recurrence detail (partialReason, elapsed-time range, validity result) down to a symptom plus a pointer at #6333.

Instruction-surface check: read docs/conventions/instruction-exception-register/README.md (present in this checkout) and compared against the Gate 0 classes (irreversible-action, secret-handling, data-integrity, external-publication, legal-compliance, agent-authority). The SKILL.md edit compresses text but keeps every substantive rule intact — headless sessions still never background the CLI, suites still run one after another, -j concurrency is still scoped inside a suite, the session still must not answer while a run is in flight, and an interactive session still may only background as a harness-tracked, waited-on task. Nothing is deleted, narrowed, or softened; the trimmed gotcha detail is exactly the volatile restatement .claude/rules/skill-bodies-state-current-rules.md asks to move behind a pointer, not a guardrail. No Gate 0 class applies, no finding.

Grader/sample change: stays-attached.md and its sample now agree with each other and with SKILL.md/the case's expected_outcome (one suite at a time in the foreground, no background wrapper of any shape) — this closes the inconsistency the earlier Codex review flagged, it doesn't introduce one. The grader text and sample JSON are static fixtures with no injection or execution surface.

Result: No security issues found. This increment is documentation- and eval-fixture-only, addressing prior review feedback; it has no security-relevant surface (no command execution, auth, secrets, or injection points) and no weakening of any standing instruction.

claude-lane-summary: lane=claude-security-review sha=26d04ce3f35bb64d0e5479d168276e7b1acbf4be run=38347122514

@kyle-sexton
kyle-sexton added this pull request to the merge queue Oct 13, 2026
Merged via the queue into main with commit 63752a8 Oct 13, 2026
19 checks passed
@kyle-sexton
kyle-sexton deleted the docs/6333-plugin-eval-attached branch October 13, 2026 04:45
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.

docs(evals): plugin-eval runs started in the background die when a headless launcher exits

2 participants