Repository navigation
Description
Category
category:runtime
Type
type:fix
Remedy / files the remedy will touch
spec/refs/git.go downloadRepoFromMode/GitResolveRef and the GitClient WarmUp batch (git_client.go:~500-525): collect the refs a load will download and resolve them in one bounded-parallel pre-pass, deduped in-process; plus a test that N refs resolve with bounded concurrency
Cited design decision or org-rulebook rule (or none)
none
Classification
Non-blocking — genuinely separable; left unclaimed for a later session to pick up.
Evidence (verified: commands with output, file:line, measurements)
charly config check-pod-overlay in the charly repo, using the throwaway build with the charly#1340 memo, so the loads are not repeated. Measured with strace -f -ttt -e trace=execve,exit_group:
process wall=33.0s ls-remote n=37 sum=16.8s wall-covered=16.8s [email protected] [email protected] max=0.64s
The summed time equals the wall time covered, so the 37 calls never overlap: they run strictly one after another and fill half the command. Each asks one plugin repo for main:
execve("/usr/bin/git", ["git", "ls-remote", "https://github.com/opencharly/plugin-…", "main", "refs/tags/main", "refs/tags/main^{}", "refs/heads/main"], …)
That is 36 distinct plugin repos, one of them twice. Path: spec/refs/git.go:771 downloadRepoFromMode → GitResolveRef (git.go:242) before the cache-path lock. The policy in spec/refs/git_client.go:35-39 ("download … NOT persisted … re-taken from upstream per process, deduped in-process") makes every process pay this.
Mechanism
downloadRepoFromMode resolves the commit a mutable ref names (GitResolveRef → git ls-remote) on demand, one repo at a time, as the loader reaches each @github candy. The freshness policy forbids persisting that answer across processes, which is correct, but nothing batches the per-process probes. So every process pays one network round-trip per referenced repo, serially.
Missed control
WarmUp batches the latest-tag and default-branch probes but not the download-freshness probe. No timing test covers the network leg of a load.
Blast radius
Every charly command that loads a project with @main (mutable) candy refs: about 16 s per command on this host for the charly repo. Every bed phase and every nested charly in a check pays it again. GitHub rate-throttling under multi-lane check runs is the failure mode the git_client comment already records (deploy-add stalled at 493 s+).
Root fix
Resolve every ref a load needs in one bounded-parallel batch at the start of the load (the same shape as WarmUp's batch), deduped in-process, before the serial walk asks for them. The policy stays the same: fresh per process, never served from disk while the network answers.
Spike (its result, or none with the reason)
The same 37 ls-remote invocations from the trace, run from a shell against GitHub:
serial: 15.803168683 s
parallel(16): 1.304420560 s
Batching the per-process ref resolution into one parallel pre-pass, the way WarmUp already batches latest-tag probes, bounds this leg at ~1.3 s instead of ~16 s: 12× on this leg, about 15 s of every command's wall time. The freshness contract is unchanged, because every ref is still re-taken from upstream in every process.
Agent: vol-cdi · Claude Code session 8daa865c-d43e-447b-90b3-7d16ccc921d7
Assisted-by: Claude Code Anthropic Claude Opus 5.5 (analysed on a live system)
Activity