Repository navigation
fix(pipeline): resolve ${env.NAME} in a data string — both spellings, the real map, a named miss - #52
Conversation
… 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]>
Review — BLOCKHead SHA: Change class: runtime — Go plugin-library change in Security screen: PASS — no injection, no secrets/egress, no weakened gate (the Blocks
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
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]>
|
STATUS — round 2 pushed: head 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 The mechanism, measured (not inferred). Captured with Block 2 — "confirm the new mutable state is race-free". Structural: What changed in this round
Gate on the committed round-2 tree: 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)
Review — PASSHead SHA: Security screen: PASS — no injection, no secrets/egress, no new deps, no weakened guardrail (the Comment dispositions
Non-blocking notes (no rulebook gap): (1) body's Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
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 migratedentity's
corpus,cache.keyandvars.sha/emithead:+sha:leaves reached a verb bodyas literal text.
refs.go:27—\$env\.([A-Z0-9_]+)envRefReadmits$env.NAMEand${env.NAME}(refs.go:23), split fromrunRefRe(refs.go:31)resolveRefsreturned the text verbatim under the standalone IDENTITY resolverrefs.go:37-39refs.go:56), because nothing else in the chain resolves itverb_env.go:65standaloneVerbEnvprocEnv: envMap()—os.Environ(), the source the retired$env.NAMEread (verb_env.go:103)""refs.go:56verb_env.go:216)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.Lowermoves a lifted verb's body — including the data leaf — into the generatedcharly.ymlas atask:entity, and leaves only the argv in the.lobster:So the engine never sees the leaf. Teaching
plugin-lobster'sresolveArgsTemplatea dotted namewould have added a SECOND env resolver wired to a string it never receives — the R2 defect this
change exists to avoid.
plugin-lobsteris 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 tradeopencharly/sdk#443refused for the knobform. 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
corpusleaf needs one more thing.skillCorpusreadsrc.skills["corpus"]andrc.skillshas no writer in the package — that is plugin-pipeline#37 (evidence addedthere). This change makes that ref RESOLVABLE; entity-level config: knobs are inert — the cutover deleted the populator (executor.go) but kept the readers; skill:/report:/media:/repo: are dead #37 makes it REACHABLE. Half-wiring the knob
from
raw["skills"]here would collide with 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 chosen dispatcher-level repopulator.skip_whentowhen:staysopencharly/sdk#443's (the expressiongrammar). Its sibling
condition:is a DATA field and is fixed here.plugin-migrateneeds no change, and that is measured rather than assumed: no spellingresolved in a data string before this change —
${NAME}-uppercase is the plan expander'sgrammar (
kit.TestVarRefPattern) overt.vars∪t.env∪-p, never the processenvironment, and the engine's
${arg}reads run args — so re-pointing the emission would nothave helped.
${env.NAME}is now both the spelling that resolves AND the one the expressiongrammar accepts, so the reshape's output stays as it is.
Head
7b6a148e758436945a1b87c4dba21db3b1293c86:495 insertions(+)/68 deletions(-)across10 files (
git diff --numstat origin/main HEAD). That head is an EMPTY re-freeze of9210549(
git diff --stat 9210549 7b6a148is empty) — the round-2 push created no workflow run, so an emptycommit 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/charlywelds aplugin-pipelinefrom before thekind-threading cutover (
welded plugin @github.com/opencharly/plugin-pipeline/candy/plugin-pipeline:v2026.251.2226then
node "mixed-plan": no kind discriminator), so a bed run on it is0/15on ANY tree andproves nothing. Both arms below therefore run on a driver built from the merged charly tree, with
the tree under test's
plugin-pipelineand the mergedplugin-lobsterbaked: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/maincarrying ONLY the new test file, so every failure below is theold source's own behaviour:
.PIPELINE_PROBE_ENVon the fourth case is bash's own expansion of the unresolved$envplus theliteral
.NAME— the proof that the ref reached the shell as TEXT.TestAuthoredValidatorReadsTheShellOwnEnvironmentpasses on both sides ON PURPOSE: it is thecontrol for the replacement the refusal names, not a change-detector.
2. The same tests on the committed tree
TestEnvDataRefResolvesThroughTheVerbDispatchdrivesNewProvider().Invoke→ theOpRunarm →invokeLiftedVerb: the production dispatch, not a hand-builtverbEnv. 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
envRefReback to the bare arm; M2 removedprocEnv: envMap()fromstandaloneVerbEnv; M3 made an absent name render the literal$env.Xinstead of recording it; M4 removed the
validate:refusal.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
TestMissingEnvNameIsANamedErrorstill passes (the miss is what that testwants to see).
4. Module gates on the committed tree
golangci-lintv2.13.2, baseline vs head: the same 10 findings on the same symbols, so my diff addsnone. The single difference is a LINE NUMBER, because
render.gogained a doc comment.The ten are
plugin-pipeline#48's, unchanged.charly box validateon the committed tree, with theplugin served from that tree rather than from a pin:
5. The change-class R10 bed, before and after
check-pipeline-local, one bed, both trees, the same driver, each tree's ownplugin-pipelinebaked (so the fixtures'
kind:pipelineresolves). Before =origin/main45d4023; after = thecommitted head:
allowlisted: 4in both summaries is the dev-worktree-binary notice every bed prints on a hostwith a packaged charly install;
errors: 0,warnings: 0.check-lobster-localis not in this change's class:plugin-lobsteris untouched, so its bed wasnot 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 theconcurrency is added):
origin/main45d4023origin/main45d4023origin/main45d4023fd420e5The bed is byte-identical on the two trees, so the rate cannot be tree-dependent:
The signature is the same on BOTH trees, captured with
$?rather than a||:r1=0means thepipeline runsucceeded; 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#51records 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
-raceand by mutationsubstituteEnvRefsappends torc.missingEnv;invokeLiftedVerbreads it afterrun. The reasonthat is not a race is structural —
invokeLiftedVerbbuilds its OWNverbEnvper Invoke(
verb_env.go:standaloneVerbEnv), and the grammar only ever runs against that instance — and it isnow measured two ways.
The whole module under the race detector:
And the test this round added,
TestEnvRefsAcrossConcurrentDispatches: eight dispatches in flightat 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
missingEnvinto one package-level accumulator makes it fail under-race:The source was restored afterwards and verified (
sha256sum -c→refs.go: OK / verb_env.go: OK).Rulebook compliance
/charly-internals:git-workflow,/charly-internals:strict-policy,/charly-internals:go,/charly-internals:plugin,/charly-check:check,/charly-internals:go-quality; the repo's ownAGENTS.mdread for its build / validate / landing rules; the root-cause-analyzer discipline applied to the bed anomaly in section 6 instead of a re-run.0/15on the umbrella binary: mechanism = that binary weldsplugin-pipeline:v2026.251.2226, which predates the kind-threading fix, so a fixture'skind:pipelinenever 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 ascharly#1013, with the bed's own side on test(bed):check-pipeline-localis 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 issuescarries all of them.Lowerkeeps the leaf out of the.lobster), so no second env resolver exists.README.mdclaim that$env.NAME"is resolved by the engine" was false, and it is corrected in the same change.refReis gone (exit 1, no output). The one survivingidentity resolverhit is this change's ownCORRECTED 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.git statusstated before every git action; ONE commit (fd420e5), never amended after a push, no force-push, no push tomain, no hook bypass;.check/was deliberately left untracked and uncommitted.NewProvider().Invoke, and the bed runs the real lowered pair through the real engine. The resolver's mutable state is proven per-dispatch under-racewith a mutation that makes the detector fire (section 7).allowlisted: 4dev-binary notice is the only skip-adjacent surface and it is reported in section 5, not hidden.charlybinary 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.9210549, whose tree7b6a148re-freezes byte-identically) with a fresh deploy and a freshupdate: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 ascharly#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.mdcorrection: class runtime,gate
check-pipeline-local. Tier fully tested and validated: the change-class bed passed on thecommitted tree (
errors: 0,warnings: 0, 15/15), the changed dispatch path was executed live bothby that bed and by the eight tests that drive
NewProvider().Invokerather than a hand-builtcontext, 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 makesskills.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-localis non-deterministic on this host (2 of 5runs, 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 bedropped 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-existinggolangci-lintfindings; measured unchanged(same 10 symbols, one line-number shift).
A3 attribution evidence
~/.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.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.DeepSeek Harness, providerollama-cloud, modeldeepseek-v4.1-flash— so the footerbelow 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)