Skip to content

feat: the plugin-hooks session eval — the plugin's hooks in real sessions - #29

Merged
mauricios merged 1 commit into
mainfrom
feat/eval-packaged-hooks
Oct 5, 2026
Merged

mauricios merged 1 commit into
mainfrom
feat/eval-packaged-hooks

Conversation

@mauricios

Copy link
Copy Markdown
Contributor

What changed and why

The plugin's hooks were rewritten five times between v1.0.2 and v1.0.6. The static hook tests run them as scripts, but nothing checked them in a real Claude Code session: that Claude Code runs them from the plugin, and that what they print reaches the session. This adds that check as a session-eval suite.

The plugin-hooks suite (evals/dynamic/fixtures/plugin-hooks/):

  • project.sh builds a project on the packaged install. It has no hook scripts of its own, only config.sh and the install: packaged stamp, plus something for each hook to stop: a work branch with a spec folder, a sensitive area, a lockfile, and an env template.
  • Seven cases, each driving one hook with the plugin loaded per session (--plugin-dir): session-context, guard-git, triage-first, protect-paths, careful-paths, check-env-declared, and stand-down. The last runs in a copy switched to the committed install (stand-down.setup.sh), where the plugin's hooks must do nothing.
  • inspect.sh checks each run and marks it ✓ or ✘. A PostToolUse hook's message reaches Claude through the session transcript, not the output stream, so that check reads the transcript.

Runner (run-session-evals.sh), general additions:

  • an optional per-case <case>.setup.sh;
  • inspect.sh receives the run's output and the case name, which the existing suites ignore;
  • the summary counts each run's ✓ and ✘;
  • this suite defaults to Haiku, 8 turns, and $0.50 per run.

Documented in evals/dynamic/README.md, with a report in evals/dynamic/reports/2026-10-04-plugin-hooks.md.

Upgrade impact

Framework-internal.

How to verify

./evals/dynamic/run-session-evals.sh --suite plugin-hooks

It needs a signed-in CLI and costs about $0.40.

Verified / not verified

  • Verified:
    • The suite through the runner: 8 of 8 checks across 7 Haiku sessions (Claude Code 2.1.286), $0.40.
    • Negative controls: every check marks ✘ when fed a run where its hook didn't act.
    • Static suites pass: 154, 81, 45, and 11.
    • The existing suites' inspect.sh ignores the new arguments.
  • Not verified: Sonnet and Opus. The hooks don't depend on the model, so Haiku keeps it cheap.

Merge danger

  • Evals only. Nothing in skeleton/ or the plugin changes, and a revert is safe.

🤖 Generated with Claude Code

…ions

Each of the aplyca-adf plugin's hooks, driven in a real Claude Code
session on a project with the packaged install (the plugin loaded with
--plugin-dir), and the plugin's stand-down on a committed one: seven
cases on Haiku, checked automatically by inspect.sh, which marks each
check ✓ or ✘. A PostToolUse hook's message reaches Claude through the
session transcript, so that check reads the transcript.

The runner gains a per-case <case>.setup.sh (stand-down switches its
copy to the committed install), passes each run's output and case to
inspect.sh, counts the ✓ and ✘ in the summary, and defaults this suite
to Haiku. First run: 8 of 8 checks, $0.40; every check marks ✘ when fed
a run where its hook didn't act. Report in evals/dynamic/reports/.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mauricios
mauricios marked this pull request as ready for review October 5, 2026 02:54
@mauricios
mauricios merged commit 2a0aa76 into main Oct 5, 2026
1 check passed
@mauricios
mauricios deleted the feat/eval-packaged-hooks branch October 5, 2026 02:54
mauricios added a commit that referenced this pull request Oct 5, 2026
…al sessions (#32)

A minor release: the packaged install becomes the default for new
projects (decision 0018), with evals for its paths. Unreleased becomes
v1.1.0, covering #29, #30, #31, and one more fix:

/aplyca-adf:adopt took the skeleton from wherever the framework source
was while pinning the newest release tag, so a project's committed files
could be newer than its pinned plugin. It now finds the newest release
tag, takes the framework at that tag (a shallow clone of it, or a
worktree of a local checkout), and stamps that tag's commit; SETUP.md's
manual copy says the same. The packaged adopt eval reran on Sonnet:
8/8, stamped ab56cb6 from a scratch worktree at v1.0.6.

plugin.json 1.1.0; the README names the release.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant