Skip to content

perf(harness-ops): skip the marketplace re-clone in plugins sync when the remote commit is unchanged - #12559

Merged
kyle-sexton merged 2 commits into
mainfrom
work-resolve-issue/issue-12544-41546066526-1
Nov 3, 2026
Merged

kyle-sexton merged 2 commits into
mainfrom
work-resolve-issue/issue-12544-41546066526-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #12544

Summary

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

Step 1 of /harness-ops:plugins sync now runs git ls-remote origin <ref> in a git-backed marketplace's clone before claude plugin marketplace update (which re-clones on every call, 9.0 s of a 16.7 s first pass in the issue's baseline). It skips the CLI call only when the remote's ref (HEAD, or refs/heads/<ref> for a pinned ref) is the clone's HEAD. Several guards must also hold: a github/git source with no unknown source keys, a clone root at installLocation whose origin matches the recorded source, no modified or untracked file, and a pinned ref checked out as that branch. Any other case, including an unreachable remote or one asking for a credential, runs the refresh as before. I picked the skip over the issue's other option, an upstream request, because the skip is the one this lane can build and verify. The basis is the plugin commands reference, which says marketplace update moves a git source to the latest commit of its ref. The digest records a skip as refresh.skipped {head, ref} and the report adds a refresh skipped row.

Not verified

  • sync-run.test.sh was not executed here: this lane's Bash runs only the named wrappers. The new case is left to the PR's CI test suites.
  • Before-and-after wall clock against the digest timings.marketplace_update on a real fleet needs a host run with the claude CLI and a git-backed marketplace. The issue's parent asks for this measurement, and this lane cannot make it.
  • The docs do not say whether a marketplace update that lands the same commit does other work besides rewriting lastUpdated. The skip assumes the catalog files are the same at the same commit; sync.md states this assumption and how to force a refresh.
  • The github source kind's origin match (*\[/\]github.com\[/:\]<repo>, case-insensitive) has no test: a local fixture cannot give the clone a github.com origin that ls-remote can reach, because git remote get-url expands insteadOf. No test checks that refresh.skipped survives an `--only-
  • In tidy pass 5 (ai-slop), the deterministic detector (detect.sh) could not run under this lane's Bash allowlist. The rubric was applied by reading the new markdown lines and found no tells.
  • The issue's other option, an upstream request to Claude Code to skip the clone itself, was not filed: that is an outward action this lane does not take.

Fix

  • plugins/harness-ops/skills/plugins/scripts/sync-run.sh: new refresh_skip_check (ls-remote comparison with its guards). Step 1 calls it before the CLI refresh, and the marketplace_update timing includes the check. REFRESH_SKIP_JSON is reset per marketplace, persisted and restored across the `--
  • plugins/harness-ops/skills/plugins/scripts/render-report.jq: adds a refresh skipped: the clone is at <sha>, where origin <ref> points row under the marketplace header.
  • plugins/harness-ops/skills/plugins/scripts/sync-run.test.sh: new case with a real origin repository and clone. It covers the skip at the remote's commit (digest, journal, report row, timing), a pinned ref on the checked-out branch, and five cases that must run the refresh: a pin to another branch, a
  • plugins/harness-ops/skills/plugins/context/sync.md: Step 1 gains the paragraph on the skip, its guards, its doc basis and how to force a refresh. catalog_last_updated and the catalog regression check text now say what a skipped refresh means for them.
  • .changes/harness-ops/work-resolve-issue-issue-12544-41546066526-1-99cd5cad.md: patch changelog fragment for harness-ops.

Verification

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

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

The run reports:

  • read https: //code.claude.com/docs/en/plugins/cli-reference: plugin marketplace update 'Refresh one marketplace, or every marketplace, from its source to fetch new plugins and versions. A marketplace added with a branch or tag ref updates to the latest commit of that ref, not the repository's de
  • read https: //code.claude.com/docs/en/plugins/loading: known_marketplaces.json records source, installLocation, lastUpdated, autoUpdate. marketplaces/<name>/ holds the clone of a GitHub or other git marketplace. A namemarketplace install refreshes that marketplace before lookup u
  • read https: //code.claude.com/docs/en/plugin-marketplaces: marketplace authoring overview; nothing on refresh internals beyond pointing to the reference pages.
  • check-changelog-fragments: all 102 fragments valid (run before and after tidy and review fixes)
  • check-changed-skills: plugins/harness-ops/skills/plugins PASS, 0 errors, 4 warnings that already existed (description length, body length, token size, converge.md TOC); run three times, last after the final edits
  • check-affected: the first run failed shellcheck SC2178/SC2128 (a local named found clashed with a global array); renamed, and the last run passed 12 checks with 6 skipped (ruff, typos, three validate-plugins sub-checks and changed-skills that run checked-tree code)
  • fresh-context review subagent over the whole diff: no high or medium findings; 3 low findings confirmed and fixed (untracked files, unknown source pin keys, BatchMode overriding a user ssh command); the stale catalog-regression wording fixed; test gaps partly addressed
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/41546066526

Left out: the items under Not verified.

Related

#12544

Lane-Activity: work-resolve-issue/resolve-issue
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Unattended merge: native auto-merge leaves this pull request unarmed at head da400ae221044fdcc2ba6c9548292690b4580baa. The lanes clear this reason on their own; the next scheduled run judges it again.

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

@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

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

Security review (incremental): PR #12559, changes since da400ae

I found no security issues. This review covers the one file changed since the last round, plugins/harness-ops/skills/plugins/context/sync.md, and I read every hunk of its change.

What changed. The change edits only the prose in the "A refresh that would land the same commit is skipped" paragraph:

  • It opens with what Step 1 skips, then links the plugin commands reference.
  • It adds a recheck trigger: the docs section changes which commit a github or git source updates to, or a same-commit refresh is seen to change anything beyond the clone.
  • It restates the skip's basis as an assumption: the catalog files are the same at the same commit, and a refresh that moves nothing does no other work this skill depends on. This replaces the earlier sentence saying the docs are silent on that.

What I checked:

  • Instruction-surface lens. No rule is deleted, narrowed or softened. The guard list that controls the skip is unchanged: source keys, installLocation, the origin match, a clean git status, a pinned ref checked out as that branch, and the remote SHA equal to the clone's HEAD. So are the fail-closed cases and the way to force a refresh. The only new instruction is a recheck trigger, which adds a check and removes none.
  • Behaviour. The edit is prose only. sync-run.sh, render-report.jq and the test are unchanged since the last round, which found no issues in them.
  • Trusted paths and trust controls. The file matches no trusted-path glob. The change touches no trust control, merge hold, kill switch, token request or plugin manifest.
  • Embedded text. The PR context contains no directive aimed at this lane.

Spend: none.

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

claude-lane: claude-review

@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

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

Code review (incremental): PR #12559, e771abc1 since da400ae2

Scope. This round covers only the change since da400ae2, one hunk in plugins/harness-ops/skills/plugins/context/sync.md. I read all of it, then checked it against the head file and .claude/rules/skill-bodies-state-current-rules.md, which applies to this path. The other four files have not changed since the last review.

The last round's inline finding is fixed (discussion_r4449273924). The Step 1 skip paragraph at L445-465:

  • states the decision in our own words ("Step 1 skips the refresh … when git ls-remote shows the source's ref already at the clone's HEAD").
  • drops the claim that the CLI re-clones on every refresh, and the 9.0 s / 16.7 s timing figure.
  • no longer paraphrases what marketplace update moves a source to. It names the topic and points to the anchored reference section, read 2026-11-02.
  • adds a recheck trigger: the section changes which commit a github/git source updates to, or a same-commit refresh is seen to change anything beyond the clone.

That matches the record the rule asks for: pointer, as-of date and trigger. The new hunk has no new problems.

Finding (summary only, restated from the last round and still open at head). The Step 1 paragraph at sync.md#L471-L472 still says: "In sync, a backward move across the pre-refresh to pre boundary is this run's own refresh pulling a source that moved backward." When refresh.skipped is set, nothing was pulled.

The Run journal section of the same file now says otherwise at L303-L306: "in sync a skipped refresh (refresh.skipped set) pulls nothing, so a regression in that same first interval is the checkout changing under the run as well".

The report prints only the interval (Catalog regression: pre-refresh->pre). So a model that reads the Step 1 paragraph will blame the run's own refresh for a regression the run didn't cause.

Fix: add the same exception to L471-472, e.g. "…unless refresh.skipped is set, when nothing was pulled and the move is the catalog changing under the run, as in audit."

Not counted as findings:

  • No plugin manifest changed in this increment.
  • Nothing in the PR context or prior-findings file tells the review what to do.
  • There is no settled-threads file.
  • This is round 2 of 3, so the round cap did not apply.
  • I did not run sync-run.test.sh. The PR says its lane didn't run it either, so the new test case is unrun except by CI.

Lane-Activity: pr-unblock/address-feedback
Lane-Thread: PRRT_kwDOTCGFQM6y60FE
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

pr-unblock / address-feedback finished round 1 of max 4 on e771abc.

@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 3, 2026
Merged via the queue into main with commit bacba03 Nov 3, 2026
45 checks passed
@kyle-sexton
kyle-sexton deleted the work-resolve-issue/issue-12544-41546066526-1 branch November 3, 2026 00:35
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Post-merge mutation testing

Killed 4, survived 3, timeout 0, no coverage 0, invalid 0, not run 0.
Covered-code score 57%; mutation score 57%.

File Killed Survived Timeout No coverage Invalid Not run
plugins/harness-ops/skills/plugins/scripts/sync-run.sh 4 3 0 0 0 0

Surviving mutants

Location Operator Disposition Cause
plugins/harness-ops/skills/plugins/scripts/sync-run.sh:1739 SBR productive input-gap
plugins/harness-ops/skills/plugins/scripts/sync-run.sh:1594 SBR productive input-gap
plugins/harness-ops/skills/plugins/scripts/sync-run.sh:1731 SBR productive input-gap

The run's summary has the full report.

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.

perf\(harness-ops\): reduce plugins sync's remaining wall clock and digest size - part 4 of 4

1 participant