Skip to content

fix(source-control): move the babysit wrappers out of the top-level bin/ - #5882

Merged
kyle-sexton merged 3 commits into
mainfrom
fix/5850-source-control-bin-relocate
Oct 2, 2026
Merged

kyle-sexton merged 3 commits into
mainfrom
fix/5850-source-control-bin-relocate

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

Closes #5850

Summary

claude.ai organization plugin sync rejects a plugin with a top-level bin/, and source-control had one holding its two babysit wrappers. The wrappers now live under scripts/ with the same names, and a CI gate keeps any plugin from adding a top-level bin/ again. Part of #5835.

Fix

  • Moved source-control-babysit-merge and source-control-babysit-resolve-thread from plugins/source-control/bin/ to plugins/source-control/scripts/. Both are still executable (mode 100755); they locate the engine through ../skills/babysit-prs/scripts, which is unchanged for a file in scripts/.
  • Repointed every reference: the babysit-prs skill and its references (safety.md, orchestration.md, independent-resolution.md), the setup skill's canary, the guard-contract generator and its regenerated guard-contract.md, and the shell and Python tests.
  • Rewrote the wrapper header comments and the safety.md section on bare names. The wrappers had no dependable bare name before (PATH delivery is unreliable), so no allow rule stops matching.
  • Added a third check to scripts/check-plugin-manifest-presence.sh: any plugins/*/bin with content fails. An empty bin/ passes because git tracks no empty directory. The existing CI step already runs this script, so no new step was added; only its name changed. Test cases added to check-plugin-manifest-presence.test.sh.
  • Updated docs/plugin-philosophy.md (the bin/ stance is now Decline) and docs/migration-playbook.md.
  • Bumped source-control to 0.73.0 with a CHANGELOG entry.

Verification

  • plugins/source-control/skills/babysit-prs/scripts Python suite: 782 tests, OK (includes test_guards.py, which checks the regenerated contract is not stale, and test_skill_contract.py).
  • 19 source-control shell suites, including babysit-wrapper-help.test.sh, babysit-readiness-gate.test.sh, and engine.test.sh: all passed (3 optional skips, unrelated: Windows-only paths, zip missing).
  • scripts/check-plugin-manifest-presence.test.sh: 14 passed; the gate is green on this tree and reports TOP-LEVEL BIN DIRECTORY on a populated fixture bin/.
  • check-changelog-parity.sh --check and --check-bump origin/main, check-shell-portability.sh origin/main, check-skill-portability.sh origin/main, check-spoke-plugin-root.sh, validate-plugins.sh, shellcheck, shfmt, markdownlint-cli2: clean.
  • check-script-contract.test.sh: 46 passed, 2 failed (check-html-assets.sh, htmlhint not installed in this worktree); the same 2 fail without this change.
  • The full affected-tests.sh --run selection (337 suites) was not run to completion locally; CI runs it on ready.

Related

🤖 Generated with Claude Code

kyle-sexton and others added 3 commits October 2, 2026 13:27
claude.ai organization plugin sync rejects a plugin with a top-level bin/.
Move source-control-babysit-merge and source-control-babysit-resolve-thread to
scripts/ under the same names and repoint every reference (skills, references,
tests, the guard contract). Fail the plugin-manifest-presence gate when any
plugin has a populated top-level bin/. Bump source-control to 0.73.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The wrappers now live under scripts/, so the org-sync bin/ constraint has no exception.

Refs #5850

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kyle-sexton
kyle-sexton marked this pull request as ready for review October 2, 2026 17:50
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 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-10-02T17:55:11.125689Z 7ce5fa4 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.

@claude

claude Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 3m 43s —— View job


Code review complete

  • Gather context (PR body, diff, changed files)
  • Understand request (CI code-review lane via /review:code-review)
  • Review changed files for correctness/maintainability
  • Post findings

Scope: reviewed the full diff (origin/main...HEAD, 24 files) against this lane's correctness/maintainability criteria. Security is out of scope here (handled by the separate security lane).

Findings: none that clear the high-signal bar.

What I checked in particular, since this PR is mostly a mechanical path rename plus one new gate:

  • The new NO BIN check in scripts/check-plugin-manifest-presence.sh: traced the -d/-L/-e branching by hand for a populated dir, an empty dir, a symlink, and a plain file named bin — each resolves to the stated behavior (empty passes, populated/symlink/file-named-bin fail). Test fixture in check-plugin-manifest-presence.test.sh (case 6e) exercises the populated/empty/nested-bin cases and matches.
  • Every live reference to the old plugins/source-control/bin/... path (skills, safety.md, orchestration.md, independent-resolution.md, setup/SKILL.md, the guard-contract generator (guard_contract.py) and its regenerated guard-contract.md, test_guards.py, test_skill_contract.py, the shell wrappers and their tests) is repointed to scripts/... consistently — grepped the whole plugins/source-control tree for any remaining bin/ wrapper reference and found only one, in CHANGELOG.md:5347, which is a dated historical entry describing a past state (#787) and is correctly left unchanged (the regenerated guard-contract's WRAPPER_COMMAND regex now matches only scripts/..., so that historical line isn't validated against — intentional, not a drift risk).
  • source-control-babysit-merge's --allow-unpinned-head prefix/=value filtering logic is unchanged content-wise (only header comments were trimmed in the move); re-derived the bash stem/pattern-match logic by hand against several inputs (--a, --allo, --ally, --allow-unpinned-head=true) and it refuses exactly the intended family.
  • Executable bits preserved on both relocated wrappers (100755 in the git index), and the old bin/ directory is fully gone from the tree.
  • Doc/table edits (plugin-philosophy.md, migration-playbook.md, CHANGELOG.md, plugin.json version bump) are consistent with the code change and with each other.

Note: I could not execute the shell/Python test suites in this environment (the Bash tool here is restricted to read-only inspection — bash <script> invocations were denied), so the author's test-run claims in the PR description are author-reported and unverified by me; my review above is from static reading of the diff, not from re-running the suites.

@claude

claude Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 1m 48s —— View job


Security review: no issues found

  • Gather context (PR diff, changed files)
  • Skip-gate check
  • Review shell scripts (wrappers, manifest-presence gate) for injection/trust issues
  • Review instruction-surface changes (safety.md, SKILL.md, guard-contract.md) for weakened guardrails
  • Review CI workflow change
  • Post findings

This PR relocates the two babysit-prs mutation wrappers (source-control-babysit-merge,
source-control-babysit-resolve-thread) from plugins/source-control/bin/ to
plugins/source-control/scripts/, repoints every reference to them, and adds a new CI gate
(scripts/check-plugin-manifest-presence.sh) that fails on any plugin carrying a top-level bin/.
I reviewed every changed file in the diff (git diff origin/main...HEAD) for logic, trust-boundary,
and guardrail-weakening issues. No security findings.

Specifics checked:

  • --allow-unpinned-head refusal in the merge wrapper
    (scripts/source-control-babysit-merge):
    confirmed byte-for-byte identical to the prior bin/ version via git diff -M (rename
    similarity 78%, only the header comment changed). The prefix/abbreviation/=value refusal logic
    that stops an unattended invocation from merging an unvetted head is unchanged.
  • New top-level bin/ gate
    (scripts/check-plugin-manifest-presence.sh):
    a symlinked bin/ (dangling or not) falls through to the failure branch in both the -d/!-L
    and the !-e/!-L arms, so a symlink can't be used to dodge the check. Test coverage
    (check-plugin-manifest-presence.test.sh) exercises empty, populated, and nested-bin/ cases.
  • Instruction-surface edits (safety.md, SKILL.md, guard-contract.md, setup/SKILL.md,
    orchestration.md, independent-resolution.md, plugin-philosophy.md,
    migration-playbook.md): all are mechanical bin/ → scripts/ path updates to prose and
    generated contract rows. None removes or narrows an enforced rule — the plugin-philosophy.md
    stance for bin/ actually tightens (Adopt on need → Decline), and the guard-contract
    generator/tests (guard_contract.py, test_guards.py) still assert the wrapper-level refusal
    rows end-to-end.
  • CI workflow change (.github/workflows/ci.yml): only the step display name changed; the
    underlying script invocation (scripts/check-plugin-manifest-presence.sh) and permissions are
    untouched, so no Actions-hardening concern.

No CRITICAL, IMPORTANT, or SUGGESTION findings.

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: top-level bin/ blocks claude.ai organization plugin sync

1 participant