Skip to content

Latest commit

 

History

History
281 lines (207 loc) · 18.9 KB

lab_live_differential_scope_matrix.md

File metadata and controls

281 lines (207 loc) · 18.9 KB

Lab-vs-Live Differential Scope Matrix

Bead: asupersync-2a6k9.1.1
Parent: asupersync-2a6k9.1, asupersync-2a6k9
Generated by: WildBarn (codex-cli / gpt-5)
Date: 2026-03-18
Dependencies: docs/replay-debugging.md, docs/tokio_differential_behavior_suites.md, src/lab/runtime.rs, src/lab/explorer.rs, src/lab/fuzz.rs, tests/semantic_witness_replay_e2e.rs, tests/adversarial_witness_corpus.rs

Purpose: define exactly which semantic surfaces the lab-vs-live differential program is allowed to validate first, later, or not at all, and tie every scope decision to observability and controllability instead of optimism.


1. Claim Boundary

The lab-vs-live differential program is a semantic parity program, not a "prove the whole runtime is identical under every environment" program.

The program may only make positive trust claims when all of the following are true:

  1. inputs are controllable enough that the same scenario can be rerun with stable seed lineage,
  2. both lab and live paths can emit a shared normalized observable record,
  3. the surface is narrow enough that external effects are either virtualized or explicitly excluded from the claim,
  4. divergences can be preserved as replayable artifacts rather than hand-waved away as "probably noise".

If any of those preconditions fail, the surface is either supported later after more instrumentation/virtualization, or unsupported for this program.

This matrix intentionally defaults to a smaller truthful claim set. Over-claiming lab fidelity would make the whole differential program operationally useless.


Parent Contract Map (asupersync-2a6k9.1)

The parent bead asupersync-2a6k9.1 is intentionally a four-part contract. The sub-beads are not competing designs. Together they define the only claim set that later differential-validation beads are allowed to rely on:

Contract slice Source of truth What later beads inherit
supported semantic surfaces, rollout order, and explicit non-goals asupersync-2a6k9.1.1 in this document which surfaces are admitted now, deferred, or forbidden
comparator inputs and semantic-equivalence rules asupersync-2a6k9.1.2 in docs/lab_live_normalized_observable_schema.md which normalized fields are semantic, provenance-only, exact-match, or contract-scoped
divergence classes, rerun policy, and escalation law asupersync-2a6k9.1.3 in docs/lab_live_divergence_taxonomy.md what counts as a runtime bug, lab-model bug, unsupported surface, or noise
verification floor, logging vocabulary, and retained artifact contract asupersync-2a6k9.1.4 in docs/lab_live_verification_taxonomy.md which T0/T1/T2/T3/T4 evidence and stable bundle fields are required before a surface claim is credible

Later beads that cite asupersync-2a6k9.1 inherit all four documents together. They are not allowed to redefine comparator inputs, admitted surfaces, or policy classes ad hoc inside harness code or suite-local prose.

A lab-vs-live parity claim is therefore in-bounds only when all of the following are simultaneously true:

  1. the surface is admitted by this scope matrix,
  2. the comparison only uses semantic fields allowed by docs/lab_live_normalized_observable_schema.md,
  3. any mismatch is classified by docs/lab_live_divergence_taxonomy.md,
  4. the evidence bundle and validation depth satisfy docs/lab_live_verification_taxonomy.md.

2. Scope Buckets

Three scope buckets are normative:

  • supported-now: the surface is valid for the first implementation wave and should be differentialized before broader expansion.
  • supported-later: the surface is a legitimate future target, but only after additional normalization, virtualization, or observability work lands.
  • unsupported: the surface is out of scope for this program unless the architecture changes materially enough to remove the current externality gap.

These labels are about what the differential validator can defend, not about whether the runtime feature exists.


3. Rollout Order

The rollout order is strict because trust should start where the lab already has its strongest semantics and its smallest externality surface.

Rollout phase Bucket Why this phase exists
Phase 1 supported-now Start with pure runtime semantics that already live inside deterministic control surfaces.
Phase 2 supported-later Add time and virtualized transport once the comparator and evidence model have stabilized.
Phase 3 supported-later Add richer adapters and protocol layers only when they can be driven through captured or virtualized boundaries.
Phase 4 unsupported unless promoted explicitly Raw OS, browser host, and real-network effects stay outside the trust claim until they stop being opaque externalities.

The practical "what next?" answer for future contributors is:

  1. finish the Phase 1 semantic core,
  2. widen to Phase 2 timer/transport surfaces,
  3. only then consider Phase 3 protocol and adapter surfaces,
  4. treat Phase 4 surfaces as non-goals until a separate bead supplies the missing boundary controls.

4. Normative Scope Matrix

Surface Bucket Rollout phase Lab is expected to model Live path exercises Why this classification is correct
Cancellation protocol supported-now Phase 1 request, drain, finalize, cancel checkpoints, terminal outcome classification current-thread runtime cancellation and cleanup under controlled scenarios cancellation is a first-class semantic contract already represented in runtime state and trace artifacts; it is the strongest early trust claim
Combinators (join, race, loser drain, severity aggregation) supported-now Phase 1 normalized branch completion, loser-drain completion, final Outcome severity same combinator paths on live current-thread runtime branch ordering noise can be normalized away while the semantic contract remains observable
Channels (mpsc, oneshot, broadcast, watch) supported-now Phase 1 reserve/commit behavior, cancel-safe delivery, disconnect outcomes, waiter cleanup live channel behavior with the same scenario harness the channel contract is internal and explicit; it does not require raw kernel fidelity to compare meaningfully
Obligations supported-now Phase 1 commit/abort balance, leak absence, obligation state transitions same obligation bookkeeping on live runtime obligation balance is exactly the kind of semantic invariant differential comparison should defend early
Region close / quiescence supported-now Phase 1 no live children, finalizer completion, close-to-quiescence semantics live region lifecycle under controlled runtime harnesses region ownership and quiescence are internal contracts with direct evidence surfaces already present
Sync primitives (Mutex, Semaphore, Pool, similar bounded invariants) supported-now for controlled harnesses Phase 1 acquisition/release semantics, cancellation cleanup, no-leak outcomes live current-thread or otherwise bounded harnesses with normalized outcomes these are still semantic-core surfaces when exercised without opaque external scheduling dependencies
Timers / virtualized time supported-later Phase 2 deadline semantics, timeout completion, timer cancellation, logical-time progression live runtime time behavior normalized against scenario clocks timer semantics are a real target, but only after time normalization and rerun policy are explicit enough to reject incidental drift
Virtualized transport / loopback network supported-later Phase 2 delivery ordering within the chosen virtual transport model, cancellation of in-flight operations, normalized transport evidence loopback/virtual transport runner with captured events valid future target because the externality surface can be constrained, but not before the core comparator model is proven
Actor / supervision / mailbox semantics supported-later Phase 3 restart, supervision, mailbox ordering classes, shutdown outcomes live app/spec harnesses with captured supervision evidence these build on the core runtime semantics but introduce richer orchestration that needs stable scenario contracts first
HTTP / gRPC / higher-level protocol adapters on virtualized or loopback transport supported-later Phase 3 protocol-level semantic outcomes, request/response termination, cancellation mapping adapter paths driven through virtualized or fully captured boundaries these are not raw-network claims; they only become valid after the transport/evidence layer is already differentialized
Browser-like environments with explicit host capture supported-later Phase 3 only the captured semantic subset, never ambient browser behavior as a whole browser-adapter paths that emit explicit normalized observables possible only when the host boundary is explicit and captured; otherwise browser behavior is too ambient for a truthful semantic parity claim
Raw sockets / reactor backends / kernel scheduling unsupported Phase 4 not a valid first-class claim surface real epoll/kqueue/io_uring or OS scheduler behavior the program cannot honestly claim parity over raw kernel behavior when the live side is dominated by external OS decisions that the lab does not model directly
Real network behavior (DNS, TLS, packet loss on live networks, remote peers) unsupported Phase 4 not currently claimable actual network stacks and remote systems without full capture or virtualization, real-network behavior is an environment property, not a stable semantic comparator input
Raw browser host behavior (scheduler quirks, opaque host APIs, service-worker lifetime as if it were stable runtime parity) unsupported Phase 4 not currently claimable actual browser host behavior under uncontrolled environments browser host behavior must stay outside the trust claim unless a separate boundary bead proves otherwise
Filesystem, process, signal, and other native host effects unsupported Phase 4 not currently claimable live OS-facing side effects these are too dependent on host conditions unless and until a virtualized/captured contract is introduced

The minimum named rollout order for future work is therefore:

cancellation -> combinators -> channels -> obligations -> region close/quiescence -> sync primitives -> timers -> virtualized transport -> actor/supervision -> HTTP/gRPC over captured boundaries -> browser-like captured boundaries

If a future contributor wants to skip ahead, the burden is on them to add a new boundary-control bead, not to silently reinterpret this scope ladder.


5. Explicit Non-Goals

The following are explicit non-goals for the differential program in its current form:

  • raw event ordering parity across lab and live executions,
  • pointer identity, internal address stability, or other incidental runtime details,
  • performance parity, throughput parity, or wall-clock latency claims,
  • raw OS, browser, or network fidelity without virtualization/capture,
  • whole-system equivalence for arbitrary external side effects,
  • automatic support claims for raw sockets, HTTP over real networks, or browser host behavior just because a feature exists in the repository.

The validator compares normalized semantics, not every incidental detail that appears in a trace.


6. Admission Rules for New Surfaces

A new surface may enter the differential program only if the proposing bead can answer all of these questions concretely:

  1. Controllable inputs: what scenario inputs and seed lineage make reruns stable?
  2. Normalized observables: what semantic record will both lab and live map into?
  3. Externality boundary: what effects are virtualized, captured, or explicitly excluded?
  4. Artifact contract: what crashpack, repro command, summary, and comparator artifacts are emitted on divergence?
  5. Failure interpretation: how will the program distinguish a real runtime bug from a lab-model gap or unsupported surface?

If a proposal cannot answer all five, the surface remains supported-later or unsupported.

7. Eligibility Gate for Raw-Socket, HTTP, and Browser Surfaces

Bead asupersync-2a6k9.7.3 does not promote raw sockets, HTTP, or browser surfaces by itself. It publishes the gate that a later promotion bead must satisfy before the differential program may make a meaningful parity claim.

The mere existence of src/net/*, src/http/*, Browser Edition packages, or a working demo is not enough. The gate is about truthful semantic comparability, not feature presence.

Gate Verdicts

Every expansion proposal for these surface families must end in one explicit verdict:

  • eligible_for_pilot
  • blocked_missing_virtualization
  • blocked_missing_observability
  • blocked_missing_verification
  • blocked_scope_red_line

If a proposal cannot name one of those verdicts directly in its report bundle, the proposal is incomplete.

Surface Eligibility Matrix

Surface family Minimum virtualization boundary Minimum observability hooks Minimum verification floor before promotion Current red lines
raw_socket loopback or virtual transport only; peer identity, injected faults, and connection lifecycle must stay inside a bounded scenario boundary normalized connection lifecycle and terminal outcome, cancellation/cleanup evidence, CaptureManifest, explicit boundary contract ID, retained repro command T0 unit_contract for the boundary and mapping rules, T2 dual_run_smoke through bounded loopback or virtual transport, T4 negative_control proving unsupported-surface rejection, and T3 pilot_surface only after the bounded runner stabilizes no parity claim over epoll/kqueue/io_uring scheduling, kernel wake ordering, host-clock latency, DNS, TLS handshake timing, or remote peers
http_surface HTTP over loopback or virtualized transport with a captured peer model and explicit timeout boundary; no ambient internet dependency normalized request/response termination, protocol version, request/connection identifiers, cancellation mapping, CaptureManifest, retained lab/live normalized records T0 unit_contract, T1 golden_fixture for normalized request/response bundles, T2 dual_run_smoke, T3 pilot_surface for request/response and shutdown families, and T4 negative_control for malformed or under-observed traces no real-internet claims, no uncontrolled TLS or packet-loss claims, no opaque upstream server behavior, and no wall-clock SLA or latency parity claims
browser_surface explicit host-role contract plus a captured execution boundary (browser_main_thread, dedicated_worker, or bridge-only lanes) with downgrade behavior instead of ambient host assumptions normalized semantic subset, CaptureManifest, host_role, support_class, reason_code, lane_id, retained downgrade artifacts, explicit unsupported-surface reason T0 unit_contract for host-role policy and lane diagnostics, T1 golden_fixture for host classification artifacts, T2 dual_run_smoke through a real browser-facing runner on admitted lanes, T4 negative_control for unsupported or downgrade cases, and T5 stress_nightly before noisy multi-host parity claims no raw browser scheduler parity, no service-worker lifetime parity, no shared-worker direct-runtime claim before promotion, and no opaque host-clock or Web API timing claims

The browser row is additionally anchored to the truthful support boundary in README.md and docs/WASM.md: a browser feature may exist in the repository and still be ineligible for differential trust claims.

Required Gate Packet

Any future proposal that wants one of these surface families promoted must publish a gate packet that includes, at minimum:

  • eligibility_verdict
  • surface_family
  • virtualization_boundary
  • observability_status
  • artifact_bundle
  • repro_command
  • unsupported_reason whenever the verdict is not eligible_for_pilot

Browser-facing proposals must additionally publish:

  • host_role
  • support_class
  • reason_code
  • lane_id

The proposal is not allowed to bury these facts in prose-only discussion. They must be present in machine-readable artifacts or stable contract output.

Promotion Law

No raw-socket, HTTP, or browser surface may claim meaningful parity until:

  1. the virtualization boundary is explicit and bounded,
  2. the observability hooks are sufficient to emit shared normalized records,
  3. the verification floor above has been met,
  4. the retained artifacts are strong enough to reproduce or reject divergences,
  5. current red lines are preserved as explicit non-claims.

If any of those conditions fail, the correct outcome is a blocked verdict, not an optimistic promotion.


8. Downstream Binding

This scope matrix is upstream policy for the immediate follow-on beads:

Downstream bead What it consumes from this document
asupersync-2a6k9.1.2 comparator schema only for surfaces admitted here
asupersync-2a6k9.1.3 divergence taxonomy should classify failures relative to these buckets
asupersync-2a6k9.1.4 verification/logging requirements must match the rollout ladder here and should be published in docs/lab_live_verification_taxonomy.md
asupersync-2a6k9.4.4 time/scheduler-noise policy must define how Phase 1 suppresses timing drift and how Phase 2 timer surfaces get promoted through scenario clocks
asupersync-2a6k9.2.* scenario model should prioritize Phase 1 surfaces first
asupersync-2a6k9.4.* live evidence capture should only target admitted surfaces
asupersync-2a6k9.6.* pilot suites must follow the exact Phase 1 ordering defined above
asupersync-2a6k9.7.* timer and virtualized transport work starts only after Phase 1 closure

If a later bead makes a stronger surface claim than this document allows, that bead is wrong until this matrix is updated deliberately.


9. Validation Commands

Heavy validation commands must run through rch exec --.

  • rch exec -- env CARGO_TARGET_DIR=${TMPDIR:-/tmp}/rch_target_lab_live_differential_docs cargo fmt --check
  • rch exec -- env CARGO_TARGET_DIR=${TMPDIR:-/tmp}/rch_target_lab_live_differential_docs cargo check --all-targets
  • rch exec -- env CARGO_TARGET_DIR=${TMPDIR:-/tmp}/rch_target_lab_live_differential_docs cargo clippy --all-targets -- -D warnings
  • rch exec -- env CARGO_TARGET_DIR=${TMPDIR:-/tmp}/rch_target_lab_live_differential_docs cargo test --test lab_live_differential_scope_matrix -- --nocapture

Exit criteria for asupersync-2a6k9.1.1:

  1. this document exists and is substantial,
  2. the scope matrix explicitly covers supported-now, supported-later, and unsupported surfaces,
  3. the rollout order is mechanically discoverable,
  4. explicit non-goals prevent accidental scope inflation,
  5. the contract test for this document passes deterministically.