Repository navigation
fix(source-control): hold plugin-declared executable paths on the merge floor - #8479
Conversation
…ge floor
The risk scorer takes each plugin's plugin.json, .mcp.json and
hooks/hooks.json as read at the base commit (RiskInput.declarations) and
joins every path they declare as run to the HIGH floor: each
${CLAUDE_PLUGIN_ROOT} reference, and plugin.json's ./ paths under its
executable keys. A declaration it cannot read, an unknown declaration
file, or a path outside its plugin rates HIGH as high-path:**.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
… floor Co-Authored-By: Claude Opus 5.5 <[email protected]>
…merge gate score_unattended now reads each DECLARATION_FILES file at the base SHA (babysit_merge_policy.declarations_at: a clone holding it, else the contents API) whenever the floor applies and passes them to the risk scorer. A file that cannot be read is passed as (path, None), and a base tree that cannot be listed as None, both scoring HIGH. The unattended test harness answers the new read with no declarations. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…touched plugins The scorer also reads .lsp.json, monitors/monitors.json, plugin.json experimental.monitors, and config files a plugin.json executable key points at (declaration_pointers); a pointer not read is unsafe. Any plugin-root reference it cannot resolve (a default, a trim, $env: or %...%) is unsafe, and ./ and ../ paths in any declaration resolve against the plugin root. declarations_at now reads only the plugins the pull request's changed files sit in, plus their pointed config files, and nothing for a change outside every plugin. The test fixtures use made-up plugin names. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rge-floor-declared-executables
When a clone holds the base SHA, declarations_at reads every plugin's declarations through git, which costs no API call, so an untouched plugin whose declared path escapes into a changed plugin holds the pull request. Without a clone it still reads only the touched plugins. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ectories A monitors file, monitors/monitors.json or one a monitors key points at, is read as the documented top-level array or as an object; every other declaration must still be an object. HIGH_FLOOR holds plugins/*/bin/**, whose files are on the Bash tool's PATH while the plugin is enabled. 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. |
|
claude-security-review reviewed No security findings in the incremental change since 9008a53.
I did not consult the instruction exception register. The diff deletes and softens no standing instruction. |
|
claude-review reviewed Incremental review of 402ea72 against 9008a53 (3 files). No findings.
The earlier-reviewed files are unchanged since the last review and were not re-reviewed. |
…ble tests from git env Hold `**/.lsp.json` on the HIGH floor beside `**/.mcp.json`, with a test that a pull request changing only a plugin's .lsp.json scores HIGH. Clear inherited GIT_DIR, GIT_WORK_TREE and GIT_CONFIG at the top of test_babysit_risk_declared_executables.py, which builds git fixtures, so the fixture-git-isolation hygiene check passes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
No related issue: Phase 2 of the lane-funding write-lane plan (owner-approved 2026-10-19), a merge-floor hardening ahead of lanes that author plugin code
Hold: a human merges this
Summary
The pr-merge risk scorer's HIGH floor holds listed paths (hooks,
lib/,.claude-plugin/, and so on) for a human merge. Write lanes are about to author plugin code, so the floor now also reads every plugin's declarations at the base SHA and holds each path a plugin declares as executable.Fix
babysit_risk.py:RiskInput.declarationstakes the base-side text of these declaration files:plugin.json,.mcp.json,hooks/hooks.json,.lsp.json, andmonitors/monitors.json(the documented monitors array).hooks,mcpServers,lspServers,monitorsandexperimental.monitors, plusplugin.jsonstring pointers to other config files.${CLAUDE_PLUGIN_ROOT}-relative or./-relative path joins the HIGH match as the directory that holds it.CLAUDE_PLUGIN_ROOTspelling the parser cannot resolve.plugins/*/bin/**joinsHIGH_FLOOR, sincebin/is on the Bash tool's PATH while the plugin is enabled.babysit_merge_policy.declarations_atreads the declarations atpr.base.sha, never the head, so a PR cannot drop its own declaration to escape the floor.plugins/. This keeps the lanes App's hourly API budget intact.babysit_merge.score_unattendedpasses the declarations whenever the high floor applies.test_babysit_merge_unattended.pyreturns an empty declaration set. No assertion changed.Verification
pytest plugins/source-control/skills/babysit-prs/scripts/tests: 2064 passed, 1 failed. The failure istest_guards::test_the_recording_shim_is_reachable, which fails the same way on main under this host's Python.test_babysit_risk_declared_executables.py, including end-to-endscore_unattendedcases. With main's scorer and reader restored, 37 of 38 fail; the one that passes is the LOW control.scripts/run-ruff.sh: clean.CLAUDE_PLUGIN_ROOTspellings slipped through) and the second passed. The second's high finding, the monitors array shape, is fixed here.A bare
${CLAUDE_PLUGIN_ROOT}argument floors the whole plugin (about 13 plugins today). That is deliberately conservative.Related
🤖 Generated with Claude Code