Repository navigation
feat: candywalk gains remote-ref-aware discovery (the candy cutover Phase 3 — the generators survive Phase 4) - #167
Conversation
…generator seam) The candy de-submodule cutover Phase 3: after Phase 4 deletes the in-repo candy/ dirs, the docs + marketplace generators lose the moved corpus. candywalk now supports CollectEntitiesRemote(roots, resolve) — a caller-supplied resolver seam (out-of-process generators use spec/refs.DownloadRepo; in-proc callers could use the loader's EnsureRepoDownloaded) — that fix-points over every @github.com/opencharly/... ref in the walked files' require:/candy: lists, fetches each repo, and unions the fetched entities (candy/<name>/charly.yml or the root manifest for config candies). Entity gains SourceRoot (the absolute repo root) so schema reads resolve against the fetched tree. CollectEntities (no resolver) is unchanged: the pure local FS walk for the pre-Phase-4 state. R3: this is the ONE discovery kit — no fork; the generators wire the seam.
The remote fix-point must not attempt to fetch @github.com/opencharly/charly/candy/<name> refs — the pre-cutover in-repo form box submodule repos still carry. Those resolve to the LOCAL charly checkout (the FS walk already surfaces them), or are stale after Phase 4 (swept by the box repos' own cutover). Only standalone kind-prefixed repos are fetched.
The naive last-colon split treated @github.com/opencharly/charly/candy/<name> as the whole repo path, so the in-repo-form guard never matched and the resolver tried to fetch github.com/opencharly/charly/candy/uv.git. The spec ref vocab is host/org/repo + subpath; parse the first three segments as the repo path so the charly-in-repo guard works and subpaths stay available to callers.
The standalone candy repos prepend `version: <calver>` (the schema header) to their charly.yml. The old map[string]map[string]yaml.Node decode rejected the whole file on that scalar key, so fetched remote repos yielded ZERO entities. Decode to map[string]yaml.Node and iterate the mapping node's kind keys, skipping scalar top-level keys (the header, directive-style keys) — the same reader now walks both the pre-cutover in-repo manifests and the standalone repos.
Review — BLOCKHead SHA: Change class: code — Go mechanism change in the Blocks
Comments considered: none — the thread has no comments ( Verdict: BLOCK deepseek.com/deepseek-v4-flash — pi-review-action. |
…Refs comment (validator B14/B5 findings)
Review — BLOCKHead SHA: Change class: code — Go mechanism change in the Blocks
Comments considered
Architecture gatePlacement: CORRECT — Verdict: BLOCK deepseek.com/deepseek-v4-flash — pi-review-action. |
… (the docs generator's schema contract)
Review — PASSHead SHA: Security screen: PASS — no scope mismatch (all diff behaviors accounted for in the body), no secrets/exfiltration (kit stays stdlib + yaml.v3 only; the resolver is caller-supplied, no network in the kit), no weakened guardrails, no supply-chain change. Checklist: All applicable rules PASS or NA. Placement: CORRECT — candywalk is a kind-blind sdk kit; the remote-ref seam is caller-supplied and import-free; no alias file, no new Comments considered (2 prior bot reviews):
Verdict: PASS deepseek.com/deepseek-v4-flash — pi-review-action. |
… keep the pre-cutover subpath form refused (#470) `acceptedRef` refused `github.com/opencharly/charly` outright. That refusal was written (87a2fcd, #167, 2026-08-25) for ONE form: `@github.com/opencharly/charly/candy/<name>`, the pre-cutover IN-REPO ref that resolves to the local charly checkout's candy dir (which the local FS walk already surfaces) and that the box submodule repos' own cutover sweeps. Keyed on `RepoPath` alone it could not tell that form from the BARE repo-root form — the shape `opencharly/opencharly`, `spec` and `sdk` are already pinned as, and the shape `charly` began authoring its own skills in (`.agents/skills/`, 2026-10-23) AFTER the refusal existed. So the skip is narrowed to the form it was written for: if pr.RepoPath == "github.com/opencharly/charly" && pr.SubPath != "" { return "" } `spec.ParsedRef.SubPath` already carries the distinction. Consequences, measured on the real refs list (225 first-hop refs) with an offline resolver stub and the real `[email protected]` tree: - pre-fix the charly pin is refused SILENTLY: 225 resolver keys, 0 charly refs, `rc=0`, no message — three skills unreachable from the corpus; - post-fix the same list queues the charly ref, the walk reads its root manifest and emits exactly 4 `skill:` nodes (`go`, `go-quality`, `plugin`, `charly-version`, all `owner=charly-skill-shelf`, `dir=.`); - the pre-cutover SUBPATH form is still refused, versioned and versionless alike (the regression guard: a box submodule carrying it must not start fetching); - the closure grows by charly's 56 declared refs, all at old `v2026.27x/28x` tags, every one a twin of a repo already pinned at a newer tag — mitigated by `resolve.go`'s direct-pin authority (`preferEntity` step 2) and proven by the marketplace refs leg's with/without-pin corpus diff, not absorbed here. The `collectRefs` doc comment that states the reason is corrected in the same change (R5), as are `acceptedRef`'s and `parseRemoteRef`'s, so no comment still claims a blanket refusal of the repo. Refs #468, opencharly/opencharly#600. Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated) Co-authored-by: Andreas Trawoeger <[email protected]>
Summary
The candy de-submodule cutover, Phase 3: sdk/candywalk gains a remote-ref-aware discovery mode —
CollectEntitiesRemoteresolves every@github.com/opencharly/...ref in the walked files'require:/candy:lists through a caller-supplied resolver seam, and unions the fetched repo's candy entities into the result, transitively (fix-point until closure).Entity.SourceRootcarries the fetched repo dir so schema reads resolve against the fetched tree. This is the mechanism that keeps the docs + marketplace generators (both built on candywalk) emitting the full moved corpus after Phase 4 deletes the in-repocandy/dirs.R3: ONE discovery kit — the FS-walk default (
CollectEntities, resolve == nil) is unchanged; the remote mode is the same walker with the resolver seam. No fork.Two behavioral changes beyond the seam, both in the diff:
ReadEntityFilenow tolerates the standalone repos' prepended scalarversion: <calver>header (skipped, not an entity) and skips per-key non-mapping shapes instead of rejecting the whole file — the standalone repo manifests carry the header.collectRefsexplicitly skips the pre-cutover in-repo form@github.com/opencharly/charly/candy/<name>(RepoPath == github.com/opencharly/charly) — only standalone kind-prefixed refs are resolved.How tested
The candywalk tests — 4/4 PASS. The new
TestCollectEntitiesRemote_FetchesRemoteCandyproves the discovery SEAM: a local candy whosecandy:list references a moved candy via@github.com/opencharly/layer-ripgrep:v...resolves that repo through the caller-supplied resolver (a stub returning a synthetic export dir — no network fetch in the unit test), unions the fetched entity, propagatesSourceRoot, and asserts the schema/ read resolves against the fetched tree (the docs generator's schema contract):go vetclean on the changed package.Rulebook compliance
Change classification
go vet+ the org validatoranalysed on a live system— the changed seam ran in the unit test against a stub resolver; the real fetch path is the runtime's DownloadRepo (proven by charly's refs_sweep test)Assisted-by: pi openrouter/deepseek/deepseek-v4-flash-0731 (analysed on a live system)