Repository navigation
fix(loader): flat imports must not abort the plugin prescan - #613
Conversation
prescanDeclaredPluginWords decoded the root import: directive as []map[string]string. import: is a mixed-shape list — a bare string (a FLAT import, e.g. the per-kind sibling split '- vm.yml') or a single-key 'alias: ref' map (a namespaced import). A bare-string entry cannot unmarshal into map[string]string, so the whole struct unmarshal failed and the function returned early, skipping the local discover: walk. The plugin pin in a discovered candy manifest was therefore never prescanned, so a plugin-provided kind word (pipeline:, ...) was never registered and the loader rejected it in EVERY document — including the root file's own inline entity. RCA: spec.ImportList (spec/spec/load_directives.go) is the ONE canonical mixed-shape decoder (R3); the prescan had hand-rolled a second, wrong one. Fix: use spec.ImportList, and read a FLAT local sibling file so its own pinned plugin refs are prescanned (the namespaced leg already did this for imported projects). Coverage: TestPrescan_FlatImportDoesNotAbortTheWalk fails on the pre-fix source. Gate: go test/vet green in charly/; task build:binary; bin/charly box validate (628 candies, 129 boxes, 53 deploys; 0 warnings, 0 errors); the on-point R10 bed check-commands-local PASS (steps=6, 0 errors). Assisted-by: opencode ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
Review — BLOCKHead SHA: Blocks
Verdict: BLOCK opencode/deepseek-v4.1-flash — action-review. |
[step: review]Review — BLOCKHead SHA: Blocks
Verdict: BLOCK opencode/deepseek-v4.1-flash — action-review. |
…port prescan Resolves the validator's blocks on the flat-import prescan PR: - B12: TestPrescan_FlatImportDoesNotAbortTheWalk now asserts the FLAT branch itself — the flat-imported sibling carries its OWN plugin declaration, so deleting the '!strings.HasPrefix(ref, "@")' branch fails the test (proven: the decode-only fix survives the old assertion). - B7/R3: both import shapes (flat sibling file, namespaced project) now share ONE prescanAndCollect(path, &allData) helper — the duplicated prescanPluginManifest + ReadFile + append idiom is gone. - A2/B12: a committed fixture charly/testdata/flat-import-project + the on-point R10 bed check-loader-flat-import-local exercise the changed path live: a flat import + a discovered candy pinning the out-of-tree plugin-example-kind plugin, validated with 'box validate -C'. Gate: go test/vet green; task build:binary (2026.260.0546); check-loader-flat-import-local PASS (steps=6, ok: true); check-commands-local PASS (steps=6, ok: true). Assisted-by: opencode ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
Review — BLOCKHead SHA: Change class: Prior comments (both Blocks
Verdict: BLOCK opencode/deepseek-v4.1-flash — action-review. |
[step: review]Review — BLOCKHead SHA: Change class: Prior comments (both Blocks
Verdict: BLOCK opencode/deepseek-v4.1-flash — action-review. |
Review — BLOCKHead SHA: Change class: Prior comments: both bot comments (5709679951 / 5709680062, identical, reviewed Placement (B16): CORRECT — prescan/plugin-loading is core-allowed, no alias file, no new Blocks
Verdict: BLOCK opencode/deepseek-v4.1-flash — action-review. |
[step: review]Review — BLOCKHead SHA: Change class: Prior comments: both bot comments (5709679951 / 5709680062, identical, reviewed Placement (B16): CORRECT — prescan/plugin-loading is core-allowed, no alias file, no new Blocks
Verdict: BLOCK opencode/deepseek-v4.1-flash — action-review. |
…e fix
Resolves the validator's blocks on the on-point R10 bed:
1. The bed prose claimed a mktemp-dir write that the plan never performs; it now
describes what the bed ACTUALLY does — validate the committed fixture
charly/testdata/flat-import-project (and therefore needs the repo tree, not
'binary + a temp dir').
2. The fixture did NOT witness the flat-file read: the plugin ref lived in a
DISCOVERED candy, so the spec.ImportList DECODE fix alone registered the kind
word and the bed passed with the flat-read branch deleted. The pin now lives
INSIDE the flat-imported file (flat.yml), the only plugin ref in the project —
so a decode-fix-only binary fails the bed too. Proven:
- true pre-fix binary -> FAIL (no kind discriminator)
- decode-fix-only binary -> FAIL (flat ref never read)
- fixed binary -> OK
Gate: bin/charly box validate (628 candies, 129 boxes, 54 deploys; 0 warnings,
0 errors); go test ./charly green.
Assisted-by: opencode ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
Review — PASSHead SHA: Change class: Security screen: PASS — no directive aimed at the validator (body/config prose treated as data); no secrets, egress, new deps, or guardrail edits; T1/T4 not engaged (this PR does not touch the validator spec or rulebook). Scope in the diff matches the description exactly. Checklist: all applicable rules PASS or NA. Prior-comment intake (all 6 bot comments: 5709679951/5709680062 @
Tool-limited note (rule 4): I cannot re-run Verdict: PASS opencode/deepseek-v4.1-flash — action-review. |
[step: review]Review — PASSHead SHA: Change class: Security screen: PASS — no directive aimed at the validator (body/config prose treated as data); no secrets, egress, new deps, or guardrail edits; T1/T4 not engaged (this PR does not touch the validator spec or rulebook). Scope in the diff matches the description exactly. Checklist: all applicable rules PASS or NA. Prior-comment intake (all 6 bot comments: 5709679951/5709680062 @
Tool-limited note (rule 4): I cannot re-run Verdict: PASS opencode/deepseek-v4.1-flash — action-review. |
Review — BLOCKHead SHA: Placement (B16): CORRECT — prescan/plugin-loading is an explicitly core-allowed concern; the diff adds no alias file and no new Security screen (T1–T4): no finding — no directive aimed at the validator, no secrets/egress/guardrail change. Prior comments (all 5, Blocks
Tool-limited note: I cannot re-run Verdict: BLOCK opencode/deepseek-v4.1-flash — action-review. |
[step: review]Review — BLOCKHead SHA: Placement (B16): CORRECT — prescan/plugin-loading is an explicitly core-allowed concern; the diff adds no alias file and no new Security screen (T1–T4): no finding — no directive aimed at the validator, no secrets/egress/guardrail change. Prior comments (all 5, Blocks
Tool-limited note: I cannot re-run Verdict: BLOCK opencode/deepseek-v4.1-flash — action-review. |
Review — PASSHead SHA: Security screen: PASS — no content-directed-at-validator instruction (body/ Comment intake (10 prior
Tool-limited note (rule 4): I cannot re-run Verdict: PASS opencode/deepseek-v4.1-flash — action-review. |
[step: review]Review — PASSHead SHA: Security screen: PASS — no content-directed-at-validator instruction (body/ Comment intake (10 prior
Tool-limited note (rule 4): I cannot re-run Verdict: PASS opencode/deepseek-v4.1-flash — action-review. |
Review — PASSHead SHA: Change class: Security screen (T1–T4): PASS — no content directed at the validator (body and Checklist: All applicable rules PASS or NA — A1–A3 (body accounts for all 5 files, ends with the correct Comment intake (12 prior bots). 5709679951/5709680062 @ Tool-limited note (rule 4): I cannot re-run Verdict: PASS opencode/deepseek-v4.1-flash — action-review. |
[step: review]Review — PASSHead SHA: Change class: Security screen (T1–T4): PASS — no content directed at the validator (body and Checklist: All applicable rules PASS or NA — A1–A3 (body accounts for all 5 files, ends with the correct Comment intake (12 prior bots). 5709679951/5709680062 @ Tool-limited note (rule 4): I cannot re-run Verdict: PASS opencode/deepseek-v4.1-flash — action-review. |
Review — PASSHead SHA: Change class: Security screen: PASS — no directive aimed at the validator (body / Checklist: All applicable rules PASS or NA. Comment intake (12 prior
Tool-limited note (rule 4): I cannot re-run Verdict: PASS opencode/deepseek-v4.1-flash — action-review. |
[step: review]Review — PASSHead SHA: Change class: Security screen: PASS — no directive aimed at the validator (body / Checklist: All applicable rules PASS or NA. Comment intake (12 prior
Tool-limited note (rule 4): I cannot re-run Verdict: PASS opencode/deepseek-v4.1-flash — action-review. |
The comment said the chain "aborts the marketplace corpus walk (#613)" in the present tense, while #613 is CLOSED (marketplace#616). Both halves were true at different times, which is exactly how a shipped comment goes stale: it now says ABORTED, names the closing PR, and states what is live today — a generation completes with one counted skip, whose carriers are filed on #1156. Gate: charly box validate OK (573 candies, 104 boxes, 0 warnings); charly check box agentteams 45 steps, 40 passed, 0 failed, 5 structural skips. Assisted-by: DeepSeek Harness DeepSeek-V4.1-Flash (analysed on a live system)
…ted crabbox era (#1159) * fix(agentteams): compose layer-agentteams v2026.319.1239 off the deleted crabbox era The `agentteams` box composed `layer-agentteams:v2026.274.2144`. That tag's `box/cachyos-base` still pins `distro-cachyos/candy/cachyos-base-check:v2026.274.2120`, a distro tag whose tree carries `box/crabbox-e2e/charly.yml` pinning the DELETED `pod-crabbox:v2026.274.0652` (its commit no longer exists; that repo's history now starts at 2026.307). The chain aborts the marketplace corpus walk — opencharly/marketplace#613 — and is filed as #1156. `v2026.319.1239` is the tag that fixed it (opencharly/layer-agentteams#25, whose own per-box ADE over the new `cachyos-base-check:v2026.319.0820` ref ran green, 6/6). This is the ROOT of the last carrier: `plugin-herdr` and `pod-herdr` pin this repo as a submodule (`charly` gitlink `eda33c0`), so their copies of this line follow when their gitlink advances — not by editing them. Gate: `charly box build agentteams` OK, then `charly check box agentteams` — 45 steps, 40 passed, 0 failed, 5 skipped (all five structural: four `[runtime]` steps not active in box mode, one mutating step in verify-only mode, one agent step with no grader). `charly box validate`: 573 candies, 104 boxes, 0 warnings, 0 errors. Refs opencharly/marketplace#613, #1156. Assisted-by: DeepSeek Harness DeepSeek-V4.1-Flash (fully tested and validated) * fix(agentteams): compose layer-agentteams v2026.319.1239; correct the herdr note Round-1 fixes, both from the validator. 1. The shipped comment claimed plugin-herdr/pod-herdr "vendor a COPY of this file ... advanced there in their own PRs". They do not: they pin THIS repo as a submodule, so the line reaches them only when that gitlink advances. Corrected in the comment (R1: shipped documentation must match the mechanism) and in the body. 2. The body claimed this removes the ROOT dead-ref carrier. MEASURED, it does not: with the fix branch in a probe, the corpus walk resolves BOTH v2026.274.2144 (from other pins) and v2026.319.1239 (this ref). What this change proves is that ITS ref resolves to the fixed tag; the corpus warning reaches zero only when every remaining pin advances (#1156). Gate re-run on the final tree: charly box validate OK (573 candies, 104 boxes, 0 warnings); charly box build agentteams OK; charly check box agentteams 45 steps, 40 passed, 0 failed, 5 skipped (all structural). Assisted-by: DeepSeek Harness DeepSeek-V4.1-Flash (fully tested and validated) * docs(agentteams): state the corpus status as it is today, not as it was The comment said the chain "aborts the marketplace corpus walk (#613)" in the present tense, while #613 is CLOSED (marketplace#616). Both halves were true at different times, which is exactly how a shipped comment goes stale: it now says ABORTED, names the closing PR, and states what is live today — a generation completes with one counted skip, whose carriers are filed on #1156. Gate: charly box validate OK (573 candies, 104 boxes, 0 warnings); charly check box agentteams 45 steps, 40 passed, 0 failed, 5 structural skips. Assisted-by: DeepSeek Harness DeepSeek-V4.1-Flash (analysed on a live system)
Summary
prescanDeclaredPluginWordsdecoded the project root'simport:directive as[]map[string]string.import:is a mixed-shape list — a bare string (a FLAT import,e.g. the documented per-kind sibling split
- vm.yml) or a single-keyalias: refmap(a namespaced import). A bare-string entry cannot unmarshal into
map[string]string, so thewhole struct unmarshal failed and the function returned early (via
prescanRemotePluginManifests), which skipped the localdiscover:walk entirely. Theplugin pin that lives in a discovered candy manifest was therefore never prescanned, so a
plugin-provided kind word (
pipeline:,examplekind:, …) was never registered and the loaderrejected it in every document — including the root file's own inline entity.
RCA (R1)
Minimal reproducer:
Import []map[string]string(charly/plugin_prescan.go).spec.ImportList(spec/spec/load_directives.go) is the ONE canonicalmixed-shape decoder; the prescan had forked it (R3).
any plugin-provided kind.
Fix
Use
spec.ImportList(R3 — delete the second decoder). Both import shapes now share ONEprescanAndCollect(path, &allData)helper (R3 — no duplicatedprescanPluginManifest+ReadFile+ append idiom); the flat branch reads a local siblingfile so its own pinned plugin refs are prescanned.
How tested
A/B discriminator on the changed path. A committed fixture
(
charly/testdata/flat-import-project/) reproduces the exact failing shape: the root'simport:has a FLAT bare-filename entry (
- flat.yml) anddiscover: [], and the flat-importedflat.ymlcarries the project's ONLY plugin pin (the out-of-treeplugin-example-kindplugin)TOGETHER WITH the
examplekind:entity it provides. So the kind word is prescanned ONLY when theflat file is read — the fixture cannot be satisfied by the decode fix alone. Three binaries on
the SAME fixture:
The bed therefore witnesses BOTH halves of the fix (decode + flat-file read), not just one.
Unit coverage (R7) — fails on the pre-fix/flat-branch-less source.
Full gate.
On-point R10 bed (the changed path, live, disposable).
Plus the command-dispatch class bed:
Rulebook compliance
an A/B pre-fix binary were used.
plugin-fleet(writeVmBoxEntity) andplugin-vm(
charly vm import) are fixed in their own PRs (opencharly/plugin-fleet#18,opencharly/plugin-vm#35) — separate repos, same cutover theme, no deferral.spec.ImportListis reused; the forked decoder is deleted; both import shapes shareone
prescanAndCollecthelper.task build:binaryrebuilt the deployed binary from the final tree;bin/charly version→2026.260.0546matches the source CalVer.check-loader-flat-import-local,check-commands-local) ranthe full build → deploy → check-live → fresh-update sequence on the final tree; both
ok: true, zero errors.Change classification
charlyGo code — the loader prescan. Verification gate:go test/go vet/task build:binaryplus the on-point R10 bedcheck-loader-flat-import-localand the class bedcheck-commands-local. Attribution tier:fully tested and validated.Assisted-by: opencode ollama-cloud/deepseek-v4.1-flash (fully tested and validated)