Repository navigation
Conversation
doublewhy
force-pushed
the
1434-typed-runtime-domain
branch
from
October 9, 2026 13:25
6e425be to
9a80447
Compare
doublewhy
marked this pull request as ready for review
October 9, 2026 15:28
9 of 11 tasks
… an untyped string RuntimeDomain is a str enum, so a backend entry whose domain was the plain string "provisioning" passed the value comparison in the plan-ownership check and was committed. The control-plane submission and credential paths compare the domain by identity, so every later planner-authorized plan for that resource was refused as incoherent, and the resource could not be torn down. Backend snapshot admission now requires a RuntimeDomain member, next to the typed profile-binding check. Two test helpers that built backend results with string domains now use RuntimeDomain.PROVISIONING, so the closed-excess test keeps failing for closed excess.
doublewhy
force-pushed
the
1434-typed-runtime-domain
branch
from
October 13, 2026 06:34
9a80447 to
5672244
Compare
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
SnapshotEntry.domainis typedRuntimeDomain, astrenum, but backend snapshot admission never checked that type. The plan-ownership check inbackend_entry_transitions._identity_violationcomparesentry.domain != domain, and"provisioning" == RuntimeDomain.PROVISIONINGis true. Ondevat cf8b430, a reference provisioner whose successful result named its changed entries' domains as plain strings was committed with success, by bothRuntimeManager.applyand the control plane.The control-plane submission path (
control_plane_submission._submitted_operation_diagnostic) and the credential path (backend_account_credentials._closed_plan_entry) compare the domain by identity. After one such result, the planner-authorized teardown ofprovision.node.webwas refused withruntime.plan-resource-incoherent, so the resource could not be removed until a durable reload re-typed it.Backend snapshot admission now refuses an entry whose domain is not a
RuntimeDomainmember, next to the existing typed profile-binding check.Because this changes source bound by the research evidence, both families get one fresh content-addressed capture, as
docs/develop/research-captures.mdrequires since #1449. Retained outcomes, classifications and claim limits are unchanged, and formal replay shows no drift.Requirement UIDs
ASR-532(Runtime Backend Result Integrity).specs/formal/runtime-contracts/backend-result-admission.mdsays a submitted plan owns the resource's "runtime domain" and "A backend MUST NOT rewrite these".docs/requirements/ASR-532/requirement.mdalready listsraes_runtime/backend_snapshot_contracts.pyas an IMPLEMENTS file. As in feat: carry resolved realization authority through plans #1081, the branch name carries no UID and there is no requirement scope file, so requirement governance is not activated and no requirement record changes.Related Issues
Closes #1434
ADR Impact
specs/formal/runtime-contracts/backend-result-admission.mdas a normative contract; this change follows it and changes no ADR text.Changes
implementations/python/packages/raes_runtime/backend_snapshot_contracts.py: new_domain_violation, checked first in_entry_violation. It requirestype(entry.domain) is RuntimeDomainand otherwise reports "Backend snapshot contains an untyped runtime domain.". The existing shape gate turns that intoruntime.backend-contract-invalidand keeps the predecessor.implementations/python/tests/test_issue_1434_typed_runtime_domain.py(new): a delegating wrapper around the reference provisioner whose first successful result names its changed entries' domains as strings. The tests compare exact(code, message)diagnostics.RuntimeManager.applyrefuses it with one diagnostic,runtime.backend-contract-invalid"Backend snapshot contains an untyped runtime domain.", and leaves the snapshot empty.runtime.control-plane.operation-failed, and the next planner-authorized plan succeeds without diagnostics. The typed control commits and then removesprovision.node.webwithout diagnostics. Both end with onlyprovision.network.lab, and with typed domains.implementations/python/tests/test_issue_1200_mixed_runtime_constraints.py(_returned) andimplementations/python/tests/test_issue_1067_resolved_realization_authority.py(_snapshot_from_plan): these helpers built backend results withdomain="provisioning"and now useRuntimeDomain.PROVISIONING. Without this, 13test_issue_1200cases that expect acceptance fail on the new check, andtest_backend_apply_uses_plan_authority_and_restores_baseline_on_closed_excesswould pass for the wrong reason: its result is refused as an untyped domain, and with the excess mutation removed, the result was also refused as an untyped domain. With the typed helper, the excess result is refused with "Backend materialized closed realization concern 'runtime-environment'.", and with the excess mutation removed the result is accepted. The test now asserts that message as well as the code.capture-621839feead974e36c1d1ca296447fc7ae844949feaea591aa92546102615050(template: dev's newest capturecapture-94a84282...) and formal-validation capturecapture-30800f71c4ba3ceedeb9ad43db759b1d3e1a83f9df1a5e529b661b6b6f195c70(baseline: dev's newest capturecapture-2df4b6bd...), each with itscapture-recordsreceipt, recorded withpython -m tools.research_capture record. Both bind implementation digest2943bea1d38eat code commit5d623a26. No numbered file, index, pin or evidence test changes. This branch's earlier numbered evidence (specification 69.0.0, formal 70.0.0, their index entries and revision pins) is dropped, and the two code commits are rebased ontodevat cf8b430 unchanged.Test Plan
uv run --project implementations/python --frozen --all-extras python -m pytest implementations/python/tests/test_issue_1434_typed_runtime_domain.py -q -p no:cacheproviderpassed (3 passed). Withbackend_snapshot_contracts.pyrestored fromdev, the same command failed 2 of 3. The manager case committed the result (assert True is False), and the control-plane case's second receipt was refused withruntime.plan-resource-incoherent("Submitted plan disagrees with the admitted snapshot resource identity."). The typed control passed.With the fix in place, reverting the
_snapshot_from_planhelper todomain="provisioning"makes the closed-excess test fail on its message assertion, because the refusal becomes "Backend snapshot contains an untyped runtime domain.". Reverting the_returnedhelper instead makes 13 of the 46test_issue_1200cases fail.The targeted modules from the issue's verification plan passed:
test_issue_1434_typed_runtime_domain.py,test_issue_1067_resolved_realization_authority.py,test_issue_1200_mixed_runtime_constraints.py,test_issue_158_runtime_result_integrity.pyand the fourtest_issue_1204_result_*modules (178 passed). With-m integrationthey select no tests (178 deselected).tools/check_specification_coverage.pyandtools/check_formal_semantic_validation.pypassed underuv run --project implementations/python --frozen --all-extras(integrity and replay). The evidence modulestest_specification_coverage.py,test_formal_semantic_validation.py,test_issue_989_versioned_evidence.pyandtest_research_capture.pypassed with default markers (226 passed) and with-m integration(18 passed).nox -s contracts -- --base-rev origin/dev, the command of CI's "Run governed contract graph" step, passed every step. Formal replay of the retained corpus showed no drift and no pinned artifact changed.nox -s verify-fast-feedback -- --base-rev origin/devpassed every stage except four skips: requirement governance (--skip-requirement), YAML syntax (no YAML files changed) and the two tooling lint stages (no tooling Python changed). It ran the three directly changed test modules (79 passed).nox -s lintpassed.backend_snapshot_contracts.pyis 288 lines.CI at
5672244e: 28 checks passed anddeploywas skipped (CI run 38357433381, Docs 38357432923, PR Body Policy 38357432962, PR Title Lint 38357432928). The SonarCloud quality gate passed with no failing conditions.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
docs/research/specification-coverage/captures/capture-621839fe.../,docs/research/formal-semantic-validation/captures/capture-30800f71.../and theircapture-recordsreceipts6e8c198a) addedbackend_snapshot_contracts.py, including the typed profile-binding check, and the value comparison inbackend_entry_transitions._identity_violation. Carry resolved realization posture through the backend-facing plan #1067 (SEM-218) closed through feat: carry resolved realization authority through plans #1081 (5c210d52), which added the closed-excess test and its_snapshot_from_planhelper.Checklist
CHANGELOG.mdfrom it)