Repository navigation
perf(harness-ops): run every plugin's SessionStart prerequisites check from one row - #12267
Conversation
…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]>
Refs: #6633 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Refs: #6633 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 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".
|
claude-security-review reviewed Chunk 1 of 4 (40 files)Security review: chunk 1 of 4No security issues in this chunk. critical-findings: 0 What I checked
Settled threads and earlier findings
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
Prior and settled findings
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 foundI found no security issues in the 40 files of this chunk. critical-findings: 0 What I checked
Prior findings and settled threads
SpendNone. The change cuts SessionStart processes from about 38 to 2, plus at most one probe child for each of the 10 plugins that declare 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
Prior findings
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 |
…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]>
|
claude-review reviewed Chunk 1 of 4 (40 files)Code review, chunk 1 of 4: no findingsScope. I read every hunk of all 40 files in
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
Identical files.
Settled and prior findings. Both settled threads concern Closing issue. The PR only says Plugin manifests. No 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 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 findingsScope. I read every hunk of all 40 files in What this chunk changes, and what I checked.
Plugin manifests. This chunk changes no Closing issue. The PR says only Settled threads and prior findings. Both settled threads are about 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 findingsScope. I read every hunk of all 40 files in
I ran nothing. Any claim that the tests pass comes from the author and is unverified. What I checked.
Settled and prior. Both settled threads (the install-record choice and managed Closing issue. The PR says Plugin manifests. No Identical files. None of the copy paths in 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 Chunk 4 of 4 (36 files)Code review, chunk 4 of 4: no findingsScope. I read every hunk of all 36 files in What I checked.
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 Plugin manifests. This chunk changes no Path-scoped rules. Embedded text. The PR context, settled-threads and prior-findings files contain no instructions aimed at this lane. |
…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
|
The pr-verify verifier failed head What it wrote (97 lines)This pull request leaves the merge queue, and ci-status holds it out while it carries |
|
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. |
Post-merge mutation testingKilled 1, survived 1, timeout 0, no coverage 0, invalid 0, not run 5.
Surviving mutants
The run's summary has the full report. |
Refs: #6633
Summary
Every hook plugin carried its own SessionStart prerequisites rows: 28 node-notice rows and 10
prerequisites.mjs proberows, about 38 processes at each session start answering the same questions. This change leaves two rows, both in harness-ops:hooks/prerequisites-fleet.mjs, which runs the probe of each enabled plugin that declaressession_probein itsprerequisites.jsonand 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
verifysubprocesses.Fix
hooks/prerequisites-fleet.mjs, with its test, and its row inhooks/hooks.json, under thestartup|resume|clear|forkmatcher.check-prerequisites.mjs's settings path (enabledPluginsplusinstalled_plugins.json) and never runsclaude plugin list.lib/prerequisites.mjs probeas a child, with that plugin'sCLAUDE_PLUGIN_ROOTandCLAUDE_PLUGIN_DATA, so latches and git-hook drift detection behave as before.pluginConfigsin the user and managed settings (hook-config-delivery channel F), else from the option's declared default.lib/prerequisites.mjsand the schema accept an optional top-levelsession_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.session_probe. 28 plugins drop their node-notice row and the 10 also drop their probe row. instruction-placement'shooks/hooks.jsonis removed, since nothing remained in it. testing'sgen-hook-filters.shstops emitting the row.systemMessagegoes to Claude on the next turn and is not shown to the user (hooks § How async hooks execute).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.hooks.jsondescriptions.scripts/node-notice-rows.test.sh, and the per-plugin tests that pinned the old rows.Verification
scripts/node-notice-rows.test.shchecks that:session_probegate is auserConfigoption;It gives 4 FAIL on the base tree and 9/9 on this branch.
plugins/harness-ops/hooks/prerequisites-fleet.test.mjs(9 cases):claudeprocess starts;The case with the kill switch set to true fails without the
booleansopt-in.lib/prerequisites.test.mjs: thesession_probeschema cases pass, 312 tests in all.CHECK_DATA_ROOT=<wt> scripts/check-affected.sh --testson 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 -lreturns 1, the harness-ops row, which the issue allows.Remaining on #6633
install-python-deps.shSessionStart rows (explainer-video, speech, animation) set the critical path. This change does not touch them.Related
prerequisites.jsondata.🤖 Generated with Claude Code