Skip to content

feat(source-control): read convention config from the config-cascade layers - #18116

Merged
melodic-automation-lanes[bot] merged 4 commits into
mainfrom
work-resolve-issue/issue-18000-44983079501-1
Nov 22, 2026
Merged

melodic-automation-lanes[bot] merged 4 commits into
mainfrom
work-resolve-issue/issue-18000-44983079501-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #18000

Summary

Opened by the work-resolve-issue lane. The run's own summary:

source-control now resolves its convention keys from the config-cascade layers: the team file docs/conventions/source-control.yaml and the new personal override docs/conventions/source-control.local.yaml (same YAML keys, wins per key). There is no user-global layer and no new userConfig option, so setup apply refuses layer=user, writes layer=local as YAML, and appends the docs/conventions/**/.local. ignore line. During the dual-read window, ~/.claude/source-control.md is still read as the lowest layer, and .claude/source-control.local.md is read as the personal override while the personal YAML is absent. Each run of parse-branch-issue.sh prints one 'old location' note per old file, naming the file, its new location and /source-control:setup apply. Setup check names each old file, and apply moves it: one preview and a single yes, then the keys are copied, the values are verified to match, and the old file is deleted. Design choices: the personal override is YAML rather than markdown because the team layer is YAML and the guardrails enforcement resolver already reads docs/conventions/source-control.local.yaml. The old personal file is read only while the new one is absent (file-level, as the issue's 'where no new-layer file supplies that layer' says, and as the testing plugin's migration does). The migration lives in the setup skill text rather than a retirements.yaml record, because a retirement record cannot name a ~/ path and a 'migrate' record reports FAIL for a file that is still read.

Not verified

  • parse-branch-issue.test.sh was not executed in this run: the lane runs only its named wrappers and check-changed-skills skips script tests (CHECK_SKILL_SKIP_SCRIPT_TESTS=1). Cases were traced by hand and by the review subagent; left to the PR's CI.
  • Tidy skipped: the change spans 30 files and two areas and touches lib/, over the tidy cutoffs (10 files, 300 lines, 1 area, no shared paths).
  • The old personal-override fixtures plugins/source-control/skills/commit/.claude/source-control.local.md and plugins/source-control/skills/setup/.claude/source-control.local.md are now unreferenced but sit under a protected .claude/ path the lane cannot change; delete them by hand.
  • docs/contracts/config-cascade/README.md still describes source-control's pre-0075 .claude/**/.local. ignore-line posture (ADR 0040) and its Implementers rows; not updated here. The issue leaves the canonical location list to the docs/config-locations pull request.
  • No retirements.yaml record declares the dual-read window: a kind: file record cannot name a ~/ path, and a migrate record reports FAIL in setup check for a file that is still read. The window is declared in config-resolution.md and moved by setup apply instead.
  • Two setup eval names (user-global-write-runs-no-repo-git-checks, apply-at-home-root-refuses-team-and-local-but-writes-user) no longer match their updated expectations, which now expect layer=user to be refused; not renamed.
  • convention-key.sh old-files lists a symlinked old personal file that physically is ~/.claude/source-control.md twice (the parser itself skips it); low impact, not fixed.
  • The personal YAML is read whether or not git ignores it (as the old .local.md was); the enforcement resolver reads it only while ignored. Setup check reports a tracked or unignored personal override as FAIL.
  • config-resolution.md keeps its 'The three layers' heading and a few 'three layers' / 'user-global layer' phrasings in the loop-key and policy-floor sections, to keep anchors stable; the old user-global file is still read during the window.
  • review-venue.txt was absent from the scratchpad, so the review ran locally in one fresh-context subagent.

Fix

  • plugins/source-control/skills/pull-request/scripts/parse-branch-issue.sh: layer list is now personal YAML, else old .claude/source-control.local.md, then tracked team YAML, then old ~/.claude/source-control.md; one 'old location' note per old file naming the file, the new location and…
  • plugins/source-control/skills/pull-request/scripts/parse-branch-issue.test.sh: added cases for new layers only, a personal YAML without the key, an invalid or rejected personal YAML, old personal file only (value applies, one note naming file, new location and setup), both personal files (YAML…
  • plugins/source-control/lib/convention-key.sh: convention_key_yaml_value/list take an optional repo-relative YAML path; new subcommands local-value, local-list and old-files (prints <old path><TAB><new location> per old file present).
  • lib/resolve-convention-pattern.sh: the drafting-inputs paragraph now names the personal override and the dual-read old locations instead of the two .claude paths, linking the commit-convention contract.
  • plugins/guardrails/hooks/resolve-convention-pattern.sh: regenerated by sync-shared-copies (identical to the lib/ source).
  • plugins/source-control/reference/config-resolution.md: The three layers section now lists team and personal YAML, states there is no user-global layer, and adds a dual-read window table; config-files, key-grammar, loop-key, worked-example, drafting-vs-enforcement and consumer .gitignore text…
  • plugins/source-control/skills/setup/SKILL.md: description and argument-hint drop layer=user; check reports old locations via convention-key.sh old-files as WARN, probes the docs/conventions/**/.local. ignore rule and the personal YAML; apply refuses layer=user and a home/non-repo root, and moves…
  • plugins/source-control/skills/setup/reference/apply-convention.md: target-layer table is team/local YAML; layer=local writes docs/conventions/source-control.local.yaml (markdown template removed); step 6 verifies the new path and ignore line; new section 'Move config off the old locations'…
  • plugins/source-control/skills/commit/SKILL.md: probes now cover the personal YAML and the old personal file, with an 'Old locations' paragraph; the ladder names the new layers.
  • plugins/source-control/skills/commit/reference/config-probes.md: probe rationale updated for probes 2 to 4 and the new personal path.
  • plugins/source-control/skills/pull-request/reference/create.md: pr_body_required_sections read names the personal YAML (local-list/local-value) and the old user-global file at a home root.
  • plugins/source-control/skills/babysit-loop/SKILL.md: loop-key cascade wording names team then the personal YAML, plus the old locations.
  • plugins/source-control/README.md: convention-resolution bullet names the new layers and the old paths still read with a warning.
  • plugins/source-control/skills/setup/evals/evals.json, plugins/source-control/skills/commit/evals/evals.json, plugins/source-control/skills/pull-request/evals/evals.json, plugins/source-control/skills/babysit-loop/evals/evals.json: expectations and fixture paths moved to…
  • plugins/source-control/skills/commit/evals/docs/conventions/source-control.local.yaml, plugins/source-control/skills/setup/evals/docs/conventions/source-control.local.yaml: new personal-override YAML fixtures the commit and setup eval cases name.
  • plugins/source-control/evals/setup-check-reports-team-layer-and-ignore-gap/ (prompt.md, scaffold.sh, samples/ignore-rule-fail.json, samples/no-shell-gitignore-write.json): ignore rule and sentinel moved to docs/conventions/**/.local.; scaffold header comment deleted.
  • plugins/source-control/evals/setup-writes-only-confirmed-change/ (prompt.md, scaffold.sh, graders/no-personal-override-written.md, samples/*.json): declined personal override is docs/conventions/source-control.local.yaml; scaffold writes the new ignore line; scaffold header comment deleted.
  • .changes/source-control/work-resolve-issue-issue-18000-44983079501-1-3e41146d.md: minor fragment describing the move, the dual-read warning and the setup migration.
  • .changes/guardrails/work-resolve-issue-issue-18000-44983079501-1-2c221d7b.md: bump none, comment-only change in the synced resolver copy.

Verification

The runner ran each check from the base copy against d0ee2ca:

  • scripts/check-changelog-fragments.sh --check: passed
  • scripts/check-changed-skills.sh --merge-base: passed

The run reports:

  • check-changelog-fragments: all 6 fragments valid (after adding the guardrails fragment it first reported missing)
  • check-changed-skills: 4 skills checked, 0 failed (warnings only: sizes and description length); fixed a dropped trigger phrase it first reported in the setup description
  • check-affected: 16 passed, 8 skipped, 0 failed over 30 changed files (earlier runs failed on shellcheck SC2143 in the test helper, the missing guardrails fragment, and comment-lint on new comment lines; all fixed)
  • sync-shared-copies: regenerated plugins/guardrails/hooks/resolve-convention-pattern.sh from lib/resolve-convention-pattern.sh (exit 0)
  • fresh-context review subagent over the whole diff: found a stale --explain test expectation, eval cases naming a missing personal-override fixture, and migration-text gaps (ignore rule before the write, single confirmation, stop on failed verification); all fixed
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/44983079501

Left out: the items under Not verified.

Related

#18000

Lane-Activity: work-resolve-issue/resolve-issue
@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/fix-ci

Run 44986495923, attempt 1

Field Value
Model rung 0
Leg handoff
Run job success
Activity step success
Commits pushed none (read lane)
Run 44986495923

Failed GitHub API calls

No failed call recorded by the run job's scripts.

@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/apply-patch

Run 44986495923, attempt 1

Field Value
Model rung 0
Leg base
Run job success
Activity step success
Commits pushed 8fb540c
Run 44986495923

Failed GitHub API calls

No failed call recorded by the run job's scripts.

@github-actions

github-actions Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

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

Security review: PR #18116, incremental from 1235e22 to e3a2710

I found no security issues in this push. This lane already reviewed an earlier head, so this review was blocking only: it reports CRITICAL and IMPORTANT findings and drops SUGGESTION ones. Only one file is on the incremental list, and I read its whole change.

What changed and what I checked

plugins/source-control/skills/setup/reference/apply-convention.md is the migration guidance for moving keys off ~/.claude/source-control.md and .claude/source-control.local.md. This push changes three things:

  • Resolving moved earlier. Each key is now resolved across the layers read today before the preview, not before the write. The guidance records each key's value and the layer that supplies it, and runs parse-branch-issue.sh --explain for branch_issue_pattern.
  • Narrower carry rule. A key is carried only when the old file is the layer that supplies its value. Every other key is shown with both values and not carried. That includes a key a higher layer supplies, and any key of an old personal override that goes unread because the personal YAML exists.
  • Rollback on a failed check. When the before/after check fails, the target is now restored to its content before the write, or removed if the move created it. The old file is kept.

On trust:

  • Nothing is widened. The change makes fewer keys eligible to move and adds a rollback. It removes no confirmation, preview or ignore-rule check.
  • Trust keys still bind only from the team layer. The two policy-floor loop keys (babysit_loop_trusted_internal_bot_logins and the babysit_loop_merge raise) bind only from the team-tracked layer, as checked in the earlier review. This push doesn't touch that code.
  • No outside actor reaches this path. The move still requires the operator's single confirmation. A team-file write still lands in a commit that goes through the repository's normal review and merge gates.

Instruction-surface lens. The edit rewords steps 1 and 3 of the move procedure. It removes no rule: "Without a yes, write nothing" is unchanged, and so are the ignore-rule precondition and "a failed verification stops the move". The protected-class register wasn't consulted; I judged the change by its consequences.

Other checks

  • No plugin manifest, workflow, token, kill-switch, trusted-actor or merge-hold file changed in this push.
  • The changed file matches no trusted-path glob.
  • The PR context holds no instructions aimed at this review.
  • The one prior lane post is a summary comment with 0 findings, so nothing needed repeating.

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: 4 inline finding(s) on 8fb540c8e3a5c78162a947e95b49bfe97cb91b8a; the summary is in this lane's pull request comment.

claude-lane: claude-review

@github-actions

github-actions Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

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

Code review (incremental, blocking only): PR #18116 at e3a271012a

I reviewed only the change since 1235e2206b. It touches one file, plugins/source-control/skills/setup/reference/apply-convention.md, in the "Move config off the old locations" section. This lane has already reviewed earlier heads, so this round reports blocking findings only. I found none.

The earlier blocking finding is now settled (thread on apply-convention.md:440, resolved at this head, lines unchanged since).

  • Step 1, before the preview: it resolves each key across the layers that are read today and records the layer that supplies it. A key is carried only when the old file is that layer. An old .claude/source-control.local.md that goes unread because the personal YAML exists has none of its keys carried; each is shown with both values. That covers the earlier example.
  • Step 3, on a mismatch: it restores the target to its content before the write, or removes the file if the move created it, before it stops.

A case I checked and cleared: step 3 no longer sets the old file aside when it resolves again. I asked whether a newly created team YAML could be untracked, and so skipped by the resolver (parse-branch-issue.sh:280-283). The re-check would then pass on the old file's value, and the old file would be deleted. It cannot: step 2 runs step 6's team verification, which stages the team file (apply-convention.md:287-335). A staged file is tracked, so the resolver reads it.

Closing issue #18000

  • "copies its keys into the new location, checks the new location resolves the same values, then deletes the old file": met in the skill text for both old files. No eval or test runs the move, so nothing would fail if it broke.

All verification in the PR body and the owner's replies is author-claimed; I did not verify it. The security lane runs on this repository, so I left security findings out. No text in the PR context, the threads or the prior-findings file tried to steer the review.

Spend: none.

Advisory and manifest lines (3)
  • Loosened checks would be marked: fail. That is the default, because the prompt has no loosened_check_verdict: or loosened_check_patterns: line; patterns: 0. The prompt also has no loosened_check_decision_record: line, so I did not check the citation requirement. This push changes skill prose only and loosens no check.
  • Paved paths: no paved-path row was found in earlier rounds, and this push changes no standards file.
  • No .claude-plugin/plugin.json or marketplace.json changed, so there are no manifest lines.

Verifier dropped 0 of 1 candidates. I dispatched no verifier subagents. I cleared the one candidate (the untracked team YAML in step 3) myself against step 6 of apply-convention.md at head, so it was never reported.

@melodic-automation-lanes

melodic-automation-lanes Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor Author

Unattended merge: native auto-merge leaves this pull request unarmed at head e3a271012a735d6fb0671edb77b45ad2290046a2. No person needs to act: a lane clears this reason, and the next scheduled run judges it again.

pr-merge's gate refuses its verifier verdict (verify:missing)

@github-actions

github-actions Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/address-feedback

Run 44996992141, attempt 1

Field Value
Model rung 0
Leg handoff
Run job success
Activity step success
Commits pushed none (read lane)
Run 44996992141

Failed GitHub API calls

No failed call recorded by the run job's scripts.

@github-actions

github-actions Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/publish-feedback

Run 44996992141, attempt 1

Field Value
Model rung 0
Leg base
Run job success
Activity step skipped
Commits pushed none recorded
Run 44996992141

Failed GitHub API calls

No failed call recorded by the run job's scripts.

…move

- setup apply moves ~/.claude/source-control.md to the team YAML by
  default, as #18000's mapping table says; the personal YAML is the
  operator's alternative. A key a layer above the old file already sets
  is shown and not carried, and step 3 compares each key's resolved
  value before and after the move, not only the per-file value.
- parse-branch-issue.test.sh strips old-location notes only in cases
  that set up an old file; every other case keeps the strict
  empty-stderr check. Test count unchanged (107).
- Rename two setup eval cases whose names contradicted their expected
  output: user-layer-refused-writes-nothing and
  apply-at-home-root-refuses-every-layer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RAoAtUnz4WHB5auUnwQYq7

@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 1235e2206b62bd90cdbbd5cba318a0842c8c8e86; the summary is in this lane's pull request comment.

claude-lane: claude-review

…ting

setup apply now resolves each key across the layers read today before
the preview, and carries a key only when the old file is the layer that
supplies its resolved value. An old .claude/source-control.local.md that
is not read, because the personal YAML exists, has every key shown and
none carried. A step 3 mismatch restores the target to its pre-write
content before stopping. Docs only; tests unchanged (107).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RAoAtUnz4WHB5auUnwQYq7
@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/apply-feedback-patch

Run 44996992141, attempt 1

Field Value
Model rung 0
Leg base
Run job success
Activity step skipped
Commits pushed none recorded
Run 44996992141

Failed GitHub API calls

No failed call recorded by the run job's scripts.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path is about to arm native auto-merge at head e3a271012a735d6fb0671edb77b45ad2290046a2, the head its arming checks judged. The arm fails if the head moves first.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Merge-Risk: max=HIGH demote=true head=e3a271012a735d6fb0671edb77b45ad2290046a2 rubric=10.7.0 rater=claude-opus-5-5 checker=claude-opus-5-5

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Nov 22, 2026
@kyle-sexton kyle-sexton added the do-not-merge Hard merge gate: do not merge while applied. label Nov 22, 2026
@kyle-sexton

Copy link
Copy Markdown
Member

Hold (PR lane session): the do-not-merge label is on while the PR lane checks whether this rating's Impact HIGH is a trust-boundary change (the merge lane's babysit_loop keys moving out of the protected .claude tree). It comes off once that check finds it covered; otherwise the owner decides.

@kyle-sexton

Copy link
Copy Markdown
Member

Hold lifted (PR lane session), R18 acceptance at e3a2710. Reversibility HIGH: the config migration moves and deletes ~/.claude/source-control.md and .claude/source-control.local.md only after a preview and a yes, carries only keys whose resolved value comes from the old file, and restores the target on any mismatch; it is #18000's spec. Impact (checker HIGH): moving the personal override out of .claude cannot widen what the merge lane may do, because config-resolution.md:502-513 makes babysit_loop_trusted_internal_bot_logins bind from the team-tracked layer only and lets a personal value only lower babysit_loop_merge; a raise from it is ignored and reported. No token, secret, account, cost, permission or trust-boundary change; the do-not-merge label comes off.

@kyle-sexton kyle-sexton removed the do-not-merge Hard merge gate: do not merge while applied. label Nov 22, 2026
Merged via the queue into main with commit fbce023 Nov 22, 2026
115 of 117 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-18000-44983079501-1 branch November 22, 2026 08:34
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit fbce0237cdf8e4db13864cc2a9d7d357468a8c3a; later checks count it verified from this comment.

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.

source-control: read config from the config-cascade layers, not ~/.claude

1 participant