Skip to content

feat: candywalk gains remote-ref-aware discovery (the candy cutover Phase 3 — the generators survive Phase 4) - #167

Merged
github-actions[bot] merged 6 commits into
mainfrom
feat/candywalk-remote
Aug 25, 2026
Merged

github-actions[bot] merged 6 commits into
mainfrom
feat/candywalk-remote

Conversation

@atrawog

@atrawog atrawog commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The candy de-submodule cutover, Phase 3: sdk/candywalk gains a remote-ref-aware discovery mode — CollectEntitiesRemote resolves 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.SourceRoot carries 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-repo candy/ 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:

  • ReadEntityFile now tolerates the standalone repos' prepended scalar version: <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.
  • collectRefs explicitly 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_FetchesRemoteCandy proves the discovery SEAM: a local candy whose candy: 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, propagates SourceRoot, and asserts the schema/ read resolves against the fetched tree (the docs generator's schema contract):

$ go test ./candywalk/ -count=1 -v
--- PASS: TestCollectEntities_NestedDecodeRoundTrip (0.00s)
--- PASS: TestReadEntityFile_SkipsNonCatalogShapes (0.00s)
--- PASS: TestCollectEntitiesRemote_FetchesRemoteCandy (0.00s)
--- PASS: TestCollectEntities_UnchangedDefault (0.00s)
ok  	github.com/opencharly/sdk/candywalk	0.001s

go vet clean on the changed package.

Rulebook compliance

Rule How / N/A
R0 N/A — Go mechanism change
R1 The Phase-3 research mapped which generators break on Phase 4; this is the mechanism fix
R2 No deferral — the discovery seam lands here; the generator wiring lands in the companion plugin-docs/plugin-marketplace PRs
R3 ONE candywalk kit — the remote mode is the same walker with a resolver seam, no fork
R4 No workaround — the resolver seam is the runtime's DownloadRepo contract
R5 N/A — the FS walk remains the default until Phase 4
R6 status checked; no force-push; feat-branch + PR landing
R7 Test + vet output pasted above
R10 The seam path ran in the unit test (stub resolver — the fetch itself is the runtime's DownloadRepo, exercised by the refs_sweep test in charly)

Change classification

  • Change class: mechanism (candywalk remote-ref discovery seam)
  • Verification gate: the candywalk tests + go vet + the org validator
  • Attribution tier: analysed 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)

…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.
@github-actions

Copy link
Copy Markdown

Review — BLOCK

Head SHA: 24eba1a516c52c89ea4bd0b014766d98d7521c71

Change class: code — Go mechanism change in the candywalk sdk kit (remote-ref-aware discovery mode), 2 files.

Blocks

  1. B14(a) / R3–R5 — dead code in the PR's own touched module (candywalk/candywalk.go). parsedRemoteRef.SubPath is written in parseRemoteRef but never read anywhere in the diff: collectRefs and the fix-point loop consume only RepoPath/Version. Additionally, collectEntitiesWithRemote carries a third _ string parameter that neither public caller passes a meaningful value for and the function never reads — a vestige of a removed design. Remove the dead field and the dead parameter.

  2. B5 / R5 — doc/comment divergence from reality (candywalk/candywalk.go). The CollectEntitiesRemote doc comment documents a rootRefs parameter ("rootRefs is the seed: refs found in the LOCAL files' require:/candy: lists before any fetch") that does not exist in the actual signature CollectEntitiesRemote(roots []Root, resolve RemoteResolver) — this is the same removed-seed design that left the dead _ string param behind. The parseRemoteRef comment likewise claims subpaths are kept "so callers can distinguish a standalone repo from an in-repo ref," but no caller reads SubPath. Sweep the stale comments to match the real signature and field usage.

  3. B18 — Go gates not green for this head. get_ci_status shows validate / validate still in_progress with no conclusion. The dead SubPath field is exactly the class of finding the unused/staticcheck gate catches, so it must be fixed and the validate check re-run to green before this can be re-reviewed.

  4. B12 / A2 — R10 evidence not internally coherent. The body claims "the new test fetches a real moved candy" and "the RDD proof that a moved candy's charly.yml + schema resolve from the fetched remote." The test's resolver is a stub returning a local t.TempDir() — no real fetch occurs and no schema/ file is exercised; only entity discovery + SourceRoot propagation are proven. Either correct the claims in the body or extend the test to actually exercise a fetched schema/ read.

  5. A1 — incomplete summary accounting. The body does not account for two diff behaviors: the ReadEntityFile parsing change (scalar top-level version: headers tolerated, per-key non-mapping skip instead of whole-file rejection) and collectRefs's explicit skip of in-repo @github.com/opencharly/charly/candy/... refs. Both are behavioral changes in this diff and must appear in the Summary.

Comments considered: none — the thread has no comments (comments: []).

Verdict: BLOCK


deepseek.com/deepseek-v4-flash — pi-review-action.

View action run

@github-actions

Copy link
Copy Markdown

Review — BLOCK

Head SHA: 008e076deb1d16683fd2ee7e408e987b34e9952f

Change class: code — Go mechanism change in the candywalk sdk kit (2 files, +285/−15), remote-ref-aware discovery seam.

Blocks

  1. B12/A3 — R10 evidence overclaimed (surviving finding). The body states "the new test fetches a real moved candy" and "the RDD proof that a moved candy's charly.yml + schema resolve from the fetched remote." Neither is true of TestCollectEntitiesRemote_FetchesRemoteCandy: the resolver is a stub returning a local t.TempDir() — no spec/refs.DownloadRepo fetch occurs — and no schema/ file is created, read, or asserted anywhere in the test. The test proves only the seam: resolver invoked with the right repo/version, the fetched repo's entity unioned, SourceRoot propagated. Correct the claims in the body (Summary, How tested, R10 row, attribution justification) or extend the test to actually exercise a fetched schema/ read.

  2. A1 — incomplete summary accounting (surviving finding). The Summary does not account for two behavioral changes in the diff: ReadEntityFile's new parsing shape (scalar top-level version: headers tolerated; per-key non-mapping skip instead of whole-file rejection) and collectRefs' explicit skip of in-repo @github.com/opencharly/charly/candy/... refs. Both must appear in the Summary.

  3. A3 — inflated attribution tier justification. The footer's tier justification, "analysed on a live system — the remote fetch ran live in the new test," is false: the changed path ran inside a unit test against a stub resolver, not live, and no fetch occurred. Re-justify the tier against what the pasted evidence actually demonstrates.

  4. B18 — Go gates not green on the current head. get_ci_status shows validate / validate still in_progress with no conclusion for head 008e076. It must complete green before re-review (note: this item self-resolves if the run lands green).

Comments considered

  • github-actions[bot] review (head 24eba1a5): findings 1–2 (dead SubPath field, dead _ string param, stale rootRefs comment) → stale-superseded — removed in commit 008e076; verified absent in the current diff. Findings 4 and 5 → verified-blocking — both reproduce against the current body/diff (blocks 1–2 above). Finding 3 (CI green) → verified-blocking (pending) — still in_progress.

Architecture gate

Placement: CORRECT — candywalk is a kind-blind sdk kit consumed by multiple plugins (docs, marketplace); the remote-ref seam is caller-supplied, keeping the kit import-free (stdlib + yaml.v3 only, no charly/sdk import, no new deps, no network calls in the kit). No alias file, no new charly/ import.

Verdict: BLOCK


deepseek.com/deepseek-v4-flash — pi-review-action.

View action run

@github-actions

Copy link
Copy Markdown

Review — PASS

Head SHA: 487046884ed4 (base 1fc70de99b)

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 charly/ import. Note: 6 commits collapse by squash into one atomic feature (feat + validator-driven fixes + test); no partial/split work pattern. Two tool-limited notes, neither blocking: go vet is claimed without pasted output (no vet-visible issue in the diff), and the only CI check (validate / validate) is in_progress — it is the review action itself, whose green is not observable before this review completes; no Go-gate check has failed and no diff-visible lint finding exists.

Comments considered (2 prior bot reviews):

  • Dead SubPath field, dead _ string param, stale rootRefs comment → stale-superseded — absent from the current diff (removed in 008e076).
  • R10 overclaim ("fetches a real moved candy", no schema/ exercised) → stale-superseded — the current body explicitly states the stub-resolver/no-network-fetch nature, and commit 48704688 adds the fetched-schema/ read assertion.
  • A1 summary accounting → stale-superseded — the body's "Two behavioral changes beyond the seam" paragraph covers ReadEntityFile and collectRefs.
  • A3 inflated tier → stale-superseded — footer tier analysed on a live system is the ceiling for a change whose branch ran only in tests; justification is honest and matches the pasted proof.
  • CI not green → verified-non-blocking — in_progress check is the validator's own run (self-referential); no red gate, no diff-visible finding for the Go gates.

Verdict: PASS


deepseek.com/deepseek-v4-flash — pi-review-action.

View action run

@github-actions
github-actions Bot enabled auto-merge (squash) August 25, 2026 16:46
@github-actions
github-actions Bot merged commit 87a2fcd into main Aug 25, 2026
1 check passed
charly-auto-merge Bot added a commit that referenced this pull request Aug 25, 2026
@aitrawog
aitrawog deleted the feat/candywalk-remote branch September 25, 2026 19:07
github-actions Bot pushed a commit that referenced this pull request Oct 24, 2026
… 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]>
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