fix(work-items): resolve consumer-local gh-bot.sh wrapper independent of adapter location#826
Conversation
… of adapter location
The GitHub adapter's WIT_GH_BOT resolved the bot wrapper relative to the
adapter's own directory, so a consuming repo's wrapper at
${CLAUDE_PROJECT_DIR}/tools/github-auth/gh-bot.sh — the override path
CONTRACT.md already documented — was never found, and tracker writes silently
fell back to the ambient gh (session-user) identity.
wit_gh_resolve_bot_wrapper now checks the consumer-local path first, falling
back to the plugin-bundled path, mirroring the adapter's own
consumer-local-first/plugin-bundled-fallback resolution.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K1V3gkrfSf75isB8MiDy3o
|
Claude finished @kyle-sexton's task in 1m 53s —— View job PR Review — fix(work-items): consumer-local gh-bot.sh wrapper resolution
Assessment: ApproveThe fix is correct, minimal, and architecturally consistent. The bug (adapater-relative-only resolution of common.sh —
|
|
Claude finished @kyle-sexton's task in 2m 20s —— View job Security Review
|
|
Post-green review classification (babysit lane): Both automated PR reviews returned Approve / Good to merge with no blocking findings. Both automated security-review runs raised one identical Low-confidence defense-in-depth item, classified below.
No blocking or defer-forbidden item applies. No inline review threads exist on this PR (GraphQL query returned empty) — nothing to resolve. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Claude finished @kyle-sexton's task in 1m 55s —— View job Security Review
FindingsSUGGESTION —
|
|
Claude finished @kyle-sexton's task in 1m 33s —— View job PR Review — fix(work-items): consumer-local gh-bot.sh wrapper resolution
Assessment: ApproveThis is a clean, targeted bug fix. The root cause (adapter-relative-only
|
…de-ops, work-items Re-checked open PRs touching these plugins' plugin.json right before the version-bump collision protocol requires it: source-control carries #839 (0.15.8) and #840 (0.15.9), claude-ops carries #844 (0.17.2), work-items carries #826 (0.18.2) — all still open. Bumps this PR's claims one past each plugin's current highest open-PR claim (source-control 0.15.10, claude-ops 0.17.3, work-items 0.18.3) so this PR does not collide at merge time regardless of which sibling lands first. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1V3gkrfSf75isB8MiDy3o
|
Tower merge-sit: merge-drive lane dark ~5.5h (rate-limit hold since ~10:36Z); tower sitting merges per stall protocol. Gate-verified live: CLEAN, 0 unresolved threads. This was generated by AI (control tower, session 6). |
Resolves conflicts on source-control and work-items plugin.json/CHANGELOG.md: main advanced source-control to 0.15.8 (#839, merged) and work-items to 0.18.2 (#826, merged) since this branch was last rebased. Also re-checked live open PRs at merge time and found work-items now carries a new open claim, #857 at 0.19.0 (Jira adapter) — re-bumped this branch's work-items claim from 0.18.3 to 0.19.1 to stay ahead of it. source-control's 0.15.10 and claude-ops's 0.17.3 remain valid (still one past #840/#860's 0.15.9 and #844/#860's 0.17.2 open claims, respectively). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1V3gkrfSf75isB8MiDy3o

Summary
WIT_GH_BOTresolved the bot wrapper relative to the adapter's own directory (${CLAUDE_PLUGIN_ROOT}/tools/github-auth/gh-bot.shin the normal bundled path), never checking the consumer-local override path CONTRACT.md already documented (${CLAUDE_PROJECT_DIR}/tools/github-auth/gh-bot.sh).gh(session-user) identity instead of bot attribution.Fix
common.sh: extractedwit_gh_resolve_bot_wrapper, which now resolves the bot wrapper consumer-local-first, plugin-bundled fallback — checking${CLAUDE_PROJECT_DIR}/tools/github-auth/gh-bot.shfirst (independent of where the adapter itself resolved from, so a shadowed consumer-local adapter still finds the consumer's wrapper), then falling back to the bundled path beside the seam tree. This mirrors the existing two-rule adapter resolution documented in CONTRACT.md's "Adapter resolution" section.CONTRACT.md: updated the "Identity routing (GitHub adapter)" section to document the corrected consumer-local-first/plugin-bundled-fallback resolution order (previously it documented the buggy adapter-relative-only behavior).common.test.sh: added regression coverage forwit_gh_resolve_bot_wrapper— resolves the consumer-local wrapper when present, falls back to the bundled path when the consumer has none, and falls back whenCLAUDE_PROJECT_DIRis unset.Verification
Full adapter + dispatcher test suite run, all green:
All other
adapters/github/*.test.shfiles andwork-item-tracker.test.sh(including its own consumer-local/adapter-resolution cases) also pass unchanged.shellcheckon both modified shell files: no findings.Closes #365
Related