Repository navigation
feat(refs): dispatch the remote-repo fetch backend through candy/plugin-refs (P7 consumer) - #59
Conversation
…in-refs (P7 consumer) Consumer half of P7 — the remote-repo FETCH BACKEND becomes a plugin. Core DELETES its refs_git.go, composes the git primitives from sdk/kit, and dispatches every cache-miss remote-candy download through the compiled-in candy/plugin-refs — the swappable fetch backend that unlocks alternative ref backends (OCI/S3-hosted candies). Behaviour-neutral: the default backend is the same git fetch. - candy/plugin-refs: a compiled-in plugin candy (Class refs, word refs) implementing kit.RefsDownloader via kit.DefaultDownloader (git). In compiled_plugins:. Registered at init() before the first load — no bootstrap cycle (the compiled-in command:migrate already invokes at the same deep-in-load point). - ClassRefs (charly/provider.go) — the new refs provider class. - activeRefsDownloader (charly/refs_threaded.go) — the registered fetch backend, wired when a provider implements kit.RefsDownloader (charly/plugin_inproc.go); swapping the refs plugin swaps the backend (git -> OCI/S3). Mirrors activeLoaderParser (P6). - EnsureRepoDownloaded (charly/refs.go): the cache-miss DownloadRepo(...) call becomes activeRefsDownloader.Download(...). The fetch ORCHESTRATION stays core (override / cache-hit / the post-fetch schema auto-migration via command:migrate). - charly/kit_refs_aliases.go: core binds the moved kit primitives it still calls directly; the DownloadRepo alias is gone (core dispatches through the plugin — no transitional code). - R5: charly/refs_git.go + refs_git_test.go DELETED; the moved tests live in sdk/kit; charly/debug_notice_test.go keeps the core printDebugRetentionNotice test. Cross-repo: sdk gitlink -> 2fd8a86 (the merged P7 sdk half, tag v0.2026192.1026); charly/go.mod require -> v0.2026192.1026 (in-tree resolution rides replace => ../sdk). Assisted-by: Claude (fully tested and validated)
pr-validator — APPROVED ✅Change class: cross-repo (charly/sdk Go) — the P7 superproject consumer half. I re-derived compliance independently (fresh context, no author claims trusted). Every gate re-run below is my own. Cross-repo producer-merged-first (verified): sdk Checklist
Decision: APPROVED. This is a clean seam-extraction cutover: the remote-repo fetch backend moves out of core ( Assisted-by: Claude (analysed on a live system) |
Merge-time CalVer stamp applied by the pr-validator: CHANGELOG placeholder renamed to the merge-time version and its H1 rewritten to match. Assisted-by: Claude (fully tested and validated)
… live-stdio reverse channel (#106) The superproject leg of the F12 interactive/streaming reverse-channel (#62) — pairs with the merged sdk PR #44 (executor legs + carrier). charly shell / charly cmd / charly logs --follow move off their inline syscall.Exec / os/exec bodies onto the F12 executor reverse channel: the host RESOLVES the venue command (the #59 resolution inventory stays core), the owning deploy plugin runs it over the served venue executor via RunInteractive/RunStream, and the operator's terminal (inherited host-side by the reverse-channel server) drives it — stdio never crosses the wire. - Dispatch: LifecycleTarget.Attach + substrateLifecycle.Attach + externalDeployTarget.Attach + grpcSubstrateLifecycle.Attach; the venue executor is resolved GENERICALLY via VenueExecutor (vm → guest SSHExecutor ssh -t, pod → nil → host ShellExecutor podman exec/run -it; NO arbiter bracket). grpcSubstrateLifecycle.Logs threads a resolved plan for a substrate with a logs resolver. - Resolvers (pod_lifecycle_resolve.go): resolvePodShellPlan/CmdPlan/LogsPlan RELOCATE shell.go/cmd.go/commands.go verbatim; R3 resolvePodRuntimeImage is the shared image-context head with resolvePodStartDirect. Plugin bodies: pod OpAttach→podAttach (RunInteractive), OpLogs→RunStream (the podCli("logs") reentry DELETED); vm OpAttach→vmAttach over the guest SSHExecutor. OpShell stays the #57 charly service capture leg. - Verb rewires: shell→lt.Attach(tty=true), cmd→lt.Attach(tty=false)+notify wrapper, logs→lt.Logs. R5: shell.go −264 (buildShellArgs/buildExecArgs/shellQuoteArgs relocated; execCommand/findExecutable deleted). Closes the #57 M-core register IOU rows for cmd/shell/logs-follow. - Deliberate rename (orchestrator-approved): substrateLifecycle.TeardownExecutor → VenueExecutor (two consumers now: bundle-del teardown + the F12 Attach leg); the wire Op sdk.OpTeardownExecutor keeps its name for wire stability. - R2 fix: dispatchLifecycleTarget connectPluginByWord(ClassDeployTarget, node.Target) so shell/cmd/logs work on an UNCONFIGURED image. - Bumps the sdk submodule to the merged e2cc807 (tag v0.2026195.501) + charly/go.mod require. Validated by a fresh pr-validator against sdk@e2cc807: coordinates verified exactly; workspace go build/test/vet clean, golangci-lint 0, gofmt clean, both touched candies standalone green, cue:gen + pluginsgen reproducible; R5 rename/deletion sweep clean; F12 consumers live-proven on the stamped binary 2026.195.0216 with both acceptance lanes green. Completes the #62 cutover. Assisted-by: Claude (fully tested and validated)
The require directive was still pinned to the pre-P12a version; the in-tree go.work replace directive made this cosmetic for local dev, but out-of-tree consumers need it current. Bumped to the sdk tag PR #59's merge produced. Assisted-by: Claude (fully tested and validated)
…→ sdk Relocates the genuinely pure, project-loader-free helpers shared between charly core's remaining config_image.go/start.go/service.go/tunnel.go/engine.go call sites and candy/plugin-deploy-pod's future pod_lifecycle_resolve.go quadlet- mode move: the charly bridge-network mechanism (network.go), SSH/GPG agent- forwarding resolution (agent_forward.go), runtime data provisioning (data.go), the pod-security arg builders + direct-mode start argv (security.go's SecurityArgs/ResourceCapArgs, start.go's buildStartArgs), the entrypoint/init-def resolution (service.go's wellKnownInitDefs + resolveEntrypointFromMeta/ resolveInitDefFromMeta), the quadlet/systemd path helpers (quadlet.go), the deploy-time engine resolver (engine.go's ResolveBoxEngineForDeploy/FromMeta), the tunnel label-metadata resolution (tunnel.go's port-mapping helpers + TunnelConfigFromMetadata), and the direct-deploy marker probe (config_image.go). Bumps the sdk submodule to f7e7061, which lands the new sdk/kit + sdk/deploykit files these charly-core call sites now alias. Every charly-core call site keeps compiling unchanged via the existing kit_aliases.go/deploykit_pod_aliases.go alias files (no new alias files, per ZERO-ALIASES); each relocated function's owning unit test moved with it. Also removes a pre-existing dead splitDottedPath alias in deploykit_state_aliases.go (unused-var lint residue from the already-merged P4 cutover, unrelated to this move but blocking an honest zero-warnings gate). Verified: go build/vet/test/lint clean (zero warnings) on charly, sdk, candy/plugin-bundle, and candy/plugin-deploy-pod. pod_lifecycle_resolve.go itself is held out of this cutover — its resolvers run host-side and ship a spec.PodLifecyclePlan envelope to the plugin over the existing F6 OpStart/OpStop channel (already the compliant architecture, tracked as #59 migration inventory since already-merged commits), and its quadlet-mode functions call directly into enc.go's encPlanFor/resolveEncPassphrase — held as group 3 pending the loader-projection wave. Folding it requires either violating that hold or a real self-resolve architecture change, not a mechanical move. Claude-Session: https://claude.ai/code/session_01R8UGGr3ui1959oTb5JuSif
…d roster The prior R10 section cited numbers not backed by fresh artifacts — check-builder-vm had never run, check-charly-vm's only run was 16 days stale (predating the #59 fix), and it falsely claimed check-k3s-vm green. Replaced with the real 2026-07-28 roster run against the final terminus binary: 9 green (each backed by an on-disk summary.yml), and check-k3s-vm honestly recorded as the pre-existing #61 k3s-kubeconfig-timeout failure (R2-separable, deploy mechanism proven, not a #118 regression). Assisted-by: Claude Code Anthropic Claude Opus 4.8 (fully tested and validated)
…s cover Two pins move together, because they are one mirror state: docs@69f97926 is the whole-site projection at plugins@853e72a9, and pinning either alone re-splits it. Both DERIVED rather than confirmed. The pin must reach the newest projection any source in this tree covers, not merely this leg's own producer merge — the tree now carries three producers' sources. [email protected]/main is exactly one commit, #177's merge, whose source is in this tree; docs@620839538.. origin/main is two, #59 (patch 1's projection) and #58 (patch 2's), both now sourced here. DOCS_REF follows the docs gitlink at BOTH occurrence sites. It had drifted three merges behind on this branch: five commits moved the gitlink — four docs projections and the four-pin re-pin — and none carried the pin that names it. A projection commit must carry the page AND the pin; carrying only the page leaves check-docs cloning a pre-projection commit and asserting that same commit, so it passes while proving stale content. task docs:pin is the gate, and it binds on nothing automatic — not CI, not a hook, not a bed. Verified: marketplace drift is clean at 400 artifacts with both sources and this pin, which was the stated target and is measurable only on the clean path. Claude-Session: https://claude.ai/code/session_01Rt9KMZF6v3x1iL24M74dN2
Summary of changes
P7 (the remote-repo FETCH BACKEND → plugin) — the superproject consumer half. Core DELETES its
refs_git.go, composes the git primitives fromsdk/kit, and dispatches every cache-miss remote-candydownload through the compiled-in
candy/plugin-refs— the swappable fetch backend that unlocks alternativeref backends (OCI/S3-hosted candies). Behaviour-neutral: the default backend is the same git fetch.
candy/plugin-refs— a compiled-in plugin candy (Classrefs, wordrefs) implementingkit.RefsDownloaderviakit.DefaultDownloader(git). Incompiled_plugins:. Registered at init() beforethe first load — no bootstrap cycle (the compiled-in
command:migratealready invokes at the samedeep-in-load point).
ClassRefs(charly/provider.go) — the newrefsprovider class.activeRefsDownloader(charly/refs_threaded.go) — the registered fetch backend, wired atregistration when a provider implements
kit.RefsDownloader(charly/plugin_inproc.go); swapping the refsplugin swaps the backend (git → OCI/S3). Mirrors
activeLoaderParser(P6).EnsureRepoDownloaded(charly/refs.go) — the cache-missDownloadRepo(...)call becomesactiveRefsDownloader.Download(...). The fetch ORCHESTRATION stays core (local-override resolution,cache-hit short-circuit, the post-fetch schema auto-migration via
command:migrate).charly/kit_refs_aliases.go— core binds the moved kit primitives it still calls directly(
RepoGitURL/GitClone/GitDefaultBranch/GitLatestTag/compareSemver/RepoCacheDir/RepoCachePath/IsRepoCached); theDownloadRepoalias is gone (core dispatches through the plugin — no transitional code).charly/refs_git.go+refs_git_test.goDELETED; the moved tests live insdk/kit;charly/debug_notice_test.gokeeps the coreprintDebugRetentionNoticetest.sdk→ the merged commit;charly/go.modrequire → the merged sdk tag.Change class
cross-repo (charly/sdk Go). Order: sdk PR (merged + tagged) → this superproject consumer.
How R10-tested
The gate is the moved functions unit-tested, a LIVE fresh clone dispatched THROUGH plugin-refs, a
reconcilerun, and the disposable roster (every bed resolves the root@githubdistro imports through theplugin fetch backend), ONE binary
2026.192.0911(plugin-refs compiled in), all CONCURRENT.Attribution tier
fully tested and validated— the plugin fetch backend proven live (fresh clone dispatched through it) + theconcurrent disposable roster on a fresh rebuild;
go testgreen.CLAUDE.md rule compliance
activeRefsDownloaderseam mirrorsactiveLoaderParser(R3 with P6).charly/refs_git.go+ tests DELETED; theDownloadRepoalias removed (no transitional path); grep clean.2026.192.0911); no new OS dep.candy/plugin-refsshipsdescription:+ aplan:check (refs-module-present).kit.RefsDownloaderseam; the git primitives + fetch orchestration are generic mechanisms in kit/core.CHANGELOG/2026.192.1035.mdstaged (placeholder; the pr-validator finalizes + tagsv<YYYY.DDD.HHMM>).Assisted-by: Claude (fully tested and validated)