Repository navigation
fix(loaderkit): guard the namespace fold against a cyclic graph — one path-scoped NamespaceAncestors (#352) - #353
Conversation
…e path-scoped NamespaceAncestors ProjectCandiesScanned folded uf.Namespaces by recursing UNGUARDED, so a namespace that reaches itself up the CURRENT path -- the intentional `main<->sub` mutual import, and before opencharly/spec#202 also the self-mount of a same-repo subdirectory import -- died with `fatal error: stack overflow` (measured live on a project carrying a resolved pod target, whose leg runs this scan; #352). The rule it needed already existed, re-derived at five other call sites, so it now lives ONCE as loaderkit.NamespaceAncestors (namespace_walk.go): a PATH-SCOPED ancestor stack, NEVER a global pointer set, because the loader mounts the SAME *spec.UnifiedFile at multiple namespace paths BY DESIGN (a diamond import reached as `a.c` AND `b.c` via reference-mount pointer identity, or one repo mounted at `arch` + `cachyos.arch`) and a global set records only the first path in map-iteration order, silently dropping every later alias. Every loaderkit walk now uses it -- StampDeployDescents, captureNamespaceLevels, capturePluginKindsSeen, restorePluginKindsSeen, projectCandiesScanned -- and ResolveProjectSeams.FillNamespacedBoxes carries the type across the seam, so a plugin implementing that leg inherits the semantics rather than re-deriving them. Tests: TestProjectCandiesScanned_TerminatesOnACyclicNamespaceGraph (the regression -- it aborts the package with `fatal error: stack overflow` before this change) and TestNamespaceAncestors_IsPathScopedNotGlobal (the rule itself). Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)
Review — BLOCKHead SHA: Change class: sdk library code ( Blocks
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
…heckable Review round 1 fixes, every finding of the BLOCK, in one commit. A1: the body asserted "one commit on a feat/ branch" while the branch is fix/name-uninitialized-submodule. The claim is corrected to the branch actually used; fix/ is the prefix this repository uses for fixes (cf. #353, #359). B14(d)/R2: the sibling claim - "no other loader carries the same defect" - was asserted without a pasted command. The commands and their real output are now in the body, including the one hit that does exist (exec/ResolveHome, unrelated to import resolution) rather than a claim of an empty result. Also, from the review's non-blocking notes: uninitializedSubmodule did not use its walker receiver, so it is now a plain function. Gates re-run on this tree: go test ./... 14 packages ok; gofmt clean; go vet rc=0; cross-compile amd64/arm64/arm/386 all ok; the four targeted tests pass. Assisted-by: dsh deepseek-v4.1-flash (analysed on a live system)
…a missing file (#361) * fix(loaderkit): name an uninitialized submodule instead of reporting a missing file A namespaced import whose target is a declared submodule directory that exists but holds nothing - the ordinary state of a fresh `git worktree` - resolved to the directory, had the unified file name appended, and failed with a bare ENOENT. On an older engine the same tree surfaced it as `json: unsupported value: encountered a cycle via map[string]*spec.UnifiedFile`. Neither reading named the cause, and because the umbrella pre-commit hook calls `charly task ...` from a session worktree, it silently blocked every umbrella PR from the sanctioned place (opencharly/charly#847). The walk now reports the cause it can prove: the directory is empty AND its containing repository declares it as a submodule path in .gitmodules. The message names the submodule and the command that fixes it. Anything else - a populated directory, an undeclared directory, a non-NotFound error - is left untouched so the ordinary not-found path still works for a genuinely wrong ref. Three negative cases are covered beside the positive one. Assisted-by: dsh deepseek-v4.1-flash (syntax check only) * fix(loaderkit): drop the unused receiver and make the sibling claim checkable Review round 1 fixes, every finding of the BLOCK, in one commit. A1: the body asserted "one commit on a feat/ branch" while the branch is fix/name-uninitialized-submodule. The claim is corrected to the branch actually used; fix/ is the prefix this repository uses for fixes (cf. #353, #359). B14(d)/R2: the sibling claim - "no other loader carries the same defect" - was asserted without a pasted command. The commands and their real output are now in the body, including the one hit that does exist (exec/ResolveHome, unrelated to import resolution) rather than a claim of an empty result. Also, from the review's non-blocking notes: uninitializedSubmodule did not use its walker receiver, so it is now a plain function. Gates re-run on this tree: go test ./... 14 packages ok; gofmt clean; go vet rc=0; cross-compile amd64/arm64/arm/386 all ok; the four targeted tests pass. Assisted-by: dsh deepseek-v4.1-flash (analysed on a live system) * fix(loaderkit): name the submodule-search depth bound Review round 2, both findings, one commit. A1: the body asserted "one commit" while the branch carries two. The assertion is removed rather than corrected to a number: the branch carries the fix commit and its review-round fix commits, and the org lands by squash - a count would be stale again the moment this commit lands, which is the exact defect this campaign already measured once. R4/B8: submoduleRoot's ancestor search was bounded by a bare literal 4. It is now maxSubmoduleSearchDepth, with the reason it is four rather than any other number: a gitlink lives directly under the repo that declares it, or one level deeper in nested layouts, so four covers every org layout while keeping the search from climbing to the filesystem root on a path that is not in a submodule at all. The bound decides whether the named-cause error fires, so it is not a detail. Gates: go test ./loaderkit/ ok; gofmt clean; go vet rc=0; go build ./... rc=0. Assisted-by: dsh deepseek-v4.1-flash (analysed on a live system)
…UR functions, not six The shipped comment in namespace_walk.go claimed the path-scoped subtlety "was re-derived at six call sites". Measured on main it was re-derived as a LOCAL guard in exactly four functions: `git grep -n 'ancestors\[' loaderkit` returns stampDescents, captureNamespaceLevels, capturePluginKindsSeen and restorePluginKindsSeen, and nothing else. A third count (five) appeared in the PR body. The comment now names the four, so the claim carries its own evidence instead of a number the reader has to take on faith. Assisted-by: dsh deepseek-v4.1-flash (fully tested and validated)
validator INCONCLUSIVE — no review verdict was produced (not a BLOCK; no code finding)The gate could not obtain a review verdict on this run, so it produced no code finding. This is not a BLOCK and the PR is not being rejected — but the required check stays RED on purpose: unreviewed code must never merge.
Root cause (measured in this run). The engine's own terminal line names the class: the model used the shared Measured in this run (the engine's own lines): Durable remedy.
Thread policy. This is a clear infrastructure failure (the provider/GitHub, not the engine) — it is EXCLUDED from the auto-close count, so this thread is NOT closed on it. Fix any A run that produced no verdict keeps this required check RED: unreviewed code must never merge. Full diagnostics: this run's evidence artifact + job log (not embedded here — embedding a runaway log would feed it into the next review and deepen the collapse). |
Review — PASSHead SHA: Security screen: PASS — no scope mismatch, no secrets/egress, no weakened guardrail, no supply-chain change; the seam-signature change is documented as the cutover's consumer leg. Checklist: All applicable rules PASS or NA. Comments considered:
Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
Summary
plugin.providers:andplugin.requires:both name a#PluginCapability, but only theproviders:path had its class vocabulary checked.spec#216made the CUE pattern's class segment structural — retiring the CUE-side check on both paths — which would have leftrequires:with no vocabulary check anywhere. This PR moves the check into the one shared reporter, so both paths share one taxonomy (R3) andrequires:names an undeclared class instead of calling a correct wordmalformed.What changes:
candy/plugin-box/validate_rules.go— onereportCapabilityFaultshared by both paths.candy/plugin-box/validate_parity_test.go—TestPluginRequiresClassVocabularycovers both directions.charly.yml— onecheck:step incheck-box-localwitnessing therequires:arm.workflow:lobster→zzznotaclass:lobsteris required, not incidental:workflowjoined the known vocabulary (schema/candy.cue:559), so the old fixture went red onmain, and nothing surfaced it because this repo has noci.yml(#38).Fresh branch off
origin/main; supersedes#37, which the verdict counter auto-closed. The pre-change ref here is simplyorigin/main, which retires the proof-binding findings the old thread kept producing.How tested
R7 — the coverage fails without the change. Reverting
validate_rules.gotoorigin/main, with acmpidentity check so the revert cannot be a silent no-op:The reverted output contains no capability diagnostic at all, so the assertions can only fail — the test cannot pass vacuously on the old code.
The two renamed-fixture tests were red on
main, measured:The module gates at this head:
That failure reproduces identically on a pristine
origin/mainworktree, and its mechanism is host state:candyProjectDirwalks up for an enclosing project, the test's "orphan" lives undert.TempDir()(which resolves under/tmphere), and/tmp/charly.yml— another session's leftover from 2026-10-07 — is found. CI'sgojob is green on this very head, which places the failure on the host, not the tree. Filed as#366; the stray file was not deleted (removing someone else's scratch to turn a test green is the workaround R4 forbids).R10 — the change-class bed ran green. A worktree-local binary was built with this branch's plugin compiled in from its local checkout, and the repo's own witness ran against it:
summary.ymlbinds it:driver_version: 2026.282.1710,driver_size: 52920818, andok: trueon all six steps. The new step fired —check-live.log:[box-capability-unknown-class-in-requires] exit=0— and it declares a valid provider plus an invalidrequires:class with a control expected to stay silent, so it cannot pass vacuously.Filed issues
#38— noci.ymlin this repo:gofmt/vet/test/golangci-lintrun nowhere on a PR here. An ad-hoc lint finds 6 pre-existingerrcheckfindings, none in this diff.#366—TestCandyProjectDirasserts an absolute where the property is relative; it fails on any host with acharly.ymlaboveTMPDIR.Rulebook compliance
spec#216; the bed failure and the reddeploykittest were both root-caused rather than labelled "pre-existing"; the earlier thread's findings were fixed, not argued with.main.bin/, never installed.check-box-localran on this tree:steps=6, allok: true.Change classification
Code and configuration — a new validation rule, its tests, and one bed step. Not breaking in the wire sense; it intentionally widens what
charly box validaterejects on therequires:path, which is the point. Tier:fully tested and validated— the change-class gate passed on the final tree, and the changed paths ran live in both the unit tests and the bed.Agent: issue-ledger-fanout, bed-venues — the original change (superseded PR #37)
Agent: org-triage-2026-10-09 — re-cut onto a fresh main, gates and R10 re-run here
Assisted-by: DSH DeepSeek deepseek-v4.1-flash (fully tested and validated)