Repository navigation
feat(contracts): publish mixed-backend execution and readback contracts - #1442
Merged
Merged
Conversation
Publish mixed-backend-execution-binding-v1 and mixed-backend-stage-report-v1 as draft contracts for the executable edge and native handoff obligations that issue #1355 defined. A binding is the plain-data form of one installed bridge or transfer service, its time coordinator and its readers for one admitted sem-234/rev1 edge or component-changing transition. A stage report carries one time-grant, execution, delivery, observation, handoff or owner-readback fact for one invocation of the shared backend operation protocol. Pure validators join bindings to the sealed profile, requests to shared contextual admission and the pinned service, and stage reports to the response transcript, so a proposed success or known failure must match the stages. Optional raes_backend_protocols interfaces describe bridges, time coordinators and stage readers. Backend manifests and profiles may declare the two IDs; the stub and reference backends do not. Add the schemas, publication entries, example transcripts, migration note and API-407 specification rules. The reference coordinator still executes its in-process bindings; no executable or runtime adoption is claimed.
doublewhy
force-pushed
the
1371-mixed-backend-execution-contracts
branch
3 times, most recently
from
October 9, 2026 13:53
6929cd3 to
6dbce89
Compare
…ned producers validate_mixed_backend_stage_reports now takes a MixedBackendStageContext holding the time model, the committed time readback the coordinator received, RAES's own post-invocation readback and, for a native handoff, the committed composition state. Grant coordinates must equal the committed readback, and a handoff must name the committed history head and phase revision. Success needs a post-invocation readback in which neither bound clock moved backwards; a handoff failure needs one too. Every stage now names its producer, which must equal the coordinator, bridge, delivery reader, observation reader, transfer service or owner reader that the binding pins for that stage. An incomparable grant with no invocation stage establishes a known failure, and a new mixed-edge-time-refused transcript shows that route. Edge time requirements carry the admitted temporal coupling, joined to the edge. The migration note states the stage and settlement model and the digest rule, and no document claims that these rules reproduce the in-process coordinator.
10 of 11 tasks
doublewhy
force-pushed
the
1371-mixed-backend-execution-contracts
branch
from
October 9, 2026 14:33
6dbce89 to
75fe7b3
Compare
doublewhy
marked this pull request as ready for review
October 9, 2026 15:15
This was referenced Oct 9, 2026
An edge binding's bridge, coordinator, delivery reader and observation reader, and a handoff binding's transfer service, coordinator and owner reader, must now differ in both service reference and digest. Before this, a binding could pin the bridge as its own readers, and the stage validator then accepted a SUCCEEDED transcript in which the bridge reported execution, delivery and observation itself. The stage context now carries the time-model reference and digest it was resolved under, which must equal the binding's time requirement. A supplied composition state must still activate the bound edge, or hold the handoff's source component without its destination.
doublewhy
force-pushed
the
1371-mixed-backend-execution-contracts
branch
from
October 9, 2026 18:18
75fe7b3 to
df71248
Compare
The stage validator accepted reports in ascending sequence, but no interface or document said how a producer picks its number, so a coordinator, bridge and readers that each numbered their own report from 1 were refused. Each stage report's sequence is now its stage's fixed position in its chain: time grant 1, execution or handoff 2, delivery or owner readback 3, observation 4. Any other value is refused, so independent producers can number their reports without coordination. The rule and the ascending acceptance order are stated in the migration note, the API-407 rule, the stage-transcript invariant, the stage report model and the producer protocols. The stage-report schema and its entry are regenerated. Tests also cover a bridge that installs every shared operation method but lacks or narrows its own mixed methods, and a post-invocation readback whose destination clock regressed. The time-refused example no longer says that no bridge call follows.
doublewhy
force-pushed
the
1371-mixed-backend-execution-contracts
branch
from
October 10, 2026 13:03
df71248 to
34fe98d
Compare
…d-backend-execution-contracts # Conflicts: # docs/research/formal-semantic-validation/analysis-v70.json # docs/research/formal-semantic-validation/bundles/retest-v70.json # docs/research/formal-semantic-validation/execution-snapshot-v70.json # docs/research/formal-semantic-validation/index.md # docs/research/specification-coverage/analysis-v69.json # docs/research/specification-coverage/execution-snapshot-v69.json # docs/research/specification-coverage/index.md # implementations/python/tests/test_formal_semantic_validation.py # implementations/python/tests/test_issue_989_versioned_evidence.py # implementations/python/tests/test_specification_coverage.py # tools/check_specification_coverage.py # tools/formal_semantic_validation/_loading.py # tools/formal_semantic_validation/_release_revisions.py # tools/formal_semantic_validation/_releases.py # tools/formal_semantic_validation/_retest.py
Collaborator
|
11 tasks done
…d-backend-execution-contracts # Conflicts: # docs/research/formal-semantic-validation/analysis-v72.json # docs/research/formal-semantic-validation/bundles/retest-v72.json # docs/research/formal-semantic-validation/execution-snapshot-v72.json # docs/research/formal-semantic-validation/index.md # docs/research/specification-coverage/analysis-v71.json # docs/research/specification-coverage/execution-snapshot-v71.json # docs/research/specification-coverage/index.md # tools/formal_semantic_validation/_baseline.py
Collaborator
|
doublewhy
added a commit
that referenced
this pull request
Oct 12, 2026
PR #1442 published mixed-backend-execution-binding-v1 and mixed-backend-stage-report-v1 after this branch was cut, so the tracing gate reported both as untraced once the branch was rebased onto dev. API-407 owns both. Issue #1371, which #1442 implements, asks to "Update API-407 contracts" for these carriers, and #1442 states the rules for both contracts under the API-407 section of specs/formal/runtime-contracts/participant-backend-contracts.md. The API-407 statement requires the installed mapping, bridge, time-coordination and readback services that the binding pins and the stage reports evidence to be checked in context, and API-407 already owns mixed-participant-composition-profile-v1 and links the issue #1355 runtime modules whose carriers #1442 published.
doublewhy
added a commit
that referenced
this pull request
Oct 12, 2026
PR #1442 published mixed-backend-execution-binding-v1 and mixed-backend-stage-report-v1 after this branch was cut, so the tracing gate reported both as untraced once the branch was rebased onto dev. API-407 owns both. Issue #1371, which #1442 implements, asks to "Update API-407 contracts" for these carriers, and #1442 states the rules for both contracts under the API-407 section of specs/formal/runtime-contracts/participant-backend-contracts.md. The API-407 statement requires the installed mapping, bridge, time-coordination and readback services that the binding pins and the stage reports evidence to be checked in context, and API-407 already owns mixed-participant-composition-profile-v1 and links the issue #1355 runtime modules whose carriers #1442 published.
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
Issue #1355 made the reference coordinator execute admitted mixed-backend edges and native handoffs, but it kept their inputs and evidence in
raes_runtime:MixedEdgeExecutionBinding,MixedHandoffBindingand their bridge, time, delivery, observation and handoff carriers. A backend author therefore had no portable contract to implement against.This PR publishes two draft contracts for those obligations.
mixed-backend-execution-binding-v1is the plain-data form of one installed bridge or native transfer service, its time coordinator and its readers for one admittedsem-234/rev1edge or component-changing transition. Each role is pinned to a distinct service: no two roles in one binding share a service reference or digest.mixed-backend-stage-report-v1carries one time-grant, execution, delivery, observation, handoff or owner-readback fact for one invocation of the #1360 backend operation protocol, and names the pinned service that produced it. Each report'ssequenceis its stage's fixed position in its chain, so independent producers number their reports without coordinating. Pure validators join bindings to the sealed profile, requests to shared contextual admission, and stage reports to the response transcript and to the caller's own committed time and composition readbacks.The migration note states the stage and settlement model that the stage validator enforces. That model governs the published carriers only; it makes no claim about the in-process coordinator, which does not read them. No executable or runtime adoption is claimed; #1372 owns execution.
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
## Requirementssection, so this PR declares no requirement UID and changes no requirement record, and the branch carries no UID or scope file. The change does extend API-407 (participant feature support): it adds API-407 rules for the two contracts tospecs/formal/runtime-contracts/participant-backend-contracts.mdand editsmanifest_authority.pyandtest_backend_manifest.py, which API-407 already traces, without changing its feature terms or support levels. Traceability below notes the schema owner that ci(policy): require every published contract to trace to a governing requirement #1422's gate will need.Related Issues
Closes #1371
ADR Impact
Changes
raes_contracts/contracts/mixed_backend_binding.py(edge and handoff bindings with pinned services, a governed time requirement, declared mapping loss and evidence obligations; an edge's time requirement,MixedBackendEdgeTimeRequirementModel, also carries the admittedtemporal_coupling) andmixed_backend_stages.py(six closed stage kinds bound to the invocation and request digest; every stage names itsproducer). An edge binding fixescompiled-identity, so the authorized action address is preserved, and names the destination provider's action allocation as effect owner without controller, disclosure or commit authority. Model validators refuse a binding that pins one service to two roles byservice_refor bydigest: across an edge's bridge, coordinator, delivery reader and observation reader, and across a handoff's transfer service, coordinator and owner reader. A bridge therefore cannot grant its own order or read back its own delivery or observation, and a transfer service cannot grant its own order or read back its own owner.mixed_backend_validation.pyrequires exactly one matching binding per active edge and per one-to-one component-changing transition, with the edge's time coordinates and temporal coupling equal to the admitted edge. It refuses missing, foreign, duplicate and contradictory bindings, ungoverned order and other component changes. It also requires a request to commit to the binding, its operation kind and its pinned service before shared admission.validate_mixed_backend_stage_reports()inmixed_backend_transcript.pytakes aMixedBackendStageContextthat the caller resolves itself. It holdstime_modelwith thetime_model_refandtime_model_digestit was resolved under (both must equal the binding's time requirement),time_state(the committed time readback the coordinator received),post_time_state(RAES's own readback after the invocation, orNone) andcomposition_state(required for a handoff). A supplied composition state must belong to the binding's profile and still be open for the obligation: the bound edge is active, or the handoff's source component is active and its destination is not. Each report'ssequencemust be its stage's fixed chain position (time grant 1, execution or handoff 2, delivery or owner readback 3, observation 4), and reports are accepted in ascendingsequencewhatever order they are supplied in, so producers that see neither each other's reports nor a shared counter can number them. Each stage must follow its prerequisite and name the coordinator, bridge, delivery reader, observation reader, transfer service or owner reader that the binding pins for it. Grant coordinates must equaltime_state. A handoff must name the committed history head and phase revision, and its owner readback is judged against that revision. An invocation stage needs anorderedgrant and an accepted acknowledgement. A proposedSUCCEEDEDorFAILEDoutcome must equal the established state: success needs a post-invocation readback in which neither bound clock moved backwards (a handoff failure does too), and anincomparablegrant with no invocation stage establishesFAILED. Shared evidence may cite only supplied reports.raes_backend_protocols/mixed_backend.pyaddsMixedBackendBridge(on top ofBackendOperationProvider),MixedTimeCoordinator,MixedStageReaderandrequire_mixed_backend_service(), which checks declarations and call shapes without invoking code. Each producer method's docstring gives thesequenceits reports carry.MIXED_BACKEND_CONTRACT_IDSjoinsBACKEND_SUPPORTED_CONTRACT_IDS, so thebackend-manifest-v2andbackend-profile-v1enums and entries change; the stub and reference backends exclude the IDs, andtest_backend_manifest.py's expected stub list excludes them too. Two hand-governed schemas undercontracts/schemas/control-plane/carryx-raes-invariantsnaming the validators and their inputs, includingtime-runtime-state-v1and the composition states ofruntime-snapshot-v1. The binding schema's local-consistency invariant states the distinct-service rule, and the stage-transcript invariant states the fixed sequence per stage, the time-model identity and the open-obligation joins. Their publication entries are new, andschema_bundle()registers them throughbundle_runtime.py. Exports go through a new_mixed_backend_exports.pyspread inside_mixed_composition_exports.py, so_exports.pystays at 499 lines.valid/,invalid/andcontext-invalid/fixtures. The binding'sinvalid/bridge-as-reader.jsonpins the bridge as both readers andinvalid/transfer-as-owner-reader.jsonpins the transfer service as its own owner reader. Six request/response/stage transcripts (mixed-edge,mixed-edge-partial,mixed-edge-refused,mixed-edge-time-refused,mixed-handoff,mixed-handoff-stale) and two capability declarations sit beside the backend operation corpus. Inmixed-edge-time-refusedthe destination clock sits in a later segment, the grant isincomparable, and the bridge accepts the start but reports no execution stage and proposes a known failure with no effect.docs/migration/mixed-backend-execution.md(bindings and their distinct services, stage reports with their fixed sequence numbers and producers, the digest rule, producer and reader obligations, the stage and settlement model with its preconditions, compatibility, examples, limits) linked fromdocs/migration/README.md. It cites ADR-102 section 13 as the decision and the Define executable mixed-backend mapping and time contracts #1355 preflight as architecture guidance. Also a section indocs/explain/reference/mixed-participant-composition.md, API-407 rules inspecs/formal/runtime-contracts/participant-backend-contracts.md, the public API page and one paragraph indocs/public/backends.md.execution-snapshot-v69.json,analysis-v69.json, issue-1371 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.tools/check_specification_coverage.py,tools/formal_semantic_validation/, and the three evidence test modules. Both research indexes record the new releases.Test Plan
uv run --project implementations/python --frozen --all-extras python -m pytest implementations/python/tests/test_issue_1371_mixed_backend_contracts.py -qpassed (145 passed); the module has no integration-marked tests, so-m integrationselects none (145 deselected). With--cov-branch, the module covers every line and branch of the seven new modules (544 statements, 164 branches).Reviewer probe for this revision. On df71248 the stage validator accepted the
mixed-edgereports numbered 1, 2, 3, 4 or 10, 20, 30, 40, but refused them when each producer numbered its own report from 1 ("duplicate stage report sequence changed its content") and when the coordinator picked 5 and the bridge 3 ("mixed stage report precedes its prerequisite stage").mixed-edge-partial(each producer from 1) andmixed-handoff(from 1, and coordinator 5 with transfer service 3) were refused the same way. On this head each of those numberings other than 1, 2, 3, 4 is refused with "stage report sequence differs from its stage's chain position", and chain-numbered reports supplied in reverse order are accepted.The new tests were written before the source change.
test_independent_producers_number_each_stage_by_its_chain_positionhas six cases, and each re-cites its renumbered reports so that the numbering is its only defect. With the retargeted case for a stage reported again under a second number, all 7 failed against the unchanged validator: 3 with "changed its content", 2 with "precedes its prerequisite stage", 1 accepted (10, 20, 30, 40) and 1 with "at most once". All pass after the fix. The previous revision's 128 tests, run unchanged against the fix, all pass except the two cases this PR retargets: the foreign-stage case now adds an owner readback at sequence 3, and the second-number case now expects the new message. All six fixture transcripts already use the chain numbers, so no fixture changed. The removed "at most once" branch can no longer be reached, because two reports of one stage now share a number.Two in-memory mutants survived the previous tests: a bridge check that skips the bridge's own
execution_bindingandstage_reportsmethods, and a time confirmation that ignores the destination clock. The new bridge cases (a dropped or narrowedexecution_bindingorstage_reports, with every shared operation method installed) fail under the first mutant (4 failures), and the new destination-regressed readback cases fail under the second (3 failures). The earlier rounds' cases for distinct services, time-model identity, open obligations, the handoff fence and the grant and producer joins are unchanged and pass in the same run.The new module ran together with the neighbouring modules for backend manifests (including the v2 adapter), backend profiles, facade exports, corpus packaging, #1004, #1014 (contracts and governance), #1016, #1330 schema coverage, #1355, #1360 (operations and rejections) and runtime contracts and boundaries: 592 passed, 14 deselected. The 14 deselected tests are the integration-marked tests in
test_corpus_packaging.py, which build a wheel and install it into a throwaway virtual environment; they were not rerun locally, and CI's integration job runs them.tools/check_generated_schemas.pyandtools/check_schema_publication.py --base-rev origin/devpassed aftermixed-backend-stage-report-v1.jsonand its entry were regenerated; only its description and stage-transcript invariant changed, and the binding schema did not change.nox -s contracts -- --base-rev origin/devpassed all 14 steps, including schema publication, generated schema drift, JSON artifact validation and both evidence steps.nox -s docs-localpassed (Sphinx-W, Vale, public source boundary), and Vale run directly on the migration note reports no findings.make policyandnox -s lintpassed. Requirement governance does not apply:python -m tools.requirement_context --branch 1371-mixed-backend-execution-contractsresolves no UID and the branch has no scope file, so CI's canonical lane passes--skip-requirement.Both evidence checker CLIs pass (integrity and replay), and the republish helper's read-only check reports the branch evidence as current. The captures were regenerated at the same releases and bound to 1c42b73; only their source identity fields changed. The three evidence modules pass with default markers (209 passed, 19 deselected) and with
-m integration(19 passed, 209 deselected). There are no formal deviations and no changed artifact pins.verify-fast-feedback -- --base-rev origin/devpassed on the final commit. CI run 38054240362 on 34fe98d passed all 32 checks withdeployskipped, and the SonarCloud quality gate is OK (0 new issues, 100% coverage of new code, 0% duplication).Ground Control Checks
make policypassed on the final tree. The maintainer's pre-push Codex review was not run for this lane.Traceability
implementations/python/packages/raes_contracts/contracts/mixed_backend_binding.py,mixed_backend_stages.py,mixed_backend_validation.py,mixed_backend_transcript.py,mixed_backend_schema.py,implementations/python/packages/raes_backend_protocols/mixed_backend.pyimplementations/python/tests/test_issue_1371_mixed_backend_contracts.py,implementations/python/tests/test_backend_manifest.pyIMPLEMENTS → SPECowner for the two new schemas.Checklist
CHANGELOG.mdfrom it)FM3 (stateful and control semantics: a stage-report state machine and the result contract it settles). The abstract state-machine model is the "Stage and settlement model" section of
docs/migration/mixed-backend-execution.md: its state (accepted stages, accepted acknowledgement, confirmed time), the preconditions on the trusted inputs, transitions with their prerequisites and joins, the settlement table, observation rules and invariants. Invariants: one binding per executable obligation; preserved compiled subject; a distinct pinned service for each role of a binding; pinned service, time, coupling and loss coordinates equal to the admitted edge or transition; every stage from its pinned producer; every report numbered by its stage's fixed chain position and accepted in ascending sequence; a trusted time model resolved under the binding's reference and digest; a composition state still open for the bound edge or handoff; grant coordinates equal to the committed time readback; a handoff fenced on the committed history head and phase revision; no invocation stage without anorderedgrant and an accepted acknowledgement; a proposed success or known failure equal to the established state; citations only of supplied reports. Artifacts: typed closed models, contract validators with parametrized valid and invalid cases, the routed fixture corpus, the model above and the rule-removal and mutant checks in the Test Plan. No TLA+ or Alloy model is added. No executable or runtime adoption is claimed.Documentation
Updated:
docs/migration/mixed-backend-execution.md(new),docs/migration/README.md,docs/explain/reference/mixed-participant-composition.md,specs/formal/runtime-contracts/participant-backend-contracts.md,docs/public/api/contracts.rst,docs/public/backends.md, both research evidence indexes.