Repository navigation
fix: build the observed estate with the caller's parameters (#1483) - #1486
Merged
Merged
Conversation
`chant graph --live` builds the source to learn which entities to observe, and did it on default parameters. The declared overlay built beside it resolves the caller's. So the two halves of an overlay came from different parameters. For a project whose parameters choose which resources *exist* — a tier, a size, a profile — that is not a near miss. Every resource the real parameter declares is absent from the observation and reads as not deployed; every resource the default declares is observed against nothing and reads as pending. The overlay is confidently wrong rather than empty, which is the worse of the two. Found in kubemicrovm-ops, whose `minimal` tier declares a bare MicroVM and whose `prod-ha` declares a replica set, a class and a network connector instead. A converged prod-ha estate — image SUCCESSFUL, connector ACTIVE, readyReplicas at the floor — overlaid as four unobserved Kubernetes resources, because it was being compared against minimal's declarations. The stderr ordering was what gave it away: at KMV_TIER=prod-ha the not-observed warnings name minimal's entity set, and `[param] tier = "prod-ha" (env)` prints afterwards from the declared pass. `build()` already forwards `options.buildParams` to `discover`, so this is the resolution the non-live path has done since #1359, moved ahead of the call that needed it too. before tier=minimal -> 11 nodes tier=prod-ha -> 11 nodes after tier=minimal -> 11 nodes tier=prod-ha -> 13 nodes Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XsCknJvqegvVkB9WKUeBgG
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1483.
chant graph --livebuilds the source to learn which entities to observe, and did it on default parameters (handlers/graph.ts:147). The declared overlay built beside it resolves the caller's (:307). So the two halves of an overlay came from different parameters.Why it is worse than a missing lens
For a project whose parameters choose which resources exist — a tier, a size, a profile — every resource the real parameter declares is absent from the observation and reads as not deployed, and every resource the default declares is observed against nothing and reads as pending. The overlay is confidently wrong rather than empty.
Found in kubemicrovm-ops, whose
minimaltier declares a bareMicroVMand whoseprod-hadeclares aMicroVMReplicaSet,MicroVMClassandMicroVMNetworkinstead. A fully converged prod-ha estate — imageSUCCESSFUL, connectorACTIVE,readyReplicasat the floor — overlaid as four unobserved Kubernetes resources, because it was compared against minimal's declarations.The stderr ordering is the tell: at
KMV_TIER=prod-hathe not-observed warnings nameimage,operatorNs,vm,workloadNs— minimal's entity set,vmand notreplicaSet— and[param] tier = "prod-ha" (env)prints afterwards, from the declared pass.The change
build()already forwardsoptions.buildParamstodiscover, so this is the resolution the non-live path has done since #1359, moved ahead of the call that needed it too. SamegraphBuildParamshelper, same early return on an unresolvable parameter.Verified against kubemicrovm-ops with the patch applied to an installed 0.38:
Tests
Two regression tests under
live graph (--live), mirroring the #1359 pair that covers the non-live path. Thebuildmock now forwards its arguments so a test can assert what was passed, the same reasondiscover's already does.Confirmed non-vacuous — with the source change reverted, both fail:
tsconfig.typecheck.jsonreports 755 errors before and after this change, all pre-existing inexamples/; none inhandlers/graph.ts.🤖 Generated with Claude Code
https://claude.ai/code/session_01XsCknJvqegvVkB9WKUeBgG