Skip to content

fix(deploy): resolve a namespace-qualified deploy key by exact match first - #678

Merged
github-actions[bot] merged 4 commits into
mainfrom
feat/rca-b-core
Sep 26, 2026
Merged

github-actions[bot] merged 4 commits into
mainfrom
feat/rca-b-core

Conversation

@aitrawog

@aitrawog aitrawog commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fix resolveDeployNodeByPath to resolve a namespace-qualified deploy key by
exact match first, so a namespaced bed's substrate provider is connected.

RCA (8-step, measured live)

Unexpected. From the umbrella root, every namespaced pod bed failed at
deploy-add:

charly: error: command "deploy": resolve target: deployment "charly.check-docs":
target "pod" is a known substrate but its deploy provider is not connected
(the github.com/opencharly/plugin-deploy-pod/candy/plugin-deploy-pod plugin candy
is not compiled-in or failed to load)

Mechanism. deployNodePluginContext → resolveDeployNodeByPath split the
deploy name unconditionally on ., so a namespaced top-level key
(charly.check-dsh-pod) was read as root charly + member path, missed, and
returned false — deployNodePluginContext then collected ZERO plugin words and
loadDeployPlugins never connected its pod substrate provider.

Root cause. spec.ResolveNodePath (spec#164) had already adopted
exact-key-first for the plugin-side walk, but this core pre-connect
collector — a second, independent resolver — was not updated: a producer/consumer
split across the spec/core boundary.

Fix

name, _ = spec.SplitVmAddress(name)
if node, ok := tree[name]; ok {   // EXACT full-key match FIRST
    return &node, true
}
parts := strings.Split(name, ".") // member descent only when absent

Mirrors spec.ResolveNodePath's exact-key-first contract — the same rule at the
core pre-connect layer.

Note on the SDK pin: charly origin/main already carries sdk v0.2026269.1159,
whose ProjectDeployConfig folds uf.Deploys() (the namespace-aware projection),
so no pin change is needed — the only missing half was this core resolver. This
PR's diff vs origin/main is exactly the 2 files below.

How tested

R7 regression test — FAILS pre-fix, PASSES post-fix

charly/deploy_plugin_load_test.go::TestResolveDeployNodeByPath gains the
qualified-key cases (charly.check-dsh-pod, vm:charly.check-dsh-pod):

# pre-fix source (test applied to unmodified plugin_loader.go):
    deploy_plugin_load_test.go:76: resolveDeployNodeByPath("charly.check-dsh-pod") ok=false, want true
    deploy_plugin_load_test.go:76: resolveDeployNodeByPath("vm:charly.check-dsh-pod") ok=false, want true
    --- FAIL: TestResolveDeployNodeByPath
# with the fix:
    --- PASS: TestResolveDeployNodeByPath

Go gate

$ gofmt -l charly/        # (empty)
$ go vet ./charly/        # exit 0
$ go test ./charly/       # ok github.com/opencharly/charly/charly

Live R10 — full namespaced bed green, from the final tree

Proof binary built from this final tree:

$ git rev-parse HEAD
19579fc50f8ad4d6271ae7d84a734aa152e1b077
$ (/tmp/c678v) version
2026.269.1858

$ charly -C . check run charly.check-docs
[image-build]         PASS
[check-image]         PASS
[deploy-add]          PASS   <-- required this fix; FAILED pre-fix
[config]              PASS
[start]               PASS
[bring-up-members]    PASS
[check-live]          PASS
[feature-run]         PASS
[update]              PASS
[rebuild-ready]       PASS
[check-live-rebuild]  PASS
[feature-run-rebuild] PASS
[cleanup]             PASS
[cleanup-members]     PASS
charly check run charly.check-docs: PASS (steps=14)
# summary.yml: ok: true

Target: charly.check-docs — disposable: true in charly/charly.yml
(check-docs: { pod: { image: docs-site-app, disposable: true } }).

Rulebook compliance

  • R1 — the failure was RCA'd live before remediation.
  • R2 — fixed in this tree; no deferral.
  • R3 — the exact-key rule stays one-per-layer (spec owns the plugin-side walk;
    core owns the pre-connect collector).
  • R4 — no workaround: the resolver is corrected, not bypassed.
  • R5 — the split-only path is replaced, not shadowed.
  • R6 — feat/ branch, PR-only, no force-push (append-only merge from main).
  • R7 — a regression test that FAILS without the change and PASSES with it.
  • R8 — the emitted artifact (the bed) is validated at its boundary.
  • R9 — the proof binary is a worktree build verified with charly version.
  • R10 — the whole namespaced bed passed live from the final committed tree.

Change classification

  • Change class: Go source (charly/plugin_loader.go) + test.
  • Verification gate: go test ./charly/ (fails-then-passes regression) + the
    live charly.check-docs R10 bed on a disposable: true target (14/14).
  • Attribution tier: fully tested and validated.

Assisted-by: opencode ollama-cloud/deepseek-v4.1-flash (fully tested and validated)

…first

resolveDeployNodeByPath split the name unconditionally on '.', so a
namespaced top-level deploy key (charly.check-dsh-pod) was read as a root
named 'charly' plus a member path, missed, and returned false.
deployNodePluginContext then collected ZERO plugin words for the deploy, so
loadDeployPlugins never connected its substrate provider and every
namespaced pod bed failed at deploy-add with

  target "pod" is a known substrate but its deploy provider is not connected

Fix: try the EXACT full key first; fall back to the member-path split only
when absent. This mirrors spec.ResolveNodePath's exact-key-first contract
(spec#164) — the same rule at the core pre-connect layer.

Test: TestResolveDeployNodeByPath gains the qualified-key cases
(charly.check-dsh-pod and its vm:-prefixed form); they FAIL against the
pre-fix source and PASS with the fix.

Assisted-by: opencode ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
@github-actions

Copy link
Copy Markdown
Contributor

Review — BLOCK

Head SHA: d151975841f460a1ded3ae88032e654537c75b01 (branch: feat/rca-b-core)

Change class: Go source (charly/plugin_loader.go) + Go test (charly/deploy_plugin_load_test.go) — runtime/code change (bed run required).

The diff itself is clean: the +11/-0 exact-key-first guard and the +13/-0 regression cases are internally consistent (hunk counts match; the new tree entry charly.check-dsh-pod makes the added cases fail on the pre-fix split and pass with the guard; the 14 listed bed steps reconcile with steps=14). Security screen clean (no scope mismatch, no secrets/egress, no guardrail weakening, no supply-chain change; this is not the security machinery). No comment thread to dispose (empty).

Blocks

  1. A1 / B17 / B12 (R10) — the live-R10 evidence never names a disposable: true target. The "How tested" §3 block and the R10 compliance bullet present a live charly.check-docs run whose step list includes bring-up-members / cleanup / cleanup-members (an autonomous deploy + destroy), yet the body never names the target and never states it is marked disposable: true. B17 forbids deriving disposability from a name/bed/lifecycle-tag; the body must name the target and its disposable: true marking (or cite the standing preemptible exception). Fix: add the exact target name and its disposable: true marking to the How-tested block and the R10 line.

  2. B11 (R9) — no charly version match for the proof binary. The body asserts a binary "built from this final tree", but never shows charly version output matching source. R9 requires the rebuilt-binary assertion to include the version match. Fix: paste the charly version output for the proof binary.

Verdict: BLOCK


ollama-cloud/deepseek-v4.1-flash — action-review.

View action run

…jection)

charly pinned sdk v0.2026269.145, whose deploykit.ProjectDeployConfig projects
the root-only uf.Deploy map. That is the missing half of the namespaced-deploy
fix: even with resolveDeployNodeByPath's exact-key match, a namespaced bed's
substrate provider never connects (MEASURED: check-docs deploy-add fails
'provider is not connected'). Adopt sdk v0.2026269.920 (#297), whose
ProjectDeployConfig folds uf.Deploys() — with it, the same deploy-add PASSES.

Assisted-by: opencode ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
@github-actions

Copy link
Copy Markdown
Contributor

Review — PASS

Head SHA: 5d98d463dbb5e72592c22f8564fa351c46950651 (branch: feat/rca-b-core)

Security screen: PASS — no scope mismatch (diff = the two fixes + dep pin the body claims), no secrets/egress, no guardrail weakening, no rulebook/spec edit; the sdk pin bump is the documented supply-chain change.
Checklist: All applicable rules PASS or NA.
Comments: 1 — the prior github-actions[bot] BLOCK (reviewed head d151975841f4, an earlier commit) is stale-superseded: re-derived against the current body, both its findings are resolved — the body now names the disposable: true target (charly.check-docs, citing charly/charly.yml) and pastes charly version output (2026.269.1235), so B17 and B11/R9 are satisfied in the current state. Diff is internally consistent: the +11/-0 exact-key-first guard makes the +13/-0 qualified-key cases fail pre-fix and pass post-fix; the 14 listed bed steps reconcile with steps=14; git rev-parse HEAD matches the head SHA.

Verdict: PASS


ollama-cloud/deepseek-v4.1-flash — action-review.

View action run

@github-actions
github-actions Bot enabled auto-merge (squash) September 26, 2026 18:42
@github-actions

Copy link
Copy Markdown
Contributor

Review — BLOCK

Head SHA: 19579fc50f8ad4d6271ae7d84a734aa152e1b077 (branch: feat/rca-b-core)

Change class: Go source (charly/plugin_loader.go) + Go test (charly/deploy_plugin_load_test.go) — runtime/code change (fresh-rebuild bed run required).
Placement: CORRECT — resolveDeployNodeByPath feeds deployNodePluginContext's pre-connect plugin-word collection, i.e. plugin loading in core; no alias/kit-import smell in the diff.
Security screen: PASS — no scope expansion beyond the two hunks, no secrets/egress, no guardrail/spec/rulebook edit, no embedded directives. (The body's claimed dep-pin is a supply-chain claim that, per finding 2, is not in the diff at all.)

Blocks

  1. A2 / B12 (R10) — the live bed evidence is from a superseded tree, not the PR head. The body's "How tested" block asserts $ git rev-parse HEAD → 5d98d463dbb5e72592c22f8564fa351c46950651 and calls it "this final tree", but the PR head is 19579fc50f8ad4d6271ae7d84a734aa152e1b077. Two origin/main merges (16ac0b66f9ca, 19579fc50f8a) landed after the tested commit, so the proof binary (2026.269.1235) and the 14/14 charly.check-docs run do not cover the current head, and the "fully tested and validated" tier is asserted against a tree that is not what ships. Fix: re-run the bed from the current head and paste output whose git rev-parse HEAD matches 19579fc5… (or drop the R10/live claim).

  2. A1 / B5 (R1) — the body claims a change that is absent from the diff. The RCA ("charly pinned sdk v0.2026269.145… Fix: (2) adopt sdk v0.2026269.920"), the "Change classification" line ("a dependency pin (sdk v0.2026269.145 → v0.2026269.920)"), and commit 5d98d463dbb5 all assert a dependency-pin change, yet the changed-file set is exactly two Go files — no go.mod/go.sum diff is present in this message to verify. Either mechanism docs: bump plugins → pr-validator always comments on the PR #2 is missing from the PR (the fix is then incomplete for its own stated root cause), or the body overclaims a pin that base main already carries (a documentation-vs-reality divergence, R1). Fix: reconcile — include the pin change in the diff, or correct the body's RCA/classification to the actual state.

Comments considered

  • 5846339528 (BLOCK @ d151975841f4) — stale-superseded: its two findings are resolved in the current body (the target charly.check-docs is named as disposable: true per charly/charly.yml; charly version → 2026.269.1235 is pasted), and it reviews an earlier commit.
  • 5848845321 (PASS @ 5d98d463dbb5) — stale-superseded: it rests on "git rev-parse HEAD matches the head SHA", which held only while the head was 5d98d46; the head has since advanced to 19579fc via two origin/main merges, so its verification does not cover the current tree and I do not import its PASS.

Verdict: BLOCK


ollama-cloud/deepseek-v4.1-flash — action-review.

View action run

@github-actions

Copy link
Copy Markdown
Contributor

Review — PASS

Head SHA: 19579fc50f8ad4d6271ae7d84a734aa152e1b077 (branch: feat/rca-b-core)

Security screen: PASS — diff is exactly the two claimed hunks (no scope expansion, no secrets/egress, no guardrail/spec/rulebook edit, no embedded directives, no supply-chain change in the diff).
Checklist: All applicable rules PASS or NA. Diff is internally consistent: the +11/−0 exact-key-first guard makes the +13/−0 qualified-key cases fail on the pre-fix dotted split and pass with the guard; the 14 listed bed steps reconcile with steps=14; the body's git rev-parse HEAD matches the head SHA; the charly.check-docs target is named and marked disposable: true; the changed code path executed live (deploy-add PASS, FAILED pre-fix), so the fully tested and validated tier is justified. Placement: CORRECT (core plugin-loading pre-connect collector).

Comments: all three stale-superseded — 5846339528 (BLOCK @d1519758) and 5848983986 (BLOCK @19579fc5) rest on body text the current body has replaced (disposable target + charly version now present; git rev-parse HEAD now matches the head; the body no longer claims a go.mod pin change — it states "no pin change is needed" and "the diff vs origin/main is exactly the 2 files below"); 5848845321 (PASS @5d98d463) is stale on head-SHA grounds, though its substance holds in the current body.

Verdict: PASS


ollama-cloud/deepseek-v4.1-flash — action-review.

View action run

@github-actions
github-actions Bot merged commit 4ee2491 into main Sep 26, 2026
1 of 3 checks passed
charly-auto-merge Bot added a commit that referenced this pull request Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants