Repository navigation
Conversation
The reference and libvirt interpreters built their realization only from ProvisioningPlan.resources. The authenticated HTTP route carries the published plan model, which has no resources map, so a relayed plan committed every planned address as SUCCEEDED while the driver realized nothing. The map is also outside runtime_plan_digest, so a rewritten map changed what was realized without changing the planner authorization. planned_provisioning_resources(plan) in raes_contracts.plan_projection returns one PlannedResource per non-delete operation, falling back to resources only for operation-free plans, and both interpreters iterate it.
Specification-coverage release 69.0.0 and formal-validation release 70.0.0 bind the current implementation digest; outcomes and claim limits are unchanged.
doublewhy
force-pushed
the
1425-relay-plan-parity
branch
from
October 9, 2026 13:19
708e34b to
57f309e
Compare
doublewhy
marked this pull request as ready for review
October 9, 2026 15:24
9 of 11 tasks
This branch has not been deployed
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
The reference and libvirt interpreters built their realization only from
ProvisioningPlan.resources.POST /operations/provisioningconverts the publishedProvisioningPlanModelwithcontrol_plane_api_models._provisioning_plan, and the published model carries operations and noresourcesmap. Ondevat 3512210, a planner-authorized plan submitted over HTTP to the reference backend therefore ended SUCCEEDED and committedprovision.network.labandprovision.node.web, while the in-process driver realized nothing. The same plan applied directly throughRuntimeManager.applyrealizes both.The map is also outside
runtime_plan_digest. An in-process plan whoseresourcesmap had been rewritten kept its digest and planner authorization, and the driver realized the rewritten node image (attacker/backdoor:latestin the regression test).This PR adds
planned_provisioning_resources(plan)toraes_contracts.plan_projection. It returns onePlannedResourceper non-delete operation, and falls back toresourcesonly for an operation-free plan. Both interpreters iterate it instead ofplan.resources. Because this changes source bound by the research evidence, both captures are republished at the next free releases (specification coverage 69.0.0, formal validation 70.0.0). Retained outcomes, classifications and claim limits are unchanged.Requirement UIDs
tools/policy/requirement_order.yaml), so no requirement is claimed. The branch carries no UID and has no scope file (docs/governance/requirement-scopes/1425.json).Related Issues
Closes #1425
ADR Impact
interpret_provisioning_plan(plan)as mapping node, network and placement resources without naming the map it reads, so it still holds.Changes
implementations/python/packages/raes_contracts/plan_projection.py: newplanned_provisioning_resources(plan), next toruntime_plan_digest, the projection whose content it reads. Each non-delete operation yields aPlannedResourcewith the operation's address, type, payload, dependencies and profile bindings in the provisioning domain. A plan with no operations returnsresources, so the pure interpreters still accept the operation-free plans that existing realization tests build. Apply paths drive no resource without an active operation. The module docstring now names this backend-facing view.implementations/python/packages/raes_reference_backend/realization.py(interpret_provisioning_plan) andimplementations/python/packages/raes_backend_libvirt/realization/_plan.py(_collect_supported_resources) iterateplanned_provisioning_resources(plan)instead ofplan.resources.implementations/python/tests/test_issue_1425_relay_plan_parity.py(new):resourcesmap keeps the plan digest but does not change the realized image.tools/research_evidence.pyimplementation_digest()hashes every package.py:execution-snapshot-v69.json,analysis-v69.json, issue-1425 bundle) replays the retained matrix against this branch's source.execution-snapshot-v70.json,analysis-v70.json,retest-v70.json) replays the retained formal cases with baseline 69.0.0. The snapshot records no deviation (deviations: []).tools/check_specification_coverage.py,tools/formal_semantic_validation/, and the three evidence test modules. Both research indexes record the new releases.Reviewer notes:
resourcesmap holds.raes_processor/planner/operations._build_provisioning_planbuildsresourcesand the operations from the same provisioning resources, one operation per resource (_ordered_apply_ops).raes_runtime/backend_preparation._selected_planalready rebuildsresourcesfrom non-delete operations. Direct execution therefore realizes the same networks, containers, domains and placements as before._order_containers, which visits addresses in sorted order. Libvirt iterates resources in address order. Only the reference interpreter's diagnostics now follow operation order.resourcesare unchanged.raes_backend_libvirt/capability_envelope._materialized_payloadsandraes_backend_protocols/domain_topology._materialized_resourcesreadresourcesand then every non-delete operation.raes_contracts/account_materialization._mailbox_inventoryreads onlyresources, so a relayed mailbox plan is still refused withreference-backend.mailbox-unsupported. That fails closed and is not part of this false success.resourcesmap still feeds_mailbox_inventory, and_mailbox_requestdeep-copies that mailbox record intoAccountMailboxMaterialization(the credential still comes from the digest-bound operation), so the tamper fix covers the two interpreters only. HTTP-relayed orchestration and evaluation plans always arrive withresources={}, so the reference orchestrator (raes_reference_backend/orchestrator.py:63) and evaluator (raes_reference_backend/evaluator.py:58) reportrunning: False.Test Plan
uv run --project implementations/python --frozen --all-extras python -m pytest implementations/python/tests/test_issue_1425_relay_plan_parity.py -q -p no:cacheproviderpassed (4 passed). With the three source files reverted toorigin/dev(git checkout origin/dev --onplan_projection.py,realization.pyand_plan.py), the same command failed all 4 cases. The HTTP case realizedfrozenset(), both parity cases found an empty relayed realization, and the tampered case realizedattacker/backdoor:latest. The operation branch ofplanned_provisioning_resourcesruns in every case, and its operation-free branch runs in the existing realization tests below. A directRuntimeManager.applyof the issue's scenario on the in-process driver realizedprovision.network.labandprovision.node.web, both ondev's source and on this branch.The modules named in the issue, the new module, and
test_libvirt_backend_guest_certified.pypassed (211 passed):test_reference_backend_realization.py,test_libvirt_backend_realization.py,test_reference_backend_provisioner.py,test_libvirt_backend_provisioner.py,test_domain_controller_placement.pyandtest_runtime_control_plane_api.py. With-m integrationall 211 are deselected, because none is integration-marked.The 70
tests/*.pyfiles that reference either package passed: 1376 passed, 6 deselected. They are the output ofgrep -l 'raes_reference_backend\|raes_backend_libvirt' implementations/python/tests/*.py: 67 test modules pluslibvirt_participant_proof.py,libvirt_conformance_fixtures.pyandlibvirt_participant_fixtures.py. With-m integration, 2 passed and 2 skipped. The passes aretest_repo_policy_tools.py::test_make_policy_delegates_requirement_context_to_the_shared_nox_gateandtest_repo_policy_tools.py::test_default_structural_policy_runner_executes_rego. The two real-libvirt certification modules skip becauseRAES_REAL_LIBVIRT_URIis unset.test_reference_backend_docker_integration.pycarries only thedockermarker and was not run locally.The 16 test modules whose source mentions
plan_projectionand are in neither set above passed (241 passed). They are the output ofgrep -l plan_projection implementations/python/tests/test_*.py, less the two sets above:test_plan_projection.py,test_issue_673_account_credential_bindings.py,test_issue_1187_control_plane_security_conformance.py,test_issue_1200_mixed_runtime_constraints.py,test_issue_1204_collection_lifecycle.py,test_issue_1204_nested_domains.py,test_issue_1204_recursive_carriage.py,test_issue_1204_recursive_defaults.py,test_issue_1204_resource_collections.py,test_issue_1212_runtime_boundaries.py,test_issue_1241_inspection_plans.py,test_issue_1241_materialization_context.py,test_issue_1241_materialization_runtime.py,test_issue_1242_review_regressions.py,test_issue_1361_execution_policy.pyandtest_issue_1361_policy_admission.py. With-m integrationall 241 are deselected.After the republish,
tools/check_specification_coverage.pyandtools/check_formal_semantic_validation.pypassed underuv run --project implementations/python --frozen --all-extras. The three evidence test modules passed with default markers (209 passed, 19 deselected) and with-m integration(19 passed, 209 deselected).nox -s verify-fast-feedback -- --base-rev origin/devpassed every stage except two skips: requirement governance (--skip-requirement) and YAML syntax (no YAML files changed). It ran the four directly changed test modules (213 passed, 19 deselected).nox -s lintpassed.On 57f309e, all 32 PR checks passed and
deploywas skipped. In CI run 37936049355, jobcanonical / integrationreported 226 passed and 2 skipped (the two real-libvirt certification tests), andtest_repo_policy_tools.py::test_default_structural_policy_runner_executes_regoPASSED. Jobintegration-dockerran both tests intest_reference_backend_docker_integration.py(2 passed), andcanonical / coverage-reducepassed. The SonarCloud quality gate is OK for 57f309e: new-code coverage 100.0%, duplication 0.0%, 0 new issues.Ground Control Checks
make policypassed (requirement governance skipped by--skip-requirement). No pre-push Codex or test-quality review was run for this lane.Traceability
implementations/python/packages/raes_contracts/plan_projection.py,implementations/python/packages/raes_reference_backend/realization.py,implementations/python/packages/raes_backend_libvirt/realization/_plan.pyimplementations/python/tests/test_issue_1425_relay_plan_parity.pydocs/decisions/issue-1067-resolved-realization-posture-handoff-preflight.md, says "Reference and libvirt must consume the same total plan lookup" (line 281), requires the runtime-manager and authenticated HTTP paths to "yield the same non-approximation diagnostic" (lines 285-286), and says "Do not preserve only in-process behavior" (line 325). Those rules govern the realization-posture handoff. This PR applies the same parity to the desired resources the interpreters realize.Checklist
docs/explain/reference/coding-standards.md). Invariants: (1) when a provisioning plan has operations, the reference and libvirt interpreters read desired resources only from its non-delete operations, whichruntime_plan_digestcovers, and they readresourcesonly for an operation-free plan; (2) interpreting a plan relayed through its published model equals interpreting it directly. Artifacts: this invariant list and the unit tests intest_issue_1425_relay_plan_parity.py. Its parametrizedtest_relayed_and_direct_plans_interpret_identicallyis the differential test across both interpreters, and it relays through the publishedProvisioningPlanModel. No formal model is added. No executable or runtime adoption is claimed.CHANGELOG.mdfrom it)docs/decisionsanddocs/research, no document mentionsinterpret_provisioning_planor theresourcesmap, and ADR-063 (see ADR Impact) does not name the map the interpreters read.