Repository navigation
fix(loaderkit): name an uninitialized submodule instead of reporting a missing file - #361
Conversation
…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)
Review — BLOCKHead SHA: Change class: code/config (Go library, Comments: none present (0 in thread) — nothing to disposition. Placement: CORRECT — Blocks
Notes (non-blocking, for the author)
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)
Review — BLOCKHead SHA: Change class: code/config (Go library — Security screen: no T1–T4 finding — no secrets/egress, no guardrail weakening, no scope mismatch (the diff does exactly what the body describes), no embedded directive. Comments considered:
Blocks
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
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)
Review — PASSHead SHA: Security screen: PASS — no secrets/egress, no guardrail weakening, diff does exactly what the body states, no embedded directives.
Checklist: All applicable rules PASS or NA. (Placement: CORRECT — the fix lives in the sdk Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
Review — PASSHead SHA: Security screen: PASS — no secrets/egress, no guardrail weakening, diff does exactly what the body states (one helper + one call site + one named constant + tests), no embedded directives. Placement: CORRECT — the fix lives in the sdk Comments considered:
Checklist: All applicable rules PASS or NA. (R7 coverage present — Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
…dule (#863) * fix(deps): carry the sdk loader fix that names an uninitialized submodule Consumes opencharly/sdk#361 (merged; tag v0.2026281.2051, commit 54c82a9). charly's loader is loaderkit in the SDK, so the defect fixed there - a namespaced import whose target is a declared submodule directory that exists but holds nothing reported as a bare ENOENT - is only fixed FOR CHARLY once the module requirement moves. That requirement is the declaration the build reads; the umbrella gitlink is a second declaration of the same producer and is not touched here. sdk v0.2026280.2246 -> v0.2026281.2051 in charly/go.mod; go mod tidy moved the two go.sum lines it owns. Verified at the artefact level rather than by inference: the rebuilt binary reports dep github.com/opencharly/sdk v0.2026281.2051, with no replace in go.mod. Closes #847. Agent: charly (fan-out prerequisite) Assisted-by: dsh deepseek-v4.1-flash (fully tested and validated) * chore: re-trigger on the body that routes the gitlink surface to its named row R2/B14(b): the body parked a surfaced failure as a separate step. It now names the row that carries it - #864 - with the measured failure and candidate fixes pasted there, and the R2 bullet says so. No code change; the tree is identical. Agent: charly (fan-out prerequisite) Assisted-by: dsh deepseek-v4.1-flash (fully tested and validated) * fix(tools): align the lockstep modules with the shared sdk pin The go check failed on TestContractPinsMatchShared: bumping charly's sdk requirement moved the SHARED pin to v0.2026281.2051, and the three lockstep tools modules still required v0.2026280.2246. The test names its own remedy, so it was run rather than reasoned about: charly task mods-tidy, whose own run and check steps both pass. Six files move: the go.mod and go.sum of tools/generate-packages, tools/golden-cloudinit and tools/golden-compile. TestContractPinsMatchShared now passes locally and bootstrap-charly.sh returns 0. Agent: charly (fan-out prerequisite) Assisted-by: dsh deepseek-v4.1-flash (fully tested and validated)
…ound fired (#363) A step killed by the per-attempt never-hang bound reported only the mechanism of its death (`process terminated by signal (signal: killed)` plus the bound line, from #361). That answers "how long did it run" and not "was the probe making progress or was it wedged?" — and the two have different owners: a wedged probe is a defect in the probe, a legitimately slow probe needs an authored `timeout:`. Where a LOCAL pid exists, the process is the witness, so the kill now says which it was: - `kit/never_hang_evidence.go` — `KillEvidence` (bound, pid, alive-at-the-bound, silence) plus `ObserveLocalKill`, which reads liveness and elapsed silence from INJECTED readings so the never-hang path is provable without waiting for a production bound. - `AnnotateNeverHangKillWithEvidence` is the ONE implementation of the kill annotation; `AnnotateNeverHangKill` is its unobserved case, so every existing caller and message is byte-identical (R3). - `kit/images.go` — `runEngineCommand` reads liveness INSIDE `cmd.Cancel` (at the instant the bound fires, before our own SIGKILL) and annotates the deadline error. Remote/venue probes have no local pid, so they keep exactly the message they had: the qualifier is "where a local pid exists". Unchanged by design: the never-hang ceiling is still a HANG bound, `ProbeNeverHang` still honours an authored `timeout:` over the floor, and no timeout was widened (charly#846's isolated-cache fix is the precedent — the number is the symptom, never the fix). Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated) Co-authored-by: charly <[email protected]>
Summary
loaderkit's unified-file walk reports a missing file when the real cause is an uninitialized submodule. Fixesopencharly/charly#847.A namespaced import whose target is a declared submodule resolves to that directory; the directory exists (a gitlink directory always does), so
os.Statsucceeds, theIsDirbranch appendscharly.yml, and the read fails with a bareENOENT. On an older engine the same tree surfaced the identical state asjson: unsupported value: encountered a cycle via map[string]*spec.UnifiedFile. Neither reading names the cause, and both send the reader into the loader.That is not cosmetic: the umbrella's pre-commit hook calls
charly task …, and Part II rule 2 makes a session worktree the sanctioned place for umbrella work — so a bareENOENTfrom the loader silently blocks every umbrella PR from the sanctioned place, and R6 forbids the bypass.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 restraint is the point: a populated directory, an undeclared empty directory, a non-
NotFounderror and an existing target are all left untouched, so the ordinary not-found path still works for a genuinely wrong ref. A hint that fires on the wrong tree would be worse than theENOENTit replaces.How tested
loaderkit, live, in a fresh umbrella worktree that fails onmain(4a2fc64: 423 uninitialized submodules,charly/empty,.gitmodulesdeclaringpath = charly), withcharlyrebuilt against this tree:Four tests, one positive and three negative, each pinning one case:
This repository's own gates, on the final tree (
.github/workflows/ci.yml):Change classification:
fully tested and validated- the changed path executed live on the exact failing tree, this repo's full gate set green on the final tree, and cross-compile clean. The live before/after below was taken on the first revision; this revision changes only the receiver and the prose, and the gates were re-run on it.Review round 1 — every BLOCK finding fixed in this commit (
8f482d0)A1 — the body asserted a branch form the PR did not use. Corrected: the branch is
fix/name-uninitialized-submodule, andfix/is this repository's prefix for a fix (#353,#359). The R6 bullet now states the real branch.B14(d) / R2 — "checked and found none" is not evidence. The commands and their output:
Read honestly: the
(%q): %wshape does occur inspec— twice, both inexec/, forResolveHome, with no relation to import resolution. So the accurate statement is:spec's loader has no import-error path at all (import %sabsent; theloaderpackage is a single discovery file), and the only similarly-shaped errors elsewhere inspecare executor home-resolution ones. A claim of an empty result would have been wrong; the claim here is the one the output supports.Non-blocking notes. The unused
walkerreceiver is gone —uninitializedSubmoduleis now a plain function (call site and tests updated). The overlapping test the review flagged (…IgnoresExistingTargetpassing via theos.Statshort-circuit) is left as-is: it pins the intended case, and the reviewer judged it non-blocking.Gates re-run on this tree after the changes:
go test ./...-> 14 packages ok ·gofmt -l .clean ·go vetrc=0 · cross-compileamd64/arm64/arm/386ok · the four targeted tests pass.Review round 2 — both findings fixed in the same commit as this text
A1 — the body asserted a commit count the branch did not have. The previous revision said "one commit"; the branch carried two. Corrected structurally rather than numerically: the R6 bullet now states the branch's shape (the fix commit and its review-round fix commits, collapsing to one on squash). A corrected number would have been stale the instant this commit landed - the exact defect already measured on
charly#861tonight.R4 / B8 — unnamed magic number.
submoduleRootbounded its ancestor search with a barefor i := 0; i < 4; i++. It is nowmaxSubmoduleSearchDepth = 4, with the reason it is four: a gitlink lives directly under the repo that declares it (umbrella/charly), or one level deeper in nested layouts (repo/sub/candy), so four covers every layout the org uses 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 named rather than inlined.Gates on this tree:
go test ./loaderkit/ok ·gofmt -l .clean ·go vetrc=0 ·go build ./...rc=0.Branch catch-up (after the PASS verdict)
gh pr update-branchwas run because the PR readbehindwhen its verdict came back PASS - the org's auto-merge does not merge a stale branch.The catch-up did not touch the fix, and that is measured rather than assumed:
So the live-run evidence above still describes the same code, and this body names no tree hash, so nothing in it is invalidated by the head moving.
Rulebook compliance
git-workflowloaded before any git/PR action; this repo'sAGENTS.mdread first (Part II rule 4), including its "load these skills first" list and its gate list.grep -rn 'import %s' $GOMODCACHE/github.com/opencharly/->loaderkit/walk.go:192), after three greps insidecharly/found nothing. A message a program prints is owned by whichever module built that code.feat/, which the PR did not use; a later one asserted a commit count, which the next push would have made stale - so the claim is now the branch's shape, not its arithmetic).fix/is the prefix this repository uses for a fix, cf.#353(fix/loaderkit) and#359(fix(vmshared)). The org lands by squash, so one commit is what lands. No force-push, no hook bypass, no direct push tomain.exec/ResolveHome, unrelated to import resolution) instead of a claim of an empty result.Coordination
opencharly/sdk#353is open onloaderkittoo, for the different defect#352(a missing cycle guard on the namespace fold). It touchesnamespace_walk.go,project_candies.goand siblings; this change toucheswalk.goand a new test file - no overlap. Preflight run before this push (gh pr liston this repo,git worktree list, the watch list); no duplicate PR exists for this fix.Agent:
issue-ledger-fanout· sessionsession-66d2db27-61c9-484e-833f-534a3f71de10Assisted-by: dsh deepseek-v4.1-flash (fully tested and validated)