Skip to content

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

Closed

Description

@melodic-automation-lanes

Part 3 of 4 of #12539, split at intake (owner Q93). The done-when below is copied from #12539 as written.

Done when

  • Install record count. 771 of the 1,572 records point at paths that no longer exist, and installed_plugins.json is rewritten and read in full on each call. A sandbox update took 1.0 s per call on a 19 KB file and 2.0 s on a 696 KB one; load's share of that gap is UNVERIFIED. /source-control:worktree audit reports these and gives a gated reap, but nothing reaps the 90 local-scope ones.

Activity

  1. added
    needs-triage
    on Nov 2, 2026
  2. github-actions commented on Nov 2, 2026

    @github-actions
    Contributor

    Proposed work class: work-class: scoped
    Basis: automated intake triage; the lanes App applied this class.

    Size: Small
    Complexity: Low
    Uncertainty: Known
    Flags: intent
    Blocked by: none

    Decision recorded.
    Agent choice, not an owner answer.

    What counts as done (refinement questions 1 to 4): prune the dead-path install records, the local-scope ones included, through the existing gated reap, and report the per-call update time before and after. This is not an owner question: the intent (cut plugins sync's wall clock, part 3 of #12539) stays, and the choice changes no primary design and touches no secret, account or bill.

    [quote truncated; the full decision is at the link]

    #12543 (comment) is not the decision; the decision is kyle-sexton's comment: #12543 (comment)

    The decision settles the four open questions: prune dead-path records (local-scope included) via the existing gated reap, measure load vs rewrite before any format change, and target zero candidate orphan paths. It keeps the confirmation of each dead path with a person, so I've applied needs-human for that step. The rest is host-run work: the audit, the reap and the before/after timings.

    Automated triage, applied by the lanes App.

  3. added
    needs-owner-decision
    on Nov 2, 2026
  4. melodic-automation-lanes commented on Nov 2, 2026

    @melodic-automation-lanes
    ContributorAuthor

    The triage verdict left this issue at status: needs-decision:

    • flagged: intent
    • held by needs-human
    • no lanes App verdict comment shows whether an earlier verdict was flagged
  5. added and removed
    needs-triage
    on Nov 2, 2026
  6. melodic-automation-lanes commented on Nov 2, 2026

    @melodic-automation-lanes
    ContributorAuthor

    Refinement. A read-only run explored this repository, searched its issues and pull requests, and read the allowed docs to draft what follows. On an issue a listed human filed, it counts as the issue's spec once posted, while unedited; it is still model text, so check it.

    Intended outcome: Stale install records are pruned, including the 90 local-scope ones, with a measured per-call update time before and after, but the owner has not settled which of these is the done-when.

    Related work

    Open questions

    1. What counts as done: pruning the dead-path records, reaping the 90 local-scope ones, a measured per-call time drop, or some combination?
      RECOMMENDED: Prune the dead-path records and reap the 90 local-scope ones, then report the per-call update time before and after. Basis: plugins/source-control/skills/worktree/context/audit.md:21
    2. Reaping is a gated step in the audit that a person confirms (audit.md:118-134). May an unattended run reap records for paths it judges dead, or should this stay a human-run step with the issue limited to tooling changes?
      RECOMMENDED: Keep the live-path confirmation with a person. The unattended run adds a non-interactive, liveness-checked reap mode that can be tested against fixtures. Basis: plugins/source-control/skills/worktree/context/audit.md:118
    3. Should load's share of the 1.0 s vs 2.0 s gap be measured before any change to the file format or to how it is read?
      RECOMMENDED: Yes. Measure load against rewrite on the 19 KB and 696 KB files first, and change the format only if load dominates. Basis: judgment
    4. Do the done-when numbers (771 of 1,572 records dead, 90 local-scope) come from a particular machine? If so, what is the target count or time to reach?
      RECOMMENDED: Treat them as one machine's snapshot. Use acceptance of zero candidate-orphan paths in the audit, not fixed counts. Basis: plugins/source-control/skills/worktree/context/audit.md:21

    Sources read

    • plugins/source-control/skills/worktree/context/audit.md:21: the audit reports orphaned project- and local-scope install records, with the target of zero paths in the candidate-orphan bucket.
    • plugins/source-control/skills/worktree/context/audit.md:25-33: cleanup reaps records only for teardowns it performs, and nothing else reaps a record whose path is gone.
    • plugins/source-control/skills/worktree/context/audit.md:118-134: reaping is gated on confirmed paths and uses scripts/reap-orphaned-plugin-records.sh.
    • plugins/source-control/scripts/reap-project-plugin-records.sh: the existing per-worktree reap script.

    To answer, post a comment that starts with this line:

    **Decision recorded.** <answer>
    

    Automated refinement by the lanes App. Answer with a comment whose first line is **Decision recorded.**.

  7. added
    host-run
    on Nov 4, 2026
  8. kyle-sexton commented on Nov 4, 2026

    @kyle-sexton
    Member

    Decision recorded.
    Agent choice, not an owner answer.

    What counts as done (refinement questions 1 to 4): prune the dead-path install records, the local-scope ones included, through the existing gated reap, and report the per-call update time before and after. This is not an owner question: the intent (cut plugins sync's wall clock, part 3 of #12539) stays, and the choice changes no primary design and touches no secret, account or bill.

    The tooling is already on origin/main. plugins/source-control/scripts/reap-project-plugin-records.sh enumerates and removes records whose scope is project or local (:2, :226), and reap-orphaned-plugin-records.sh runs it for each path "a person individually confirmed as dead" (:2-3), because a live repository on an unmounted share looks the same as a dead worktree to an existence check (plugins/source-control/skills/worktree/context/audit.md:35-37). The body's "nothing reaps the 90 local-scope ones" is therefore a run that has not happened, not a missing tool. The person gate stays (refinement question 2); no unattended reap mode is added. The counts in the body are one machine's snapshot (question 4), so the target is the audit's own: zero paths in candidate orphan (audit.md:21). Load's share of the 1.0 s vs 2.0 s gap is measured before any change to the file format (question 3).

    Every remaining item runs on the machine that holds the records, so this issue goes to the host queue (host-run), builder Automation Lanes.

  9. added
    needs-triage
    needs-human
    and removed
    needs-owner-decision
    needs-triage
    on Nov 4, 2026
  10. added
    needs-owner-decision
    on Nov 4, 2026
  11. added
    status: confirmed
    and removed
    needs-owner-decision
    needs-human
    on Nov 5, 2026
  12. self-assigned this
    on Nov 5, 2026
  13. kyle-sexton commented on Nov 5, 2026

    @kyle-sexton
    Member
    No description provided.
  14. kyle-sexton commented on Nov 5, 2026

    @kyle-sexton
    Member

    Install record count: local-scope records reaped and measured.

    What ran: the owner confirmed the list on 2026-11-05 and ran reap-orphaned-plugin-records.sh on 82 paths under the worktree root (git config worktreeroot.path). It printed ok: 82 path(s) reaped and exited 0. Every one of those paths was absent on disk and held one local-scope record. This finishes what the 2026-11-04 project-scope reap left (#12539 comment).

    Registry Before After
    installed_plugins.json 199,532 B 163,565 B
    Records (user / project / local) 463 (126 / 227 / 110) 381 (126 / 227 / 28)
    Audit candidate orphan paths 82 0

    Audit after the reap (/source-control:worktree audit Step 2b classification): 24 live-here paths (225 records), 2 live-elsewhere (2), 0 candidate orphans, 2 other-project paths (28 records).

    Left in place: 28 records (local and project) on two absent Claude Code native worktrees under the main checkout's .claude/worktrees/. They are outside the worktree root, so audit Step 2b reports them for information only and offers no remedy (plugins/source-control/skills/worktree/context/audit.md:65). A directory recreated there would also sit inside the main checkout's work tree, where the reap helper's main-tree refusal does not apply.

    Measurement. Sandbox CLAUDE_CONFIG_DIR with a local marketplace, the #6309 method. strace confirmed every write stayed in the sandbox. Claude Code 2.1.318, hyperfine with 9 runs per cell over two passes, 1-minute load average 1 to 4.

    The fixtures were:

    • S: 465 B.
    • M: a copy of the real registry, before and after the reap.
    • L: 724 KB, held constant as a control.

    The calls timed were update on a current plugin, which reads the registry 4 times and writes it 0 times, and a real update from 0.9.0 to 1.0.0, which reads it 7 times and writes it once (temp file, then rename).

    Wall ms, median Before M (232 KB) After M (191 KB)
    no-op update, same session 377 395
    real update, same session 389 388
    registry rewrite window (strace) 5.4 to 6.4 5.0 to 6.6
    • At this size the reap makes no difference per call that can be measured: the gap is inside a 90 to 120 ms spread.
    • Across sessions every cell got faster, the controls included (real update on S fell about 130 ms with the same file), so the host changed between sessions and that drop does not come from the reap.
    • How much a call costs depends little on registry size: about 0.1 s more at 724 KB than at 0.5 KB, and under 30 ms of that is the rewrite. The rest is reading and parsing.
    • The 1.0 s vs 2.0 s per-call gap reported in perf(harness-ops): reduce plugins sync's remaining wall clock and digest size #12539 does not reproduce. Every call took 0.33 to 0.51 s. Neither issue records how those figures were taken, so the cause of the gap is UNVERIFIED (host load, which perf(harness-ops): reduce plugins sync's remaining wall clock and digest size #12539 puts at about 20, another host, or another CLI version).

    Done when (from the 2026-11-04 decision comment)

    • /source-control:worktree audit ran on a fleet host. Each dead path was confirmed by a person, the owner, who reaped them through reap-orphaned-plugin-records.sh, local-scope records included: ok: 82 path(s) reaped, exit 0.
    • Per-call update time was measured before and after the reap, with load's share of the gap separated from the rewrite's. Load and parse cost about 0.1 s at 724 KB versus 0.5 KB, and the rewrite under 30 ms (strace). The 19 KB and 696 KB files no longer exist on this host, so a 465 B fixture and a synthetic 724 KB fixture stood in for them, beside the real registry before and after.
    • The audit on that host now reports 0 paths in candidate orphan.

    Closing as done. The 28 records on the two .claude/worktrees/ paths fall outside this issue's audit remedy.

  15. removed
    status: confirmed
    host-run
    on Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Fields

Work status

confirmed

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions