Repository navigation
fix(spec): resolve a local import ref to its PROJECT identity, not the enclosing repo - #202
Conversation
…e enclosing repo RepoIdentity() returned the git `origin` identity of the ref's directory, and `git remote get-url origin` walks UP to the enclosing repository. A namespaced import of a subdirectory project inside the same repo therefore inherited the ROOT's identity, so walkNamespace's repo-identity cycle-break resolved it as a REFERENCE mount to the root — a degenerate self-cycle. The materialized wire marshaller then failed with `json: unsupported value: encountered a cycle via map[string]*spec.UnifiedFile` (opencharly/opencharly#330's signature), and once that marshaller was made cycle-safe the whole namespace was silently dropped. ProjectRepoIdentity() now owns the rule uniformly (RootRepoIdentity is a thin forward to it): an explicit `repo:` in the project's charly.yml is authoritative; otherwise the git origin identity is QUALIFIED by the project's path relative to the git toplevel whenever the project is not itself the repo root. A repo-root project (a local submodule) keeps the bare identity, so the local<->remote mutual-import short-circuit is unchanged. Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)
Review — BLOCKHead SHA: Change class: Go code ( Blocks
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
…forms The first revision qualified only a LOCAL ref's identity. A remote `@host/org/repo[/sub]` ref still dropped its sub-path, so a subdirectory project addressed remotely collapsed to its enclosing repo — the same false back-edge on the other path. ParseRemoteRef already exposes SubPath; RepoIdentity now carries it, mirroring the local branch's toplevel-relative qualification, so one rule covers both forms. The test header also now names WHICH of the two coupled fixes each consequence belongs to: this identity fix (the project resolves as a definition mount, so the namespace is delivered at all) versus the loaderkit wire codec's back-edge truncation (opencharly/sdk#350), which with the identity collapse still present silently dropped the namespace instead of crashing. Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)
Review — BLOCKHead SHA: Change class: Go code ( Security screen: PASS (no secrets/egress, no weakened guardrail, no new dependency, no edit to this validator's spec or the rulebook). Blocks
Comment dispositions
Non-blocking observations (investigated, not verdict-changing)
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
Review — PASSHead SHA: Security screen: PASS — no secrets/egress, no weakened guardrail, no new dependency, no edit to this validator's spec or the rulebook (spec/repo_identity.go is the Comment dispositions:
Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
The validator's prescribed remedy for the R10 finding: an in-repo `disposable: true` bed that exercises the changed dotted-local dispatch. The repo root IMPORTS its own testdata/dotted-local-fixture project as the namespace `dottedfix`, so that project's kind:local bed is reachable ONLY as the namespace-qualified `dottedfix.dottedfix-bed` — the dotted-key shape the local arm must resolve. check-dotted-local-resolve drives it through a real `charly check live` and asserts the fixture's step id, which the pre-fix code never reaches (it exits non-zero with `local deployment ... not found`). This shape requires the two producer fixes that make it possible at all: opencharly/spec#202 (an import ref's identity names its PROJECT, so a subdirectory project mounts as a definition rather than a self-reference) and opencharly/sdk#350 (the materialized wire codec terminates the cyclic namespace graph instead of rejecting it). Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)
…#78) (#85) * fix(check): resolve a dotted local bed with the dispatcher's resolver The local live arm resolved a dotted name with an in-substrate-only member walk, which cannot reach a NAMESPACE-QUALIFIED deploy key (charly.check-task — its dots are namespace separators), so every dotted local bed reported "local deployment … not found" before its plan ran. Use resolveDeployNodeByPath (exact-key-first), the SAME resolver the dispatcher checkLocalTarget already uses, and tighten checkLocalTarget to dispatch on a RESOLVED leaf's venue instead of falling through to its root. * test(check): host-root + non-host-leaf dispatch case (#78) checkLocalTarget now dispatches on a RESOLVED leaf's venue; add the case that distinguishes it (my-local.pod-child -> not local), which returns true on the pre-fix code and so fails without the change. * test(check): add the in-repo disposable dotted-local R10 bed (#78) The validator's prescribed remedy for the R10 finding: an in-repo `disposable: true` bed that exercises the changed dotted-local dispatch. The repo root IMPORTS its own testdata/dotted-local-fixture project as the namespace `dottedfix`, so that project's kind:local bed is reachable ONLY as the namespace-qualified `dottedfix.dottedfix-bed` — the dotted-key shape the local arm must resolve. check-dotted-local-resolve drives it through a real `charly check live` and asserts the fixture's step id, which the pre-fix code never reaches (it exits non-zero with `local deployment ... not found`). This shape requires the two producer fixes that make it possible at all: opencharly/spec#202 (an import ref's identity names its PROJECT, so a subdirectory project mounts as a definition rather than a self-reference) and opencharly/sdk#350 (the materialized wire codec terminates the cyclic namespace graph instead of rejecting it). Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated) * revert(check): drop the speculative leaf-venue dispatch change (#78) The resolver fix (resolveLocalDeployNode + the local arm using it) is the whole of #78's defect, and the in-repo R10 bed witnesses it: its target dottedfix.dottedfix-bed resolves to a HOST leaf, so `charly check run check-dotted-local-resolve` fails before the fix and passes after it with NO change to checkLocalTarget. The accompanying checkLocalTarget dispatch change (a RESOLVED non-host leaf under a HOST root must not be local-routed via its root) alters a DIFFERENT behavior, and its only witness is a unit case — the local-bed R10 cannot distinguish it. It is therefore separable from this cutover and moves to its own named change (#86), which must carry a runtime witness bed. Also corrects charly.yml's stale header comment ("This file declares no entities of its own - it only tells charly where to look"), which is false since this file now declares the import and the R10-witness entities. Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)
…orktree-safe
Two changes in one commit: the pin advance this PR came for, and the fix for the defect that
stopped its OWN gate from running.
1. Policy-B pin advance (via `charly task pins MODE=bump`, scoped to the charly gitlink):
charly 350435d789836d135304c2e49af40211cd5f10e9 -> 214692903edee807d9149f518fcd6896c7c294f6
What the pin carries (the merged producer chain): opencharly/spec#202 (an import ref's
identity names its PROJECT), opencharly/sdk#350 (the wire codec terminates the cyclic
UnifiedFile.Namespaces graph), opencharly/plugin-check#85 (the local arm resolves a
namespace-qualified bed with the dispatcher's resolver) and opencharly/plugin-check#87 (a
resolved non-host leaf under a host root dispatches on its own venue). Together these
close #330: `./charly/bin/charly task list` from the umbrella root
loads and lists every maintenance task instead of aborting at project load with
`json: unsupported value: encountered a cycle via map[string]*spec.UnifiedFile`.
No distro-* move is required: charly's box/* gitlinks are identical at 350435d7 and
21469290, so policy B already holds for the twins.
2. scripts/check-harness-config.mjs: the self-test no longer aborts on an unmaterialized
submodule surface. `stage()` copied every surface unconditionally, so a checkout without
the `marketplace` submodule -- the session-worktree layout Part II rule 2 REQUIRES --
threw ENOENT out of the self-test and made `charly task verify` un-runnable there. It now
SKIPS such a surface with a NOTICE, the same precondition the gate already guards at
checks 8/12/13, and the four corpus-measured arms (check 12's two, check 13's coverage
and collision) are skipped in the same voice; the report names how many arms were live.
Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)
…+ loader-cycle fixes (#330) (#424) * chore(pins): advance charly to v2026.280.1631 -- the dotted-local-bed + loader-cycle fixes Policy-B pin advance via `charly task pins MODE=bump` (scoped to the charly gitlink): charly 350435d789836d135304c2e49af40211cd5f10e9 -> 945f9d7d35d3383bee4863f1aa00d10c6a48e3a9 What the pin carries (the merged producer chain): - charly#821 adopts spec v0.2026280.1255 (opencharly/spec#202 -- an import ref's identity names its PROJECT), sdk v0.2026280.1251 (opencharly/sdk#350 -- the wire codec terminates the cyclic UnifiedFile.Namespaces graph) and plugin-check v0.2026280.1309 (opencharly/plugin-check#85 -- the local arm resolves a namespace-qualified bed with the dispatcher's resolver). Together these fix #330: `./charly/bin/charly task list` from the umbrella root now loads and lists every maintenance task (rc=0) instead of aborting at project load with `json: unsupported value: encountered a cycle via map[string]*spec.UnifiedFile`. No distro-* move is required: charly's box/* gitlinks are unchanged between the old and the new pin, so policy B already holds for the twins (verified). Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated) * chore(pins): advance charly to v2026.280.1725 and make the pin gate worktree-safe Two changes in one commit: the pin advance this PR came for, and the fix for the defect that stopped its OWN gate from running. 1. Policy-B pin advance (via `charly task pins MODE=bump`, scoped to the charly gitlink): charly 350435d789836d135304c2e49af40211cd5f10e9 -> 214692903edee807d9149f518fcd6896c7c294f6 What the pin carries (the merged producer chain): opencharly/spec#202 (an import ref's identity names its PROJECT), opencharly/sdk#350 (the wire codec terminates the cyclic UnifiedFile.Namespaces graph), opencharly/plugin-check#85 (the local arm resolves a namespace-qualified bed with the dispatcher's resolver) and opencharly/plugin-check#87 (a resolved non-host leaf under a host root dispatches on its own venue). Together these close #330: `./charly/bin/charly task list` from the umbrella root loads and lists every maintenance task instead of aborting at project load with `json: unsupported value: encountered a cycle via map[string]*spec.UnifiedFile`. No distro-* move is required: charly's box/* gitlinks are identical at 350435d7 and 21469290, so policy B already holds for the twins. 2. scripts/check-harness-config.mjs: the self-test no longer aborts on an unmaterialized submodule surface. `stage()` copied every surface unconditionally, so a checkout without the `marketplace` submodule -- the session-worktree layout Part II rule 2 REQUIRES -- threw ENOENT out of the self-test and made `charly task verify` un-runnable there. It now SKIPS such a surface with a NOTICE, the same precondition the gate already guards at checks 8/12/13, and the four corpus-measured arms (check 12's two, check 13's coverage and collision) are skipped in the same voice; the report names how many arms were live. Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)
… path-scoped NamespaceAncestors (#352) (#353) * fix(loaderkit): guard the namespace fold against a cyclic graph -- one 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) * fix(loaderkit): state the real count — the guard was re-derived in FOUR 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)
Summary
An import ref's identity named its enclosing repo, not its project — on BOTH ref forms. A namespaced import of a subdirectory project inside the same repo inherited the root's identity, so
walkNamespace's repo-identity cycle-break resolved that distinct project as a REFERENCE mount to the root — a degenerate self-cycle. Measured consequence: the materialized wire marshaller rejected it with(the signature of opencharly/opencharly#330) — and once that marshaller is made cycle-safe, the namespace is silently dropped, strictly worse than the crash.
RepoIdentity()now resolves the PROJECT identity on both paths —ProjectRepoIdentity(dir)resolves a filesystem path (andRootRepoIdentity()forwards to it), while the remote branch qualifies the parsed ref byParseRemoteRef'sSubPath:@host/org/repo[/sub][:ver]→host/org/repoplus/subwhen a sub-path is present (ParseRemoteRefalready exposes it; previously the sub-path was dropped, so a remote subdirectory project collapsed to its repo — the same false back-edge on the other path);repo:in the project'scharly.ymlis authoritative; otherwise the gitoriginidentity qualified by the project's path relative to the git toplevel whenever the project is not itself the repo root;Head
ccecd10ca0f5a7076295826d268f12a4314e7510, diff vsorigin/main:Commits:
16f62d6(the local-path fix) andccecd10(the remote-path fix, plus naming in the test header which of the two coupled fixes each consequence belongs to).How tested
The new tests FAIL on the pre-fix code — the coverage is real, not vacuous. The final test file run against a clean
origin/mainworktree:On this head all four pass, and the CI-equivalent gate is green (
golangci-lintv2.13.2, the version CI installs):Live, end-to-end on the real loader — a charly binary built against this spec worktree (
replace github.com/opencharly/spec => <spec worktree>), on a project whose rootcharly.ymlmounts a subdirectory project as a namespace:The first result is this fix: the namespace mounts and is delivered instead of being dropped. The last line is the intended end state for this leg — the loader now delivers the namespaced
kind: localbed and the classifier routes it to the LOCAL arm; the remainingnot foundis the local-arm resolver bug owned by opencharly/plugin-check#78 / PR #85, which is in flight and already carries that fix. Before this change the bed never reached the classifier at all.Scope note, stated because the live run predates
ccecd10: it exercises the local branch, whichccecd10does not touch — that commit extends the SAME rule to the remote branch, whose pure-function behavior is pinned byTestRepoIdentity_RemoteSubPathIsProjectScopedabove. The remote arm has therefore not executed live, and the attribution tier above is set to that fact rather than claiming a coverage it does not have.Rulebook compliance
git-workflow,go,pluginskills loaded before any edit.RepoIdentity→git remote get-url originwalks up to the enclosing repo, and the remote branch droppedParseRemoteRef'sSubPath;walkNamespacebreaks cycles by that identity, so a distinct subdirectory project was resolved as a back-reference to the root. Confirmed by controls (the same fixture with a nested.git, or imported from outside the repo, mounts correctly).16f62d6, remote inccecd10); the coupled wire-codec half is a named, in-flight PR (opencharly/sdk#350) and the consumer is opencharly/plugin-check#85 — no deferral or "pre-existing" framing.ProjectRepoIdentity(dir)resolves a filesystem path andRepoIdentity's remote branch qualifies the parsed ref bySubPath; both yield "the PROJECT, never the enclosing repo", andRootRepoIdentity()forwards toProjectRepoIdentity. No second rule survives.RepoIdentitydoc now states the project-scoped contract on both forms.git statusclean before and after each commit; PR-only branch; no force-push (the review fix is an append-only commit).Change classification
analysed on a live system— the module's CI-equivalent gate passed on the final tree and the changed local branch ran live on the real loader; the remote-branch arm added inccecd10is a pure function, pinned byTestRepoIdentity_RemoteSubPathIsProjectScopedbut not itself executed live, so the higherfully tested and validatedclaim is deliberately not made.Related: opencharly/opencharly#330 (same load-graph defect family; the wire-codec half lands as opencharly/sdk#350), opencharly/plugin-check#85 (the consumer PR whose R10 this unblocks).
Agent:
plugin-check-85-takeover· sessionsession-fe6a1287-a711-4e47-b913-70b78d262fd1Assisted-by: DeepSeek Harness deepseek-v4.1-flash (analysed on a live system)