Skip to content

perf(harness-ops): run every plugin's SessionStart prerequisites check from one row - #12267

Merged
kyle-sexton merged 10 commits into
mainfrom
host-run/6633-shared-prereq-runner
Nov 2, 2026
Merged

kyle-sexton merged 10 commits into
mainfrom
host-run/6633-shared-prereq-runner

Conversation

@kyle-sexton

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

Copy link
Copy Markdown
Member

Refs: #6633

Summary

Every hook plugin carried its own SessionStart prerequisites rows: 28 node-notice rows and 10 prerequisites.mjs probe rows, about 38 processes at each session start answering the same questions. This change leaves two rows, both in harness-ops:

  • harness-ops' existing shell-form node-notice row, unchanged. It is now the fleet's only one.
  • A new exec-form row, hooks/prerequisites-fleet.mjs, which runs the probe of each enabled plugin that declares session_probe in its prerequisites.json and prints their notices as one message.

Processes go from about 38 to 2, plus one probe child per declaring plugin (at most 10). Each child still runs its own detection and git-hook verify subprocesses.

Fix

  • harness-ops:
    • The new hooks/prerequisites-fleet.mjs, with its test, and its row in hooks/hooks.json, under the startup|resume|clear|fork matcher.
    • It reads enabled plugins through check-prerequisites.mjs's settings path (enabledPlugins plus installed_plugins.json) and never runs claude plugin list.
    • It runs each plugin's own lib/prerequisites.mjs probe as a child, with that plugin's CLAUDE_PLUGIN_ROOT and CLAUDE_PLUGIN_DATA, so latches and git-hook drift detection behave as before.
    • It reads each plugin's kill switch from pluginConfigs in the user and managed settings (hook-config-delivery channel F), else from the option's declared default.
  • lib/prerequisites.mjs and the schema accept an optional top-level session_probe: { run_if_unset_or_true?: "<OPTION>" }. They are synced to every copy, with one fragment per carrying plugin.
  • lib/plugin-options.mjs: readOperatorOptions(..., { booleans: true }) reads a boolean option stored as a JSON boolean. Existing callers are unchanged. The change is synced to source-control, corrections and toolchain, and a new harness-ops copy is added.
  • The 10 probe plugins declare session_probe. 28 plugins drop their node-notice row and the 10 also drop their probe row. instruction-placement's hooks/hooks.json is removed, since nothing remained in it. testing's gen-hook-filters.sh stops emitting the row.
  • Both rows stay synchronous, as perf(hooks): SessionStart p95 7.1 s from about 26 per-plugin prerequisites rows; use one shared async runner #6633 step 2 asks. An async hook's systemMessage goes to Claude on the next turn and is not shown to the user (hooks § How async hooks execute).
  • Contracts updated:
    • docs/contracts/prerequisites/README.md: the file key, the probe registration and the hook-notices table. It now says that without harness-ops no session-start notice reports a missing node, and names the runner's blind spots.
    • docs/contracts/hook-budget/README.md.
    • docs/contracts/check-placement/README.md.
    • docs/plugin-philosophy.md.
    • The READMEs of three plugins.
    • The hooks.json descriptions.
    • scripts/node-notice-rows.test.sh, and the per-plugin tests that pinned the old rows.

Verification

  • scripts/node-notice-rows.test.sh checks that:

    • only harness-ops carries a node-notice row;
    • no plugin carries a probe row;
    • harness-ops has one exec-form runner row;
    • each session_probe gate is a userConfig option;
    • with node absent, the row prints one notice per session under bash, dash and pwsh.

    It gives 4 FAIL on the base tree and 9/9 on this branch.

  • plugins/harness-ops/hooks/prerequisites-fleet.test.mjs (9 cases):

    • notices combine into one message;
    • no claude process starts;
    • undeclared and disabled plugins are skipped;
    • a kill switch set to false is honored as a JSON boolean and as a string, and an option whose declared default is false is honored too;
    • the latch lands in the probed plugin's own data directory, so the second run in a session is silent.

    The case with the kill switch set to true fails without the booleans opt-in.

  • lib/prerequisites.test.mjs: the session_probe schema cases pass, 312 tests in all.

  • CHECK_DATA_ROOT=<wt> scripts/check-affected.sh --tests on the head: 14 checks passed, ruff skipped (no Python changed), and every runnable shell suite passed. 85 Python and outside-node suites are left to their CI lanes.

  • grep -l 'prerequisites.ps1' plugins/*/hooks/hooks.json | wc -l returns 1, the harness-ops row, which the issue allows.

Remaining on #6633

  • The after-measurement: SessionStart p50/p95 over at least 100 fires on the Windows lane, with the record's debug-file harness, once this is installed.
  • Separate finding: the three install-python-deps.sh SessionStart rows (explainer-video, speech, animation) set the critical path. This change does not touch them.

Related

🤖 Generated with Claude Code

kyle-sexton and others added 5 commits November 1, 2026 21:56
…k from one row

Each hook plugin registered its own SessionStart node-notice row, and ten
also registered a prerequisites.mjs probe row: about 38 processes at every
session start answering the same questions.

harness-ops now carries the fleet's only node-notice row and one exec-form
row, hooks/prerequisites-fleet.mjs, that runs the probe of every enabled
plugin whose prerequisites.json declares the new optional session_probe key.
Each probe runs as a child with that plugin's own root and data directory, so
its latch, its git-hook drift check and hook::notice_once keep working. The
runner reads enabled plugins from the settings files (never `claude plugin
list`) and skips a plugin whose kill switch pluginConfigs turns off; the
shared plugin-options reader gains an opt-in for options stored as JSON
booleans. The runner row stays synchronous: an async hook's systemMessage
goes to Claude, not the user.

Refs: #6633

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rerequisites runner change

Refs: #6633

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

chatgpt-codex-connector Bot commented Nov 2, 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-11-02T04:58:51.368655Z d984479 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: d9844798d0

ℹ️ 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: 1 inline finding(s) on d9844798d0aaad988035b27a278925ee10a9523c; the summary is in this lane's pull request comment.

claude-lane: claude-security-review

@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

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

Chunk 1 of 4 (40 files)

Security review: chunk 1 of 4

No security issues in this chunk.

critical-findings: 0

What I checked

  • lib/plugin-options.mjs (L121): the new { booleans = false } setting is off unless a caller asks for it.
    • The callers that don't ask for it (corrections/scripts/findings-buffer.mjs:146, source-control/.../resolve-promotion-evidence.mjs:261, toolchain/hooks/result-gate.mjs:35) behave as before. A JSON boolean still throws OptionsError, so they still fail closed.
    • Only harness-ops/hooks/prerequisites-fleet.mjs:42 (in chunk 3) asks for it. With it on, only a JSON boolean is turned into "true" or "false". Any other non-string value still throws.
    • The values still come only from the user and managed settings files, never from the checkout or the CLAUDE_PLUGIN_OPTION_* mirror. No new input source reaches it.
  • validateManifest and the schema (lib/prerequisites.mjs and its 22 synced copies here, plus prerequisites.schema.json): the new session_probe key accepts only an object with a single optional key, run_if_unset_or_true.
    • That value must match OPTION_RE (/^[A-Z0-9_]+$/, lib/prerequisites.mjs:65). It never reaches a shell or a path, and any other key is rejected.
  • The hooks.json changes (actionlint, animation, autonomy, bash-format, biome-format, context-budget): each removes a SessionStart node-notice row or a prerequisites.mjs probe row.
    • These rows only show notices. SessionStart cannot block, so removing them takes away no guard, deny rule or allowlist.
    • Every other row is unchanged. None of these files is a plugin.json or marketplace.json, so no manifest lines apply.
  • The 3 prerequisites.json files: each adds session_probe gated on the plugin's existing *_ENABLED option.
  • The tests: the shell tests swap their SessionStart row checks for a jq check of session_probe. prerequisites.test.mjs adds schema cases. These are test changes only.
  • The docs (check-placement, hook-budget, prerequisites contract, plugin-philosophy): I read them under the instruction-surface lens. They describe the moved rows. No rule from the instruction exception register's protected classes is removed or weakened, and the hook-budget notes on onFailure: block keep the same meaning.
  • The changelog fragments: prose only.
  • The identical copies: copies of .changes/ fragments, and plugins/corrections/scripts/lib/plugin-options.mjs ↔ plugins/source-control/skills/babysit-loop/scripts/operator-options.mjs. Neither copy's path is a hook, workflow, settings or manifest path, so the content does the same thing there.
  • No trust control, plugin manifest, workflow, token request, kill switch or merge hold is touched in this chunk. No trusted-path glob matches a file in it.

Settled threads and earlier findings

  • This lane's one earlier inline finding, on prerequisites-fleet.mjs in chunk 3, was resolved and fixed (managed settings now win). The owner's resolution covers it, and nothing in this chunk reopens it.

Round cap: not reached (1 of 3 rounds with findings before this review).

Spend: none added. The change cuts SessionStart processes; it does not add billable work.

Chunk 2 of 4 (40 files)

Security review: chunk 2 of 4 (40 files)

No security issues found in this chunk.

critical-findings: 0

What I checked

  • plugins/corrections/scripts/lib/plugin-options.mjs and its identical copy plugins/source-control/skills/babysit-loop/scripts/operator-options.mjs.
    • The new { booleans } option defaults to false. Existing callers get the same behavior: a non-string value still throws OptionsError, so they still fail closed.
    • With the option on, only a JSON boolean is accepted, and it becomes "true" or "false". Null, numbers and objects still throw.
    • The copy's path is not a hook, workflow, settings or manifest path, and it is not on the trusted list (babysit-prs/ is; babysit-loop/ is not). The same content does not act differently there.
  • lib/prerequisites.mjs, copied into 26 plugins. validateManifest now accepts a top-level session_probe.
    • It must be an object, and its only key is run_if_unset_or_true, which must match OPTION_RE. Any other key is rejected.
    • This only tightens or extends schema checking of prerequisites.json, a file the plugin ships itself. No new input reaches a spawn here. The header comment change is prose only.
  • hooks.json row removals (context-guard, desktop-notification, discovery, disk-hygiene, eol-normalizer, explainer-video, go-format, guardrails).
    • Each row removed is either a shell-form node-notice advisory or a prerequisites.mjs probe advisory. Both always exit 0 and print a systemMessage.
    • None of them is a guard, block list or allowlist. guardrails keeps every PreToolUse and PostToolUse guard row, so no enforcement is removed.
    • I read these under the instruction-surface lens. The guardrails git-hooks drift notice and the "node missing" warning now come only from harness-ops' runner, so without harness-ops the user is no longer told. This lowers what the user is told, not what is enforced: the git-hook entries and the guard rows are unchanged. Not a finding.
    • The docs/contracts/instruction-exception-register/README.md protected-class list was not consulted from this chunk (no shell). I used recognition by consequence instead.
  • prerequisites.json (go-format, guardrails) adds session_probe gated on GO_FORMAT_ENABLED and GIT_HOOKS_NOTICE_ENABLED. These are the same options the removed rows passed to --run-if-unset-or-true. How the harness-ops runner reads them is in chunk 3 (plugins/harness-ops/hooks/prerequisites-fleet.mjs) and is out of scope here.
  • Tests and READMEs (disk-hygiene, eol-normalizer, go-format, guardrails): test pins and prose updated to match the removed rows. No security surface.
  • No plugin.json or marketplace.json, workflow, trusted-actor list, token, kill switch or merge hold is touched in this chunk.

Prior and settled findings

  • This lane's earlier finding (managed enabledPlugins ignored) is in plugins/harness-ops/hooks/prerequisites-fleet.mjs, which chunk 3 holds. It is settled (fixed and resolved, lines unchanged since), and this chunk does not touch it.

Round cap: not reached (1 round with findings before this review, cap 3).

Spend: none added.

Chunk 3 of 4 (40 files)

Security review, chunk 3 of 4: no security issues found

I found no security issues in the 40 files of this chunk.

critical-findings: 0

What I checked

  • The new plugins/harness-ops/hooks/prerequisites-fleet.mjs and its hooks.json row. This adds a path where harness-ops starts other plugins' code. I checked each input that reaches the spawn call:
    • How it starts the child: it runs process.execPath with an array of arguments, not a shell (L124), so no command can be injected.
    • Where the plugin roots come from: each installPath comes from the user's own installed_plugins.json, filtered by enabledPlugins.
    • Managed settings: they are applied last, so a managed false wins. When a managed file cannot be parsed, or holds a non-Boolean value, the hook probes nothing (L163-L170).
    • Config directory: it comes from the install's own real path, not from the environment (L71-L75).
    • Project directory: CLAUDE_PROJECT_DIR points the runner at a project's .claude/settings.json. A spoofed value only selects settings a repository already controls. It can enable only plugins the user installed, and the managed scope still overrides it.
    • Child environment: harness-ops' own CLAUDE_PLUGIN_OPTION_* values and CLAUDE_PLUGIN_DATA are removed before the child starts (L94-L96), so harness-ops' option values never reach another plugin's probe.
  • check-prerequisites.mjs rootsFromSettings. It now takes the managed files and picks install records by rootsFromListing's rule. That only narrows which install paths are chosen. It adds no new input source.
  • The new plugins/harness-ops/lib/plugin-options.mjs copy. It reads pluginConfigs only from managed settings and from the user settings file found through the install path. It never reads the environment or the project. The new booleans option only turns a JSON boolean into the string "true" or "false". Any other non-string value still throws, and the caller then skips the probe.
  • The session_probe checks in validateManifest (synced to every lib/prerequisites.mjs copy). They reject unknown keys and any gate name that does not match OPTION_RE. No input reaches anything that runs code.
  • Removed SessionStart rows (markdown-format, powershell-format, multi-agent, playwright, rate-limit-guard, review, and the deleted instruction-placement/hooks/hooks.json). I read these under the instruction-surface lens. They are node-notice and prerequisites-probe notices, not guardrails, and the PreToolUse deny rows in multi-agent and review are unchanged. Each plugin's kill switch now reaches the runner through session_probe.run_if_unset_or_true. Those switches only stop a notice from printing, so moving them changes no security control. I did not read docs/contracts/instruction-exception-register/README.md, because this lane has no access beyond the diff files. I judged the removals by their consequence instead, and none removes a protected-class rule.
  • Test and README hunks: prose and test pins that match the code.
  • What this chunk does not touch: no trust control, plugin manifest (plugin.json or marketplace.json), workflow, token request, kill switch or merge hold.

Prior findings and settled threads

  • The earlier finding that managed-disabled plugins were still probed (discussion_r4439061808) is settled: the thread is resolved and its lines are unchanged since resolution. The fix is still in place at this head, so I am not raising it again.
  • Round cap: not reached (1 of 3 rounds had findings before this one).

Spend

None. The change cuts SessionStart processes from about 38 to 2, plus at most one probe child for each of the 10 plugins that declare session_probe.

Chunk 4 of 4 (36 files)

Security review: chunk 4 of 4 (36 files)

No security issues in this chunk.

critical-findings: 0

What I checked

  • The 23 synced lib/prerequisites.mjs copies (review, ruff-format, session-flow, skill-quality, songwriting, source-control, speech, sql-server, testing, toolchain, typos-format, user-experience, user-interface, verification, visualization, wizard, work-items, x and others). Each carries the same change, blob 9563590a..393e7dd0:
    • validateManifest now accepts an optional session_probe object with one key, run_if_unset_or_true.
    • The key must be a string that matches OPTION_RE, and any other key under session_probe is rejected.
    • The change only widens what the schema accepts. It adds no exec, spawn or path handling.
  • plugins/toolchain/hooks/plugin-options.mjs: readOperatorOptions gains an opt-in { booleans: true }.
    • The default stays false, so existing callers still fail closed on a value that is not a string.
    • With the opt-in, only a JSON boolean becomes "true" or "false". null, numbers and objects still throw OptionsError.
  • hooks/hooks.json in ruff-format, session-flow, source-control, speech, testing, toolchain and typos-format: the per-plugin SessionStart node-notice and prerequisites.mjs probe rows are removed.
    • These rows printed user notices and blocked nothing. No PreToolUse or Stop guard row is touched.
    • The RUFF_FORMAT_ENABLED and TYPOS_FORMAT_ENABLED kill switches move to session_probe in each prerequisites.json. harness-ops' runner reads that key. Earlier rounds reviewed the runner, and its managed-settings issue is settled and fixed.
  • plugins/testing/scripts/gen-hook-filters.sh and its test: the generator stops emitting the notice row, and the test now checks that no SessionStart key exists.
  • Tests and registries: scripts/node-notice-rows.test.sh, scripts/check-killswitch-hoist.sh (comments only), scripts/cross-plugin-source-registry.txt and scripts/shared-copies.txt. The last two register the new harness-ops copy of plugin-options.mjs under the existing sync check, and no other change in them affects security.
  • Instruction-surface lens: the removed rows are hook config, not standing instructions, and none of them was a block list or allowlist. I did not consult the protected-class register: it is not readable with this lane's tools.
  • Plugin manifests: no .claude-plugin/plugin.json or marketplace.json file is in this chunk. hooks.json and prerequisites.json are not manifest fields.
  • Identical copies: the copies are .changes/ fragments and plugins/corrections/scripts/lib/plugin-options.mjs → plugins/source-control/skills/babysit-loop/scripts/operator-options.mjs. None of those paths changes what its content does.
  • Trust controls: no trusted-path file in this chunk. No workflow, token, kill-switch action, trusted-actor list or merge hold is touched.

Prior findings

  • The one prior inline finding, the managed-policy bypass in prerequisites-fleet.mjs, is in chunk 3. It is resolved and marked lines changed since resolution: no, so I did not raise it again.

Round cap: not reached (past the cap: no).

Spend: none added. The change cuts SessionStart processes from about 38 to 2, plus one probe child for each plugin that declares session_probe.

…ttings fallback

rootsFromSettings took the last install record and preferred a user record,
without checking projectPath, so the prerequisites runner could probe another
project's install that lacks session_probe and drop the current install's
notices. It now applies rootsFromListing's rule: a project or local record
for another project is skipped, and the most specific scope wins.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

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

Chunk 1 of 4 (40 files)

Code review, chunk 1 of 4: no findings

Scope. I read every hunk of all 40 files in .claude-lane/chunks/chunk-1.patch:

  • seven changelog fragments
  • the check-placement, hook-budget and prerequisites contracts, plus the prerequisites schema
  • docs/plugin-philosophy.md
  • lib/plugin-options.mjs, lib/prerequisites.mjs and its test
  • the synced lib/prerequisites.mjs copies, which are byte-identical (9563590a..393e7dd0)
  • the hooks.json rows and test scripts for actionlint, bash-format, biome-format, animation, autonomy and context-budget

For context I also read the PR context, the settled-threads, prior-findings and identical-files lists, and the chunk manifest. I ran nothing. Any claim that tests pass comes from the author and is unverified.

What I checked

  • session_probe validation. validateManifest adds session_probe to the allowed keys, rejects unknown sub-keys, and checks the gate against OPTION_RE. OPTION_RE is defined at lib/prerequisites.mjs:65 as /^[A-Z0-9_]+$/, the same pattern the schema uses. The schema test (lib/prerequisites.test.mjs) pins both property sets. The new cases cover a non-object value, a lower-case gate and an unknown key.
  • readOperatorOptions(..., { booleans }). The option is off by default, so existing callers keep the old behavior: any non-string value still throws OptionsError. With the option on, only a JSON boolean is turned into a string. Numbers and null still fail closed.
  • Contract text matches the code. The hook-budget contract says the notice names /harness-ops:check. That matches harness-ops' node-notice row at plugins/harness-ops/hooks/hooks.json:158. The prerequisites contract names the runner's blind spots (--plugin-dir, --settings, server-managed policy). It also says a managed enabledPlugins value wins and an unparseable managed file probes nothing, which matches the settled managed-policy fix.
  • Hooks rows. Every plugin that lost its SessionStart rows in this chunk still has its other events: actionlint (Stop), bash-format and biome-format (PostToolBatch/Stop), animation (its install row), autonomy (Stop) and context-budget (PreToolUse). In bash-format's digest-reset check, .hooks.SessionStart[]? now handles the missing key.
  • Tests. The per-plugin probe-gate tests are replaced by a check that prerequisites.json has a session_probe gate. The gate's behavior is now covered once, in the harness-ops runner test (chunk 3), not in this chunk.

Identical files.

  • Each changelog fragment copy is under its own plugin's .changes/ directory, where it is release data and does nothing else.
  • plugins/source-control/skills/babysit-loop/scripts/operator-options.mjs gets the same change as plugins/corrections/scripts/lib/plugin-options.mjs. Both are library modules, and the new option is off by default, so the path does not change what the code does.

Settled and prior findings. Both settled threads concern prerequisites-fleet.mjs, which is in chunk 3, and are marked lines changed since resolution: no. Nothing here raises them again. The only prior entry is a summary with 0 findings. Rounds with findings so far: 0 of a cap of 3, so the cap did not apply.

Closing issue. The PR only says Refs: #6633, and the PR context file has no closing-issue section, so there are no acceptance criteria to check.

Plugin manifests. No plugin.json or marketplace.json changes in this chunk, so no manifest lines apply.

Spend. This change uses no extra credits or minutes. It cuts the processes started at each session start from about 38 to 2, plus one probe child for each plugin that declares session_probe.

Embedded text. I found no instructions aimed at this lane in the PR context, settled-threads or prior-findings files.

Chunk 2 of 4 (40 files)

Code review, chunk 2 of 4: no findings

Scope. I read every hunk of all 40 files in .claude-lane/chunks/chunk-2.patch, from plugins/context-guard through plugins/harness-memory. For context I also read the PR context file, the settled-threads file, the prior-findings file and the head versions of go-format.test.sh and git-hooks-notice.test.sh. I also searched plugins/harness-ops/hooks/prerequisites-fleet.mjs (chunk 3) for how it reads the gates. I ran nothing; the passing tests are the author's claim and I have not verified them.

What this chunk changes, and what I checked.

  • Removed SessionStart rows. context-guard, desktop-notification, discovery, eol-normalizer, explainer-video and guardrails drop their node-notice rows; disk-hygiene drops its notice handler from a shared entry. go-format and guardrails also drop their prerequisites.mjs probe rows. In every hooks.json the JSON stays well-formed:
    • explainer-video keeps its install-python-deps entry;
    • disk-hygiene keeps its resume-notice handler;
    • the other files lose the whole SessionStart key.
  • lib/prerequisites.mjs copies, all with the same blob 9563590a..393e7dd0. validateManifest now accepts an optional session_probe object with only run_if_unset_or_true, checked against OPTION_RE. OPTION_RE is defined at line 67 of the file, before it is used.
  • Probe opt-ins.
    • go-format/prerequisites.json declares GO_FORMAT_ENABLED and guardrails/prerequisites.json declares GIT_HOOKS_NOTICE_ENABLED.
    • Each maps to a declared userConfig key: go_format_enabled and git_hooks_notice_enabled.
    • The runner's gateValue lowercases the gate before it looks the key up (prerequisites-fleet.mjs#L41), so the two declarations resolve.
  • corrections/scripts/lib/plugin-options.mjs.
    • The { booleans: true } opt-in turns a JSON boolean into "true" or "false" before the string check.
    • The default (booleans = false) keeps the old fail-closed throw for existing callers.
    • The change matches the lib/plugin-options.mjs change in chunk 1.
  • Tests.
    • The go-format test drops its probe-gate block. NODE_BIN, SYS_PATH and PROBE_* are no longer used anywhere in the file, and WORK/UNRELATED are still defined before their later uses.
    • git-hooks-notice.test.sh now runs the plugin's own probe directly. The case "the option off keeps the row quiet" moves to the runner's kill-switch tests (chunk 3).
    • disk-hygiene and guardrails now assert the rows are gone.
  • READMEs. The disk-hygiene and guardrails README changes match the new behaviour. Without harness-ops, no session-start notice reports a missing node, and each plugin's /…:check reports it instead. disk-hygiene's README rightly drops the "disk_hygiene_enabled set to false silences it" claim, because the fleet-wide notice no longer reads that option.

Plugin manifests. This chunk changes no .claude-plugin/plugin.json or marketplace.json, so no manifest lines apply.

Closing issue. The PR says only Refs: #6633 and the PR context file holds no closing-issue section, so there are no acceptance criteria to check.

Settled threads and prior findings. Both settled threads are about prerequisites-fleet.mjs, which is in chunk 3, and I raise neither again. The only prior entry is a summary comment from an earlier round with 0 findings. Rounds with findings so far: 0 of a cap of 3, so the cap did not apply.

Embedded text. None of the data files contains an instruction aimed at this lane.

Chunk 3 of 4 (40 files)

Code review, chunk 3 of 4: no findings

Scope. I read every hunk of all 40 files in .claude-lane/chunks/chunk-3.patch. For context I also read pr-context.md, the settled threads, the prior findings, identical.txt, and these parts of the head tree:

  • rootsFromListing and rootsFromSettings in check-prerequisites.mjs
  • cmdProbe, firstNoticeThisSession and gitHookDrift in plugins/harness-ops/lib/prerequisites.mjs
  • instruction-placement's plugin.json
  • the prerequisites contract's hook-notices text and the shared-copies.txt and cross-plugin-source-registry.txt rows, both in the full diff

I ran nothing. Any claim that the tests pass comes from the author and is unverified.

What I checked.

  • prerequisites-fleet.mjs
    • Child environment: the CLAUDE_PLUGIN_OPTION_* and CLAUDE_PLUGIN_DATA variables are stripped, and each child gets its own CLAUDE_PLUGIN_ROOT and a CLAUDE_PLUGIN_DATA built as <config>/plugins/data/<id with [^A-Za-z0-9_-] replaced by ->. The probe's latch (firstNoticeThisSession) and gitHookDrift use exactly those variables, and gitHookDrift also uses CLAUDE_PROJECT_DIR, which passes through.
    • Kill switch: the runner reads the value with readOperatorOptions(..., { booleans: true }), else takes the declared userConfig default. Any value other than unset, empty or "true" skips the plugin, which matches cmdProbe's old --run-if-unset-or-true rule. A malformed options source throws, the runner catches it, and the plugin is skipped.
    • Managed settings: before anything else, main checks each managed file and returns "" for one that will not parse or holds a non-Boolean value. That agrees with rootsFromSettings, which skips such a file anyway.
    • Output: Promise.all keeps the plan's sorted order, so the notices combine in a stable order. The row's 15 s timeout covers the 10 s per-child timeout, because the children run in parallel.
  • rootsFromSettings: it now applies rootsFromListing to each plugin's install records and applies the managed files last. The fixture in check-prerequisites.test.sh gains the projectPath that a local record now needs.
  • validateManifest (session_probe): this hunk is byte-identical in all 20 copies in this chunk (blob 9563590a..393e7dd0). OPTION_RE is already defined in the file.
  • Deleted plugins/instruction-placement/hooks/hooks.json: that plugin's plugin.json has no hooks field, so nothing points at the deleted file. Its prerequisites.json now declares session_probe: {}, so the runner keeps its git-hook drift probe.
  • The new plugins/harness-ops/lib/plugin-options.mjs: it is registered as a synced copy in scripts/shared-copies.txt and scripts/cross-plugin-source-registry.txt, in chunk 4.
  • Plugin hooks.json files (markdown-format, powershell-format, multi-agent, playwright, rate-limit-guard, review): they drop only the node-notice and probe rows, and the descriptions now match what still ships. The markdown-format and powershell-format tests now check the session_probe gate in prerequisites.json statically. The runner's own test covers the gate's behavior.
  • Documented trade-offs, not findings:
    • Project-scope pluginConfigs, --settings options, --plugin-dir plugins and server-managed policy are not visible to the runner, as the contract's hook-notices section states.
    • Without harness-ops, no session-start notice reports a missing node. The PR body records this as intended.

Settled and prior. Both settled threads (the install-record choice and managed enabledPlugins) are marked lines changed since resolution: no, and the current code still carries both fixes, so I did not raise them again. The only prior entry is a summary comment with 0 findings. Rounds with findings so far: 0 of a cap of 3, so the cap did not apply.

Closing issue. The PR says Refs: #6633 and closes no issue, and the PR context file holds no closing-issue section, so there are no criteria to check.

Plugin manifests. No plugin.json or marketplace.json changes in this chunk, so no manifest lines apply.

Identical files. None of the copy paths in identical.txt changes what its content does: they are changelog fragments, plus operator-options.mjs, which is a synced library copy.

Embedded text. The PR body, settled threads and prior-findings file contain no instructions aimed at this lane.

Spend. No paid charge. At each session start, harness-ops now runs one extra local process, plus one child process per enabled plugin that declares session_probe.

Chunk 4 of 4 (36 files)

Code review, chunk 4 of 4: no findings

Scope. I read every hunk of all 36 files in .claude-lane/chunks/chunk-4.patch. The identical changelog fragments for the plugins in this chunk are copies whose first paths sit in chunk 1, so I did not review them here. For context I read plugins/harness-ops/hooks/hooks.json on the head and confirmed that plugins/harness-ops/skills/check/SKILL.md exists. I ran nothing. The PR's test results (for example "9/9 on this branch" for node-notice-rows.test.sh) come from the author and are unverified.

What I checked.

  • Synced lib/prerequisites.mjs copies (review, ruff-format, session-flow, skill-quality, songwriting, source-control, speech, sql-server, testing, toolchain, typos-format, user-experience, user-interface, verification, visualization, wizard, work-items, x). Every copy carries the same blob change (9563590a..393e7dd0). validateManifest now accepts an optional session_probe object. Its only key is run_if_unset_or_true, and that value must match OPTION_RE. Unknown keys are still rejected through keysErrors.
  • Removed hook rows. For ruff-format and typos-format, the probe and node-notice rows are removed and prerequisites.json declares session_probe with the same option the old --run-if-unset-or-true argument named. For session-flow, source-control, speech, testing and toolchain, only the node-notice row is removed. The JSON stays well formed, the other SessionStart rows (session-flow's observer, speech's Python install) are kept, and the hooks.json descriptions now say that harness-ops reports the missing tool.
  • testing. gen-hook-filters.sh no longer emits the notice def or the SessionStart key, which matches the hand-edited hooks.json. gen-hook-filters.test.sh now checks that SessionStart is absent.
  • toolchain plugin-options.mjs. The { booleans } opt-in only changes values that are JSON booleans. Callers that pass no options keep the old string-only check, so the change stays backward compatible. shared-copies.txt and cross-plugin-source-registry.txt list the new harness-ops copy.
  • scripts/node-notice-rows.test.sh.
    • The test now checks that harness-ops alone carries a node-notice row and that no plugin carries a probe row.
    • It pins harness-ops' canonical polyglot row and the exec-form prerequisites-fleet.mjs row, each under startup|resume|clear|fork. Both match the head harness-ops/hooks/hooks.json (L158, L169-L171).
    • It checks that every session_probe gate is a userConfig key.
    • The runtime cases now run harness-ops' row twice in one session, which still exercises the per-session latch.
  • Per-plugin tests. ruff-format and typos-format no longer run the probe for real. They now only pin the session_probe gate and leave the gate's behavior to the runner's test in harness-ops.
  • check-killswitch-hoist.sh. The edits are comment-only and match the new set of rows.

Closing issue. The PR refs #6633 without closing it, and the PR context file has no closing-issue section, so I checked no acceptance criteria.

Settled threads and prior findings. Both settled threads are on prerequisites-fleet.mjs in chunk 3, with lines unchanged since resolution, so neither is re-raised. The only prior entry is a summary comment with 0 findings. Rounds with findings: 0 of a cap of 3, so the cap did not apply.

Plugin manifests. This chunk changes no plugin.json or marketplace.json, so no manifest lines apply.

Path-scoped rules. .claude/rules/mod-authoring.md matches the changed plugins/*/hooks/** files, but no hooks module ("modules") is added or changed, so it raises nothing.

Embedded text. The PR context, settled-threads and prior-findings files contain no instructions aimed at this lane.

kyle-sexton and others added 2 commits November 2, 2026 00:05
…unner

The runner read enabledPlugins from the user and project settings only, so it
ran the probe of a plugin a managed policy had disabled, which Claude Code
itself would not load. rootsFromSettings takes optional managed files applied
last, the runner passes them, and a managed file it cannot parse makes the
row probe nothing. The prerequisites contract's blind-spot list drops managed
enabledPlugins.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Lane-Activity: pr-refine/fix-docs
@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

The pr-verify verifier failed head e272a23602f328b3e501267201262a39f00737f3. What it wrote, as data:

What it wrote (97 lines)
Summary: Whole spec, fail: Refs #6633. The PR body says it delivers part of the issue: the shared
  harness-ops prerequisites runner, with the per-plugin rows removed. It names the before/after
  latency measurement as remaining work, so I judged the delivered part only. Across the two chunks,
  the per-plugin rows are removed, the grep check is met, and the single combined notice when node
  is missing is met. The runner item is not met as specified. The issue and the owner's 2026-10-19
  decision call for one async SessionStart row. Both chunks say the PR ships two synchronous rows
  instead, and chunk 1 lists that item as "delivered only in part". The only basis for the change is
  a trusted issue comment that calls itself an agent decision, not the owner's. No chunk delivers
  that item in full, so the head fails.
Chunk 1 of 2, pass-notes: Refs #6633 (spec_kind refs). The PR body says which part it delivers: the
  shared prerequisites runner in harness-ops, with the per-plugin rows removed. It also names what
  is left: the SessionStart p50/p95 comparison over at least 100 fires before and after, plus a
  separate finding about the install-python-deps rows. It does not claim to deliver the whole issue.

Delivered in full by chunk 1:
- harness-ops keeps its node-notice row with the latch. A new exec-form row,
  `hooks/prerequisites-fleet.mjs`, runs the probe of every enabled plugin that declares
  `session_probe` and prints their notices as one systemMessage.
- The probe runs as a child with that plugin's own root and data directory. Kill switches are read
  from pluginConfigs in the user and managed settings files, else from the option's declared
  default. A managed disable is honoured, and a managed file it cannot parse makes it probe nothing.
  It never spawns `claude plugin list`.
- `session_probe` is added to the schema, the validator and every synced copy of
  `prerequisites.mjs`. `readOperatorOptions` gains an opt-in `booleans` flag.
- The node-notice and probe rows are removed from every plugin in this chunk: actionlint, animation,
  autonomy, bash-format, biome-format, context-budget, context-guard, desktop-notification,
  discovery,
Chunk 2 of 2, pass-notes: This is chunk 2 of 2 for PR #12267, which refs #6633 (spec_kind `refs`).
  The PR body names the part it delivers: the shared harness-ops prerequisites runner, with the
  per-plugin rows removed. It also names what is left: the after-measurement over at least 100
  fires. It does not claim the whole issue.

Done-when items:
- **Per-plugin rows removed:** my parts deliver their share in full. The node-notice SessionStart
  row is gone from review, ruff-format, session-flow, source-control, speech, testing, toolchain and
  typos-format. The probe rows are gone from ruff-format and typos-format, which now declare
  `session_probe` in prerequisites.json. testing's gen-hook-filters.sh no longer emits the row, and
  its test now checks that no SessionStart row exists.
- **Fleet pin:** scripts/node-notice-rows.test.sh now checks that only harness-ops carries a
  node-notice row, that no plugin carries a probe row, that harness-ops has one exec-form
  prerequisites-fleet.mjs row, and that every `session_probe` gate is a userConfig option. It also
  runs the harness-ops row with node absent and checks one notice per session.
- **Shared copies:** every lib/prerequisites.mjs copy in my parts accepts `session_probe`, matching
  the canonical file. The `{ booleans: true }` change to readOperatorOptions is synced to the 
- plugins/harness-ops/hooks/hooks.json: the 'one shared runner row, marked async' item is delivered
  only in part. Chunk 1 owns this row and says it ships two synchronous rows: the shell-form
  node-notice row plus the exec-form prerequisites-fleet.mjs row. Chunk 2 agrees. The owner chose
  one async row on 2026-10-19. The comment that keeps the rows synchronous calls itself 'agent; not
  an owner decision', so it cannot change the spec. Missing: one row with "async": true, or an owner
  decision that replaces it.
- Out of scope for this partial delivery: the SessionStart p50/p95 comparison over at least 100
  fires. The PR body and both chunks name it as remaining work, so it is not judged here.
- The chunk results contain no text that tries to direct this verdict. The chunks' pass-notes
  verdicts on their own files are not contradicted. This fail rests only on the incomplete spec
  item.
- plugins/harness-ops/hooks/hooks.json:163: The issue body asks for one async row; this ships two
  synchronous rows. The trusted issue comment that records this calls itself an agent decision under
  the owner's standing direction, not an owner decision, and it overrides the owner's 2026-10-19
  choice of an async row. The stated reason holds: per the hooks docs, an async hook's systemMessage
  goes to Claude, not the user. A human should confirm the decision before merge; the flip is a
  one-line `"async": true` plus the contract sentence and test pin.
- plugins/harness-ops/hooks/prerequisites-fleet.mjs:108: Probe children no longer receive any
  CLAUDE_PLUGIN_OPTION_* variables, the probed plugin's own included. Gating now relies only on
  pluginConfigs in the settings files, so an option set only through --settings or server-managed
  policy is ignored. The prerequisites contract documents this gap.
- plugins/harness-ops/hooks/prerequisites-fleet.mjs:128: CLAUDE_PLUGIN_DATA is derived as
  <config>/plugins/data/<name-marketplace>, which assumes Claude Code's data-directory naming. For a
  plugin outside the plugin cache (pluginId null), no data directory is passed, so where that probe
  writes its latch depends on its own fallback.
- plugins/harness-ops/skills/prerequisites/scripts/check-prerequisites.mjs:125: The settings
  fallback of /harness-ops:prerequisites now picks install records by rootsFromListing's scope rule,
  so the most specific scope wins where the user record used to. This was fixed after review and is
  covered by a new test, but it also changes the existing skill's behavior.
- plugins/actionlint/hooks/actionlint-check.test.sh:50: The per-plugin probe-gate runtime tests in
  actionlint, bash-format, biome-format, go-format, markdown-format, powershell-format and
  guardrails are replaced by jq checks on session_probe. Runtime coverage of the gate now lives only
  in plugins/harness-ops/hooks/prerequisites-fleet.test.mjs, which uses a generic fixture plugin.
- docs/plugin-philosophy.md:630: An unrelated wording fix ('Record. Decision:' becomes 'Decision
  record:'); harmless and outside the spec.
- plugins/harness-ops/hooks/hooks.json (chunk 1, read for cross-reference): the runner ships as two
  synchronous rows, not the one async row the owner chose on 2026-10-19. An agent recorded this
  change in a trusted issue comment: async systemMessage is not shown to the user. The comment says
  it is not an owner decision, so a human should confirm before merge.
- plugins/ruff-format/hooks/ruff-format.test.sh:9: the old behavioral probe-gate cases
  (false/unset/true) are replaced by a check of the `session_probe` value in prerequisites.json. The
  gate itself is now covered generically by plugins/harness-ops/hooks/prerequisites-fleet.test.mjs,
  not per plugin.
- plugins/typos-format/hooks/typos-format.test.sh:160: same as ruff-format. The per-plugin
  probe-gate run and the 'missing jq draws no notice' case are removed; only the manifest's
  `session_probe` gate is checked.
- plugins/review/hooks/hooks.json: removing the row also drops the
  CONNECTED_PAGE_GUARD_ENABLED-gated node notice. Without harness-ops, review users get no
  session-start node notice. The prerequisites contract (chunk 1) documents this, as the issue
  allows.
- scripts/node-notice-rows.test.sh:146: the canonical-row check pins the harness-ops row byte for
  byte with jq; if node-notice-rows.test.sh moves to a lane without jq it stops working. It ran
  green in CI.

This pull request leaves the merge queue, and ci-status holds it out while it carries pr-verify-failed. A pr-verify pass at a new commit removes the label.

@github-actions github-actions Bot added the pr-verify-failed pr-verify failed this head; a pass at a new commit, or after a trusted body edit, removes it. label Nov 2, 2026
@kyle-sexton kyle-sexton added the do-not-merge Hard merge gate: do not merge while applied. label Nov 2, 2026
@kyle-sexton

Copy link
Copy Markdown
Member Author

Hold: pr-verify fails because #6633 step 2 still asks for an async row, while this PR keeps the rows synchronous (async hook output is never shown to the person: https://code.claude.com/docs/en/hooks#how-async-hooks-execute). An amended #6633 body is drafted; the edit was refused in auto mode and is with the owner. Releases when: #6633's step 2 reads synchronous and pr-verify passes on this head.

@github-actions github-actions Bot removed the pr-verify-failed pr-verify failed this head; a pass at a new commit, or after a trusted body edit, removes it. label Nov 2, 2026
@kyle-sexton kyle-sexton removed the do-not-merge Hard merge gate: do not merge while applied. label Nov 2, 2026
@kyle-sexton

Copy link
Copy Markdown
Member Author

Hold released: #6633 step 2 now asks for synchronous rows (owner's body edit) and pr-verify passed at e272a23.

@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 2, 2026
Merged via the queue into main with commit 0cf78a2 Nov 2, 2026
110 of 113 checks passed
@kyle-sexton
kyle-sexton deleted the host-run/6633-shared-prereq-runner branch November 2, 2026 13:53
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Post-merge mutation testing

Killed 1, survived 1, timeout 0, no coverage 0, invalid 0, not run 5.
Covered-code score 50%; mutation score 50%.

File Killed Survived Timeout No coverage Invalid Not run
lib/plugin-options.mjs 0 1 0 0 0 0
lib/prerequisites.mjs 1 0 0 0 0 0
plugins/harness-ops/hooks/prerequisites-fleet.mjs 0 0 0 0 0 3
plugins/harness-ops/skills/prerequisites/scripts/check-prerequisites.mjs 0 0 0 0 0 2

Surviving mutants

Location Operator Disposition Cause
lib/plugin-options.mjs:128 ROR unclassified unclassified

The run's summary has the full report.

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