Skip to content

fix(source-control)!: read the merge trust and cost settings from userConfig - #17473

Merged
kyle-sexton merged 14 commits into
mainfrom
fix/17208-source-control-trust-settings
Nov 19, 2026
Merged

kyle-sexton merged 14 commits into
mainfrom
fix/17208-source-control-trust-settings

Conversation

@kyle-sexton

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

Copy link
Copy Markdown
Member

Refs: #17208

Summary

The source-control merge path trusted one organization's values, fixed in the plugin. Seven of them become source-control userConfig keys. Only the operator's user or managed settings (managed-settings.d drop-ins included) can set them, so a pull request's own head cannot widen any of them. Each key fails closed when unset. This repository's lanes now receive its values through a root-owned managed-settings drop-in written from the default branch.

The owner approved these changes to these controls in session on 2026-11-19, in two decisions:

  • the settings themselves: row L227;
  • their CI delivery: row L230, Owner, verbatim: "yes go w/ recommendations".
Setting Was fixed in Unset means
unattended_merge_owners the owner gate in reference/providers/github/pull-request/merge.md nothing merges without the user
review_lane_workflows the reusable-workflow regexes in review-venue.sh no CI run counts as a review lane, so reviews run locally
review_lane_checks babysit_review_evidence.LANES, babysit_merge.AI_REVIEW_CHECKS and the merge.md list no check counts as AI review, so the gate holds
owner_decisions_record babysit_merge_policy.DECISION_ROW and the babysit_risk hint no decision clears a cost hold
free_runner_labels babysit_risk._FREE_RUNNER only GitHub's standard labels are free
model_leg_actions babysit_risk._MODEL_ACTION* only the built-in run-claude-cli and claude-code* names count; the setting can only add
issue_status_app_login babysit_merge_policy.LANES_APP_LOGIN only a person's Work status values count

The legacy FAILs file (verify-legacy-fails.json) moves out of the plugin to .github/. The verdict reader now reads only the file BABYSIT_VERIFY_LEGACY_FAILS names.

Bump: major. A consumer loses behavior when the keys are unset: unattended merge, CI review-lane credit, cost-decision clears, the lanes App, the org's free runners, and the index mode that the legacy file beside the reader used to turn on.

Fix

  • New reader: skills/babysit-prs/scripts/babysit_merge_settings.py reads settings the way lib/plugin-options.mjs does (hook-config-delivery channel F).
    • It reads pluginConfigs["<name>@<marketplace>"].options from the user settings.json it locates from its own plugin-cache install path.
    • It also reads managed-settings.json and the managed-settings.d/*.json drop-ins, merged in name order. Managed settings win.
    • It never reads the environment or any file in a checkout. A copy run from a checkout reads managed settings only.
    • Values are exact names or * globs, escaped before any regex is built. A malformed entry drops the whole setting.
  • Consumers wired to the reader: the babysit gate tables, review-venue.sh, and the merge.md merge script and conditions. babysit_gh skips a lane that is not configured.
  • CI wiring. Each job that runs the babysit scripts gets a new step, right after its .base default-branch checkout and before any runner isolation or pull-request content:
    • The step calls apply-claude-managed-settings (ci-workflows v0.77.0, 6229c347) with drop-in-file: .base/.github/source-control-settings.json.
    • That writes /etc/claude-code/managed-settings.d/50-source-control.json, root-owned with mode 644.
    • The 12 jobs: pr-merge.yml (dispatch-post-merge-runs, merge, enable-auto-merge), pr-require-checks.yml ci-status, pr-review-main.yml (check-trigger, review, review-subscription, review-fallback), pr-dispatch-feedback.yml dispatch, pr-unblock-dispatch.yml dispatch, and post-merge-file-demotion-issues.yml (file-demotion-issue, close-cleared).
    • The same six workflows set BABYSIT_VERIFY_LEGACY_FAILS to the .base copy of the legacy file.
    • ci-status's sparse checkout lists both files, and its index-mode check reads the env.
  • This repository's values are in .github/source-control-settings.json. That file and the legacy file are trust rows on the hold floor, and so is the reader module. Generated copies are refreshed, and the floor pins moved for the three new rows.
  • Changelog: source-control fragment bump: major; pr-pipeline fragment bump: patch for the legacy file's new home.
  • Docs: plugin.json userConfig, the README tables, config-resolution.md, both merge.md files, review-venue.md, safety.md, guard-contract.md and the pr-pipeline README.

Why a pull request's head cannot widen a value:

  • The reader opens only two kinds of file: the install-anchored user settings.json, and the fixed managed paths.
  • In CI, the drop-in is built from the .base checkout of the default-branch tip (ref: ${{ steps.tip.outputs.sha }}, persist-credentials: false), inside pull_request_target, workflow_run, schedule and push workflows that run the default-branch workflow file.
  • Tests cover this:
    • test_checkout_files_and_the_environment_are_not_sources and test_the_ci_shape_ignores_the_environment_and_the_checkout plant wider values in a project .claude/settings.json, a checkout .github/source-control-settings.json, CLAUDE_PLUGIN_OPTION_*, CLAUDE_CONFIG_DIR and HOME. Only the drop-in's values are read.
    • test_drop_ins_are_read_in_name_order_after_the_base_file checks how drop-ins merge.

Verification

  • babysit-prs Python suites, all of skills/babysit-prs/scripts under python3 -m unittest discover: 4576 tests, OK (1 skipped).
  • test_babysit_merge_settings.py: 19 tests, covering unset, configured, the CI drop-in shape, pull-request-head attempts, malformed sources and precedence.
  • review-venue.test.sh: 104 PASS.
  • scripts/ci-lanes-pr-hold.test.sh: 347 PASS, including FAIL index mode through BABYSIT_VERIFY_LEGACY_FAILS.
  • merge-holds.test.mjs: 76 pass. sync-hold-floor --check and the plugin-options docs check are clean.
  • actionlint is clean on the six edited workflows.
  • With this repository's settings, the babysit gates accept the same checks as main. The merge.md script's two lane lists, set-diffed against main's (a script over .github/source-control-settings.json), match main except the claude-review lane also accepts a check named exactly claude-review-status, which babysit_merge.py already accepted on main. babysit_merge.AI_REVIEW_CHECKS also lists pr-review-no-bots / claude-review-status, which its bare claude-review-status already matched, so merge.md keeps that name.
  • ci-workflows' own tests for the drop-in step: 7 pass. They check its exact sudo calls and that a refused input writes nothing.

Remaining

What #17208 still needs after this PR:

  • Classify every org-name match across plugins/*/skills, agents, reference and hooks. That classification has not been done for the whole tree.
  • The instruction cases outside source-control: the harness-ops observability SKILL.md and the work-items morning-brief SKILL.md.
  • A portability check that fails on a new org-name match, in scripts/check-skill-portability.sh or another CI check.

Related

🤖 Generated with Claude Code

https://claude.ai/code/session_01KeBVgaQE4QB75SPD3ky1jd

kyle-sexton and others added 9 commits November 19, 2026 09:47
…Config

The merge path trusted one organization's values fixed in the plugin: the
owners it merges for unattended, the reusable review workflows and check
names that count as AI review, the owner-decisions record whose rows clear
a cost hold, the free runner labels, the model-leg actions and the App whose
Work status values count like a person's. Each is now a source-control
userConfig key that babysit_merge_settings.py reads only from user and
managed settings (hook-config-delivery channel F), never from a checkout or
the environment, so a pull request cannot widen one. Every key fails closed
when unset.

This repository's values live in .github/source-control-settings.json, on
the hold floor; the babysit-prs suites run under them.

Refs: #17208

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ged drop-in

Every job that runs the babysit scripts writes .base's
.github/source-control-settings.json into a root-owned
/etc/claude-code/managed-settings.d/50-source-control.json right after its
default-branch checkout, before runner isolation or any pull-request
content, through ci-workflows' apply-claude-managed-settings. The reader
already reads managed-settings.d; new tests prove it reads the drop-in and
nothing in the checkout or the environment.

The legacy FAILs file moves out of the plugin to .github/; the verdict
reader reads only the file BABYSIT_VERIFY_LEGACY_FAILS names, which these
workflows set to the .base copy. Both data files are trust rows on the
floor.

BREAKING CHANGE: unset, the settings name no owner, lane, check, record,
extra free runner or App, and the verdict reader reads no legacy file.

Refs: #17208

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rol-trust-settings

# Conflicts:
#	.github/workflows/pr-require-checks.yml
#	plugins/source-control/README.md
#	plugins/source-control/skills/babysit-prs/scripts/tests/test_babysit_risk.py
#	plugins/source-control/skills/babysit-prs/scripts/tests/test_floor_paths.py
#	plugins/source-control/skills/babysit-prs/scripts/tests/test_merge_holds_sync.py
The drop-in steps in pr-review-main.yml move after each leg's "Record the
main commit" step, which the workflow tests require right after the
checkout; they still run before runner isolation and pull-request content.
merge-job.test.mjs lists the new step in dispatch-post-merge-runs.

Refs: #17208

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

chatgpt-codex-connector Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-19T17:13:28.083642Z 22622ce PR opened
ℹ️ 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.

@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

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

Security review: incremental, 73e8be8 → 3752916 (5 files)

No security issues in this push. This lane already reviewed an earlier head, so the round reported blocking findings only. None turned up.

What changed

The push restores run-claude-cli as a built-in model-leg name in the merge gate's cost check. It is the fix for the settled thread on babysit_risk.py (owner reply, fixed in 3752916).

  • Code: babysit_risk.py L1270-L1272 now ends _MODEL_NAMES with run-claude-cli|claude-code[\w-]*. model_leg_actions can now only add names to that list.
  • Merge hold (trusted path): this tightens the hold rather than weakening it. When model_leg_actions is unset, a uses: …/run-claude-cli@… step matches again in three places:
    • _MODEL_ACTION_NAME (L1273), used by _billed_timeouts at L1672;
    • the uses: capture at L1277;
    • the HIGH agent-surface-review rating through _new_model_legs.
  • Regex safety: at L1277 the alternation sits inside the (?:…) group, so the new branch cannot escape the uses: anchor. Operator-supplied names still go through re.escape.
  • Test: test_the_gate_tables_are_empty now expects [True, True] with nothing configured, which pins the fail-closed default.
  • Docs: the plugin.json description, the README rows and the changelog fragment were edited to match. The changelog now drops model-leg actions from its "fails closed when unset" list. That only narrows a claim; it removes no standing instruction.

Matching an extra action name trusts no new actor or token. It only makes the cost and agent-surface checks hold more often.

Notes

  • The seven manifest userConfig.<key>: flag lines from the prior round were about keys this push does not touch, apart from model_leg_actions's description. Their status is unchanged by this increment, and they are not restated here.
  • Embedded text: none found in the PR context, settled threads or prior findings.
  • Spend: none. This push changes no turn limits, models, schedules or billed resources.
Manifest lines (1)
  • manifest userConfig.model_leg_actions.description: pass

critical-findings: 0

@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-review: 3 inline finding(s) on 22622cefa2db05dfc01a80794bd7a2ddc6276b6e; the summary is in this lane's pull request comment.

claude-lane: claude-review

Comment thread .github/workflows/pr-require-checks.yml Resolved
Comment thread scripts/ci-lanes-pr-hold.test.sh Resolved
@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

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

Code review: incremental, blocking only

This lane already reviewed an earlier head, so this pass reports only blocking findings and manifest flag lines. I read every hunk of all 5 files that changed since 73e8be85.

Result: no blocking findings.

The push fixes the loosened-check finding from the last round (thread, settled by the owner and resolved at this head):

  • babysit_risk.py: run-claude-cli is back in the built-in _MODEL_NAMES alternation (L1272), so model_leg_actions can now only add names. _MODEL_NAMES feeds both _MODEL_ACTION_NAME (L1273) and _MODEL_ACTION (L1276). So with the key unset, a new uses: …/run-claude-cli@… step again shows up as a new model leg through _new_model_legs (L1514), and the billed-timeout check covers it again.
  • test_babysit_merge_settings.py: test_the_gate_tables_are_empty now asserts 'model': [True, True] with no settings. A revert of the regex would fail it.
  • Docs: plugin.json's model_leg_actions description, both README tables and the changelog fragment now describe the built-in names as run-claude-cli and claude-code*. The fragment drops model-leg actions from the "fails closed when unset" breaking list, which is accurate now that the key only adds names. bump: major still fits the other breaking items.

Notes

  • Unverified: I had no shell and ran nothing. The owner's statement that the fix is complete is the author's claim; I confirmed it only by reading the code.
  • Loosened checks: Loosened-check verdict: fail (default: the prompt has no loosened_check lines); patterns: 0. The prompt has no loosened_check_decision_record: line, so I did not check the citation requirement. None of the incremental changes loosens a check: this push removes the earlier loosening.
  • Spend: none in this push.
Advisory and manifest lines (1)
  • manifest userConfig.model_leg_actions description: pass (the wording matches the restored built-in names; no default or options change)

Verifier dropped 0 of 0 candidates.

kyle-sexton and others added 2 commits November 19, 2026 12:51
ci-status's drop-in step read .base/.github/source-control-settings.json from
main's tip, which has no such file until this change lands, so CI Status
failed on ENOENT. The step now runs only when the file exists; until then
the reader keeps its fail-closed defaults.

- Add the source-control plugin.json to ci-status's sparse checkout, so
  resolve_install names the plugin and the drop-in's values match.
- post-merge-demotion-alert test: allow exactly the pinned drop-in step,
  with only its two inputs, in the file-demotion-issue job, and drop the
  comment that said the job runs no action but checkout and log-api-budget.
- AnchorUpload test: remove exactly one pinned drop-in step and keep the
  claude ban on the rest of the job, instead of deleting the action name.
- ci-lanes-pr-hold test: put BABYSIT_VERIFY_LEGACY_FAILS outside the
  reader's directory, and check a file beside the reader alone is not
  FAIL index mode.

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

Copy link
Copy Markdown
Contributor

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

What it wrote (36 lines)
Summary: PR #17473 uses a `Refs: #17208` line. That issue asks for three things: classify every
  shipped match of this organization's repository names, make the ones that depend on the
  organization read a configurable value, and add a CI portability check that blocks new ones. The
  diff covers one part, all inside the issue's scope: the runtime and instruction cases of the
  source-control merge path, including DECISION_ROW in babysit_merge_policy.py, which the issue
  names. Seven trust and cost values become userConfig keys, read by the new
  babysit_merge_settings.py from user and managed settings only. Every key fails closed when unset,
  which matches the owner's recorded "Off when unset" decision (owner-decisions L229). CI gets this
  repository's values through a managed-settings drop-in built from the default-branch `.base`
  checkout, with the action pinned to a commit SHA. The new files are added to the trust floor, and
  the tests show that files in a checkout and environment variables are never read. The reader, its
  consumers and the tests look correct. Every Test Python and Test Bash job passed on the judged
  head (e.g.
  https://github.com/melodic-software/claude-code-plugins/actions/runs/44582017790/job/135765536291
  and
  https://github.com/melodic-software/claude-code-plugins/actions/runs/44582017790/job/135765536444).
  I found no steering text and no secrets. The deciding defect is the PR description. A partial
  delivery must say what remains of the issue. The only item this one names as not done is the
  guardrails lanes App login, which it says reverts on its own. It never lists the issue's
  undelivered work: classifying all matches, the other plugins' instruction cases, and the
  portability check. A smaller point: the new list in the merge.md script now accepts one review
  check name the old script did not.
- PR body: add a section naming what remains of #17208 for later work. List the done-when items this
  PR does not deliver: classifying every match across plugins/*/skills, agents, reference and hooks;
  the instruction cases outside source-control (for example harness-ops observability SKILL.md and
  work-items morning-brief SKILL.md); and the `scripts/check-skill-portability.sh` (or other CI)
  check that fails on a new dependency on organization repository names. As written, the body names
  only the guardrails lanes App login as not done and says it reverts on its own, so a partial
  delivery cannot be confirmed.
- plugins/source-control/reference/providers/github/pull-request/merge.md:116: the exact-match list
  for the unattended merge is now the union of the `status` and `merge` names from
  `.github/source-control-settings.json`. That union adds the bare `claude-review-status`, which the
  old script did not accept, and drops `pr-review-no-bots / claude-review-status`, which it did. The
  PR body says the old and new tables are identical, but here they are not. Either restore exact
  parity by adding `claude-review:status=pr-review-no-bots / claude-review-status` and building this
  list so it gains no bare name, or state the change in the PR body.

This pull request leaves the merge queue, and ci-status holds it out while it carries pr-verify-failed. A pr-verify pass removes the label, at a new commit or at this same head: once a trusted person edits the body, and only trusted people have edited it since the fail, this head is judged again, so a fail on the body or the issues it links needs only the body fixed, no new commit.

@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 19, 2026
kyle-sexton and others added 2 commits November 19, 2026 13:38
…rge list

merge.md's jq matches whole check names, so the settings-derived union lost
`pr-review-no-bots / claude-review-status`, which babysit already covered
through its bare-name segment match. Name it as a merge check so the merge.md
lists match main again.

Refs: #17208

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

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

claude-lane: claude-review

With model_leg_actions unset, a workflow adding run-claude-cli no longer
rated as a new model leg, so the cost check accepted more than before.
Keep the name in the built-in pattern; the setting only adds names.

Refs: #17208

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KeBVgaQE4QB75SPD3ky1jd
@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 19, 2026
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 19, 2026
Merged via the queue into main with commit 4983b79 Nov 19, 2026
85 checks passed
@kyle-sexton
kyle-sexton deleted the fix/17208-source-control-trust-settings branch November 19, 2026 19:22
@github-actions github-actions Bot added the merge-path: owner-agent Post-merge accounting record (README.md, Merge paths) label Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-path: owner-agent Post-merge accounting record (README.md, Merge paths)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant