Repository navigation
Description
chant graph honours a build parameter supplied by environment variable. chant graph --live --overlay does not — it returns the graph for the parameter's default whatever the environment says.
That makes an env-var-driven axis (a tier, a size, a profile) work in the declared view and go flat the moment the live overlay is turned on, which is the view anyone actually operating an estate is looking at.
Reproduction
kubemicrovm-ops declares tier as a build param with env: "KMV_TIER" and a default of minimal. minimal declares a bare MicroVM; prod-ha declares a MicroVMReplicaSet, a MicroVMClass and a MicroVMNetwork instead — a different resource set, not different values.
Same shell, same estate, chant 0.38.0:
tier=minimal flags=<none> nodes=11
tier=prod-ha flags=<none> nodes=13 <- honoured
tier=minimal flags=--env dev --live --overlay nodes=11
tier=prod-ha flags=--env dev --live --overlay nodes=11 <- ignored
The overlay run at prod-ha returns minimal's Kubernetes resources:
KubeMicroVM::MicroVMImage, Core::Namespace, KubeMicroVM::MicroVM, Core::Namespace
where the non-overlay run at the same tier returns
KubeMicroVM::MicroVMImage, KubeMicroVM::MicroVMNetwork, Core::Namespace,
KubeMicroVM::MicroVMReplicaSet, KubeMicroVM::MicroVMClass, Core::Namespace
Exact commands:
export AWS_ENDPOINT_URL=http://localhost:4566 AWS_REGION=us-east-1
KMV_TIER=prod-ha npx chant graph src --detail 3 --format ir
KMV_TIER=prod-ha npx chant graph src --detail 3 --env dev --live --overlay --format irWhy it matters beyond one repo
The overlay compares declared source against live. If the declared half is built at the wrong parameter, the comparison is against an estate nobody deployed — so every resource the real tier declares and the default does not reads as absent, and every resource the default declares and the real tier does not reads as pending. The colouring is confidently wrong rather than missing.
Concretely here: a live prod-ha estate that has fully converged (image SUCCESSFUL, connector ACTIVE, readyReplicas 2/2) overlays as four un-observed Kubernetes resources, because it is being compared against minimal's declarations.
behold surfaces this directly — its tier picker (.behold.json's tiers.envVar) sets the var on the spawned chant process, which is the documented mechanism and works for /api/graph. Under /api/overlay the picker stops doing anything. I traced it there first and it is not behold's: the two commands above reproduce it with behold uninvolved.
Adjacent
Under --live --overlay the IR is split across stdout and stderr — piping stdout alone yields truncated JSON intermittently. The non-overlay form does not do this. Probably the same code path and worth a look while it is open, though it is a separate defect.
Expected
--live --overlay builds the declared side with the same parameter resolution as a plain chant graph, so an env-var-supplied param reaches it.
🤖 Generated with Claude Code
Activity
lex00 commentedon Aug 4, 2026
Traced it. The mechanism in the description is wrong, and the real one is narrower — correcting the record before anyone digs from the wrong end.
Build params are not ignored under
--live --overlay. The declared-overlay side resolves them correctly;[param] tier = "prod-ha" (env)does print. What runs on defaults is the build the observation is scoped from.packages/core/src/cli/handlers/graph.ts:147:No params, where the non-live path 380 lines down does pass them:
buildResultis what tellsobserveResourceswhich entities to look for, so the observation enumerates the default parameter's estate. The stderr ordering shows it plainly — atKMV_TIER=prod-hathe not-observed warnings nameimage,operatorNs,vm,workloadNs, which isminimal's entity set (vm, notreplicaSet), and only afterwards does[param] tier = "prod-ha" (env)print from the declared pass.So the two halves of the overlay are built at different parameters. The symptom in the description stands; the cause is one call site, not parameter resolution.
build()already forwardsoptions.buildParamstodiscover, so the fix is to resolve them before that call and pass them through. Verified against kubemicrovm-ops with the patch applied to an installed 0.38:PR incoming, with a regression test that fails without the change.
One correction to the "Adjacent" note too: the split-stream output is not overlay-specific.
[param]lines and warnings go to stderr by design (build-params-cli.ts:103), and the IR to stdout — my measurement harness was merging them. Nothing to fix there; disregard that paragraph.🤖 Generated with Claude Code
https://claude.ai/code/session_01XsCknJvqegvVkB9WKUeBgG
fix: build the observed estate with the caller's parameters (#1483) (#…
fix: the lifecycle family compares against the estate the caller aske…