Repository navigation
refactor(sdk): check plan observations against compiled addresses - #12773
Merged
Merged
Conversation
Plan validation rebuilt the observations a plan may read from address prefixes that compilation also encodes. Across the examples, the prefix rules accepted observations no compiled graph reads: any numbered discovery address, gateway and engine capabilities the graph does not read, and runtime image checks for unchecked containers. Its capacity rule matched a data source SDK graphs no longer emit. Compilation now reports the data sources its graph reads, and apply, the runtime stage, and teardown add them to the addresses the plan gate expects. Teardown keeps the applied graph's observations before it removes them. The gate keeps its action, duplicate, deposed, and mode rules. The prefix rules, compile::is_gateway_observation, discovery_graph::is_observation, and services::capacity are removed. The gateway observation test now declares its observation, because declaration is the contract the gate checks. Validation: across all 63 deployment and runtime graphs of the 44 examples, every observation a graph reads passes, and undeclared observations are rejected on apply and teardown; the rejection tests fail against the gate on 72d12f7. On Linux ARM64, cargo ci (1251 tests, 101 lifecycle tests) and cargo ci live-docker (10 tests) pass. On macOS, fmt, strict Clippy, and the SDK unit tests pass. Signed-off-by: Bowen Zhu <[email protected]>
4 tasks
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.
Summary
Plan validation now accepts only the observations a compiled graph reads. Compilation supplies those addresses, so
plan.rsno longer rebuilds them from name prefixes.Fixes #12534.
Failure
observation()indeployment/plan.rsrebuilt allowed observation names from prefixes that sandbox, runtime, and Docker compilation also encode. Across the 44 examples, those rules accepted observations no compiled graph reads:data.nemoclaw_fabric_capabilities.sandbox_99;data.nemoclaw_engine_capabilities.currentand the gateway capability observations, when the graph does not read them;managed_gateway_runtime.Its capacity rule matched
data.nemoclaw_service_capacity, which SDK graphs stopped emitting inbd5f8df94; it accepted nothing on any example graph.Changes
compile::observationsreturns the data sources a compiled graph reads. Apply, the runtime stage, and teardown add them to the addresses the plan gate expects. Teardown keeps the applied graph's observations before it removes thedatablock.observation()accepts a data source only when it is expected. Its action, duplicate, deposed, and mode rules are unchanged.compile::is_gateway_observation,discovery_graph::is_observation, andservices::capacity, which only the gate used.A new service kind, such as the containers in #12619, needs no change in
plan.rs.Evidence
72d12f7, both rejection tests fail withsandbox_99accepted.cargo cipasses (1251 tests, 101 lifecycle tests), andcargo ci live-dockerpasses all 10 Docker live tests.cargo fmt --check, Clippy with-D warnings, and the SDK unit tests pass.Notes
compile_teardownremoves thedatablock. Teardown still passes the applied graph's observations, so the gate keeps accepting their discard asgateway_observations_are_read_only_in_plans_and_discardable_during_teardownexpects.Not in this PR
deployment/reporting.rsanddeployment/apply.rsstill derive some observation names for reporting and readiness. They do not decide plan acceptance.Signed-off-by: Bowen Zhu [email protected]