Repository navigation
improve: reduce repeated receipt copies during plugin catalog refresh - #206464
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Codex review: passed. What this changesThis PR groups native plugin receipts by visible plugin root once instead of scanning all receipts separately for every plugin. Example: A catalog refresh prepares an inventory containing 40 plugins and 40 native receipts.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR provides a focused allocation improvement still absent from main, with no actionable correctness or security findings. Reviewed head: Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe native admission owner overlays cached receipts onto plugin metadata before the model catalog owner constructs worker input, preserving published metadata and passing matching receipts to the worker. flowchart TD
A[Plugin metadata inventory] --> D[Native receipt overlay]
B[Admission cache receipts] --> D
D --> E[Catalog worker input]
E --> F[Model catalog worker]
F --> G[Published model catalog]
Technical reviewBest possible solution: Retain the single-pass overlay in the existing admission owner while preserving receipt keys, precedence, references, and inventory scope. Do we have a high-confidence way to reproduce the issue? Current main visibly copies and filters the complete receipt map for every inventory row, and the author reports a matching red/green traversal regression; no target code was executed during this read-only review. Is this the best way to solve the issue? The local grouping pass removes repeated work at its existing owner without adding a persistent cache, parallel API, or changed admission policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against af91b89f6524. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +17, Tests +57. Total +74 across 2 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 27, 2026, 2:19 AM ET / 07:19 UTC. |
|
I checked the failed dependency job requested in review. Its unused exports are in Nextcloud Talk webhook state and subagent delivery. This PR changes only the native receipt overlay and its regression test. The subagent warnings also appeared on main and were repaired in #206429. The two Nextcloud exports came from #203172 and have a separate repair in #206470. The draft dependency check remains failed. Draft job · Main job · Ready-head CI. |
|
Merged via squash.
|
…restoration-ci-189390-20261127 * commit '6feeb50a3f14fbf0aa5167d342f186dc4d67fc18': (9846 commits) fix: stop 2026-11-17 main Git checkouts from half-switching on a schema update (#206341) refactor(codex): centralize native completion delivery (#206447) fix(subagents): finish claimed stops after session rotation (#206405) fix: let owners fork a chat with exec after a subagent or exec completion (#206483) test(cli): gate agent --local cold-start processes and workers (#206466) perf(ci): skip baseline inventory when line-cap debt is empty (#189909) refactor(test): share core process-result fixtures (#174149) refactor(ci): reuse canonical budget flag parsing (#189480) fix: recover Codex chats after oversized requests (#206475) fix(agents): skip the bootstrap ritual in one-shot runs (#206477) fix(test): preserve stack coordinates in redacted failure reports (#152384) fix(gateway): return consistent unavailable response guidance (#191933) fix: preserve emphasis in Markdown table row labels (#205349) fix(nextcloud-talk): keep webhook spool helpers private (#206470) perf(plugins): overlay native receipts once per visible root (#206464) fix: keep GitHub comment approvals alive and skip repeat approval on the session PR (#206129) perf(config): retain one snapshot for unchanged validation results (#206465) refactor(test): reuse canonical secret fixture cleanup (#189492) refactor(subagents): own descendant Stop cancellation (#206444) refactor(subagents): keep announce cleanup action type private (#206407) ...
What Problem This Solves
Preparing a model catalog worker copies published native plugin receipts into the requested plugin inventory. When any receipts exist, the Gateway currently copies the entire receipt map into an array and filters it again for every plugin. An inventory with 40 plugins and 40 receipts visits 1,600 entries during one overlay.
User Impact
Catalog refreshes that carry native plugin receipts can use less temporary allocation. JavaScript-only inventories with no receipts retain the existing fast path. Operators need no configuration change.
Why This Change Was Made
Index the resolved roots visible to this inventory, then scan the current receipt map once. Matching uses the first NUL in the producer’s key and preserves the full key and receipt object. Records for the same root keep separate admission dictionaries. Unmatched rows keep their identity. The index is rebuilt for each overlay so mutable inputs and narrower registry views are respected.
Evidence
Signed
60fb69f7306don7d461e504914. Focused formatter, whitespace checks and exact-range local review passed. The regression covers receipt order and overrides, mutable roots and receipts, duplicate roots, a filtered inventory, malformed keys, and row identity.In an isolated Node 24.22.1 comparison of the two overlay functions with a fixed view lookup, serialized outputs matched across all five shapes. Ten alternating batches per shape gave these median microseconds per call.
The 187-plugin case uses the number of manifests in this revision. The 40/40 shape matches the repository’s synthetic catalog fingerprint benchmark. These timings describe the isolated join. The one-plugin/one-receipt case took 0.19 µs longer.
The repository's complete worker-input benchmark builds the real catalog worker input and fingerprints it. On macOS arm64, Node 26.7.0, two counterbalanced runs per arm each measured 2,000 calls after 200 warmups. CPU and allocation used separate processes. The allocation pass sampled newly allocated bytes, including collected objects, at a 4 KiB interval.
All 16 processes produced the same complete fingerprint for each cardinality. The 40/40 test uses synthetic receipts with empty native-artifact inventories. Gateway process RSS was outside this measurement.
Three focused suites passed all five tests, including persisted native companion recovery. With just the new regression on stock, the expected one receipt-map traversal failed with three. The candidate passed the same assertion. Production +28/−11 lines, tests +59/−2.
Related to #192547.