Skip to content

refactor(sans-io): complete machine input and effect boundaries - #1358

Merged
GLinnik21 merged 67 commits into
mainfrom
sansio/verdict-integration
Nov 12, 2026
Merged

GLinnik21 merged 67 commits into
mainfrom
sansio/verdict-integration

Conversation

@GLinnik21

@GLinnik21 GLinnik21 commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Complete SessionAttempt state with V6-valid replay, typed Session cache jobs and a pure peek; complete all five addressed Watchlist jobs.
  • Capture complete roster, session, scope, clock and preference inputs on the host; machines consume borrowed Cx views instead of process-global reads. Complete Person latest-request, cancellation, scope, deferred Open and terminal-refusal handling.
  • Enforce actual typed Event/Fx contracts, private sole writers for every owned field, auxiliary-fact contracts, exhaustive enum policy and closed production modules for all ten registered machines. Actual remaining ledger entries: 4 workers / 19 globals / 61 forks / 11 fxlanes.
  • Preserve the landed Metadata (refactor(data): emit Metadata alternate-source jobs #1315), Browse (refactor(browse): capture roster facts before store steps #1319), Notify (refactor(data): run notification streams as addressed jobs #1322) and codec (refactor(session): negotiate legacy and V6 replay codecs #1324) work, plus the integrated Yellow, timed-skip and preference-backpressure behavior. This is one integration PR, not a set of old lane tips.
  • Make the build-stamp and fake-Cargo test fixtures deterministic on coarse clocks, retaining their assertions and forced-equal-mtime regression coverage.

Historical verification — serial gates

Prepared CI-correction source HEAD 3e29e7aef7c6593261d93324bd001fa478a1047c, tree aaae4c6078c94a9ae424d9170089f52835c4752f; pinned ancestor/base 0686bf703e6a313f026e76c9a05fb98110e394fd. Push and new-HEAD remote checks remain pending.

The official gates below and all 30 benchmark samples are historical verification of code commit f5dff6ba2208f2847c507cc6431abb3aa3cc2f9b, tree 705e63c72d29bd9bc6125a919ecbf36d99be4a32. The prior 950f671ecbbb71344e8c400e38c76b9713256ab5 milestone was documentation-only relative to that measured commit; the new CI-correction HEAD changes code and is not code-identical to the measured revision. These serial gates and benchmark rows were not rerun on the new HEAD.

  • make check-cargo: exit 0, including Clippy, default-feature and hostsim Rust binaries, lab-diagnostics checking and Cargo-driving self-tests. Selected default-feature results:
App:      test result: ok. 1370 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 81.92s
Data:     test result: ok. 1622 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 19.25s
Session:  test result: ok. 339 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 5.87s
Media:    test result: ok. 2016 passed; 0 failed; 88 ignored; 0 measured; 0 filtered out; finished in 57.27s
URI:      test result: ok. 240 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 2.12s
Contract: test result: ok. 41 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Screens:  test result: ok. 2147 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 80.72s
  • make check-python: exit 0, all 135 registered steps; the harness ran 731 tests with 4 existing skips. make check-nodef: exit 0, checking the shipping play-uri,play-feed feature set.
  • Parallel verification caveat: parallel make check failed the TV-lock self-test inherited-lease assertion; official Cargo/Python/nodef groups subsequently passed serially; root cause of parallel-only failure not determined. No source guards were disabled, no suppressions were added, and no tests were newly skipped; existing ignored tests remain ignored.
  • Host verification does not establish ARM linking, hardware behavior or remote CI success. Historical source checkpoints in docs/sans-io.md and docs/sans-io-guide.md are not final acceptance results; the recorded gates above apply only to the measured f5dff6b revision, not to the new CI-correction HEAD.

Historical verification — build benchmark

Pinned base 0686bf703e6a313f026e76c9a05fb98110e394fd; measured code head f5dff6ba2208f2847c507cc6431abb3aa3cc2f9b.
Actual official make build-bench, same Linux x86_64 host, same sitting, rustc 1.99.1 (58cf8f9c3 2026-10-13), 12 logical cores; serial rustc front end (HOST_THREADS=0).
Three scenario-interleaved runs within each revision (base first, then head), untimed warm-up on each revision; 30 timed samples total. Seconds below are official median [min, max].

Scenario (non-incremental) Base seconds Head seconds Median change Runs base/head
noop 0.09 [0.08, 0.15] 0.09 [0.08, 0.12] +0.0% 3/3
leaf 57.27 [57.26, 65.67] 58.66 [57.89, 59.03] +2.4% 3/3
data 41.39 [41.21, 46.73] 41.82 [41.76, 41.92] +1.0% 3/3
session 30.34 [29.09, 30.87] 29.70 [29.49, 30.14] -2.1% 3/3
screens 28.07 [26.74, 28.62] 27.12 [27.12, 27.45] -3.4% 3/3

Command on each revision (owned paths represented by variables):

export CARGO_INCREMENTAL=0 CARGO_NET_OFFLINE=true
export CARGO_TARGET_DIR="$BENCH_TARGET" CARGO_BUILD_TARGET_DIR="$BENCH_TARGET"
export MAKEFILES="$BENCH_OVERRIDES"
export GIT_INDEX_FILE="$BENCH_INDEX"
make build-bench ARGS='--runs 3 --only noop,leaf,data,session,screens --json '"$BENCH_REPORT"

BENCH_OVERRIDES contains only explicit override RUST_TDIR := <approved target>, override TEST_FAST_TDIR := <approved target>, and override HOST_THREADS := 0; both print-bench-config and Cargo metadata agreed with the same existing managed target. The official tool removes CARGO_TARGET_DIR internally; CARGO_BUILD_TARGET_DIR retains the agreed destination.
Each BENCH_INDEX is a byte-copy of that revision’s private index, isolating Git’s automatic stat refresh without suppressing cleanliness checks or changing either source index.

No-op app crate stayed fresh in all 3/3 runs on both revisions. All four edited Rust leaves were restored byte-for-byte with original nanosecond mtimes; both private source checkouts and all registered original checkout HEAD/tree/index/diff fences remained unchanged.

Scope: warm default-feature host test compilation only. No unit tests executed by these rows. ARM/staticlib, FFmpeg, incremental rows, unit-suite runtime, other leaf/hub rows, and size rows were deliberately not measured. This is build-cost evidence, not ARM/device or runtime-performance evidence.

Untimed preparation: the shared target initially treated the older head clone as fresh against newer base artifacts. An additional head cache-primer build used the official byte-and-nanosecond-mtime-restoring leaf comment guard under the same exclusive lock, Cargo argv, profile, features and target; source bytes and nanosecond mtimes were restored, flags and target policy were unchanged, and no caches were deleted. Failed setup/head attempts are preserved separately and excluded from the 30 samples.

CI corrections — local evidence; remote checks pending

  • Source-backed read-only certificates ignore only the root release package version; dependency identity, source, features and generated-producer identity remain bound. The CI-merge reproduction failed before the fix; the focused Linux Python replay passed 109 tests, with 32 supplementary security tests passing.
  • The CodeQL HIGH backtracking regex now uses the existing linear Rust lexer and balanced-group scan; all 10 adversarial regressions pass. Actual remote CodeQL on the new HEAD remains pending.
  • Empty-pin CacheKey restores historical Home generation. Person delivery preserves legacy payload bytes and explicitly admits the stamped sender before model dispatch; actual-dispatcher forgery tests reject mismatches without state changes or I/O in live, recording and both replay modes. No fixtures or expected hashes changed.
  • All 6 official Linux replay cases across three fixtures and both modes are fully graded SAME, with zero difference counters. Release build and 38 Person / 86 Data / 40 Recorder / 29 Dispatcher focused tests passed. This is local evidence for the prepared source tree, not a new full serial-gate or benchmark run.
  • The old 950f671 head had known macOS replay, Python and CodeQL failures. Actual macOS, Python and CodeQL checks for 3e29e7aef7c6593261d93324bd001fa478a1047c remain pending after push. SourceReview 56 is running; no approval, merge readiness, all-remote-green or hardware claim is made.

Capture stream eligibility in host inputs and execute notification IO in the app runner, preserving same-call admission settlement and per-connection ordering. Retire the Notify worker, global-read and production-fork ledger entries.
Keep Client construction private to the Plex registry and serialize/reset synthetic runner fixtures without changing production behavior or existing retry and stale-key assertions.
Consume notification endpoint intents explicitly and seed the existing Ready Home source required by quiet refetch policy. Preserve exact BrowseHubs then Hubs same-call fan-out and all prior timing assertions.
Preserve pre-migration Session behavior with synthetic characterization tests and opt-in raw V5 capture instrumentation. Runtime and codec migration remain pending.
Preserve four synthetic pre-migration V5 byte fixtures and unconditional include_bytes assertions alongside the prior numeric canonical hashes. Runtime Attempt and codec migration remain separate.
Probe the complete prior and prospective app shape fingerprints against unchanged recording headers and capture synthetic outer initialization bytes before production codec changes.
- Freeze byte-exact app fingerprint vectors and legacy Initial observations.
- Assert captured hashes and wire bytes without recapturing goldens.
- Anchor replay profiles to the current census.
- Record the current base fingerprints.
- Reject unclaimed and retired replies without crossing active write/read claims.

- Add captured-roster facts groundwork and focused regression coverage.
- Route canonical writes through a borrowed V5 projection without changing field order.

- Cover restored stream and sparse phase continuations.
- Fence one-answer resolve ports against stale replies and terminal-before-start races.

- Route captured client jobs through live and held app runners with same-call drains.

- Preserve held partial rows when a reread fails.
- Replace mutable SessionInit controller storage with a private runtime partition.

- Preserve total legacy DTO conversion and borrowed canonical/UI projections.

- Retain sparse restoration and phase continuation regression coverage.
- Preserve exact NotStarted requeue and started-write completion semantics.

- Add mock live and held runner coverage and explicit captured-key pump inputs.
- Check registered state writers and wildcard lint policy\n- Cover mutable aliases and production child modules
- Emit captured List, Rematch and Delta jobs through boot-selected worker ports.

- Settle terminal acknowledgements, cancellations and admission refusals exactly once.

- Preserve serial writes, fence Resolve results by full client keys and adapt runner regressions.
- Own foreground requests and valid handoffs in Attempt variants.

- Emit state entry and exit values without flat runtime remapping.

- Preserve legacy projections and characterize stale authority claims.

- Make adapter and dispatcher behavior fixtures phase-valid.
- Guard actual machine steps and IO admissions with a test-time StepScope.
- Publish clock, session, profile and grant facts through retained app views.

- Fence publications and preserve readable versus settled session semantics.

- Retire screen registry reads and add regression coverage; green verification is reserve-blocked.
- Borrow recents cache credentials before allocating account state.

- Gate Person seed reads on an open page or admitted Open, with real allocation and host read counters.

- Classify the test-only captured fixture and distinguish historical documentation from exact-head evidence.
- Require strict writer bindings and enum policy for every registered machine.

- Centralize six remaining state transitions and prove sealed generic identities.

- Cover cohort mutations and lint downgrades; document mandatory contracts.
- Preserve Data and Session compiler semantics and incident command boundaries.

- Close auxiliary transition facts and mirror bounded URI enum contracts.

- Register transition argument fixtures without changing existing assertions.
- Consume displaced HUD operations at their original drop boundaries.

- Keep HUD and URI enum handling exhaustive without suppressions.

- Migrate attempt fixtures and identity-source coverage to canonical paths.

- Publish standalone incident-event readouts with regression coverage.
- Explicitly advance the rewritten fixture output mtime without wall-clock timing assumptions.
- Mark controlled benchmark edits dirty even when source and state mtimes coincide.

- Cover two real edit targets at equal mtimes without weakening restoration or no-op checks.
@GLinnik21
GLinnik21 enabled auto-merge (squash) November 12, 2026 18:49
- Keep source proof identity stable across release version stamping.

- Remove source-oracle regex backtracking and cover adversarial inputs.

- Preserve captured Home generations and stamped Person delivery payloads.
- Carry envelope senders to host delivery without changing generic effect reporting.

- Reject forged Person commands before state changes or IO; cover live, recording and replay dispatch.
@GLinnik21
GLinnik21 merged commit 6f2c15a into main Nov 12, 2026
27 of 29 checks passed
@GLinnik21
GLinnik21 deleted the sansio/verdict-integration branch November 12, 2026 21:01
tiper added a commit to tiper/fin-native that referenced this pull request Nov 13, 2026
PlxNative plxnative#1355-plxnative#1364: sans-io session owner (plxnative#1358), site and demo video, dependency bumps.
GLinnik21 added a commit that referenced this pull request Nov 14, 2026
…um certificate

`machine/src/machine.rs` is pinned whole-file in `ci/proofs/platform-generated-enums.json`
and `ci/readonly_generated.py`, so #1385's rewrite of the `Canon` byte loops failed
`check-machine-shape.py` (the machine-shape audit lost its certificate for the newtype id
structs, so every shared opaque payload read as unproven) and `test_readonly_generated.py`.

What the certificate certifies from machine.rs is the `newtype!` macro and its ten `u32`
invocations: `declarations()` lexes exactly those and emits `pub struct Name(pub u32)`.
The PR's change is `impl Canon` and `canon_tests`, from line 882 on; lines 1-881 are
byte-identical, the extracted declarations are identical, and the FNV-1a byte stream is pinned
by the new `canon_is_fnv_1a_over_tagged_little_endian_bytes` test. So the new file hash is
added to `MACHINE_SOURCES`, the certificate is regenerated with `produce_certificate`
(only the machine.rs hash list and one review line change) and `CERTIFICATE_SHA256` is the
hash of that certificate. The way #1358 and #1366 updated it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GLinnik21 added a commit that referenced this pull request Nov 14, 2026
… first, locale-proof sched-trace flavour check (#1384)

The host harness job grew from about 240 s to 375-470 s and hit its 10-minute limit six times on 2026-11-12/13. 2647 of the module's 2678 summed test-seconds are DepGates, whose ~75 gate runs each execute all of ci/check-deps.sh; the 11-13 jump was the wall rule (ci/check-ports.py, #1358) lexing ~690 files in pure Python in every run.

- ci/check-ports.py lexes only files whose source names Instant, SystemTime or elapsed, and computes a scope's wholly-test set only when that scope has a wall site (4.1 s -> 1.6 s CPU per run). Output is identical for every file that contains a wall word. An unlexable file with a wall word still fails unless it is wholly-test, as before; one without a wall word is left to ci/check-list-caps.py, which lexes every production file and fails closed. ci/test_check_ports.py pins both.
- tests/test_harness.py: the two ui-owner loop tests plant every variant in one copy and require each by file name in one run, and the two tests that grade the checkout share one run behind a lock (75 -> 70 gate runs per pass). Nothing is skipped.
- ci/check-python-steps.txt starts the nine slowest steps first: ci/test_check_machine_shape.py, one 225 s process, used to start 190 s in and end the job at 413 s; a list schedule of the measured durations gives 317 s for the new order.
- tools/tv-sched-trace.sh spells its lower-case class out: under bash 3.2 with en_US.UTF-8, `[!a-z]` matched "Debug" as lower case, so --app=Debug exited 0 instead of 2 and failed the build bench's check row.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fraygox added a commit to fraygox/plx-native that referenced this pull request Nov 16, 2026
main's machine-shape gate (plxnative#1358, plxnative#1392) certifies shared payload types against
two proof files that pin every workspace manifest's hash. This branch adds the
`http3-curlstack` feature to rust-modules/Cargo.toml, base/Cargo.toml and
net/Cargo.toml, so after the merge both certificates were refused and
`ci/check-machine-shape.py` reported the session machine's payloads as opaque
(28 problems), failing five `make check` steps.

Both are regenerated with their own producers
(`ci/readonly_dependencies.py --produce serde_json-1.0.154.crate`,
`readonly_generated.produce_certificate`) and the pinned certificate hashes
updated, as main's own dependency bump did (6d7b48e). The only changes are
those three manifest hashes, plus play-feed's `lib_sha256` in the serde_json
certificate, which the producer refreshed: main's entry predates a later edit
to play-feed/src/lib.rs that this branch does not touch.

Signed-off-by: fraygox <251108859+fraygox@users.noreply.github.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
GLinnik21 added a commit that referenced this pull request Nov 17, 2026
The cherry-pick of 91d6975 brought a test hook, land_deck_lane_for_test,
whose last lines read `state.seen_facts = facts_key(&scope);`. On main,
6f2c15a (#1358, sans-io machine boundaries) gave facts_key a BrowseScope
parameter (`scope.clients.facts_gen()`); at v0.10.0 it takes none and reads the
process-global plex::server_facts_gen(), so the call did not compile (E0061).

#1405's fix is deck::place; the hook only records the facts epoch the same way
its sibling hooks on this line do (`state.seen_facts = facts_key();`), so the
backport calls facts_key() as the line defines it and imports nothing from
#1358.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GLinnik21 pushed a commit that referenced this pull request Nov 17, 2026
…es its newest cards behind the deck (#1405) (#1447)

With several servers, Home's Continue Watching opened scrolled to the first card of the server that answered first. The newer cards of a server answering after it were held behind the window, offset by their count, so DOWN from the hero landed on the wrong card.

The cause was deck::place, not the row's focus or scroll. Every server's answer lands on its own. A whole-source answer (a first answer, or a refresh whose reload failed) joins the deck through settle_deck, and place seated every joiner by the rule for a deck the reader had paged along: its cards newer than the window's first card went behind the window, and the overflow was dropped from the head.

place now judges whether the deck is at its head, with fit's own test on the lanes that held it before this call. At the head, a joiner's newer cards lead the window, and the overflow goes from the oldest end. A full window lets go of its oldest shown cards, which stay ahead as lookahead. A deck the reader moved keeps the old rule. A joiner with no rows (a server whose Continue Watching is empty) is seated at its head rather than past its tail, so it no longer reads as a lane the deck moved past and hides the next joiner's cards.

Deck tests (red first) cover: a joiner at the head leads with its newer cards; the arrival order makes no difference; the newest cards fill a full window; a reader-moved deck keeps its window; an empty server between two others; an empty server alone. Home tests drive the real store (a new test hook, land_deck_lane_for_test) and the engine's DOWN from the hero. They cover a cold deck in either arrival order, with an empty server in between, and after a failed reload. They also check a single-server deck, and a reader who stays on the same card when cards land in front of it.

Closes #1395

(cherry picked from commit 91d6975)

Backport note: the hook land_deck_lane_for_test calls facts_key() as v0.10.0 defines it; the per-scope facts_key(&scope) came with #1358, which is not on this line.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants