← Back to Pull requests

feat(lanes): add resync.sh for a one-command full resync #445

Open
unknown opened this pull request with 464 lines diff across 5 files
View on GitHub
unknown unknown commented on Nov 25, 2026 13:52 UTC
Author

Closes #444

Summary

A full resync from claude-code-plugins becomes one command for the session that runs it:
scripts/lanes/resync.sh [<sha>] --repo <claude-code-plugins clone> stages the copy, runs
check-sync.sh, and prints the condition 2 evidence for the CLAUDE.md rule "Merging a full resync
from claude-code-plugins". Committing, pushing, opening the PR and merging stay with the session.

Fix

  • scripts/lanes/sync-lists.sh (new): the SYNCED, LEFT_OUT, ADAPTED and PINNED lists, moved

  • verbatim out of check-sync.sh. check-sync.sh and resync.sh both source it; neither keeps a
    copy.
  • scripts/lanes/resync.sh (new): takes a ref (default origin/main of the --repo clone, fetched

  • first; without --repo it fetches from GitHub like check-sync.sh). It removes files tracked here
    under a SYNCED path that the ref lacks, checks the ref's blobs out through a throwaway index with
    no gitattributes applied (so upstream's .cmd eol=crlf rule cannot rewrite a byte), stages
    them, and stages each file's git mode from the ref whatever core.fileMode says. LEFT_OUT,
    ADAPTED and PINNED paths are left alone. It then runs check-sync.sh: exit 1 on any difference
    beyond a PINNED file, exit 0 with a paste-ready evidence block otherwise. The evidence prints the
    clone as <claude-code-plugins clone>, never a local path.
  • scripts/lanes/resync.test.sh (new): fixture test in the style of the .test.sh tests under

  • .github/scripts/merge-base/. The scripts/lanes checks have no tests of their own to follow.
  • CLAUDE.md: the rule says to produce the change with resync.sh and paste its evidence. The three

  • conditions are unchanged, and lines 3-4 (test-fixture text) are untouched.

    None of the changed files is on the SYNCED list.

    Loosened checks

    None.

    Verification

  • scripts/lanes/resync.test.sh: 29 checks pass. They cover an older ref restoring a file, the

  • default ref removing it again, byte-for-byte content with no eol conversion, the executable bit
    staged under core.fileMode=false, ADAPTED, PINNED and LEFT_OUT left alone, nothing committed,
    check-sync.sh passing on its own, a PINNED-only difference passing with that verdict, a planted
    difference (a clean filter rewriting a synced file) failing with exit 1 and no evidence, and bad
    usage exiting 2.
  • Mutation check: with --attr-source removed and --chmod=+x flipped, the eol, mode and

  • check-sync checks fail.
  • shellcheck on all four scripts with the repository's .shellcheckrc: clean. The lefthook

  • pre-commit hooks pass.
  • Trial on a throwaway worktree against claude-code-plugins

  • ef5971b:
    it wrote 4074 files (300 changed against this branch) and printed:

      check-sync: .github/standards/dependabot-policy/policy.json differs from add8219a557d432d9f4dbd1cac98b0e8a2114b10 (100644 f7e159415901d0392b884737fb78de6d1b7ad37a, want 100644 a3fa7c3b4cc59b94d6acbfda713c836881aa3652)
      

    That is the same PINNED-only result as #440. The run took 61 s, almost all of it in
    check-sync.sh, which starts about three git processes per file.

    Related

  • Owner decision: melodic-software/architecture docs/owner-decisions.md row Q301

  • and row Q302,
    which amends it: keep the session-run resync flow with no lane automation and no new permissions.
  • Earlier hand-run resyncs: #430, #440.
  • 🤖 Generated with Claude Code

    Diff: 464 lines (+348 / -116) across 5 files Reviewer: github-actions[bot] Review duration: 5m
    All Vouch review confidence checks passed
    Residual risk 0.36 = Change Risk (0.51) × (1 − Review Confidence (0.28)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.51 · 464 lines diff across 5 files
    0.51
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 44% · Reviewer familiarity: 35%
    28%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.367
    Shallow Review Depth shallow_review_depth
    0.344
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #445"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: medium confidence: 28.2% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 50.6% (MEDIUM) · Higher = larger blast radius
    50.6%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 28.2% · Lower = rushed or shallow review
    28.2%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 36.3% · Moderate risk
    36.3%