Repository navigation
perf(kits): reuse pinned fetches within one invocation - #631
Conversation
Materialize independent kit directories from verified Git objects and clean\ninvocation-owned sources through a foreground-safe lifecycle guardian.\n\nRefs: #586\n\nCo-authored-by: OpenCode [gpt-6-astra] <[email protected]>
Host measurement updateHuman-run host measurement completed from an isolated checkout of this PR at Observed result
Comparison boundaryThe prior trace used to motivate this PR observed eight remote fetches totaling 11.81 seconds. That run used a different Quickstart/Patterns revision and host configuration state. This PR run proves the fetch-count reduction from eight to one in the normal flow; it does not independently prove an exact wall-clock saving. The one observed remote fetch took roughly two wall-clock seconds based on terminal timestamps, but that is not a controlled comparison. No credential values were displayed or recorded. AI-assisted measurement analysis by OpenCode; the human executed the host command. |
wz-gsa
left a comment
There was a problem hiding this comment.
Adversarial fixed-head static review of be830b95f1b0bfacead75f339bab51e261626a4c: reuse is limited to full immutable commit refs within an invocation-local private root; the fetched HEAD is checked before marking it verified, and consumer payloads are materialized from committed objects into independent directories. I inspected the lifecycle guardian, signal/exec cleanup, credential-URL rejection, fallback fetch path, and the real-Git/PTY/signal offline fixtures. No blocker found. All three required current-head checks pass. This is not a claim of measured live MSB speedup or authenticated-transport verification; those remain tracked under #586. No reviewed-repository code was executed on the host. AI-assisted static review (OpenCode); approval does not authorize merge.
🤖 I have created a release *beep* *boop* --- ## [4.2.0](v4.1.1...v4.2.0) (2026-11-05) ### Features * **acq:** project provider inputs read-only ([#608](#608)) ([bd11c77](bd11c77)) * **sbx:** trust host state for built-in kit heal; add MSB forged-marker and legacy-sandbox coverage ([#637](#637)) ([ef24965](ef24965)) * **scripts:** add summarize-bats-timing for bats TAP timings ([#652](#652)) ([5bf9398](5bf9398)) ### Bug Fixes * **agents:** move the default OpenCode image to devenv-shell 2.1.0 ([#668](#668)) ([dbd8a76](dbd8a76)) * **common:** canonicalize macOS /var,/tmp,/etc aliases before O_NOFOLLOW traversal ([#622](#622)) ([1135fcc](1135fcc)) * **install:** package provider validator runtime ([#619](#619)) ([5192fa1](5192fa1)) * **msb:** distinguish denied probe writes from writable mounts ([#670](#670)) ([049931c](049931c)) * **msb:** strip CR from jq output in acq ports (Windows) ([#663](#663)) ([7ad6e56](7ad6e56)) * **release:** use supported macOS wheelhouse runners ([#674](#674)) ([9dbc9aa](9dbc9aa)) ### Performance Improvements * **acq:** stop the kit-fetch guardian tick from delaying exit ([#664](#664)) ([fe686ea](fe686ea)) * **kits:** reuse pinned fetches within one invocation ([#631](#631)) ([b433a61](b433a61)) * **msb:** reduce foreground node kit invocation latency ([#616](#616)) ([ec73abd](ec73abd)) * **test:** eliminate redundant bats fetches and waits ([#621](#621)) ([dda5fe1](dda5fe1)) * **test:** shorten hostport and cli-kits test tail ([#654](#654)) ([a3acc7b](a3acc7b)) * **test:** shorten port fixtures and parallelize shellcheck ([#624](#624)) ([8eb3ff8](8eb3ff8)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Summary
Implements the delegated within-invocation fetch-reuse increment in #586. A private invocation root shares one verified source per URL + full lowercase 40-character commit ID; callers receive independent kit directories materialized from committed objects. Symbolic and abbreviated refs keep per-call fetch behavior.
The foreground ACQ process retains its PID, stdin, TTY, signal behavior, and backend exec semantics. A private guardian cleans sources when EXIT handlers are replaced or the process execs; normal exits clean synchronously. Fallback cleanup normally occurs within the one-second polling interval. Nested invocations receive fresh roots. No persistent cache or new dependency is introduced.
Anonymous fetch, authenticated retry, credential-URL rejection, subdirectory validation, and suppressed Git diagnostics remain in place. Commit identity is checked before publishing the invocation-local verified marker. Materialization preserves executable bits, symlinks, tracked index/marker filenames, and export-ignore payloads; consumer edits do not modify the shared source.
Evidence and limitations
Plan and architecture
Changes: acq lifecycle ownership; acq.backends/kit-translate.sh reuse/materialization; offline transport fixture adaptation; focused real-Git and lifecycle tests. This is an implementation optimization under ADR-0011 and ADR-0030, with no new composition or distribution architecture.
Verification transcript
./scripts/test-acq-bats test/bats/102-kit-fetch-reuse.bats test/bats/103-kit-fetch-lifecycle.bats test/bats/100-kit-translate.bats test/bats/50-kit-list-completeness.bats test/bats/140-opencode-migration-gate.bats— 76 tests passed, including 21 Python lifecycle scenarios covering success/failure, trap replacement, exec, signals, spinner, stdin, PTY, nesting, and owner SIGKILL../scripts/test-acq-bats test/bats/102-kit-fetch-reuse.bats test/bats/103-kit-fetch-lifecycle.bats— 10 tests passed, including the 21 lifecycle scenarios.shellcheck --severity=warning acq acq.backends/kit-translate.sh scripts/test-acq-lib.sh test/bats/102-kit-fetch-reuse.bats test/bats/103-kit-fetch-lifecycle.bats.bash -nchecks for acq, kit-translate.sh, and test-acq-lib.sh;git diff --checkand staged diff whitespace check.Security impact and rollback
Trust boundaries and secret mechanisms remain unchanged. Only verified committed objects are reused within the invocation; no raw ref is added to debug output. Roll back by reverting this commit to restore per-call fetching.
AI assistance
AI-assisted implementation, tests, and review by OpenCode (gpt-6-astra), including independent adversarial sub-agent review. Human review is pending and required before merge. No merge requested.