Repository navigation
feat(loaderkit): route every loader git operation through the centralized GitClient - #182
Conversation
…e when ParseDoc fails (empty Threaded) The node-form branch depended on ParseDoc succeeding to classify the candy discriminator. In a resolver context before the provider registry is loaded, the Threaded snapshot is empty, kind classification fails, and a project file (version/repo/import/discover + entity nodes) yielded 'unrecognized candy manifest shape' — the 'charly.yml is everything at once' contract broke. Fix: when ParseDoc fails, fall back to a direct scan of the top-level mapping for a node whose value is a mapping carrying a candy: key — the candy discriminator — without needing kind classification. Adds TestParseCandyManifest_ProjectFileFallback.
…read that skips the project walk The clean command reached the retention defaults via ResolveRetentionDefaultsViaExecutor → LoadUnifiedViaExecutor, which WALKS the project and resolves every version-less @github import ref with a git ls-remote freshness check (70 network calls on the charly repo's own project, hanging charly clean --dry-run past the 2m never-hang ceiling, issue #423). ResolveRetentionDefaultsViaSeam reads the defaults through the lightweight 'retention-defaults' HostBuild seam — a config-only read with zero walk and zero network.
…ized GitClient The loader's git operations now go through spec/refs.GitClient (the centralized git layer from spec#65) instead of each consumer running git commands itself (issues #423, #208): - refs_seams_executor.go: a process-wide gitClient() singleton whose cache lives under the project's charly dir (.charly/cache) when CHARLY_PROJECT_DIR is set, else the repo cache dir; the LatestTag seam callback uses it; - canonical_ref.go + scan_orchestrate.go: GitDefaultBranch calls go through gitClient().DefaultBranch (24h TTL); - refs_collect.go: mutable-ref DOWNLOADS go through gitClient().Download (5m TTL — a branch can move, but not on every invocation, so the status fan-out pays the download once); first-startup WARM-UP prints 'charly: fetching git metadata for N repo(s)...' when the cache is cold; - scan_candy.go: the actual candy name is the manifest node key (ly.Name), so bare-name refs to a root-level standalone candy repo resolve; - go.mod: bump spec to v0.2026241.711 (the GitClient). Measured: charly version 13.5s -> 0.31s (0 git calls); charly status 97s -> 11s (network git calls cached; remaining time is the podman store scan, issue #173).
Review — BLOCKHead SHA: Change class: code/config (Go loader changes + spec dependency bump) Blocks
Notes (non-blocking)
Verdict: BLOCK ollama/deepseek-v4-flash — pi-review-action. |
…bare-name keying B12 coverage for the three new behaviors in this PR: - resolve_retention_defaults_test.go: ResolveRetentionDefaultsViaSeam round-trips the project's keep_images/keep_check_runs through the lightweight HostBuild seam (no project walk, no @github refs — the #423 clean-hang fix); a nil executor degrades to 0/0; - scan_candy_nodekey_test.go: a root-level standalone candy repo whose manifest node key differs from its dir name (layer-versatiles-style owning the candy versatiles-style) materializes Model.Name = the node key, so bare-name refs resolve; - scan_barename_test.go: ScanCandyFromLocal keys a remote candy by its bare name IN ADDITION to its @github ref key, so a transitive bare-name dep (versatiles-style inside pod-versatiles-frontend's list) resolves instead of failing with 'unknown candy'.
Review — BLOCKHead SHA: Change class: code/config (Go loader changes + spec dependency bump) Blocks
Comment intake
Notes (non-blocking)
Verdict: BLOCK ollama/deepseek-v4-flash — pi-review-action. |
Review — BLOCKHead SHA: Change class: code/config (Go loader changes + spec dependency bump) Blocks
Comment intake
Notes (non-blocking)
Verdict: BLOCK ollama/deepseek-v4-flash — pi-review-action. |
Review — BLOCKHead SHA: Change class: code/config (Go loader wiring + new seam + scan fixes + spec dependency bump) Blocks
Comment intake
Notes (non-blocking)
Verdict: BLOCK ollama/deepseek-v4-flash — pi-review-action. |
… `cache:` section The GitClient cache (spec#66) lives in the `cache:` section of the per-host charly.yml (~/.config/charly/charly.yml) — the single home for local system state — NOT in ad-hoc JSON files under ~/.cache/charly/repos. The process-wide gitClient() singleton passes the default deploy config path (honoring the CHARLY_DEPLOY_CONFIG override) to refs.NewGitClient, and the spec pin advances to v0.2026241.931 (the cache-in-charly.yml tag).
Review — PASSHead SHA: Security screen: PASS — spec bump (v0.2026240.1952 → v0.2026241.931) is a version advance of an existing dependency, disclosed as the GitClient source; no new/unexpected source, no secrets, no egress, no weakened guardrails, no embedded directives. Checklist: All applicable rules PASS or NA. Prior blocking findings re-derived against the CURRENT body/diff:
Architecture gate: Non-blocking observations (not defects): the body's cold-cache demonstration Verdict: PASS ollama/deepseek-v4-flash — pi-review-action. |
Summary
The loader's git operations now go through
spec/refs.GitClient(the centralized git layer from spec#65) instead of each consumer running git commands itself (issues #423, #208). The GitClient cache lives in thecache:section of the PER-HOST charly.yml (~/.config/charly/charly.yml) — the single home for local system state (deployments, ledger, system, cache) — per spec#66, NOT in ad-hoc JSON files under~/.cache/charly/repos.refs_seams_executor.go: a process-widegitClient()singleton whose cache lives in thecache:section of the per-host charly.yml (honoring theCHARLY_DEPLOY_CONFIGoverride); theLatestTagseam callback uses it.canonical_ref.go+scan_orchestrate.go:GitDefaultBranchcalls go throughgitClient().DefaultBranch(24h TTL).refs_collect.go: mutable-ref DOWNLOADS go throughgitClient().Download(5m TTL — a branch can move, but not on every invocation, so the status fan-out pays the download once); first-startup WARM-UP printscharly: fetching git metadata for N repo(s)...when the cache is cold.scan_candy.go: the actual candy name is the manifest node key (ly.Name), so bare-name refs to a root-level standalone candy repo resolve.scan_orchestrate.go: a remote candy is ALSO keyed by its bare name, so a transitive bare-name dep (versatiles-styleinside pod-versatiles-frontend's list) resolves instead of failing with "unknown candy".go.mod: bump spec to the GitClient + cache-in-charly.yml tag (spec#66).ResolveRetentionDefaultsViaSeam— the theskill:-node test fixture is an identical copy indeploykitandloaderkit, andduplcannot see across the package boundary #423 clean-hang fix) and the two scan fixes from the earlier session.How tested
New B12 coverage (each test FAILS without its behavior):
TestResolveRetentionDefaultsViaSeam— the seam round-trips keep_images/keep_check_runs through the HostBuild seam; nil executor degrades to 0/0.TestScanRepoCandyDir_NodeKeyNameOverride— a root-level standalone candy repo whose node key differs from its dir name materializes Model.Name = the node key.TestScanCandyFromLocal_BareNameKeying— a remote candy is reachable under BOTH its @github ref key and its bare name.Disposable fresh-rebuild bed run (A2/R10) —
check-charly-vm(thedisposable: trueArch VM bed that installs the in-development charly binary via thecharly-devcandy and runscharly version+ CHARLY-BINARY-OK). The charly binary was rebuilt from the committed tree with the sdk replace + the spec#66 cache-in-charly.yml change, synced tocandy/charly-dev/bin/charly, and the bed run:summary.yml:
errors: 0, warnings: 0, allowlisted: 8(the 8 allowlisted are the documentedpacman-pacnew-config-notice+pacman-needed-package-already-currentallowances).Full-stack live timing (spec#66 + this wiring + the charly prescan skip, charly binary rebuilt from the committed tree with the sdk replace):
The cache lands in the per-host charly.yml
cache:section (verified live):Rulebook compliance
go test ./...output pasted above; full-stack timing measured live; the disposable bed run pasted abovecheck-charly-vmdisposable bed ran the changed runtime path on a fresh rebuild (above) — ZERO errors, ZERO warnings (8 documented allowances)Change classification
go test ./...(fresh rebuild from the committed tree) + thecheck-charly-vmdisposable bed run (fresh rebuild, ZERO errors/warnings) + full-stack live timingAssisted-by: pi openrouter/deepseek/deepseek-v4-flash-0731 (fully tested and validated)