Skip to content

Admit mixed and staged participant trial realizations #1015

Closed

Description

@Brad-Edwards

Parent: #813

Bounded outcome

Extend deterministic trial compilation and admission to pin multiple apparatus
components, stable allocation scopes, composition topology, cross-clock and
policy mappings, and finite phase schedules under SEM-234. Preserve
backend-neutral SDL, immutable plan/run identity, schedule-independent bytes,
and fail-closed admission.

Negative cases

  • Runtime or scheduler selection of an undeclared backend or allocation.
  • Partial plan sealing, silent fallback, resampling, or dropped components.
  • Phase membership that is not finite and admitted before execution.
  • Apparatus, capability, authority, clock, or policy drift after sealing.
  • Inter-trial realization changes that reuse a run identity.

Evidence required

  • Red-green compiler/admission tests for pure, mixed, and staged entries.
  • Worker/schedule permutation determinism and digest integrity.
  • Rejection evidence for unresolved scopes, incompatible apparatus, cycles,
    missing mappings, and exceeded bounds.
  • Trial/run lineage and cleanup/isolation evidence.

Explicit nonclaims

  • No live mixed-runtime execution or backend realization.
  • No scheduler authority over semantic selection.
  • No exact replay, equivalence, or transfer claim.

Dependencies

Requirements

  • SEM-234
  • SCE-002
  • API-407

Activity

  1. added
    blockedBlocked on an upstream gate or dependency
    in-progressAn agent is actively working this issue via /implement
    on Sep 17, 2026
  2. Brad-Edwards commented on Sep 18, 2026

    @Brad-Edwards
    CollaboratorAuthor

    🛠️ Picked up by /implement - driver codex, branch 1015-admit-mixed-staged-trials, 2026-09-18T06:35:33.670Z.

  3. Brad-Edwards commented on Sep 18, 2026

    @Brad-Edwards
    CollaboratorAuthor

    gc workflow phase recorded: preflight (issue #1015). Posted by the MCP server to enforce ordering between workflow steps (issue #794 MVP-2). Do not edit or delete — used by downstream tools to gate phase prerequisites.

  4. Brad-Edwards commented on Sep 18, 2026

    @Brad-Edwards
    CollaboratorAuthor

    gc workflow phase recorded: preflight (issue #1015). Posted by the MCP server to enforce ordering between workflow steps (issue #794 MVP-2). Do not edit or delete — used by downstream tools to gate phase prerequisites.

  5. Brad-Edwards commented on Sep 18, 2026

    @Brad-Edwards
    CollaboratorAuthor

    gc workflow phase recorded: preflight (issue #1015). Posted by the MCP server to enforce ordering between workflow steps (issue #794 MVP-2). Do not edit or delete — used by downstream tools to gate phase prerequisites.

  6. Brad-Edwards commented on Sep 18, 2026

    @Brad-Edwards
    CollaboratorAuthor

    gc workflow phase recorded: plan (issue #1015). Posted by the MCP server to enforce ordering between workflow steps (issue #794 MVP-2). Do not edit or delete — used by downstream tools to gate phase prerequisites.

    Implementation plan

    All issue clauses are Path A (new feature) except the architecture/documentation and traceability updates, which are Path D and ride with the executable tests. The existing pure compiler path remains byte-for-byte compatible.

    1. Extend the existing admitted-plan contract, not its lifecycle.

      • Add a closed mixed-composition apparatus binding beside AdmittedApparatusBindingModel, carrying an exact digest-pinned profile reference and an optional exact immediate-source plan/entry/run tuple.
      • Extend AdmittedTrialPlanInputRefsModel with the exact mixed-profile input set while omitting the empty field from legacy serialization, and add governed composition-aware compiler/entry/run identity-profile literals.
      • Keep AdmittedTrialPlanModel, entry sealing, cleanup, isolation, JCS digests, and ingress as the only plan lifecycle. Update the hand-governed admitted-plan schema, generated bundle parity, fixtures, and schema-publication hash/change summary together.
      • TDD: prove legacy fixture/identity bytes remain unchanged; mixed refs and source tuples seal; stale/partial/digest-invalid joins fail closed.
    2. Add explicit, total coordinate-to-realization admission to the incumbent compiler.

      • Extend TrialCompilationRequest with immutable maps for coordinate assignments, sealed mixed profiles, contextual resolution inputs, exact per-component envelopes, and optional already-sealed source plans.
      • Reuse canonical coordinate projection and domain-separated identity derivation. Mixed assignments select a governed composition-aware profile; empty assignments adapt every coordinate to the incumbent single-realizer path. Missing, extra, ambiguous, or stale assignments reject the whole compilation without fallback or partial output.
      • Bind the assignment/profile/source tuple into plan, entry, run, and digest identity. Preserve deterministic bytes and canonical failure selection across map ordering, coordinate partitions, worker/thread permutations, and repeated compilation.
      • TDD: cover pure, alternative, simultaneous-mixed, and staged entries plus assignment changes producing new identities.
    3. Reuse and tighten the Publish portable mixed-composition contracts #1014 contextual gate.

      • Revalidate each sealed profile and exact digest, recompute the provenance-free selected-scenario snapshot for its coordinate, and call validate_mixed_composition_context().
      • Extend MixedCompositionResolutionContext only for missing trusted relationships: canonical allocation-to-semantic-effect coverage and all-phase cleanup/isolation resource coverage. Reject cross-kind overlapping active providers, unresolved targets, missing mappings, cycles, bounds, authority/policy/clock/evidence drift, or omitted later-phase resources.
      • Reuse digest-qualified manifest loading, kind allowlists, processor/backend compatibility, concrete per-component realization envelopes, and API-407’s per-provider feature resolver. Never union envelopes/capabilities or invent a primary component.
      • TDD: drive each negative case through the public compiler boundary and assert bounded trial-compiler.* diagnostics that do not expose raw resolver/Pydantic/backend content.
    4. Keep phase schedules sealed and runtime behavior fail closed.

      • The profile remains the sole owner of finite phases, transitions, topology, mappings, and possible membership. plan_batch_schedule() continues to schedule whole entries only.
      • Ensure cleanup/isolation covers every component/edge resource reachable in any admitted phase.
      • Make realize_admitted_trial_entry() explicitly reject mixed-bound entries before backend selection until Coordinate mixed participant runtimes fail-closed #1016 supplies coordination; add no live dispatch, phase state, persistence, endpoint, or scheduler authority.
      • TDD: prove scheduler output stays entry-level and the legacy one-backend realizer cannot silently choose a mixed component.
    5. Verify, publish, and reconcile authority.

      • Add a focused issue-1015 test module plus targeted extensions to admitted-plan/compiler/realization tests and composition conformance vectors.
      • Update the preflight/design reference and all three requirement traceability sections with the new implementation and test surfaces; requirements are already ACTIVE.
      • Run targeted pytest/schema checks during TDD. Before completion, run the mandated repository-policy, requirement-governance, and verify_all.py checks through the workflow gates; do not edit CHANGELOG.md, add a changelog fragment, or hand-edit the product version.

    Requirement and acceptance coverage

    • SEM-234 (1–2): alternative and simultaneous/staged profiles, stable compiled allocation kinds, explicit assignment, and backend-neutral SDL are implemented by the mixed binding and compiler admission path.
    • SEM-234 (3–4): contextual component/edge joins preserve distinct apparatus, controller, action authority, ownership, routing, disclosure, policy, clock/order, mapping-loss, failure, and evidence coordinates.
    • SEM-234 (5–6): exact immediate-source lineage receives new identities; finite profile phases retain control-loop, world-assumption, and federation posture without runtime phase state.
    • SEM-234 (7) / API-407: missing, stale, unsupported, contradictory, or weakened feature/context relationships fail closed; authorized downgrade remains exact and provider-local.
    • SCE-002: selected scenario, parameterization, random draws, and coordinate identity remain incumbent authorities; realization assignment cannot resample or rewrite SDL meaning.
    • Issue evidence: red/green tests cover pure/mixed/staged compilation, schedule/worker/order determinism, digest integrity, rejection branches, lineage, cleanup, and isolation.
    • Nonclaims: no live mixed-runtime execution, backend realization, scheduler semantic selection, exact replay, equivalence, or transfer claim.

    Whole-repository design checks

    • Security: preserve bounded JSON/model reconstruction, strict closed shapes, exact digest joins, SDL semantic admission, manifest/envelope/capability/policy/time/evidence validation, logical secret references, value-independent diagnostics, and in-process compilation with no argv/environment/path/network exposure.
    • Maintainability: reuse the admitted-plan, trial compiler, composition resolver, apparatus admission, canonicalization, cleanup/isolation, diagnostics, schema generation, and conformance incumbents; add no duplicate graph validator or abstraction.
    • Extensibility: the closed coordinate-to-realization binding, governed profile literals, and parameterized trusted context are the seams for future profile revisions; metadata bags and backend-name branching remain forbidden.
    • Whole-repo: contract models, processor compiler/realizer, normative schema/publication record, fixtures/vectors, policy ownership, docs, and requirement traceability move together.
  7. Brad-Edwards commented on Sep 18, 2026

    @Brad-Edwards
    CollaboratorAuthor

    gc_codex_review — cycle 1 of 1 (pre-push) on issue #1015 (branch 1015-admit-mixed-staged-trials)
    Diff mode: inline — the complete diff was supplied in one prompt

    Core review

    Verdict: don't-ship

    The change chooses the correct top-level seam: mixed realization remains inside the admitted-plan lifecycle, uses governed identity profiles, reuses contextual composition validation, and rejects unsupported runtime realization before backend selection. However, the implementation is not yet production-shaped because replacing the apparatus carrier drops participant-manifest authority, recursive profiles do not receive the complete admission gate, and failure selection is order-dependent. These are boundary-contract defects in the core admission path, not localized polish.

    Blocking findings (3):

    1. [class] Mixed entries drop participant-manifest authority from the sealed plan — implementations/python/packages/raes_contracts/contracts/admitted_trial_plan_components.py:231
      The mixed binding contains only the profile and optional source tuple, while the incumbent digest-pinned participant-manifest references remain on AdmittedApparatusBindingModel. The compiler then emits the mixed binding instead of request.apparatus, copies participant manifest payloads without calling validate_selected_participant_manifests, and excludes the apparatus from mixed plan intent. Consequently, participant references or payloads can be stale—or change without changing the sealed plan identity when no binding descriptor happens to consume them. This contradicts the declared separate AdmittedParticipantManifestReferenceModel join. Preserve those references in a shared entry-level carrier or the mixed binding, validate each exact payload/digest, and include them in the identity projection.
    2. [class] Nested profiles bypass the new trial-admission checks — implementations/python/packages/raes_contracts/contracts/mixed_composition_resolution.py:378
      The contextual visitor recursively walks nested profiles, but require_trial_admission applies projection/effect/resource checks only once to the root after traversal. The processor similarly validates concrete apparatus and cleanup resources only for profile.components on the root, while the aggregate-work calculation counts only request.mixed_profiles and not reachable nested payloads. A nested profile can therefore bypass concrete manifest/envelope admission, projection membership, overlap detection, all-phase resource coverage, and its own per-profile limits while its parent is admitted. Apply reconstruction, profile limits, trial-specific context checks, concrete apparatus/resource admission, and aggregate accounting to every reachable profile in the bounded traversal.
    3. [class] Mixed failure diagnostics depend on mapping insertion order — implementations/python/packages/raes_processor/trial_compiler/compiler.py:366
      Pre-entry apparatus admission fails fast while iterating mixed_profiles in caller insertion order, and validate_composition_components likewise iterates component mappings without canonical ordering. Because these sites can raise different diagnostics—such as missing manifest, envelope mismatch, or compatibility rejection—reversing logically equivalent maps can change the single emitted failure. The new permutation test covers only successful compilation, so it does not pin the required failure stability. Sort these traversals and canonically select failures, as _compile_entries already does.

    Security review

    Verdict: don't-ship

    The change uses the right overall seam: mixed realization remains a closed admitted-entry variant, identities are domain-separated, and unsupported runtime realization fails closed. However, the implementation does not preserve the same exact-authority boundary throughout admission: raw manifest collections can authorize bindings, one concrete apparatus can masquerade as multiple providers, and trial-specific validation stops at the root of a nested profile graph. Those are structural authorization gaps in the newly sealed intent, so this should not ship yet.

    Blocking findings (3):

    1. [class] Mixed compilation authorizes binding targets through unselected manifest payloads — implementations/python/packages/raes_processor/trial_compiler/compiler.py:363
      Attacker model: a caller may supply mixed-compilation artifacts but may not authorize arbitrary apparatus or participant configuration targets. The mixed branch copies the complete caller-owned apparatus_manifests and participant_manifests maps and passes them to _admitted_descriptors(), whose target resolver treats every map entry as selected authority. Unlike the legacy branch, these maps are not reduced through validate_selected_apparatus() and validate_selected_participant_manifests(). A caller can therefore add an otherwise valid but unreferenced manifest with a configuration registry, target it from an experiment binding descriptor, and have that descriptor sealed into every matching entry even though the manifest is neither selected by the composition profile nor digest-pinned by the mixed entry. This turns possession of an arbitrary manifest payload into configuration-binding authority. Construct the resolver maps exclusively from the exact validated component set, and resolve participant manifests through digest-pinned references carried by the sealed mixed authority.
    2. [one-off] One allowlisted manifest can impersonate multiple composition providers — implementations/python/packages/raes_processor/trial_compiler/apparatus.py:383
      A profile author possessing one allowed backend manifest can reference that same manifest and envelope from multiple component IDs while assigning each a distinct apparatus_identity_ref and realization_form. This loop validates each reference but silently overwrites duplicate manifest keys rather than rejecting them, then returns the manifest once per component. The composition-mode check only observes the declared realization_form strings, so one backend can be admitted as multiple supposedly distinct simulation/emulation providers and receive authority allocations intended to be separated between providers. The new positive-test builder reinforces the bypass by assigning the same manifest and envelope to every component. Reject duplicate concrete manifest bindings across components and require each component's governed apparatus identity to resolve uniquely to its concrete manifest/envelope authority.
    3. [one-off] Nested profiles bypass the new trial-admission security checks — implementations/python/packages/raes_contracts/contracts/mixed_composition_resolution.py:378
      The recursive _ContextValidator.visit() applies the baseline contextual checks to nested profiles, but require_trial_admission invokes _validate_trial_admission_context() only once for the root. Consequently, a digest-referenced child profile is never checked for component projection membership, cross-provider semantic-effect overlap, or all-phase resource coverage. A malicious nested composition can therefore introduce providers outside their admitted envelope projection, overlapping authority, or resources omitted from cleanup/isolation while the root plan is still sealed. Apply the trial-admission checks to every profile reached by the bounded recursive traversal, not only the root.
  8. Brad-Edwards commented on Sep 18, 2026

    @Brad-Edwards
    CollaboratorAuthor

    gc_codex_review pre-push cycle 1 of 1 complete for issue #1015 on branch '1015-admit-mixed-staged-trials'. Posted by the MCP server to enforce the pre-push hard-cap-1 contract (issues #796, #804, #906). Do not edit or delete — used by the next gc_codex_review (uncommitted) invocation to count cycles.

  9. Brad-Edwards commented on Sep 18, 2026

    @Brad-Edwards
    CollaboratorAuthor

    Review decision record — codex cycle 1 (issue #1015)

    Reviewer: codex
    Cycle: 1

    Architectural read:

    Core reviewer: The change chooses the correct top-level seam: mixed realization remains inside the admitted-plan lifecycle, uses governed identity profiles, reuses contextual composition validation, and rejects unsupported runtime realization before backend selection. However, the implementation is not yet production-shaped because replacing the apparatus carrier drops participant-manifest authority, recursive profiles do not receive the complete admission gate, and failure selection is order-dependent. These are boundary-contract defects in the core admission path, not localized polish.

    Security reviewer: The change uses the right overall seam: mixed realization remains a closed admitted-entry variant, identities are domain-separated, and unsupported runtime realization fails closed. However, the implementation does not preserve the same exact-authority boundary throughout admission: raw manifest collections can authorize bindings, one concrete apparatus can masquerade as multiple providers, and trial-specific validation stops at the root of a nested profile graph. Those are structural authorization gaps in the newly sealed intent, so this should not ship yet.

    Blocking findings: 6

    Finding 1 — class (5 instances)

    • ID: F1
    • Title: [core] Mixed entries drop participant-manifest authority from the sealed plan
    • Location: implementations/python/packages/raes_contracts/contracts/admitted_trial_plan_components.py:231
    • Decision: fix
    • Rationale: The mixed binding contains only the profile and optional source tuple, while the incumbent digest-pinned participant-manifest references remain on AdmittedApparatusBindingModel. The compiler then emits the mixed binding instead of request.…
    • Instances:
      • implementations/python/packages/raes_contracts/contracts/admitted_trial_plan_components.py:231
      • contracts/schemas/plans/admitted-trial-plan-v1.json:140
      • implementations/python/packages/raes_processor/trial_compiler/compiler.py:266
      • implementations/python/packages/raes_processor/trial_compiler/compiler.py:364
      • implementations/python/packages/raes_processor/trial_compiler/inputs.py:287

    Finding 2 — class (6 instances)

    • ID: F2
    • Title: [core] Nested profiles bypass the new trial-admission checks
    • Location: implementations/python/packages/raes_contracts/contracts/mixed_composition_resolution.py:378
    • Decision: fix
    • Rationale: The contextual visitor recursively walks nested profiles, but require_trial_admission applies projection/effect/resource checks only once to the root after traversal. The processor similarly validates concrete apparatus and cleanup resourc…
    • Instances:
      • implementations/python/packages/raes_contracts/contracts/mixed_composition_resolution.py:375
      • implementations/python/packages/raes_contracts/contracts/mixed_composition_resolution.py:378
      • implementations/python/packages/raes_processor/trial_compiler/inputs.py:206
      • implementations/python/packages/raes_processor/trial_compiler/compiler.py:366
      • implementations/python/packages/raes_processor/trial_compiler/realization_admission.py:173
      • implementations/python/packages/raes_processor/trial_compiler/realization_admission.py:185

    Finding 3 — class (2 instances)

    • ID: F3
    • Title: [core] Mixed failure diagnostics depend on mapping insertion order
    • Location: implementations/python/packages/raes_processor/trial_compiler/compiler.py:366
    • Decision: fix
    • Rationale: Pre-entry apparatus admission fails fast while iterating mixed_profiles in caller insertion order, and validate_composition_components likewise iterates component mappings without canonical ordering. Because these sites can raise different…
    • Instances:
      • implementations/python/packages/raes_processor/trial_compiler/compiler.py:366
      • implementations/python/packages/raes_processor/trial_compiler/apparatus.py:359

    Finding 4 — class (2 instances)

    • ID: F4
    • Title: [security] Mixed compilation authorizes binding targets through unselected manifest payloads
    • Location: implementations/python/packages/raes_processor/trial_compiler/compiler.py:363
    • Decision: fix
    • Rationale: Attacker model: a caller may supply mixed-compilation artifacts but may not authorize arbitrary apparatus or participant configuration targets. The mixed branch copies the complete caller-owned apparatus_manifests and participant_manifests…
    • Instances:
      • implementations/python/packages/raes_processor/trial_compiler/compiler.py:363
      • implementations/python/packages/raes_processor/trial_compiler/compiler.py:364

    Finding 5 — one-off

    • ID: F5
    • Title: [security] One allowlisted manifest can impersonate multiple composition providers
    • Location: implementations/python/packages/raes_processor/trial_compiler/apparatus.py:383
    • Decision: fix
    • Rationale: A profile author possessing one allowed backend manifest can reference that same manifest and envelope from multiple component IDs while assigning each a distinct apparatus_identity_ref and realization_form. This loop validates each refere…

    Finding 6 — one-off

    • ID: F6
    • Title: [security] Nested profiles bypass the new trial-admission security checks
    • Location: implementations/python/packages/raes_contracts/contracts/mixed_composition_resolution.py:378
    • Decision: fix
    • Rationale: The recursive _ContextValidator.visit() applies the baseline contextual checks to nested profiles, but require_trial_admission invokes _validate_trial_admission_context() only once for the root. Consequently, a digest-referenced child prof…
  10. Brad-Edwards commented on Sep 18, 2026

    @Brad-Edwards
    CollaboratorAuthor

    gc_codex_review — cycle 2 of 1 (pre-push) on issue #1015 (branch 1015-admit-mixed-staged-trials)
    Diff mode: inline — the complete diff was supplied in one prompt

    Core review

    Verdict: don't-ship

    The change chooses the right high-level seam: it extends the incumbent admitted-plan union, reuses contextual composition validation and domain-separated identities, and explicitly rejects mixed entries at the unsupported runtime boundary. However, the implementation weakens per-coordinate apparatus authority into a plan-wide union, changes legacy v1 serialization under the existing identity profile, and over-constrains valid manifest reuse. Those are structural contract errors that also foreclose the obvious next variation—multiple realization profiles using the same governed implementation manifest—so this is not production-ready.

    Blocking findings (5):

    1. [one-off] Plan-wide manifest union bypasses per-coordinate apparatus authority — implementations/python/packages/raes_processor/trial_compiler/compiler.py:364
      For mixed plans, authority.apparatus_manifests is the union of every root profile and is passed once to _admitted_descriptors. A descriptor targeting a manifest present only in profile B can therefore be admitted and later sealed into an entry assigned profile A; _entry_bindings filters by selection and condition but never rechecks the assigned profile's component authority. Mixed descriptor admission must use the exact profile closure selected for that coordinate, not another entry's manifests.
    2. [one-off] Legacy v1 apparatus serialization changes without a new identity profile — implementations/python/packages/raes_contracts/contracts/admitted_trial_plan_components.py:217
      participant_manifest_refs was already a defaulted field on AdmittedApparatusBindingModel; this new serializer now removes it when empty. Both plan_intent() and the entry/plan sealing helpers use ordinary model_dump(mode="json"), so pure legacy requests now produce different plan identities, entry digests, plan digests, and serialized bytes while still declaring trial-compiler-v1. Preserve the established v1 projection or introduce a governed profile/version change and compatibility vectors.
    3. [class] Manifest-key uniqueness rejects valid component and profile reuse — implementations/python/packages/raes_processor/trial_compiler/apparatus.py:361
      A manifest identifies a governed processor/backend implementation, while component and apparatus identities identify its use in a composition. Rejecting solely because the same ApparatusManifestKey appears twice prevents distinct component instances from using the same implementation and, through the second occurrence, prevents independent root profiles from sharing it. The latter is especially common for alternative profiles across coordinates. Enforce profile-local component/apparatus identity uniqueness and exact payload equality; do not require globally unique implementation manifests.
    4. [one-off] Legacy plans can advertise mixed identity profiles — implementations/python/packages/raes_contracts/contracts/admitted_trial_plan.py:279
      The validator checks mixed entry/run profiles only when compiler_profile is mixed. A plan containing only legacy apparatus entries can therefore use trial-compiler-v1 together with either mixed entry or run identity profile and still pass this join validation. Validate the complete governed profile tuple in both directions so externally supplied plans cannot claim identity derivations that do not match their compiler branch.
    5. [one-off] Immediate-source validation does not bind the referenced plan ID — implementations/python/packages/raes_processor/trial_compiler/realization_admission.py:254
      The source map is looked up by source_ref.plan_id, but the validated payload's admitted.plan_id is never compared with that value. A caller can place a valid sealed plan under an alias key and produce a target whose identity-bearing source tuple names a nonexistent or different plan while its digest, entry, and run checks pass. Include admitted.plan_id == source_ref.plan_id in the exact tuple validation.

    Security review

    Verdict: ship

    This change is shaped correctly: mixed and staged realization extends the existing admitted-plan/compiler seam through a closed binding union, digest-pinned profiles, bounded trusted-context validation, and domain-separated identities. Manifest, envelope, participant-authority, source-plan, cleanup, and semantic-effect joins remain explicit, while the existing single-backend realization path rejects mixed entries before backend selection. The coordinate-to-realization seam supports future governed profile revisions without introducing dynamic loading, host-path access, or a parallel execution lifecycle. I found no concrete exploitable security issue in the supplied diff.

    No blocking findings.

  11. Brad-Edwards commented on Sep 18, 2026

    @Brad-Edwards
    CollaboratorAuthor

    gc_codex_review pre-push cycle 2 (USER-AUTHORIZED OVERRIDE past cap 1) complete for issue #1015 on branch '1015-admit-mixed-staged-trials'. Posted by the MCP server to enforce the pre-push hard-cap-1 contract (issues #796, #804, #906). Do not edit or delete — used by the next gc_codex_review (uncommitted) invocation to count cycles.
    Override reason: user said: "overcap authroized"

  12. Brad-Edwards commented on Sep 18, 2026

    @Brad-Edwards
    CollaboratorAuthor

    Review decision record — codex cycle 2 (issue #1015)

    Reviewer: codex
    Cycle: 2

    Architectural read:

    Core reviewer: The change chooses the right high-level seam: it extends the incumbent admitted-plan union, reuses contextual composition validation and domain-separated identities, and explicitly rejects mixed entries at the unsupported runtime boundary. However, the implementation weakens per-coordinate apparatus authority into a plan-wide union, changes legacy v1 serialization under the existing identity profile, and over-constrains valid manifest reuse. Those are structural contract errors that also foreclose the obvious next variation—multiple realization profiles using the same governed implementation manifest—so this is not production-ready.

    Security reviewer: This change is shaped correctly: mixed and staged realization extends the existing admitted-plan/compiler seam through a closed binding union, digest-pinned profiles, bounded trusted-context validation, and domain-separated identities. Manifest, envelope, participant-authority, source-plan, cleanup, and semantic-effect joins remain explicit, while the existing single-backend realization path rejects mixed entries before backend selection. The coordinate-to-realization seam supports future governed profile revisions without introducing dynamic loading, host-path access, or a parallel execution lifecycle. I found no concrete exploitable security issue in the supplied diff.

    Blocking findings: 5

    Finding 1 — one-off

    • ID: F1
    • Title: [core] Plan-wide manifest union bypasses per-coordinate apparatus authority
    • Location: implementations/python/packages/raes_processor/trial_compiler/compiler.py:364
    • Decision: fix
    • Rationale: For mixed plans, authority.apparatus_manifests is the union of every root profile and is passed once to _admitted_descriptors. A descriptor targeting a manifest present only in profile B can therefore be admitted and later sealed into …

    Finding 2 — one-off

    • ID: F2
    • Title: [core] Legacy v1 apparatus serialization changes without a new identity profile
    • Location: implementations/python/packages/raes_contracts/contracts/admitted_trial_plan_components.py:217
    • Decision: fix
    • Rationale: participant_manifest_refs was already a defaulted field on AdmittedApparatusBindingModel; this new serializer now removes it when empty. Both plan_intent() and the entry/plan sealing helpers use ordinary model_dump(mode="json"), so…

    Finding 3 — class (2 instances)

    • ID: F3
    • Title: [core] Manifest-key uniqueness rejects valid component and profile reuse
    • Location: implementations/python/packages/raes_processor/trial_compiler/apparatus.py:361
    • Decision: fix
    • Rationale: A manifest identifies a governed processor/backend implementation, while component and apparatus identities identify its use in a composition. Rejecting solely because the same ApparatusManifestKey appears twice prevents distinct compone…
    • Instances:
      • implementations/python/packages/raes_processor/trial_compiler/apparatus.py:361
      • implementations/python/packages/raes_processor/trial_compiler/realization_admission.py:211

    Finding 4 — one-off

    • ID: F4
    • Title: [core] Legacy plans can advertise mixed identity profiles
    • Location: implementations/python/packages/raes_contracts/contracts/admitted_trial_plan.py:279
    • Decision: fix
    • Rationale: The validator checks mixed entry/run profiles only when compiler_profile is mixed. A plan containing only legacy apparatus entries can therefore use trial-compiler-v1 together with either mixed entry or run identity profile and still p…

    Finding 5 — one-off

    • ID: F5
    • Title: [core] Immediate-source validation does not bind the referenced plan ID
    • Location: implementations/python/packages/raes_processor/trial_compiler/realization_admission.py:254
    • Decision: fix
    • Rationale: The source map is looked up by source_ref.plan_id, but the validated payload's admitted.plan_id is never compared with that value. A caller can place a valid sealed plan under an alias key and produce a target whose identity-bearing so…
  13. Brad-Edwards commented on Sep 18, 2026

    @Brad-Edwards
    CollaboratorAuthor

    gc_codex_review — cycle 3 of 1 (pre-push) on issue #1015 (branch 1015-admit-mixed-staged-trials)
    Diff mode: manifest — the complete diff exceeded one prompt and was reviewed as 2/2 inline slice(s) (file-slices) covering 41/41 file(s)

    Core review

    Verdict: ship

    Slice 1/2: This is shaped correctly: mixed realization extends the existing admitted-plan entry seam as a closed binding variant, preserves the legacy apparatus path and identity domain, and keeps compilation, contextual validation, apparatus admission, cleanup/isolation, and runtime realization at their established boundaries. The new realization-assignment projection is identity-bearing and canonicalized, while the single-backend runtime explicitly rejects the unsupported mixed branch; that leaves the obvious next variation—runtime coordination—at the intended downstream seam rather than smuggling it into admission.

    Slice 2/2: This slice updates the formal-validation release gate coherently: 33.0.0 is already the selected current release and baseline successor, and the retest snapshot validator now applies the same shape and retained-fixture rules to it. The policy ownership additions keep the mixed-participant-composition seam explicit across its contracts, compiler, evidence, and tests without introducing a competing mechanism. This is shaped correctly.

    No blocking findings.

    Security review

    Verdict: ship

    Slice 1/2: This change extends the existing sealed trial-plan seam with a closed mixed-composition realization branch, keeping identity derivation, plan validation, apparatus admission, cleanup/isolation checks, and the single-backend runtime boundary aligned. The new trusted-context admission layer is the appropriate cross-cutting seam: it validates profile closure, manifest/envelope authority, component-local constraints, resources, and lineage before sealing, while runtime explicitly rejects unsupported mixed execution. I found no concrete exploitable security regression in this slice.

    Slice 2/2: This slice consistently extends the formal-evidence release allowlist to revision 33.0.0 and maps the new mixed/staged admission surfaces into the existing requirement-ownership policy. The seam remains the validation/policy boundary: release selection still compares the exact expected artifact set, while the ownership file only declares allowed paths. I found no concrete, exploitable security issue introduced by these changes.

    No blocking findings.

  14. Brad-Edwards commented on Sep 18, 2026

    @Brad-Edwards
    CollaboratorAuthor

    gc_codex_review pre-push cycle 3 (USER-AUTHORIZED OVERRIDE past cap 1) complete for issue #1015 on branch '1015-admit-mixed-staged-trials'. Posted by the MCP server to enforce the pre-push hard-cap-1 contract (issues #796, #804, #906). Do not edit or delete — used by the next gc_codex_review (uncommitted) invocation to count cycles.
    Override reason: user said: "overcap authorized"

  15. Brad-Edwards commented on Sep 18, 2026

    @Brad-Edwards
    CollaboratorAuthor

    Review decision record — codex cycle 3 (issue #1015)

    Reviewer: codex
    Cycle: 3

    Architectural read:

    Core reviewer: Slice 1/2: This is shaped correctly: mixed realization extends the existing admitted-plan entry seam as a closed binding variant, preserves the legacy apparatus path and identity domain, and keeps compilation, contextual validation, apparatus admission, cleanup/isolation, and runtime realization at their established boundaries. The new realization-assignment projection is identity-bearing and canonicalized, while the single-backend runtime explicitly rejects the unsupported mixed branch; that leaves the obvious next variation—runtime coordination—at the intended downstream seam rather than smuggling it into admission.

    Slice 2/2: This slice updates the formal-validation release gate coherently: 33.0.0 is already the selected current release and baseline successor, and the retest snapshot validator now applies the same shape and retained-fixture rules to it. The policy ownership additions keep the mixed-participant-composition seam explicit across its contracts, compiler, evidence, and tests without introducing a competing mechanism. This is shaped correctly.

    Security reviewer: Slice 1/2: This change extends the existing sealed trial-plan seam with a closed mixed-composition realization branch, keeping identity derivation, plan validation, apparatus admission, cleanup/isolation checks, and the single-backend runtime boundary aligned. The new trusted-context admission layer is the appropriate cross-cutting seam: it validates profile closure, manifest/envelope authority, component-local constraints, resources, and lineage before sealing, while runtime explicitly rejects unsupported mixed execution. I found no concrete exploitable security regression in this slice.

    Slice 2/2: This slice consistently extends the formal-evidence release allowlist to revision 33.0.0 and maps the new mixed/staged admission surfaces into the existing requirement-ownership policy. The seam remains the validation/policy boundary: release selection still compares the exact expected artifact set, while the ownership file only declares allowed paths. I found no concrete, exploitable security issue introduced by these changes.

    Blocking findings: 0 (clean run)

  16. Brad-Edwards commented on Sep 18, 2026

    @Brad-Edwards
    CollaboratorAuthor

    Pre-PR base synchronization

    • Source: refs/remotes/origin/dev at c745080657e4dcdbb14f7bd243a394a1d7ac16bf
    • Outcome: merged_clean
    • Published feature head: 983f402f2fadd28b8ed8f2545f62f522196735ef
    • Synchronized tree: 046385e10f2385225659f587cc3a6461ae7c0d20
  17. Brad-Edwards commented on Sep 18, 2026

    @Brad-Edwards
    CollaboratorAuthor

    Pre-PR base synchronization

    • Source: refs/remotes/origin/dev at c745080657e4dcdbb14f7bd243a394a1d7ac16bf
    • Outcome: already_current
    • Published feature head: bacd83cf689e79166668ed86e5368901e794b677
    • Synchronized tree: eb77506493cb3cdaaee11bd16f731d32c6d11fb9
  18. Brad-Edwards commented on Sep 18, 2026

    @Brad-Edwards
    CollaboratorAuthor

    Pre-PR base synchronization

    • Source: refs/remotes/origin/dev at c745080657e4dcdbb14f7bd243a394a1d7ac16bf
    • Outcome: already_current
    • Published feature head: e176428da0508e270305ec7410691994e42350e1
    • Synchronized tree: 4152bc330ef5f367790200b34a10619d016f4a5f
  19. Brad-Edwards commented on Sep 18, 2026

    @Brad-Edwards
    CollaboratorAuthor

    Pre-PR base synchronization

    • Source: refs/remotes/origin/dev at c745080657e4dcdbb14f7bd243a394a1d7ac16bf
    • Outcome: already_current
    • Published feature head: 91e2b38a047b6f5378271c361c572ebbb4ed8a8e
    • Synchronized tree: 5134a9b8ed2b2ea82d9f994fc4e6914270dd20ee
  20. Brad-Edwards commented on Sep 18, 2026

    @Brad-Edwards
    CollaboratorAuthor

    Ready for review — issue #1015

    PR: #1322
    Plan: #1015 (comment)

    Outcome

    Trial compilation now admits mixed participant compositions across backend boundaries, including staged realizations linked to sealed source trials. Exact manifests, identities, cleanup resources, and deterministic plan sealing remain enforced.

    Implemented mixed and staged trial realization admission, exact per-coordinate authority binding, source-plan validation, deterministic identity profiles, schema/publication updates, evidence releases, and focused regression coverage. CI is green and SonarCloud reports quality gate OK with zero issues and zero hotspots.

    In-scope requirements

    Proposed state in this PR — authoritative only after merge.

    • SEM-234 (Mixed Cross-Backend Participant-Control Composition) — ACTIVE (proposed)
    • SCE-002 (Scenario Composition, Parameterization, and Randomization) — ACTIVE (proposed)
    • API-407 (Participant Feature Support And Constraint Declaration) — ACTIVE (proposed)

    Files changed

    Added:

    • contracts/fixtures/plans/trial-compiler-mixed-composition-v1/identity-vectors.json
    • docs/decisions/issue-1015-mixed-staged-trial-admission-preflight.md
    • docs/research/formal-semantic-validation/analysis-v32.json
    • docs/research/formal-semantic-validation/bundles/retest-v32.json
    • docs/research/formal-semantic-validation/execution-snapshot-v32.json
    • docs/research/specification-coverage/analysis-v32.json
    • docs/research/specification-coverage/bundles/raes-standardized-specification-coverage-issue-1015-v32.json
    • docs/research/specification-coverage/execution-snapshot-v32.json
    • implementations/python/packages/raes_contracts/contracts/_mixed_composition_exports.py
    • implementations/python/packages/raes_processor/trial_compiler/realization_admission.py
    • implementations/python/tests/test_issue_1015_mixed_staged_trial_admission.py

    Modified:

    • contracts/schema-publication/entries/admitted-trial-plan-v1.json
    • contracts/schemas/plans/admitted-trial-plan-v1.json
    • docs/explain/reference/scenario-variation-and-trial-realization.md
    • docs/requirements/API-407/requirement.md
    • docs/requirements/SCE-002/requirement.md
    • docs/requirements/SEM-234/requirement.md
    • docs/research/formal-semantic-validation/index.md
    • docs/research/specification-coverage/index.md
    • implementations/python/packages/raes_contracts/contracts/__init__.py
    • implementations/python/packages/raes_contracts/contracts/_exports.py
    • implementations/python/packages/raes_contracts/contracts/admitted_trial_plan.py
    • implementations/python/packages/raes_contracts/contracts/admitted_trial_plan_components.py
    • implementations/python/packages/raes_contracts/contracts/mixed_composition_resolution.py
    • implementations/python/packages/raes_contracts/contracts/trial_compilation.py
    • implementations/python/packages/raes_processor/trial_compiler/__init__.py
    • implementations/python/packages/raes_processor/trial_compiler/apparatus.py
    • implementations/python/packages/raes_processor/trial_compiler/compiler.py
    • implementations/python/packages/raes_processor/trial_compiler/inputs.py
    • implementations/python/packages/raes_processor/trial_compiler/models.py
    • implementations/python/packages/raes_processor/trial_compiler/profiles.py
    • implementations/python/packages/raes_processor/trial_realization.py
    • implementations/python/tests/test_formal_semantic_validation.py
    • implementations/python/tests/test_issue_1014_mixed_composition_contracts.py
    • implementations/python/tests/test_issue_989_versioned_evidence.py
    • implementations/python/tests/test_specification_coverage.py
    • implementations/python/uv.lock
    • implementations/tooling/python/smoke/linux-arm64-cp314.txt
    • implementations/tooling/python/smoke/linux-arm64-cp314.wheelhouse-manifest.json
    • implementations/tooling/python/smoke/linux-x86_64-cp311.txt
    • implementations/tooling/python/smoke/linux-x86_64-cp311.wheelhouse-manifest.json
    • implementations/tooling/python/smoke/linux-x86_64-cp312.txt
    • implementations/tooling/python/smoke/linux-x86_64-cp312.wheelhouse-manifest.json
    • implementations/tooling/python/smoke/linux-x86_64-cp313.txt
    • implementations/tooling/python/smoke/linux-x86_64-cp313.wheelhouse-manifest.json
    • implementations/tooling/python/smoke/linux-x86_64-cp314.txt
    • implementations/tooling/python/smoke/linux-x86_64-cp314.wheelhouse-manifest.json
    • implementations/tooling/python/smoke/macos-arm64-cp314.txt
    • implementations/tooling/python/smoke/macos-arm64-cp314.wheelhouse-manifest.json
    • tools/check_specification_coverage.py
    • tools/formal_semantic_validation/_baseline.py
    • tools/formal_semantic_validation/_loading.py
    • tools/formal_semantic_validation/_releases.py
    • tools/formal_semantic_validation/_retest.py
    • tools/policy/requirement_order.yaml

    Reviews

    • codex: Pre-push review cycle 3 was clean with complete 41/41-file coverage; all findings from earlier cycles were resolved and targeted regression checks passed.

    Traceability reconciliation

    • Pending — requirement status transition and IMPLEMENTS/TESTS reconciliation run in Phase E once the PR merges.

    Status

    • CI: ✅ green
    • SonarCloud: ✅ passed
    • PR ready for user review and merge. Ground Control reconciliation (requirement status + traceability) runs on merge (Phase E).
  21. Brad-Edwards commented on Sep 18, 2026

    @Brad-Edwards
    CollaboratorAuthor

    Final report — issue #1015 complete

    PR: #1322
    Plan: #1015 (comment)

    Outcome

    Trial compilation now admits mixed participant compositions across backend boundaries, including staged realizations linked to sealed source trials. Exact manifests, identities, cleanup resources, and deterministic plan sealing remain enforced.

    Implemented mixed and staged trial realization admission, exact per-coordinate authority binding, source-plan validation, deterministic identity profiles, schema/publication updates, evidence releases, focused regression coverage, an AnyIO security update, and regenerated Python closure projections.

    In-scope requirements

    Verified at merge revision fe3b31860e2a.

    • SEM-234 (Mixed Cross-Backend Participant-Control Composition) — ACTIVE
    • SCE-002 (Scenario Composition, Parameterization, and Randomization) — ACTIVE
    • API-407 (Participant Feature Support And Constraint Declaration) — ACTIVE

    Files changed

    Added:

    • contracts/fixtures/plans/trial-compiler-mixed-composition-v1/identity-vectors.json
    • docs/decisions/issue-1015-mixed-staged-trial-admission-preflight.md
    • docs/research/formal-semantic-validation/analysis-v32.json
    • docs/research/formal-semantic-validation/bundles/retest-v32.json
    • docs/research/formal-semantic-validation/execution-snapshot-v32.json
    • docs/research/specification-coverage/analysis-v32.json
    • docs/research/specification-coverage/bundles/raes-standardized-specification-coverage-issue-1015-v32.json
    • docs/research/specification-coverage/execution-snapshot-v32.json
    • implementations/python/packages/raes_contracts/contracts/_mixed_composition_exports.py
    • implementations/python/packages/raes_processor/trial_compiler/realization_admission.py
    • implementations/python/tests/test_issue_1015_mixed_staged_trial_admission.py

    Modified:

    • contracts/schema-publication/entries/admitted-trial-plan-v1.json
    • contracts/schemas/plans/admitted-trial-plan-v1.json
    • docs/explain/reference/scenario-variation-and-trial-realization.md
    • docs/requirements/API-407/requirement.md
    • docs/requirements/SCE-002/requirement.md
    • docs/requirements/SEM-234/requirement.md
    • docs/research/formal-semantic-validation/index.md
    • docs/research/specification-coverage/index.md
    • implementations/python/packages/raes_contracts/contracts/__init__.py
    • implementations/python/packages/raes_contracts/contracts/_exports.py
    • implementations/python/packages/raes_contracts/contracts/admitted_trial_plan.py
    • implementations/python/packages/raes_contracts/contracts/admitted_trial_plan_components.py
    • implementations/python/packages/raes_contracts/contracts/mixed_composition_resolution.py
    • implementations/python/packages/raes_contracts/contracts/trial_compilation.py
    • implementations/python/packages/raes_processor/trial_compiler/__init__.py
    • implementations/python/packages/raes_processor/trial_compiler/apparatus.py
    • implementations/python/packages/raes_processor/trial_compiler/compiler.py
    • implementations/python/packages/raes_processor/trial_compiler/inputs.py
    • implementations/python/packages/raes_processor/trial_compiler/models.py
    • implementations/python/packages/raes_processor/trial_compiler/profiles.py
    • implementations/python/packages/raes_processor/trial_realization.py
    • implementations/python/tests/test_formal_semantic_validation.py
    • implementations/python/tests/test_issue_1014_mixed_composition_contracts.py
    • implementations/python/tests/test_issue_989_versioned_evidence.py
    • implementations/python/tests/test_specification_coverage.py
    • implementations/python/uv.lock
    • implementations/tooling/python/smoke/linux-arm64-cp314.txt
    • implementations/tooling/python/smoke/linux-arm64-cp314.wheelhouse-manifest.json
    • implementations/tooling/python/smoke/linux-x86_64-cp311.txt
    • implementations/tooling/python/smoke/linux-x86_64-cp311.wheelhouse-manifest.json
    • implementations/tooling/python/smoke/linux-x86_64-cp312.txt
    • implementations/tooling/python/smoke/linux-x86_64-cp312.wheelhouse-manifest.json
    • implementations/tooling/python/smoke/linux-x86_64-cp313.txt
    • implementations/tooling/python/smoke/linux-x86_64-cp313.wheelhouse-manifest.json
    • implementations/tooling/python/smoke/linux-x86_64-cp314.txt
    • implementations/tooling/python/smoke/linux-x86_64-cp314.wheelhouse-manifest.json
    • implementations/tooling/python/smoke/macos-arm64-cp314.txt
    • implementations/tooling/python/smoke/macos-arm64-cp314.wheelhouse-manifest.json
    • tools/check_specification_coverage.py
    • tools/formal_semantic_validation/_baseline.py
    • tools/formal_semantic_validation/_loading.py
    • tools/formal_semantic_validation/_releases.py
    • tools/formal_semantic_validation/_retest.py
    • tools/policy/requirement_order.yaml

    Reviews

    • codex: Pre-push review cycle 3 was clean with complete 41/41-file coverage; all findings from earlier cycles were resolved and targeted regression checks passed.

    Traceability reconciliation

    • IMPLEMENTS / TESTS / DOCUMENTS added: 0
    • Links updated: 3
    • Stale links removed: 0

    All three in-scope requirements are ACTIVE with IMPLEMENTS and TESTS links reconciled in the merged delivery diff.

    Status

    • CI: ✅ green
    • SonarCloud: ✅ passed
    • PR ready for user review and merge.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:runtimeRuntime and control-plane codeblockedBlocked on an upstream gate or dependencyenhancementNew feature or requestin-progressAn agent is actively working this issue via /implement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions