Skip to content

feat(refs): dispatch the remote-repo fetch backend through candy/plugin-refs (P7 consumer) - #59

Merged
atrawog merged 2 commits into
mainfrom
feat/p7-refs-plugin
Jul 11, 2026
Merged

atrawog merged 2 commits into
mainfrom
feat/p7-refs-plugin

Conversation

@atrawog

@atrawog atrawog commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Summary of changes

P7 (the remote-repo FETCH BACKEND → plugin) — the superproject consumer half. 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 at
    registration 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 (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); 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.
  • Gitlink + require: sdk → the merged commit; charly/go.mod require → 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
reconcile run, and the disposable roster (every bed resolves the root @github distro imports through the
plugin fetch backend), ONE binary 2026.192.0911 (plugin-refs compiled in), all CONCURRENT.

$ cd charly && gofmt -l . ; go vet ./... ; golangci-lint run ./...
(clean) ; 0 issues.
$ go test ./charly/...
ok  	github.com/opencharly/charly/charly   # bijection + F11 uniform-API + pluginsgen-reproducible gates pass with `refs`

# R5 grep — core's refs_git gone; DownloadRepo no longer called in core (plugin-dispatched):
$ git grep -nE 'func compareSemver|func DownloadRepo|func RepoGitURL' -- 'charly/*.go' ; git grep -n '\bDownloadRepo\b' -- 'charly/*.go' | grep -v _test
(nothing)

# LIVE fresh clone THROUGH the plugin: cleared distro-fedora cache → charly box validate re-fetched OK.
# R10 — disposable roster, ONE binary 2026.192.0911, all six CONCURRENT, all ok: true:
  check-sidecar-pod      pod                 ok  steps=11  276s
  check-exampledeploy    external deploy     ok  steps=5    83s
  check-charly-vm        vm                  ok  steps=7   272s
  check-k3s-vm           vm                  ok  steps=7   208s
  check-group            group->vm           ok  steps=5   255s
  check-k8s-deploy       group->k3s-vm+k8s   ok  steps=8   310s
# on-disk: .check/<bed>/2026.192.0959/summary.yml (ok: true); no orphaned domains/containers.

Attribution tier

fully tested and validated — the plugin fetch backend proven live (fresh clone dispatched through it) + the
concurrent disposable roster on a fresh rebuild; go test green.

CLAUDE.md rule compliance

  • R2: P7 lands as ONE cutover (kit move + plugin + rewire), not split.
  • R3: the fetch backend is served by ONE plugin composing the ONE kit copy of the git primitives; the activeRefsDownloader seam mirrors activeLoaderParser (R3 with P6).
  • R5: charly/refs_git.go + tests DELETED; the DownloadRepo alias removed (no transitional path); grep clean.
  • R7/R10: live fetch-through-plugin + concurrent disposable roster on a fresh rebuild, zero warnings; the moved kit tests + the live fetch FAIL without the change.
  • R9: rebuilt (2026.192.0911); no new OS dep.
  • ADE: candy/plugin-refs ships description: + a plan: check (refs-module-present).
  • Boundary law: the remote-repo fetch BACKEND (the pluggable capability) is a plugin resolving via the kit.RefsDownloader seam; the git primitives + fetch orchestration are generic mechanisms in kit/core.
  • CHANGELOG: CHANGELOG/2026.192.1035.md staged (placeholder; the pr-validator finalizes + tags v<YYYY.DDD.HHMM>).

Assisted-by: Claude (fully tested and validated)

…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)
@atrawog

atrawog commented Jul 11, 2026

Copy link
Copy Markdown
Contributor Author

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 2fd8a86 is on origin/main, git describe → v0.2026192.1026, the tag resolves to 2fd8a86; the PR's sdk gitlink == 2fd8a86; charly/go.mod require == v0.2026192.1026 (in-tree via replace => ../sdk, so the require bump is code-neutral).

Checklist

  • [PASS] 0. Security/anti-tampering (T1–T4): no exfiltration/scope-mismatch/weakened-gate; no manipulation. go.sum + sdk pin verified against the merged, tagged sdk commit. Diff does exactly what the summary claims.
  • [PASS] 1. Description complete — template filled, evidence pasted (not promised).
  • [PASS] 2. Change-class gate matches evidence — concurrent disposable roster + live fetch on a fresh rebuild; no dry-run/rebuild-alone fraud.
  • [PASS] 3. Attribution fully tested and validated justified — the changed dispatch path executed live against the fresh rebuild.
  • [PASS] 4. R0 skills honored — plugin/boundary + SDD + check + git-workflow; mirrors the P6 loader (activeLoaderParser) convention.
  • [PASS] 5. R1 zero warnings; no flake/transient framing (my re-runs all clean).
  • [PASS] 6. R2 no pre-existing/out-of-scope split — P7 lands as ONE cutover.
  • [PASS] 7. R3 no duplication — ONE plugin composing the ONE sdk/kit git-primitive copy; activeRefsDownloader mirrors activeLoaderParser.
  • [PASS] 8. R4 no ad-hoc workaround — kit.DefaultDownloader abstraction; the git exec is legit (charly is the fetch orchestrator).
  • [PASS] 9. R5 hard cutover — refs_git.go + its tests DELETED, DownloadRepo alias GONE, the core printDebugRetentionNotice test moved to debug_notice_test.go; grep self-tests all return zero; no transitional/dual-mode path in final code.
  • [PASS] 10. R6/R8(N/A — no Containerfile/label change)/R9 — binary rebuilt 2026.192.0911 with plugin-refs compiled in (confirmed: candy/plugin-refs.(*provider).Download embedded in /usr/bin/charly); no new OS dep.
  • [PASS] 11. R10 — six disposable beds run CONCURRENTLY (run-calver 2026.192.0959), all ok: true on-disk (.check/<bed>/2026.192.0959/summary.yml: sidecar-pod 11 / exampledeploy 5 / charly-vm 7 / k3s-vm 7 / group 5 / k8s-deploy 8), plus a live fresh-clone through plugin-refs.
  • [PASS] 12. RDD/ADE/SDD — candy/plugin-refs ships description: + a plan: check: (refs-module-present, matching the sibling compiled-in convention); no .cue/.proto in the diff; TestPluginsGenReproducible PASS; the plugins_generated.go delta is accounted for by the compiled_plugins: source addition; no new wire/@go(-) type.
  • [PASS] 13. Concurrency mandate — the loader/resolver-spine change was gated by the CONCURRENT roster (shared run-calver, ~11 min wall vs ~23 min serial sum), not one-bed-at-a-time; no idle/serial-pass framing.
  • [PASS] 14. Hard cutover — ONE atomic commit (cc0f734); no Phase-2/TODO.
  • [PASS] 15. Kernel/plugin boundary law — the fetch BACKEND is a plugin behind the kind-agnostic kit.RefsDownloader seam; core keeps only the generic orchestration mechanism; no spec.<Kind> field-read / kind switch / per-kind map leaked.
  • [PASS] 16. Disposable-only autonomy — roster on disposable: true beds; my live smoke was a non-destructive cache re-fetch.
  • [PASS] 17. Clean architecture + Go gates (re-run by me): gofmt -l charly/ empty · go vet exit 0 · go build exit 0 · go test ./charly/... green (bijection + TestNoSinglePluginAPISurface + TestPluginsGenReproducible PASS) · golangci-lint run ./charly/... = 0 issues (v2.12.2).
  • [PASS] 18. CHANGELOG present — CHANGELOG/2026.192.1035.md placeholder (I finalize the CalVer at merge).

Decision: APPROVED. This is a clean seam-extraction cutover: the remote-repo fetch backend moves out of core (refs_git.go deleted) into the compiled-in candy/plugin-refs behind the kind-agnostic kit.RefsDownloader seam, with the generic fetch orchestration staying in EnsureRepoDownloaded — exactly mirroring the P6 loader pattern. Behaviour-neutral: I independently forced a cache-miss and watched charly box validate re-fetch distro-fedora through the compiled-in plugin-refs backend (exit 0). All static gates re-ran green; the concurrent disposable roster is genuine on-disk and all ok: true; the producer sdk half is merged + tagged. Finalizing the merge-time CalVer, squash-merging, and tagging.

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)
@atrawog
atrawog merged commit 441d316 into main Jul 11, 2026
@atrawog
atrawog deleted the feat/p7-refs-plugin branch July 11, 2026 10:47
atrawog added a commit that referenced this pull request Jul 14, 2026
… 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)
atrawog added a commit that referenced this pull request Jul 16, 2026
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)
atrawog added a commit that referenced this pull request Jul 16, 2026
…→ 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
atrawog added a commit that referenced this pull request Jul 28, 2026
…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)
atrawog added a commit that referenced this pull request Aug 15, 2026
…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
aitrawog added a commit that referenced this pull request Sep 28, 2026
… keep-disk reland)

#718 pinned v0.2026271.15, which merged two seconds BEFORE the reland (#59,
tagged v0.2026271.404) — so charly lacked vm bake --domain / vm create
--keep-disk, which the merged distro-omarchy produce bed depends on.
aitrawog added a commit that referenced this pull request Sep 28, 2026
… keep-disk reland) (#721)

#718 pinned v0.2026271.15, which merged two seconds BEFORE the reland (#59,
tagged v0.2026271.404) — so charly lacked vm bake --domain / vm create
--keep-disk, which the merged distro-omarchy produce bed depends on.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant