Repository navigation
fix(candywalk): collect every remote ref form, never drop a branch or SHA (opencharly/sdk#322) - #356
Conversation
… SHA (#322) `candywalk`'s remote-ref collector matched CalVer tags only: var remoteRefRe = regexp.MustCompile(`@github\.com/opencharly/[a-zA-Z0-9._/-]+:v[0-9]+\.[0-9]+\.[0-9]+`) A branch (`:feat/...`) or a commit SHA matched NOTHING — no error, no warning. In a fail-closed generator (`charly marketplace generate` rejects an undeclared family) a silently dropped ref means the generator validates a STALE entity and reports a failure the author cannot fix by editing the map, because the map is never read. Same "a ref that does not pin" class as opencharly/charly#715. Implements the issue's PREFERRED arm (1): the collector now hands over every ref form the loader can resolve. The path class stops at the first `:` so the version stays unambiguous even when the ref itself contains `/`, `.` and `-` — a branch is indistinguishable from the path by character class, which is exactly why the CalVer anchor existed — and the ref class stops at the delimiters that end a YAML scalar. The issue's "minimum" arm (2), hard-error on a ref the collector cannot name, is NOT implemented: it was MEASURED and refused. collectRefs scans raw file bytes, comments included, and a sweep of the org's tracked charly.yml files finds 42 distinct VERSIONLESS `@github.com/opencharly/...` tokens living in PROSE (a layer-nodejs mention in a comment, a distro-* glob, a trailing-backtick example). Failing closed on those would break every tree that documents a repo path. A versionless token is not evidence of a declared ref; only a token carrying a `:version` is, and every such form is now collected. The measurement is recorded in collectRefs' doc so the arm is not re-attempted blind. R7: candywalk.TestCollectRefs_AcceptsEveryRefForm declares a CalVer tag, a branch, a 40-hex SHA and the pre-cutover in-repo charly form; it FAILS on the pre-fix pattern (verified by restoring only that line — the branch and the SHA are DROPPED) and passes with it, with the in-repo form still skipped. gofmt -l . empty; GOWORK=off go vet ./... clean; GOWORK=off go test ./... exit 0. Consumer note: the fetched-ref set a consumer sees can grow (plugin-docs and plugin-marketplace are the two consumers); their adoption is the same-landing follow-on. Agent: cache-identity Assisted-by: DeepSeek Harness deepseek-v4.1-flash (analysed on a live system)
Review — BLOCKHead SHA: Change class: code (Go library change in Blocks
Comment thread: none (0 comments) — nothing to disposition; no maintainer sign-off present, and none is required for this class. Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
Review — PASSHead SHA: Security screen: PASS — regex + doc-comment + new test only; no secrets, no network egress, no dependency/pin change, no guardrail or rulebook edit. T4 N/A (does not touch security machinery). Comment intake (1):
Checklist: All applicable rules PASS or NA. R10/live-run and CI-green claims are tool-limited (no re-run possible); pasted output is internally consistent with the diff — two Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
Review — PASSHead SHA: Change class: code — Go library change in Security screen: PASS — regex + doc-comment + new test only; no secrets, no network egress, no dependency/pin change, no guardrail/rulebook edit. T4 N/A (does not touch security machinery). Comment intake (2):
Checklist: All applicable rules PASS or NA. R7/R10 live-run and CI-green claims are tool-limited (no re-run possible); pasted output is internally consistent with the diff — Non-blocking note: the Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
Summary
candywalk's remote-ref collector matched CalVer tags only:A branch (
:feat/…) or a commit SHA matched nothing — no error, no warning. In a fail-closedgenerator (
charly marketplace generaterejects an undeclared family) a silently dropped ref meansthe generator validates a stale entity and reports a failure the author cannot fix by editing the
map, because the map is never read. Same "a ref that does not pin" class as opencharly/charly#715.
Implements the issue's preferred arm (1): the collector now hands over every ref form the
loader can resolve. The path class stops at the first
:(so the version stays unambiguous even whenthe ref itself contains
/,.and-— a branch is indistinguishable from the path by characterclass, which is exactly why the CalVer anchor existed), and the ref class stops at the delimiters that
end a YAML scalar.
Why arm (2) is NOT implemented — measured, not skipped
Arm (2) is "hard-error when a ref is present but unrecognised".
collectRefsscans raw file bytes,comments included, and a sweep of the org's tracked
charly.ymlfiles finds 42 distinctVERSIONLESS
@github.com/opencharly/…tokens living in PROSE — alayer-nodejsmention in acomment, a
distro-*glob, a trailing-backtick example:Failing closed on those would break every tree that documents a repo path. A versionless token is
therefore not evidence of a declared ref; only a token carrying a
:versionis, and every such formis now collected. The measurement is recorded in
collectRefs' doc so the arm is not re-attemptedblind.
How tested — the changed path executed live, with a control
collectRefsis reached byCollectEntitiesRemote, the discovery entry point the two consumers(
plugin-docs,plugin-marketplace) drive. That entry point was executed live, against the realGitHub remotes, over a scratch project declaring two refs at a branch (
:main), with the realrefs.DownloadRepoas the resolver seam:Not one
resolve(...)line is even reached pre-fix: both declared refs vanish before the fetchersees them, which is precisely the "the map is never read" failure the issue describes. Post-fix the
branch refs are handed over and 4 remote entities are collected. That harness is a scratch module
under
/tmp, never committed; the same call is pinned bycandywalk.TestCollectRefs_AcceptsEveryRefForm, which fails on the pre-fix pattern (the branchand the SHA are DROPPED) and passes with it.
Gates on the committed tree:
gofmt -l .empty ·GOWORK=off go vet ./...clean ·GOWORK=off go test ./...exit 0 · the repo's CI cross-compile matrix (amd64/arm64/arm/386) green.Rulebook compliance
git-workflow(before every git/gh action),
strict-policy(R1–R5 + RDD/ADE),agents,go. RDD: thearm-(2) question is an RDD spike and it was run before the decision (the 42-token sweep), not
after.
in the code rather than as an omission. The collector's own doc comment is corrected with it
(claim-keyed, rule 11).
separable item — the consumer-side corpus regeneration — is routed by name in the next section,
with the batch that owns it.
regex was added for the fail-closed arm (it was refused, see above) so no duplicate predicate
exists.
fix, and the measurement behind the refused arm is recorded rather than papered over.
claim-keyed sweep is the org-wide token sweep pasted above (42 prose tokens, deliberately not
treated as refs) plus the two
collectRefscallers, which are unchanged in signature because thecollection is total.
line), and the changed path executed live end-to-end with a control, both pasted above.
candywalkis a library with no runtime deployment target of its own; its change-classgate is this module's CI (build, vet, test, and the four-way cross-compile matrix), all green on
the head. The live execution of the changed path is the consumer entry point run pasted above —
the strongest available form for a library whose consumers are generators. No
disposable: truebed exists for
sdkitself; the beds that exercise the consumers areplugin-docs'/marketplace'sand are named below.
Change classification
Library change in
sdk/candywalk(unexported collector;CollectEntitiesRemote's signature isunchanged). Gate: the module's Go suite + the live consumer-entry-point run, both pasted.
Consumer adoption, routed by name. The collector now surfaces refs it previously dropped, so a
consumer's fetched-ref set can grow; the two consumers are
plugin-docsandplugin-marketplace.No consumer source change is needed (the seam is untouched), so the adoption is the corpus
regeneration that follows producer merges — the deliverable of cluster C7, task-3 on this team's
board (
docs-truth, owner of the marketplace corpus regeneration and thedocs#143drift gate),which is in progress. That is a named task with an owner and a start, not a parked "same landing".
Closes #322.
Agent: cache-identity
Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (analysed on a live system)