Skip to content

fix(pipeline): resolve ${env.NAME} in a data string — both spellings, the real map, a named miss - #52

Merged
github-actions[bot] merged 3 commits into
mainfrom
feat/env-data-string-resolver
Oct 21, 2026
Merged

github-actions[bot] merged 3 commits into
mainfrom
feat/env-data-string-resolver

Conversation

@aitrawog

@aitrawog aitrawog commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A pipeline data field naming an environment value had no resolver at HEAD, in three
independent ways — and plugin-migrate's reshape emits exactly that spelling, so a migrated
entity's corpus, cache.key and vars.sha / emit head:+sha: leaves reached a verb body
as literal text.

what was wrong where what it is now
the grammar matched the BARE form only refs.go:27 — \$env\.([A-Z0-9_]+) envRefRe admits $env.NAME and ${env.NAME} (refs.go:23), split from runRefRe (refs.go:31)
resolveRefs returned the text verbatim under the standalone IDENTITY resolver refs.go:37-39 the ENVIRONMENT namespace is substituted before the override (refs.go:56), because nothing else in the chain resolves it
the only production constructor left the map nil verb_env.go:65 standaloneVerbEnv procEnv: envMap() — os.Environ(), the source the retired $env.NAME read (verb_env.go:103)
a missing name read "" refs.go:56 recorded during resolution, reported as one named failure of the whole dispatch (verb_env.go:216)
a shell field would take a value as script text render.go:31 (exec.Command("bash","-c",cmd)) validate: refuses an env ref and names the shell's own ${NAME} (render.go:42)

The layer is the front-end's, decided by measurement

workflowkit.Lower moves a lifted verb's body — including the data leaf — into the generated
charly.yml as a task: entity, and leaves only the argv in the .lobster:

$ sed -n "1,12p" /tmp/lower-out.txt
validate: OK
=== workflow.lobster ===
name: eval-probe
description: a probe fixture
args:
    pr:
        description: the pr
steps:
    - id: oracle
      run: /usr/bin/charly -C /tmp/proj/.opencharly/pipelines/eval-probe task _pipeline-eval-probe-oracle --output
    - id: render
      run: /usr/bin/charly -C /tmp/proj/.opencharly/pipelines/eval-probe task _pipeline-eval-probe-render --output
$ grep -n -A6 "_pipeline-eval-probe-oracle:" /tmp/lower-out.txt
25:_pipeline-eval-probe-oracle:
26-    task:
27-        description: lowered from pipeline step eval-probe/oracle
28-        plan:
29-            - run: author
30-_pipeline-eval-probe-render:
31-    task:

So the engine never sees the leaf. Teaching plugin-lobster's resolveArgsTemplate a dotted name
would have added a SECOND env resolver wired to a string it never receives — the R2 defect this
change exists to avoid. plugin-lobster is untouched.

Missing variable: a NAMED error, deliberately

Empty is a run-time emptiness in place of a load error — a cache key that never matches, an
emitted record carrying head: "" — the same trade opencharly/sdk#443 refused for the knob
form. The names are collected during resolution and reported once, aggregate, prefixed to any
downstream error so a real failure is never hidden behind the miss.

What this does not do, with the owner named

Head 7b6a148e758436945a1b87c4dba21db3b1293c86: 495 insertions(+) / 68 deletions(-) across
10 files (git diff --numstat origin/main HEAD). That head is an EMPTY re-freeze of 9210549
(git diff --stat 9210549 7b6a148 is empty) — the round-2 push created no workflow run, so an empty
commit minted the new head that made the required gate fire; the TREE, and so every tree key above,
is unchanged.

How tested

The driver. The umbrella's charly/bin/charly welds a plugin-pipeline from before the
kind-threading cutover (welded plugin @github.com/opencharly/plugin-pipeline/candy/plugin-pipeline:v2026.251.2226
then node "mixed-plan": no kind discriminator), so a bed run on it is 0/15 on ANY tree and
proves nothing. Both arms below therefore run on a driver built from the merged charly tree, with
the tree under test's plugin-pipeline and the merged plugin-lobster baked:

$ git -C /tmp/charly-driver rev-parse --short HEAD && /tmp/charly-driver/bin/charly version 2>/dev/null | tail -1
68675149
2026.294.1108

Negative controls first. Section 1 runs the new tests against the untouched tree and they FAIL;
section 3 mutates each property of the fix and shows the test that asserts it FAIL on the mutated
source. Neither arm is a green-only gate.

1. The pre-change control — the same six tests on the untouched tree

A detached worktree at origin/main carrying ONLY the new test file, so every failure below is the
old source's own behaviour:

$ git -C /tmp/pp-base rev-parse --short HEAD
45d4023
$ cd /tmp/pp-base/candy/plugin-pipeline && go test -count=1 -v -run 'TestEnvRefGrammarAdmitsBothSpellings|TestEnvDataRefResolvesThroughTheVerbDispatch|TestMissingEnvNameIsANamedError|TestAuthoredValidatorRefusesAnEnvRef|TestAuthoredValidatorReadsTheShellOwnEnvironment|TestEnvRefResolvesFromATypedInput' ./
=== RUN   TestEnvRefGrammarAdmitsBothSpellings
    env_refs_test.go:76: resolveRefs("${env.PIPELINE_PROBE_ENV}") = "${env.PIPELINE_PROBE_ENV}", want "approve"
    env_refs_test.go:76: resolveRefs("$env.PIPELINE_PROBE_ENV") = "$env.PIPELINE_PROBE_ENV", want "approve"
    env_refs_test.go:76: resolveRefs("x-${env.PIPELINE_PROBE_ENV}-y") = "x-${env.PIPELINE_PROBE_ENV}-y", want "x-approve-y"
    env_refs_test.go:76: resolveRefs("eval/pr-1/$env.PIPELINE_PROBE_ENV") = "eval/pr-1/$env.PIPELINE_PROBE_ENV", want "eval/pr-1/approve"
--- FAIL: TestEnvRefGrammarAdmitsBothSpellings (0.00s)
=== RUN   TestEnvDataRefResolvesThroughTheVerbDispatch
    env_refs_test.go:96: condition "approve == ${env.PIPELINE_PROBE_ENV}": status = "fail" ("gate : condition false: approve == ${env.PIPELINE_PROBE_ENV}"), want pass — the env value did not reach the condition, so the literal stayed
    env_refs_test.go:96: condition "approve == $env.PIPELINE_PROBE_ENV": status = "fail" ("gate : condition false: approve == $env.PIPELINE_PROBE_ENV"), want pass — the env value did not reach the condition, so the literal stayed
--- FAIL: TestEnvDataRefResolvesThroughTheVerbDispatch (0.00s)
=== RUN   TestMissingEnvNameIsANamedError
    env_refs_test.go:126: message "gate : condition false: approve == ${env.PIPELINE_PROBE_ABSENT_9E3F1C}" does not open with "unresolved environment reference(s): PIPELINE_PROBE_ABSENT_9E3F1C" — a missing name is the CAUSE, and it must be reported as one rather than as a downstream condition verdict
--- FAIL: TestMissingEnvNameIsANamedError (0.00s)
=== RUN   TestAuthoredValidatorRefusesAnEnvRef
.PIPELINE_PROBE_ENV
    env_refs_test.go:149: validate "echo $env.PIPELINE_PROBE_ENV": status = "pass" (""), want fail — an env ref must never become shell script text
--- FAIL: TestAuthoredValidatorRefusesAnEnvRef (0.01s)
=== RUN   TestAuthoredValidatorReadsTheShellOwnEnvironment
--- PASS: TestAuthoredValidatorReadsTheShellOwnEnvironment (0.00s)
=== RUN   TestEnvRefResolvesFromATypedInput
    env_refs_test.go:196: typed-input ref = "${env.PIPELINE_PROBE_ENV} == approve", want "approve == approve"
--- FAIL: TestEnvRefResolvesFromATypedInput (0.00s)
FAIL
FAIL	github.com/opencharly/plugin-pipeline/candy/plugin-pipeline	0.062s

.PIPELINE_PROBE_ENV on the fourth case is bash's own expansion of the unresolved $env plus the
literal .NAME — the proof that the ref reached the shell as TEXT.
TestAuthoredValidatorReadsTheShellOwnEnvironment passes on both sides ON PURPOSE: it is the
control for the replacement the refusal names, not a change-detector.

2. The same tests on the committed tree

$ git rev-parse HEAD
7b6a148e758436945a1b87c4dba21db3b1293c86
$ cd candy/plugin-pipeline && go test -count=1 -v -run 'TestEnvRefGrammarAdmitsBothSpellings|TestEnvDataRefResolvesThroughTheVerbDispatch|TestMissingEnvNameIsANamedError|TestAuthoredValidatorRefusesAnEnvRef|TestAuthoredValidatorReadsTheShellOwnEnvironment|TestEnvRefResolvesFromATypedInput|TestAdeLaneHeadIsARunContextReadNeverTheProcessEnv|TestEnvRefsAcrossConcurrentDispatches' ./
=== RUN   TestEnvRefGrammarAdmitsBothSpellings
--- PASS: TestEnvRefGrammarAdmitsBothSpellings (0.00s)
=== RUN   TestEnvDataRefResolvesThroughTheVerbDispatch
--- PASS: TestEnvDataRefResolvesThroughTheVerbDispatch (0.00s)
=== RUN   TestMissingEnvNameIsANamedError
--- PASS: TestMissingEnvNameIsANamedError (0.00s)
=== RUN   TestAuthoredValidatorRefusesAnEnvRef
--- PASS: TestAuthoredValidatorRefusesAnEnvRef (0.00s)
=== RUN   TestAuthoredValidatorReadsTheShellOwnEnvironment
--- PASS: TestAuthoredValidatorReadsTheShellOwnEnvironment (0.01s)
=== RUN   TestEnvRefResolvesFromATypedInput
--- PASS: TestEnvRefResolvesFromATypedInput (0.00s)
=== RUN   TestEnvRefsAcrossConcurrentDispatches
--- PASS: TestEnvRefsAcrossConcurrentDispatches (0.01s)
=== RUN   TestAdeLaneHeadIsARunContextReadNeverTheProcessEnv
--- PASS: TestAdeLaneHeadIsARunContextReadNeverTheProcessEnv (0.00s)
PASS
ok  	github.com/opencharly/plugin-pipeline/candy/plugin-pipeline	0.062s

TestEnvDataRefResolvesThroughTheVerbDispatch drives NewProvider().Invoke → the OpRun arm →
invokeLiftedVerb: the production dispatch, not a hand-built verbEnv. The whole package suite
(go test ./...) passes on the committed tree.

3. Four mutation controls — each property is pinned by a test that can fail

Each mutation was applied to the committed source, the named tests run, then the file restored and
verified by checksum (below). M1 narrowed envRefRe back to the bare arm; M2 removed
procEnv: envMap() from standaloneVerbEnv; M3 made an absent name render the literal $env.X
instead of recording it; M4 removed the validate: refusal.

$ go test -count=1 -v -run 'TestEnvRefGrammarAdmitsBothSpellings|TestEnvDataRefResolvesThroughTheVerbDispatch' ./    # M1
=== RUN   TestEnvRefGrammarAdmitsBothSpellings
    env_refs_test.go:76: resolveRefs("${env.PIPELINE_PROBE_ENV}") = "${env.PIPELINE_PROBE_ENV}", want "approve"
    env_refs_test.go:76: resolveRefs("x-${env.PIPELINE_PROBE_ENV}-y") = "x-${env.PIPELINE_PROBE_ENV}-y", want "x-approve-y"
--- FAIL: TestEnvRefGrammarAdmitsBothSpellings (0.00s)
=== RUN   TestEnvDataRefResolvesThroughTheVerbDispatch
    env_refs_test.go:96: condition "approve == ${env.PIPELINE_PROBE_ENV}": status = "fail" ("gate : condition false: approve == ${env.PIPELINE_PROBE_ENV}"), want pass — the env value did not reach the condition, so the literal stayed
--- FAIL: TestEnvDataRefResolvesThroughTheVerbDispatch (0.00s)
FAIL
$ go test -count=1 -v -run 'TestEnvRefGrammarAdmitsBothSpellings|TestEnvDataRefResolvesThroughTheVerbDispatch|TestMissingEnvNameIsANamedError' ./    # M2
=== RUN   TestEnvRefGrammarAdmitsBothSpellings
    env_refs_test.go:76: resolveRefs("${env.PIPELINE_PROBE_ENV}") = "", want "approve"
    env_refs_test.go:76: resolveRefs("$env.PIPELINE_PROBE_ENV") = "", want "approve"
    env_refs_test.go:76: resolveRefs("x-${env.PIPELINE_PROBE_ENV}-y") = "x--y", want "x-approve-y"
    env_refs_test.go:76: resolveRefs("eval/pr-1/$env.PIPELINE_PROBE_ENV") = "eval/pr-1/", want "eval/pr-1/approve"
--- FAIL: TestEnvRefGrammarAdmitsBothSpellings (0.00s)
=== RUN   TestEnvDataRefResolvesThroughTheVerbDispatch
    env_refs_test.go:96: condition "approve == ${env.PIPELINE_PROBE_ENV}": status = "fail" ("unresolved environment reference(s): PIPELINE_PROBE_ENV — a $env.NAME / ${env.NAME} data reference reads the PROCESS environment and these names are not set there (the stage also failed: gate : condition false: approve ==)"), want pass — the env value did not reach the condition, so the literal stayed
    env_refs_test.go:96: condition "approve == $env.PIPELINE_PROBE_ENV": status = "fail" ("unresolved environment reference(s): PIPELINE_PROBE_ENV — a $env.NAME / ${env.NAME} data reference reads the PROCESS environment and these names are not set there (the stage also failed: gate : condition false: approve ==)"), want pass — the env value did not reach the condition, so the literal stayed
--- FAIL: TestEnvDataRefResolvesThroughTheVerbDispatch (0.00s)
=== RUN   TestMissingEnvNameIsANamedError
--- PASS: TestMissingEnvNameIsANamedError (0.00s)
FAIL
$ go test -count=1 -v -run 'TestMissingEnvNameIsANamedError' ./    # M3
=== RUN   TestMissingEnvNameIsANamedError
    env_refs_test.go:126: message "gate : condition false: approve == ${env.PIPELINE_PROBE_ABSENT_9E3F1C}" does not open with "unresolved environment reference(s): PIPELINE_PROBE_ABSENT_9E3F1C" — a missing name is the CAUSE, and it must be reported as one rather than as a downstream condition verdict
--- FAIL: TestMissingEnvNameIsANamedError (0.00s)
FAIL
$ go test -count=1 -v -run 'TestAuthoredValidatorRefusesAnEnvRef' ./    # M4
=== RUN   TestAuthoredValidatorRefusesAnEnvRef
    env_refs_test.go:149: validate "echo $env.PIPELINE_PROBE_ENV": status = "pass" (""), want fail — an env ref must never become shell script text
--- FAIL: TestAuthoredValidatorRefusesAnEnvRef (0.00s)
FAIL
$ sha256sum -c /tmp/k.sha
refs.go: OK
verb_env.go: OK
render.go: OK

M2's output is the proof that a nil map is not a resolver: with the map gone the miss is
DETECTED and NAMED, which is what the old code could not do — and it is why that mutation fails the
two grammar tests while TestMissingEnvNameIsANamedError still passes (the miss is what that test
wants to see).

4. Module gates on the committed tree

$ cd candy/plugin-pipeline && go build ./... && go vet ./... && echo "gofmt-lines=$(gofmt -l . | wc -l)"
gofmt-lines=0
$ test -z "$(gofmt -l .)" && echo "gofmt -l EMPTY"
gofmt -l EMPTY

golangci-lint v2.13.2, baseline vs head: the same 10 findings on the same symbols, so my diff adds
none. The single difference is a LINE NUMBER, because render.go gained a doc comment.

$ cd /tmp/pp-base/candy/plugin-pipeline && golangci-lint run ./... 2>&1 | grep -cE '^[a-z_0-9]+\.go:[0-9]+'
10
$ cd candy/plugin-pipeline && golangci-lint run ./... 2>&1 | grep -cE '^[a-z_0-9]+\.go:[0-9]+'
10
$ diff /tmp/lint-base.txt /tmp/lint-head.txt
6c6
< render.go:189:6: func resolveTemplate is unused (unused)
---
> render.go:204:6: func resolveTemplate is unused (unused)

The ten are plugin-pipeline#48's, unchanged. charly box validate on the committed tree, with the
plugin served from that tree rather than from a pin:

$ charly box validate 2>&1 | tail -3
plugin plugin-pipeline: served from /home/atrawog/.cache/charly/plugin-build/views/plugin-pipeline-3949aff6942728c5 (build sha256:d148cb078952f68cfc5ae6b83741fdb344085c66178263ff544db55d6308d724); source /home/atrawog/Sync/Atrapub/mo/dsh/opencharly/.worktrees/env-data-resolver/plugin-pipeline/candy/plugin-pipeline
charly box validate: OK — checked 3 candies, 1 deploy, 7 distros, 7 builders; 0 warnings, 0 errors

5. The change-class R10 bed, before and after

check-pipeline-local, one bed, both trees, the same driver, each tree's own plugin-pipeline
baked (so the fixtures' kind:pipeline resolves). Before = origin/main 45d4023; after = the
committed head:

$ cd /tmp/pp-base && CHARLY_PLUGIN_DIR=/tmp/baked-base CHARLY_PROJECT_DIR=$PWD /tmp/charly-driver/bin/charly check run check-pipeline-local
charly check run check-pipeline-local: [deploy-add] PASS after 7.407s [allowlisted=1] (log: .check/check-pipeline-local/2026.294.1415/deploy-add.log)
charly check run check-pipeline-local: [bring-up-members] PASS after 1ms
charly check run check-pipeline-local: [check-live] PASS after 2m40.005s [allowlisted=1] (log: .check/check-pipeline-local/2026.294.1415/check-live.log)
charly check run check-pipeline-local: [update] PASS after 6.245s [allowlisted=1] (log: .check/check-pipeline-local/2026.294.1415/update.log)
charly check run check-pipeline-local: [cleanup] PASS after 32.693s [allowlisted=1] (log: .check/check-pipeline-local/2026.294.1415/cleanup.log)
charly check run check-pipeline-local: [cleanup-members] PASS after 0s
charly check run check-pipeline-local: PASS (steps=6)
$ grep -E '^[0-9]+ steps:' /tmp/pp-base/.check/check-pipeline-local/2026.294.1415/check-live.log && grep -E '^  errors:|^  warnings:|^ok:' /tmp/pp-base/.check/check-pipeline-local/2026.294.1415/summary.yml
15 steps: 15 passed, 0 failed, 0 skipped
  errors: 0
  warnings: 0
ok: true
$ cd /home/atrawog/Sync/Atrapub/mo/dsh/opencharly/.worktrees/env-data-resolver/plugin-pipeline && CHARLY_PLUGIN_DIR=/tmp/baked-head CHARLY_PROJECT_DIR=$PWD /tmp/charly-driver/bin/charly check run check-pipeline-local
charly check run check-pipeline-local: [deploy-add] PASS after 7.543s [allowlisted=1] (log: .check/check-pipeline-local/2026.294.1507/deploy-add.log)
charly check run check-pipeline-local: [bring-up-members] PASS after 1ms
charly check run check-pipeline-local: [check-live] PASS after 2m33.698s [allowlisted=1] (log: .check/check-pipeline-local/2026.294.1507/check-live.log)
charly check run check-pipeline-local: [update] PASS after 5.886s [allowlisted=1] (log: .check/check-pipeline-local/2026.294.1507/update.log)
charly check run check-pipeline-local: [cleanup] PASS after 29.626s [allowlisted=1] (log: .check/check-pipeline-local/2026.294.1507/cleanup.log)
charly check run check-pipeline-local: [cleanup-members] PASS after 0s
charly check run check-pipeline-local: PASS (steps=6)
$ grep -E '^[0-9]+ steps:' .check/check-pipeline-local/2026.294.1507/check-live.log && grep -E '^  errors:|^  warnings:|^ok:' .check/check-pipeline-local/2026.294.1507/summary.yml
15 steps: 15 passed, 0 failed, 0 skipped
  errors: 0
  warnings: 0
ok: true

allowlisted: 4 in both summaries is the dev-worktree-binary notice every bed prints on a host
with a packaged charly install; errors: 0, warnings: 0.

check-lobster-local is not in this change's class: plugin-lobster is untouched, so its bed was
not run and nothing about it is claimed.

6. The bed's non-determinism is the BED's — the same step, at the same rate, on both trees

Round 1's finding was that the head's bed failure landed on pipeline-runs-lifted-file-verbs —
the step that exercises the changed dispatch — while the base's landed on a different step, so
"not this change's" was not established for the change-adjacent step. It is now. Same harness on
both trees: the bed's OWN step body, extracted from charly.yml, run N-way in PARALLEL (only the
concurrency is added):

harness tree iterations anomalies
bed step body, 12-way parallel origin/main 45d4023 12 3
bed step body, 12-way parallel, wave 2 origin/main 45d4023 24 2
bed step body, 10-way x3 origin/main 45d4023 30 1
bed step body, 10-way x3 head fd420e5 30 1

The bed is byte-identical on the two trees, so the rate cannot be tree-dependent:

$ git diff --stat origin/main HEAD -- charly.yml && echo "no output above = the bed is identical on both trees"
no output above = the bed is identical on both trees

The signature is the same on BOTH trees, captured with $? rather than a ||:

$ grep -m1 "FAIL" /tmp/f-2-3.out
[FAIL] rc=1 r1=0 dir=/tmp/tmp.ZL6PBbrIcM
$ grep -m1 "FAIL" /tmp/h-1-9.out
[FAIL] rc=1 r1=0 dir=/tmp/tmp.OB2LJZS6DS
$ wc -c /tmp/tmp.ZL6PBbrIcM/run.out
598 /tmp/tmp.ZL6PBbrIcM/run.out
$ ls /tmp/tmp.ZL6PBbrIcM/rendered.txt /tmp/tmp.ZL6PBbrIcM/emitted.yml
/tmp/tmp.ZL6PBbrIcM/emitted.yml
/tmp/tmp.ZL6PBbrIcM/rendered.txt

r1=0 means the pipeline run succeeded; both artifacts the step asserts on are on disk;
and the only thing missing from its captured stdout is the LAST line the run prints. So the run
completed and the tail of the plugin's forwarded stdout did not reach the caller — a mechanism that
has nothing to do with the resolver, and is filed with its own evidence as
opencharly/charly#1013. plugin-pipeline#51 records the same instability from the bed's side,
plus the stderr truncation that hides it.

7. The resolver's mutable state is per-dispatch, proven under -race and by mutation

substituteEnvRefs appends to rc.missingEnv; invokeLiftedVerb reads it after run. The reason
that is not a race is structural — invokeLiftedVerb builds its OWN verbEnv per Invoke
(verb_env.go:standaloneVerbEnv), and the grammar only ever runs against that instance — and it is
now measured two ways.

The whole module under the race detector:

$ cd candy/plugin-pipeline && go test -count=1 -race ./...
ok  	github.com/opencharly/plugin-pipeline/candy/plugin-pipeline	7.081s
?   	github.com/opencharly/plugin-pipeline/candy/plugin-pipeline/cmd/serve	[no test files]
?   	github.com/opencharly/plugin-pipeline/candy/plugin-pipeline/params	[no test files]

And the test this round added, TestEnvRefsAcrossConcurrentDispatches: eight dispatches in flight
at once, HALF of them naming an absent variable so the miss list is touched concurrently with the
resolving arm, each verdict asserted to name its own variable and no other. It BITES — turning
missingEnv into one package-level accumulator makes it fail under -race:

$ go test -count=1 -race -v -run 'TestEnvRefsAcrossConcurrentDispatches' ./    # mutated: one shared accumulator
=== RUN   TestEnvRefsAcrossConcurrentDispatches
WARNING: DATA RACE
--- FAIL: TestEnvRefsAcrossConcurrentDispatches (0.02s)

The source was restored afterwards and verified (sha256sum -c → refs.go: OK / verb_env.go: OK).

Rulebook compliance

  • R0: skills loaded BEFORE the first tool call: /charly-internals:git-workflow, /charly-internals:strict-policy, /charly-internals:go, /charly-internals:plugin, /charly-check:check, /charly-internals:go-quality; the repo's own AGENTS.md read for its build / validate / landing rules; the root-cause-analyzer discipline applied to the bed anomaly in section 6 instead of a re-run.
  • R1: every anomaly RCA'd before remediation. (a) The bed's 0/15 on the umbrella binary: mechanism = that binary welds plugin-pipeline:v2026.251.2226, which predates the kind-threading fix, so a fixture's kind:pipeline never reaches the parse-time kind set; root fix = build the driver from the merged charly tree, no repo change needed. (b) The bed's non-determinism: measured on BOTH trees at the same rate on the SAME step, and its mechanism — a dropped tail line of the plugin's forwarded stdout — filed as charly#1013, with the bed's own side on test(bed): check-pipeline-local is non-deterministic on this host — 2 of 5 runs fail, on two different steps, one of them on the unchanged tree #51. (c) The corpus knob: measured as a SECOND, separable defect, filed on entity-level config: knobs are inert — the cutover deleted the populator (executor.go) but kept the readers; skill:/report:/media:/repo: are dead #37 rather than fixed here. ## Filed issues carries all of them.
  • R2: ONE resolver. The two spellings are one pattern in one function, and the engine was left alone with the measurement that decided it (Lower keeps the leaf out of the .lobster), so no second env resolver exists.
  • R3: no workaround: no sleep, no retry, no fallback branch. A missing name is a named failure, and the shell field's refusal points at the mechanism that already exists instead of a bespoke quoting shim.
  • R4: product first, then prose. The resolver is the fix; the README.md claim that $env.NAME "is resolved by the engine" was false, and it is corrected in the same change.
  • R5: the deleted identifier and the corrected claims were swept with a claim-keyed grep, not sampled:
$ grep -rn "refRe" --include=*.go candy/
exit=1
$ grep -rn "identity resolver" --include=*.go candy/plugin-pipeline/
candy/plugin-pipeline/verb_ade_head_test.go:47:	// string that looks like a head and is not this lane's. The identity resolver is

refRe is gone (exit 1, no output). The one surviving identity resolver hit is this change's own
CORRECTED sentence: its next source line reads gone; the process environment is what makes the ref the wrong source, so the claim now describes the new behaviour instead of the old one.

  • R6: git status stated before every git action; ONE commit (fd420e5), never amended after a push, no force-push, no push to main, no hook bypass; .check/ was deliberately left untracked and uncommitted.
  • R7: coverage fails without the change (section 1) and each property is pinned by a mutation that kills its test (sections 3 and 7); the changed path executed LIVE — the dispatch tests drive NewProvider().Invoke, and the bed runs the real lowered pair through the real engine. The resolver's mutable state is proven per-dispatch under -race with a mutation that makes the detector fire (section 7).
  • R8: no live-service boundary in this change. The bed's allowlisted: 4 dev-binary notice is the only skip-adjacent surface and it is reported in section 5, not hidden.
  • R9: a plugin-module change: no charly binary ships from here, no new runtime OS dependency, and the bed's driver is a worktree build (2026.294.1108, section "How tested"), never a shared install.
  • R10: the change-class bed ran on the COMMITTED tree (9210549, whose tree 7b6a148 re-freezes byte-identically) with a fresh deploy and a fresh update: 15 steps: 15 passed, 0 failed, 0 skipped, errors: 0, warnings: 0 (section 5), plus the unchanged-tree sample in the same section. The bed's instability is measured to be the BED's at the same rate on the same step (section 6) and its mechanism is filed as charly#1013; it is not claimed away.

Change classification

A Go plugin-library change in candy/plugin-pipeline — the reference grammar, the run-context type,
the dispatch boundary and the shell boundary — plus one README.md correction: class runtime,
gate check-pipeline-local. Tier fully tested and validated: the change-class bed passed on the
committed tree (errors: 0, warnings: 0, 15/15), the changed dispatch path was executed live both
by that bed and by the eight tests that drive NewProvider().Invoke rather than a hand-built
context, and the whole module passes go test -race ./....

Filed issues

  • opencharly/plugin-pipeline#50 — the defect this PR fixes (CLAIM posted; closed by this PR).
  • opencharly/plugin-pipeline#37 — the dead config knobs; evidence added: this change makes
    skills.corpus's env ref resolvable, and entity-level config: knobs are inert — the cutover deleted the populator (executor.go) but kept the readers; skill:/report:/media:/repo: are dead #37's populator is what makes the string reach it.
  • opencharly/plugin-pipeline#51 — check-pipeline-local is non-deterministic on this host (2 of 5
    runs, two different steps, one on the unchanged tree) plus the stderr truncation that hides the cause.
  • opencharly/charly#1013 — the mechanism behind it: an out-of-process plugin's LAST stdout line can be
    dropped when the host exits (the run exits 0, its artifacts are written, and the tail line never
    arrives). Filed with both trees' rates, so the bed's instability has a numbered owner.
  • opencharly/plugin-pipeline#48 — the pre-existing golangci-lint findings; measured unchanged
    (same 10 symbols, one line-number shift).

A3 attribution evidence

  • Descriptor record for this session, ~/.dsh/storages/session_projcache/sessions/b601bb10-185f-41c1-bb6a-c9f651aa54d4.json (DSH_SESSION_ID): modelSelection.val.lastUsed = {"provider": "ollama-cloud", "model": "deepseek-v4.1-flash"}, agentPreset = "standard". The parent session record (session-5992bb88-1cd4-4d08-829a-be0b79c77dd7.json) reports the same pair.
  • The delivered system message names the harness: "You are an AI agent powered by DeepSeek Harness."
  • The DSH_* environment of this session: DSH_PROFILE=web, DSH_HOME=/home/atrawog/.dsh, DSH_SESSION_ID=b601bb10-185f-41c1-bb6a-c9f651aa54d4, DSH_WEB_URL=http://127.0.0.1:3080, DSH_SHELL=1.
  • Harness DeepSeek Harness, provider ollama-cloud, model deepseek-v4.1-flash — so the footer
    below is the runtime's own names, per opencharly/opencharly#538.

Agent: charly
Assisted-by: DeepSeek Harness ollama-cloud deepseek-v4.1-flash (fully tested and validated)

… the real map, a named miss

A pipeline DATA field naming an environment value had no resolver at HEAD, in three
independent ways: the front-end's grammar matched the BARE `$env.NAME` only (so
`plugin-migrate`'s `${env.NAME}` could never match), the one production `verbEnv`
constructor left the map nil, and `resolveRefs` returned even a matched ref
verbatim under the standalone IDENTITY resolver. The value reached a verb body as
literal text — measured on eval-omarchy's seven data leaves.

The LAYER is the front-end's, by measurement: `workflowkit.Lower` moves a lifted
verb's body into the generated `charly.yml` as a `task:` entity and leaves only
`run: <charly> ... task ...` in the `.lobster`, so the engine never sees the leaf —
teaching the engine a dotted name would be a second resolver wired to nothing (R2).

- refs.go: one `envRefRe` admitting `$env.NAME` AND `${env.NAME}` (the dot names
  the NAMESPACE; the name class stays the POSIX env charset), split from
  `runRefRe`. The ENVIRONMENT namespace is substituted BEFORE the resolver
  override, because no other layer in the chain resolves it: the plan's `${VAR}`
  expander is uppercase-only and never sees `env.`, and the engine's `${arg}`
  reads run args. Gating it behind the override is exactly how the ref survived as
  text.
- verb_env.go: `standaloneVerbEnv` supplies `procEnv` from `os.Environ()` — the
  source the retired `$env.NAME` read — in a field SEPARATE from `env`, the per-run
  BOUND map `adeLaneHead` reads; merging them is the defect RCA 2026.252.2210
  fixed, and the lock in verb_ade_head_test.go still holds it.
- a MISSING name is recorded during resolution and reported as ONE named failure of
  the whole dispatch, prefixing any downstream error. Empty is the rejected
  alternative on purpose: it is a run-time emptiness in place of a load error, the
  trade opencharly/sdk#443 refused for the knob form.
- render.go: `validate:` is handed to `bash -c`, so it is the one field where a
  substituted VALUE would become SCRIPT TEXT. An env ref there is REFUSED with the
  shell's own `${NAME}` named — bash expands a variable from the inherited
  environment and never re-parses its value as syntax — instead of splicing it.

`plugin-migrate` needs no change, measured rather than assumed: no spelling
resolved in a data string before this (`${NAME}`-uppercase is the plan expander's
grammar over t.vars/t.env/-p, never the process environment), so re-pointing the
emission would not have helped, and `${env.NAME}` is now both the spelling that
resolves and the one the expression grammar accepts.

The `corpus` leaf needs one thing more and it is filed, not half-wired here:
`rc.skills` is a dead config knob (plugin-pipeline#37), so that string never
reaches the grammar. This change makes the ref resolvable; #37 makes it reachable.

Tests: the pre-change arm fails all five behavioural claims on the untouched tree
(pasted in the PR body); four mutations (brace arm removed, procEnv removed,
missing name rendered as a literal, shell refusal removed) each kill the test that
asserts its property.

Closes #50.

Agent: charly
Assisted-by: DeepSeek Harness ollama-cloud deepseek-v4.1-flash (fully tested and validated)

Co-authored-by: Andreas Trawoeger <[email protected]>
@github-actions

Copy link
Copy Markdown

Review — BLOCK

Head SHA: fd420e5847290d84d98a983038afb4136630fdd7 (branch: feat/env-data-string-resolver)

Change class: runtime — Go plugin-library change in candy/plugin-pipeline plus one README.md correction; declared change-class gate check-pipeline-local.

Security screen: PASS — no injection, no secrets/egress, no weakened gate (the validate: refusal tightens the shell boundary), no new deps, no self-modifying-security content, no embedded directives.

Blocks

  1. CONC / R10 — the change-class bed's load failure is answered with an idle-green re-run, and the "not this change's" claim is unproven for the change-adjacent step. Body section 6 admits the change-class bed check-pipeline-local failed 2/5 runs. The head-tree failure (2026.294.1419) was on pipeline-runs-lifted-file-verbs — the step that exercises the changed invokeLiftedVerb dispatch — while the base-tree failure (2026.294.1434) was on a different step (pipeline-schedule-apply-list-remove). The body's answer is "the repeated step passed 8/8 when run by hand, so the failing step's own body is deterministic outside the bed", which is exactly the forbidden "it passed on a serial run" proof for a failure that surfaced under load. Filing test(bed): check-pipeline-local is non-deterministic on this host — 2 of 5 runs fail, on two different steps, one of them on the unchanged tree #51 does not discharge the change-adjacent step, because its failure is not shown to be pre-existing (the base tree failed on a different step, not the same one). The green sample (2026.294.1443, 15/15) is valid for that run, but the gate is the change-class bed and it is non-deterministic, so "the instability is not this change's" is not established for the step that exercises the changed path.

    Fix: reproduce the pipeline-runs-lifted-file-verbs failure on the unchanged base tree (same step), or run the bed on both trees enough times to show the head failure rate on that step is comparable to base — proving the flake is bed-level, not change-level.

  2. R10 (coverage reliability) — confirm the new mutable state is race-free. substituteEnvRefs appends to rc.missingEnv (refs.go), and invokeLiftedVerb reads it after run (verb_env.go). The tests run -count=1 with no -race, so a data race on missingEnv (if resolveRefs executes on a verbEnv shared by the bed's concurrent lanes) would be undetected — and a head-only pipeline-runs-lifted-file-verbs flake is consistent with exactly such a race. Re-run the affected package under go test -race ./... and paste the output, or show verbEnv is never shared across concurrent resolves.

Verdict: BLOCK


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

View action run

Round-1 review, block 2: `substituteEnvRefs` appends to `rc.missingEnv` and
`invokeLiftedVerb` reads it after `run`, so a `verbEnv` shared by two dispatches
would be both a data race and a cross-attribution bug (one stage's missing
variable surfacing in another stage's verdict).

The per-dispatch construction is what makes that impossible — `invokeLiftedVerb`
builds its OWN `verbEnv` per Invoke — and this adds the test that holds it: eight
dispatches in flight at once, HALF of them naming an absent variable so the miss
list is touched concurrently with the resolving arm, each verdict asserted to name
its OWN variable and no other.

Mutation-checked: turning `missingEnv` into one package-level accumulator makes
the test fail under `-race` with `WARNING: DATA RACE`, so the test can fail and
fails exactly on the property it claims.

Also measured for round 1's block 1, and recorded here so the numbers live with
the change: the change-class bed step `pipeline-runs-lifted-file-verbs` fails at
the SAME rate on the unchanged tree (1 of 30 parallel iterations on each side; 5
of 36 in two earlier 12-way waves, all on `origin/main`), with the run exiting 0,
its artifacts written, and the LAST line of the plugin's forwarded stdout missing.
That mechanism is filed as opencharly/charly#1013.

Agent: charly
Assisted-by: DeepSeek Harness ollama-cloud deepseek-v4.1-flash (fully tested and validated)

Co-authored-by: Andreas Trawoeger <[email protected]>
@aitrawog

Copy link
Copy Markdown
Contributor Author

STATUS — round 2 pushed: head 9210549, one new commit, body re-written for that head. Both blocks answered with measurement, and one of them produced a NEW filed defect in charly.

RCA, round 1 (both blocks)

Block 1 — "the change-adjacent step's instability is unproven to be pre-existing". The missed control is mine: I compared two runs and called the difference tree-level, when the discriminating test is the SAME step body run on BOTH trees at a rate. Root fix applied: the bed's own step body, extracted from charly.yml, run N-way in PARALLEL on each tree — 1 of 30 anomalous on origin/main and 1 of 30 on the head, plus 5 of 36 in two earlier 12-way waves, all on origin/main. The bed is byte-identical across the trees (git diff --stat origin/main HEAD -- charly.yml is empty).

The mechanism, measured (not inferred). Captured with $? instead of ||: the anomalous run exits 0 (r1=0), writes both artifacts the step asserts on, and its captured stdout is missing exactly the LAST line the run prints — the plugin's own status line. So the run SUCCEEDS and the tail of the plugin's forwarded stdout never reaches the caller. That is a charly-core defect, filed with its own evidence as opencharly/charly#1013; #51 carries the bed's side plus the stderr truncation that hid it.

Block 2 — "confirm the new mutable state is race-free". Structural: invokeLiftedVerb builds its OWN verbEnv per Invoke, so rc.missingEnv is per-dispatch by construction. Measured: go test -race ./... green on the whole module, and a new TestEnvRefsAcrossConcurrentDispatches drives eight dispatches at once with HALF naming an absent variable (so the miss list is touched concurrently with the resolving arm) and asserts each verdict names its own variable and no other. It BITES: turning missingEnv into one package-level accumulator makes it fail under -race with WARNING: DATA RACE.

What changed in this round

  • candy/plugin-pipeline/env_refs_test.go — the concurrency test (+80 lines). No runtime code changed, so the bed's artifact is identical.
  • The body: sections 6 and 7 are new, section 5 carries the gate sample for 9210549 (2026.294.1507), and ## Filed issues gains charly#1013.

Gate on the committed round-2 tree: check-pipeline-local 15 steps: 15 passed, 0 failed, 0 skipped, errors: 0, warnings: 0; go test ./... and go test -race ./... green; gofmt -l empty; golangci-lint v2.13.2 unchanged against the origin/main baseline (10 findings, same symbols).

Agent: charly

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

The round-2 push (9210549) created NO workflow run — neither the org-required
validator nor this repo's own ci job appeared for it (gh run list shows only the
14:49Z runs at fd420e5), so the gate was never dispatched on that head. An empty
commit mints a NEW head and a new pull_request/synchronize event, which is the
documented re-trigger; the TREE is unchanged, so every tree key in the body holds.

Agent: charly
Assisted-by: DeepSeek Harness ollama-cloud deepseek-v4.1-flash (fully tested and validated)
@github-actions

Copy link
Copy Markdown

Review — PASS

Head SHA: 7b6a148e758436945a1b87c4dba21db3b1293c86 (branch: feat/env-data-string-resolver)

Security screen: PASS — no injection, no secrets/egress, no new deps, no weakened guardrail (the validate: refusal tightens the shell boundary); no self-modifying-security content; no embedded directives.
Checklist: All applicable rules PASS or NA. Prior round's blocks re-derived and resolved by the current diff/body (same-step parallel measurement on both trees + charly#1013; -race + TestEnvRefsAcrossConcurrentDispatches with a mutation that makes the detector fire).

Comment dispositions

  • github-actions[bot] #6319004161 — stale-superseded: both blocks are addressed by the current state. Block 1 (change-adjacent step instability unproven) → §6 same step body N-way parallel on origin/main (3/12, 2/24, 1/30) and head (1/30), mechanism filed charly#1013; Block 2 (race) → §7 go test -race ./... + concurrency test + mutation.
  • @aitrawog #6319408907 — verified-non-blocking: STATUS round-2; its claims (concurrency test, bed sample, filed issue) reproduce against the current diff/body.

Non-blocking notes (no rulebook gap): (1) body's git rev-parse HEAD = 9210549 is stale relative to the 7b6a148 re-freeze commit — but the re-freeze is a no-op and the provided diff (495/68, 10 files) is byte-identical to the body's 9210549 accounting, so the evidence transfers; (2) verb_ade_head_test.go:47 "The identity resolver is gone" is accurate for the env-ref path (env is substituted before the identity override), though the resolver object still exists for run refs; (3) dispatchVerb calls t.Fatalf from worker goroutines in TestEnvRefsAcrossConcurrentDispatches — latent test-hygiene nit only, does not affect shipped code.

Verdict: PASS


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

View action run

@github-actions
github-actions Bot enabled auto-merge (squash) October 21, 2026 15:17
@github-actions
github-actions Bot merged commit df909d8 into main Oct 21, 2026
2 checks passed
charly-auto-merge Bot added a commit that referenced this pull request Oct 21, 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