From f78e67fe1cfa92ecbac0ef872ce77dace7cb6f5e Mon Sep 17 00:00:00 2001 From: Luke Curley <432854+kixelated@users.noreply.github.com> Date: Tue, 10 Nov 2026 16:45:03 -0800 Subject: [PATCH 1/9] chore(quest): claim quest/m1/model-checks-nightly.md Quest-Claim: 82d2f9c46f9ae0e4 From 947e535d1513718c1cff6e742c81450010d30f36 Mon Sep 17 00:00:00 2001 From: Luke Curley <432854+kixelated@users.noreply.github.com> Date: Tue, 10 Nov 2026 18:25:27 -0800 Subject: [PATCH 2/9] ci: model-check every TLA+ config nightly, and review resyncs a model `just test tla` runs every config through the `tla` recipes; a config marked `\* Open finding:` must break a rule, so a fix that should promote it is noticed. Nightly runs it in three legs. The JS flow models split into a passing config plus one per open finding, and REVIEW.md has a reviewer rerun a model whose covered code a PR changes. Co-Authored-By: Claude Opus 5.5 --- .claude/skills/verify-reconnect/SKILL.md | 2 +- .claude/skills/verify-resume/SKILL.md | 4 +- .claude/skills/verify-route/SKILL.md | 2 +- .claude/skills/verify-subscribe/SKILL.md | 2 +- .github/workflows/nightly.yml | 31 ++++++++++ REVIEW.md | 7 +++ js/net/src/connection/migrate.test.ts | 2 +- js/publish/verify/Publish.cfg | 3 +- js/publish/verify/README.md | 6 +- js/room/verify/README.md | 5 +- js/room/verify/Room.cfg | 2 + js/watch/verify/Failover.cfg | 2 +- js/watch/verify/FailoverCrash.cfg | 8 +++ .../{Redirect.cfg => FailoverRedirect.cfg} | 3 +- js/watch/verify/FailoverRedirectRefused.cfg | 9 +++ js/watch/verify/README.md | 17 +++--- js/watch/verify/Watch.cfg | 4 +- js/watch/verify/WatchConnecting.cfg | 5 ++ js/watch/verify/WatchRefused.cfg | 4 ++ quest/m1/README.md | 1 - quest/m1/model-checks-nightly.md | 34 ----------- quest/m1/route-mesh-model.md | 5 +- quest/m3/audit-test-coverage.md | 2 +- quest/m3/net-redirect-fallback.md | 2 +- .../verify/reconnect/OfflineWhileServing.cfg | 2 +- rs/moq-net/verify/reconnect/RedirectLost.cfg | 5 +- rs/moq-net/verify/route/CountToInfinity.cfg | 6 +- rs/moq-net/verify/subscribe/StreamWins.cfg | 2 +- sh/tla.sh | 60 +++++++++++++++++++ test/justfile | 4 ++ 30 files changed, 171 insertions(+), 70 deletions(-) create mode 100644 js/watch/verify/FailoverCrash.cfg rename js/watch/verify/{Redirect.cfg => FailoverRedirect.cfg} (53%) create mode 100644 js/watch/verify/FailoverRedirectRefused.cfg create mode 100644 js/watch/verify/WatchConnecting.cfg create mode 100644 js/watch/verify/WatchRefused.cfg delete mode 100644 quest/m1/model-checks-nightly.md create mode 100755 sh/tla.sh diff --git a/.claude/skills/verify-reconnect/SKILL.md b/.claude/skills/verify-reconnect/SKILL.md index d6bb2cfc4c2..b049d4ee3fd 100644 --- a/.claude/skills/verify-reconnect/SKILL.md +++ b/.claude/skills/verify-reconnect/SKILL.md @@ -29,7 +29,7 @@ just rs tla moq-net/verify/reconnect/Handover.tla -config rs/moq-net/verify/reco just rs tla moq-net/verify/reconnect/Handover.tla -config rs/moq-net/verify/reconnect/OfflineWhileServing.cfg ``` -The first checks every rule but the two with open findings, over four sessions: about 1.2M distinct states, under a minute on 32 cores. The second checks the same rules under `Restart::Wait` over three sessions: about 240k states. Both pass at the sync commit. The last two fail at the sync commit, each on its finding below, within seconds. The `VIEW` counts states that differ only in what nothing reads again as one: a closed session's details unless it is still the live one, a deadline of a phase the policy left, and where no dial is headed. +The first checks every rule but the two with open findings, over four sessions: about 1.2M distinct states, under a minute on 32 cores. The second checks the same rules under `Restart::Wait` over three sessions: about 240k states. Both pass at the sync commit. The last two fail at the sync commit, each on its finding below, within seconds. `just test tla rs/moq-net/verify/reconnect` runs every config here, as Nightly does, and fails if a config with an `\* Open finding:` line passes. The `VIEW` counts states that differ only in what nothing reads again as one: a closed session's details unless it is still the live one, a deadline of a phase the policy left, and where no dial is headed. Read a counterexample with `/statechart`, passing it the spec, a config, and `Handover.view.ts`, which labels what the handle reports, what the policy holds, and each step as the event that happens. diff --git a/.claude/skills/verify-resume/SKILL.md b/.claude/skills/verify-resume/SKILL.md index a0ba5e2f688..d4b61f328b6 100644 --- a/.claude/skills/verify-resume/SKILL.md +++ b/.claude/skills/verify-resume/SKILL.md @@ -28,7 +28,7 @@ just rs tla moq-net/verify/resume/ResumeReader.tla just rs tla moq-net/verify/resume/ResumeReader.tla -config rs/moq-net/verify/resume/ThreeRoutes.cfg ``` -The first checks every rule over two routes, three groups, two switches, and a reader holding each group until it finishes it: about 14.3M distinct states, three minutes on 32 cores. The second trades a group for a third route, so a route can come up after another failed: about 7.1M states, under two minutes. Both pass at the sync commit. +The first checks every rule over two routes, three groups, two switches, and a reader holding each group until it finishes it: about 14.3M distinct states, three minutes on 32 cores. The second trades a group for a third route, so a route can come up after another failed: about 7.1M states, under two minutes. Both pass at the sync commit. `just test tla rs/moq-net/verify/resume` runs every config here, as Nightly does, and fails if a config with an `\* Open finding:` line passes. `Chart.cfg` is for `/statechart` only: a story (`Story`) small enough to draw whole, where the reader switches to a route that holds an older group and asks it for that group. Pass it the spec, `Chart.cfg`, and `ResumeReader.view.ts`, which labels which route serves, what the reader has, and each step as what happens to a route or the reader. For a counterexample, pass the config that broke instead. @@ -38,7 +38,7 @@ None at the sync commit. ## Reading a failure -A counterexample is a path through the model, not yet a bug. Replay it as a test in `model/resume.rs`'s `mod test`, one call per step: `received_copy` for a route, `routes.serve(copy.consume())` for a switch, `write` for a landing group, `finish()` for a declared end, `abort(..)` for a route failing, and `drain` or `poll_recv_group` for a poll. If the code does not follow the path, the model is wrong: fix the model to match the code. If it does, report the path and the rule in the code's words, and pin it as a `residual_*` test with its own config so the others still pass. Do not weaken a rule, add a constraint, or shrink the bounds until the check passes. +A counterexample is a path through the model, not yet a bug. Replay it as a test in `model/resume.rs`'s `mod test`, one call per step: `received_copy` for a route, `routes.serve(copy.consume())` for a switch, `write` for a landing group, `finish()` for a declared end, `abort(..)` for a route failing, and `drain` or `poll_recv_group` for a poll. If the code does not follow the path, the model is wrong: fix the model to match the code. If it does, report the path and the rule in the code's words, and pin it as a `residual_*` test with its own config, marked with an `\* Open finding:` line, so the others still pass. Do not weaken a rule, add a constraint, or shrink the bounds until the check passes. ## Coverage diff --git a/.claude/skills/verify-route/SKILL.md b/.claude/skills/verify-route/SKILL.md index d2a2a815011..52f60919713 100644 --- a/.claude/skills/verify-route/SKILL.md +++ b/.claude/skills/verify-route/SKILL.md @@ -31,7 +31,7 @@ just rs tla moq-net/verify/route/RouteHandoff.tla just rs tla moq-net/verify/route/RouteHandoff.tla -config rs/moq-net/verify/route/CountToInfinity.cfg ``` -The first checks every rule but `NoCountToInfinity`: about 3.7M states, two minutes on 32 cores, and it passes at the sync commit. The second fails at the sync commit on the open finding below. +The first checks every rule but `NoCountToInfinity`: about 3.7M states, two minutes on 32 cores, and it passes at the sync commit. The second fails at the sync commit on the open finding below. `just test tla rs/moq-net/verify/route` runs every config here, as Nightly does, and fails if a config with an `\* Open finding:` line passes. Read a counterexample with `/statechart`, passing it the spec, a config, and `RouteHandoff.view.ts`, which labels each relay's route and each step as the message that arrives. It gives the shortest path to each broken rule in those words. diff --git a/.claude/skills/verify-subscribe/SKILL.md b/.claude/skills/verify-subscribe/SKILL.md index b706ad43c76..639c9a30260 100644 --- a/.claude/skills/verify-subscribe/SKILL.md +++ b/.claude/skills/verify-subscribe/SKILL.md @@ -25,7 +25,7 @@ just rs tla moq-net/verify/subscribe/SubscribeAccounting.tla just rs tla moq-net/verify/subscribe/SubscribeAccounting.tla -config rs/moq-net/verify/subscribe/StreamWins.cfg ``` -The first checks every rule but `StreamWins`: about 3.0M states, 20 to 30 seconds on 32 cores, and it passes at the sync commit. The second fails at the sync commit on the open finding below. One group is enough: groups share only the order of the Subscribe Stream, and a second group multiplies the states (60M and more) without adding a race. +The first checks every rule but `StreamWins`: about 3.0M states, 20 to 30 seconds on 32 cores, and it passes at the sync commit. The second fails at the sync commit on the open finding below. `just test tla rs/moq-net/verify/subscribe` runs every config here, as Nightly does, and fails if a config with an `\* Open finding:` line passes. One group is enough: groups share only the order of the Subscribe Stream, and a second group multiplies the states (60M and more) without adding a race. Read a counterexample with `/statechart`, passing it the spec, a config, and `SubscribeAccounting.view.ts`, which labels what each side holds for the group, which update each side is on, and each step as the event that happens. It gives the shortest path to each broken rule in those words. diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index d8ed5cbd0cc..0ec6a70a2b9 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -27,6 +27,11 @@ name: Nightly # exception: deterministic and seconds long, so `just ci` gates every diff that # can move them, and audio-quality.yml reruns them here. # +# `tla` model-checks every TLA+ config: TLC explores every ordering a model +# allows, which takes minutes per config, and a model only changes when the code +# it covers does, which review checks (see REVIEW.md). It also fails when an +# open finding's config starts passing, so the fix promotes its rule. +# # Main PRs run only the landing gate's selection as a signal, so every # path-filtered gate (Android, C, C++, X11, the audio replays, the OSS # Scanner image, platform.yml and the release dry-runs) runs here on main too, @@ -401,6 +406,32 @@ jobs: NEXTEST_PROFILE: ci CI_STRICT: 1 + tla: + name: TLA+ (${{ matrix.name }}) + runs-on: ubuntu-24.04-arm + timeout-minutes: 120 + strategy: + fail-fast: false + matrix: + # The two largest models get a runner each; the last leg takes every + # other config, so a new model is checked without editing this list. + include: + - name: resume + paths: rs/moq-net/verify/resume + - name: route + paths: rs/moq-net/verify/route + - name: rest + paths: ":!rs/moq-net/verify/resume :!rs/moq-net/verify/route" + steps: + - name: Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - uses: ./.github/actions/nix + # No dev shell: the recipes fetch TLC themselves. + - name: Model-check + run: nix shell --inputs-from . nixpkgs#just --command just test tla ${{ matrix.paths }} + # Media QA with a Firefox player against a Chromium fixture. The Chromium # player already runs in interop.yml, nightly and on release PRs. WebKit has # engine defects this cannot pass; see test/interop/README.md. diff --git a/REVIEW.md b/REVIEW.md index 4a74fc09d19..9801589395a 100644 --- a/REVIEW.md +++ b/REVIEW.md @@ -47,6 +47,13 @@ The fix is a mocked clock or an awaited event, never a shorter or longer real wa The exception is a test that drives real sockets, devices, or processes, which may wait on the real clock and opts out with `host_time()` or `hostTime()`; that opt-out belongs nowhere else. The runtime guards fail Rust and bun tests only when a timer fires on the host clock, so they miss Go and Python tests, elapsed-time assertions, and any wait that bypasses those clocks; and Rust's `host_time()` lasts for the whole process, so it hides other tests' waits outside nextest's one-test-per-process runs. +# Models + +A TLA+ model that no longer describes its code keeps passing while proving nothing, and Nightly cannot tell. +When a PR changes a file in a `verify-*` skill's Coverage table, run that skill on the head. +Flag a covered change the model does not mirror, a config whose result changed without its `\* Open finding:` line following, and a sync commit not moved to the PR's base once the model matches (PRs squash, so the base is the latest commit it can name). +The flow models under `js/*/verify/` have no skill: give a PR that changes the code their README names the same check with `just test tla`. + # Not findings Each of these has been raised and refuted repeatedly here; the rules in `AGENTS.md` already decide them: diff --git a/js/net/src/connection/migrate.test.ts b/js/net/src/connection/migrate.test.ts index fa4432e9be7..b7f7df0a599 100644 --- a/js/net/src/connection/migrate.test.ts +++ b/js/net/src/connection/migrate.test.ts @@ -245,7 +245,7 @@ test("a redirect moves the pool key while the handle keeps its origin", async () } }); -// Replays RedialsALiveRelay in js/watch/verify/Failover.tla under Redirect.cfg: a redirect is +// Replays RedialsALiveRelay in js/watch/verify/Failover.tla under FailoverRedirect.cfg: a redirect is // sticky, so once the relay it named dies, every redial goes back to that dead relay and never // to the configured URL, which still answers. test("residual: a redirected connection redials only its dead target", async () => { diff --git a/js/publish/verify/Publish.cfg b/js/publish/verify/Publish.cfg index e189698cd40..d2b70dc29b4 100644 --- a/js/publish/verify/Publish.cfg +++ b/js/publish/verify/Publish.cfg @@ -1,4 +1,5 @@ +\* LiveMeansWatchable is left out: its break, a badge that leads the announce by +\* milliseconds, is accepted (2026-11-10). SPECIFICATION Spec -INVARIANT LiveMeansWatchable INVARIANT StopStopsPublishing INVARIANT DenialIsShown diff --git a/js/publish/verify/README.md b/js/publish/verify/README.md index 30c982c5882..5e9b0b3539c 100644 --- a/js/publish/verify/README.md +++ b/js/publish/verify/README.md @@ -9,7 +9,7 @@ broadcast. | Rule | Holds when | Today | | --- | --- | --- | -| `LiveMeansWatchable` | The badge says LIVE only while viewers can find the broadcast. | Breaks: the badge reads the connection and the captured sources, not the announce gate, so it says LIVE while the gate waits for the encoders to settle. Accepted 2026-11-10 (maintainer): the window is usually milliseconds. | +| `LiveMeansWatchable` | The badge says LIVE only while viewers can find the broadcast. | Breaks: the badge reads the connection and the captured sources, not the announce gate, so it says LIVE while the gate waits for the encoders to settle. Accepted 2026-11-10 (maintainer): the window is usually milliseconds, so `Publish.cfg` leaves it out. | | `StopStopsPublishing` | A publisher who stopped the camera publishes nothing. | Holds. | | `DenialIsShown` | A publisher who refused the camera is told so. | Holds. | @@ -21,10 +21,10 @@ state has. ## Run ```sh -just js tla publish/verify/Publish.tla +just test tla js/publish ``` -TLC exits non-zero while a rule above breaks. To draw the chart, run `/statechart` with +This must pass, as Nightly checks. To draw the chart, run `/statechart` with `Publish.tla`, `Publish.cfg`, and `Publish.view.ts`. ## Left out diff --git a/js/room/verify/README.md b/js/room/verify/README.md index 1fce4e9ef3e..d9199f07492 100644 --- a/js/room/verify/README.md +++ b/js/room/verify/README.md @@ -16,10 +16,11 @@ coming back once it reconnects. ## Run ```sh -just js tla room/verify/Room.tla +just test tla js/room ``` -TLC exits non-zero while the rule above breaks. To draw the chart, run `/statechart` with +`Room.cfg` is marked `\* Open finding:`, so this passes, as Nightly checks, only while the rule +breaks. The fix drops that line. To draw the chart, run `/statechart` with `Room.tla`, `Room.cfg`, and `Room.view.ts`. `Room.cfg` plays only Bob's camera; add `"screen"` to `Kinds` to play his share too. diff --git a/js/room/verify/Room.cfg b/js/room/verify/Room.cfg index d58f2ae5945..9aedaf4d594 100644 --- a/js/room/verify/Room.cfg +++ b/js/room/verify/Room.cfg @@ -1,4 +1,6 @@ \* Bob only joins and leaves, which keeps the chart readable; add "screen" to play his share too. +\* Open finding: a screen share publishes outside the room, so +\* LeavingStopsPublishing fails. Once fixed, drop this note. SPECIFICATION Spec CONSTANT Kinds = {"camera"} INVARIANT LeavingStopsPublishing diff --git a/js/watch/verify/Failover.cfg b/js/watch/verify/Failover.cfg index e896026e35e..46f421081ba 100644 --- a/js/watch/verify/Failover.cfg +++ b/js/watch/verify/Failover.cfg @@ -1,8 +1,8 @@ \* Relays as moq-relay runs them: a draining relay sends an empty-URI GOAWAY. +\* OfflineOnlyWhenUnreachable lives in FailoverCrash.cfg while its finding is open. SPECIFICATION Spec CONSTANTS Relays = {1, 2} Redirects = FALSE -INVARIANT OfflineOnlyWhenUnreachable INVARIANT RedialsALiveRelay INVARIANT KeepsReconnecting diff --git a/js/watch/verify/FailoverCrash.cfg b/js/watch/verify/FailoverCrash.cfg new file mode 100644 index 00000000000..cbaf03f421e --- /dev/null +++ b/js/watch/verify/FailoverCrash.cfg @@ -0,0 +1,8 @@ +\* Open finding: the viewer's relay crashing shows OFFLINE though the other relay +\* serves the broadcast, so OfflineOnlyWhenUnreachable fails. Once fixed, move +\* the rule into Failover.cfg and delete this file. +SPECIFICATION Spec +CONSTANTS + Relays = {1, 2} + Redirects = FALSE +INVARIANT OfflineOnlyWhenUnreachable diff --git a/js/watch/verify/Redirect.cfg b/js/watch/verify/FailoverRedirect.cfg similarity index 53% rename from js/watch/verify/Redirect.cfg rename to js/watch/verify/FailoverRedirect.cfg index b102a390dd3..107141cf692 100644 --- a/js/watch/verify/Redirect.cfg +++ b/js/watch/verify/FailoverRedirect.cfg @@ -1,7 +1,8 @@ \* Relays that name a URI in their GOAWAY, such as a third-party relay. moq-relay never does. +\* Open finding: a followed redirect is sticky, so RedialsALiveRelay fails. Once +\* fixed, delete this file; FailoverRedirectRefused.cfg keeps checking these relays. SPECIFICATION Spec CONSTANTS Relays = {1, 2} Redirects = TRUE INVARIANT RedialsALiveRelay -INVARIANT KeepsReconnecting diff --git a/js/watch/verify/FailoverRedirectRefused.cfg b/js/watch/verify/FailoverRedirectRefused.cfg new file mode 100644 index 00000000000..5ea3d7ac2c6 --- /dev/null +++ b/js/watch/verify/FailoverRedirectRefused.cfg @@ -0,0 +1,9 @@ +\* Relays that name a URI in their GOAWAY, such as a third-party relay. moq-relay never does. +\* Open finding: the default `same-host` policy refuses a redirect to another host +\* and stops the loop, so KeepsReconnecting fails. Once fixed, move the rule into +\* FailoverRedirect.cfg, or rename this file to it if that is gone. +SPECIFICATION Spec +CONSTANTS + Relays = {1, 2} + Redirects = TRUE +INVARIANT KeepsReconnecting diff --git a/js/watch/verify/README.md b/js/watch/verify/README.md index 351db7e871d..95093626025 100644 --- a/js/watch/verify/README.md +++ b/js/watch/verify/README.md @@ -28,12 +28,12 @@ come back, drain with a GOAWAY, and lose or move their path to the origin. | Rule | Holds when | Today | | --- | --- | --- | | `OfflineOnlyWhenUnreachable` | The viewer sees OFFLINE only when no relay can reach the broadcast. | Breaks: the viewer's relay crashing shows OFFLINE until the redial lands and the announcement arrives, though the other relay serves the broadcast. | -| `KeepsReconnecting` | A viewer whose relay left keeps reconnecting while some relay is up. | Holds with moq-relay (`Failover.cfg`). Breaks with a relay whose GOAWAY names another host (`Redirect.cfg`): the default `same-host` policy refuses it and stops the loop. | -| `RedialsALiveRelay` | A reconnecting viewer can land on a relay that is up. | Holds with moq-relay. Breaks under `Redirect.cfg`: a followed redirect is sticky, so once that relay dies every redial goes back to it, never to the configured URL. | +| `KeepsReconnecting` | A viewer whose relay left keeps reconnecting while some relay is up. | Holds with moq-relay (`Failover.cfg`). Breaks with a relay whose GOAWAY names another host (`FailoverRedirectRefused.cfg`): the default `same-host` policy refuses it and stops the loop. | +| `RedialsALiveRelay` | A reconnecting viewer can land on a relay that is up. | Holds with moq-relay. Breaks under `FailoverRedirect.cfg`: a followed redirect is sticky, so once that relay dies every redial goes back to it, never to the configured URL. | A GOAWAY whose replacement connects within the handover keeps playing, and a move to another path to the origin only stalls. `Failover.cfg` plays relays as moq-relay runs them, draining with -an empty-URI GOAWAY; `Redirect.cfg` lets relays name a URI. The crash replays through +an empty-URI GOAWAY; `FailoverRedirect.cfg` and `FailoverRedirectRefused.cfg` let relays name a URI. The crash replays through `src/offline.test.ts` (a dropped session reads offline), the refused redirect through `a refused redirect ends the connection instead of reconnecting` in `@moq/net`, and the sticky redirect through `residual: a redirected connection redials only its dead target` there. @@ -41,13 +41,14 @@ through `residual: a redirected connection redials only its dead target` there. ## Run ```sh -just js tla watch/verify/Watch.tla -just js tla watch/verify/Failover.tla -just js tla watch/verify/Failover.tla -config js/watch/verify/Redirect.cfg +just test tla js/watch ``` -TLC exits non-zero while a rule above breaks. To draw a chart, run `/statechart` with the spec, -its config, and its `.view.ts`. +This runs every config, as Nightly does. `Watch.cfg` and `Failover.cfg` check the rules that hold +and must pass; each rule that breaks has its own config, marked `\* Open finding:`, which must +fail until the fix moves its rule into the passing one. A config checks the spec its name starts +with. To draw a chart, run `/statechart` with the spec, a config, and its `.view.ts`; pass a +finding's config to chart its break. ## Left out diff --git a/js/watch/verify/Watch.cfg b/js/watch/verify/Watch.cfg index cf8940e8c68..ef04fa961d0 100644 --- a/js/watch/verify/Watch.cfg +++ b/js/watch/verify/Watch.cfg @@ -1,4 +1,4 @@ +\* OfflineMeansOffline and RefusalIsExplained live in WatchConnecting.cfg +\* and WatchRefused.cfg while their findings are open. SPECIFICATION Spec INVARIANT NeverFrozenSilently -INVARIANT OfflineMeansOffline -INVARIANT RefusalIsExplained diff --git a/js/watch/verify/WatchConnecting.cfg b/js/watch/verify/WatchConnecting.cfg new file mode 100644 index 00000000000..3ea6404a563 --- /dev/null +++ b/js/watch/verify/WatchConnecting.cfg @@ -0,0 +1,5 @@ +\* Open finding: OFFLINE shows while the player connects or the connection is +\* down, so OfflineMeansOffline fails. Once fixed, move the rule into Watch.cfg +\* and delete this file. +SPECIFICATION Spec +INVARIANT OfflineMeansOffline diff --git a/js/watch/verify/WatchRefused.cfg b/js/watch/verify/WatchRefused.cfg new file mode 100644 index 00000000000..9ba30b37f41 --- /dev/null +++ b/js/watch/verify/WatchRefused.cfg @@ -0,0 +1,4 @@ +\* Open finding: a refused token shows OFFLINE for good, so RefusalIsExplained +\* fails. Once fixed, move the rule into Watch.cfg and delete this file. +SPECIFICATION Spec +INVARIANT RefusalIsExplained diff --git a/quest/m1/README.md b/quest/m1/README.md index b64ff021fc6..58063088b98 100644 --- a/quest/m1/README.md +++ b/quest/m1/README.md @@ -44,7 +44,6 @@ moves what remains of them once their claims merge. - [A resumed QUIC client gives up on its own idle timer](/quest/m1/quic-resume-idle.md) - a client stopped past its idle timeout closes within about one timeout of resuming, without waiting on a stateless reset - [A reused moq-transport alias delivers a group that beats its SUBSCRIBE_OK](/quest/m1/ietf-alias-reuse.md) - a new SUBSCRIBE clears its track's alias tombstone, so moqxr's alias-0 catalog refetch no longer hangs - [A screen share publishes only while joined](/quest/m1/room-screen-joined.md) - `@moq/room` publishes no screen share before joining or after leaving -- [The TLA+ models run nightly and reviews resync them](/quest/m1/model-checks-nightly.md) - every model config runs in Nightly, open findings must still fail, and review reruns a model whose covered code changed - [The route model covers a mesh with clients and an announce budget](/quest/m1/route-mesh-model.md) - every ordering on 4-5 relay meshes with two origins and clients, with an announce budget and convergence - [Seeded lite-07 meshes hold the route rules and an announce budget](/quest/m1/route-mesh-sweep.md) - the route rules and message budget checked on real sessions over random meshes - [A model of a relay chain's failover delivers every group once](/quest/m1/failover-chain-model.md) - route, resume, and subscribe composed across a relay chain whose hops fail diff --git a/quest/m1/model-checks-nightly.md b/quest/m1/model-checks-nightly.md deleted file mode 100644 index 88603f8c8e2..00000000000 --- a/quest/m1/model-checks-nightly.md +++ /dev/null @@ -1,34 +0,0 @@ -# [M] The TLA+ models run nightly and reviews resync them - -## Goal - -Every TLA+ model in the tree runs in Nightly: each passing config must pass, -and each open-finding config must still fail, so a fix that should promote -its rule is noticed. A PR that changes code a model covers gets that model -rerun and resynced in review, so no model keeps passing on code that no -longer exists. - -## Plan - -Decided 2026-11-10 (maintainer, /quest-plan), after [moq-dev/moq#8447](https://github.com/moq-dev/moq/pull/8447) -added the models (`rs/moq-net/verify/*`, `js/*/verify/`) and their `verify-*` -skills. - -- Nightly runs every config through the `tla` recipes. TLC runs take 20 s - to 2 min on 32 cores, so they stay out of the merge gate. An open-finding - config is one its skill lists under "Open finding"; the job expects TLC's - invariant-violation exit for it and fails on a pass. -- The JS flow models (`js/*/verify/`) check every rule in one config, so - each breaks on its open findings. Split them as the Rust models are: a - passing config plus one per open finding. Publish's `LiveMeansWatchable` - break is accepted (2026-11-10, a badge that leads the announce by - milliseconds), so it leaves the passing config. -- ✅ Drift is flagged by a review rule (rejected: a CI check that fails a PR - touching covered files without touching the model, which taxes every - refactor and comment edit; and both). `REVIEW.md` tells the reviewer to run - the matching `verify-*` skill when a PR changes a file in that skill's - Coverage table, and the PR updates the model and its sync commit. -- The periodic resync for changes that skipped review is a check-first item - in the [test coverage audit](/quest/m3/audit-test-coverage.md). - -Public API: none. Wire: none. diff --git a/quest/m1/route-mesh-model.md b/quest/m1/route-mesh-model.md index cc0e93fc9b5..05bb3ee533a 100644 --- a/quest/m1/route-mesh-model.md +++ b/quest/m1/route-mesh-model.md @@ -25,8 +25,9 @@ are routing's confidence gates for finalizing lite-07. external change, the queues empty and every relay shows what `QuietIsSettled` requires. - Keep explicit-state runs tractable with `SYMMETRY` over interchangeable - relays; run larger meshes with TLC's random simulation in Nightly - ([nightly models](/quest/m1/model-checks-nightly.md)). + relays; run larger meshes with TLC's random simulation in Nightly, whose + `just test tla` (`sh/tla.sh`) runs each config exhaustively today and needs + a way to mark a config for simulation. - Count to infinity stays in its own open-finding config until [the echo fix](/quest/m2/cluster-routing/routes/echo-order.md) lands, so the other rules still run on larger meshes. diff --git a/quest/m3/audit-test-coverage.md b/quest/m3/audit-test-coverage.md index d426c6ff7b7..64cff98bc57 100644 --- a/quest/m3/audit-test-coverage.md +++ b/quest/m3/audit-test-coverage.md @@ -147,7 +147,7 @@ land after this baseline, so the next report should show moq-mux's - Each TLA+ model's `verify-*` skill against the code it covers: run `/maintain-formal-verification-skill` on every one whose Coverage files changed since its sync commit, so a change that skipped review is resynced - (decided 2026-11-10, [nightly models](/quest/m1/model-checks-nightly.md)). + (decided 2026-11-10). ## Required diff --git a/quest/m3/net-redirect-fallback.md b/quest/m3/net-redirect-fallback.md index 84f7a726339..78cee04847e 100644 --- a/quest/m3/net-redirect-fallback.md +++ b/quest/m3/net-redirect-fallback.md @@ -9,7 +9,7 @@ still answers. ## Plan Found 2026-11-10 by the failover chart ([moq-dev/moq#8447](https://github.com/moq-dev/moq/pull/8447)): -`js/watch/verify/Redirect.cfg` breaks `RedialsALiveRelay` in 4 steps. In +`js/watch/verify/FailoverRedirect.cfg` breaks `RedialsALiveRelay` in 4 steps. In `js/net/src/connection/reload.ts` every redial after a redirect targets only the relay it was sent to, with no retry timeout by default, so the viewer redials a dead relay indefinitely. `residual: a redirected connection redials diff --git a/rs/moq-net/verify/reconnect/OfflineWhileServing.cfg b/rs/moq-net/verify/reconnect/OfflineWhileServing.cfg index f599a536433..a36b9efa1df 100644 --- a/rs/moq-net/verify/reconnect/OfflineWhileServing.cfg +++ b/rs/moq-net/verify/reconnect/OfflineWhileServing.cfg @@ -1,4 +1,4 @@ -\* The open finding a replacement dropping mid-handover: +\* Open finding: a replacement dropping mid-handover reports Disconnected, so \* OfflineMeansNothingServes fails. Once fixed, move the rule into \* Handover.cfg and delete this file. CONSTANTS diff --git a/rs/moq-net/verify/reconnect/RedirectLost.cfg b/rs/moq-net/verify/reconnect/RedirectLost.cfg index fb22ee51b6d..6ce1c02840c 100644 --- a/rs/moq-net/verify/reconnect/RedirectLost.cfg +++ b/rs/moq-net/verify/reconnect/RedirectLost.cfg @@ -1,5 +1,6 @@ -\* The open finding a GOAWAY after a probe got through: RedirectFollowed fails. -\* Once fixed, move the rule into Handover.cfg and delete this file. +\* Open finding: a GOAWAY after a probe got through is lost, so +\* RedirectFollowed fails. Once fixed, move the rule into Handover.cfg and +\* delete this file. CONSTANTS Endpoints = {"a", "b"} Start = "a" diff --git a/rs/moq-net/verify/route/CountToInfinity.cfg b/rs/moq-net/verify/route/CountToInfinity.cfg index 5995cad17b8..fcf3254f2d6 100644 --- a/rs/moq-net/verify/route/CountToInfinity.cfg +++ b/rs/moq-net/verify/route/CountToInfinity.cfg @@ -1,6 +1,6 @@ -\* The open count-to-infinity finding, checked apart so RouteHandoff.cfg still -\* checks every other rule. Once it holds, move NoCountToInfinity into -\* RouteHandoff.cfg and delete this file. +\* Open finding: an overtaking echo counts to infinity, checked apart so +\* RouteHandoff.cfg still checks every other rule. Once it holds, move +\* NoCountToInfinity into RouteHandoff.cfg and delete this file. CONSTANTS Nodes = {0, 1, 2} Origin = 0 diff --git a/rs/moq-net/verify/subscribe/StreamWins.cfg b/rs/moq-net/verify/subscribe/StreamWins.cfg index c9a8214310a..bd829855150 100644 --- a/rs/moq-net/verify/subscribe/StreamWins.cfg +++ b/rs/moq-net/verify/subscribe/StreamWins.cfg @@ -1,4 +1,4 @@ -\* The open finding: a group read whole is recorded stale. Once it is fixed, move +\* Open finding: a group read whole is recorded stale. Once it is fixed, move \* StreamWins into SubscribeAccounting.cfg and delete this file. CONSTANTS Groups = {0} diff --git a/sh/tla.sh b/sh/tla.sh new file mode 100755 index 00000000000..6386bfee7f5 --- /dev/null +++ b/sh/tla.sh @@ -0,0 +1,60 @@ +#!/usr/bin/env bash +# Model-check every TLA+ config under the given paths (default: all of them) +# through the `tla` recipes. A config with a `\* Open finding:` line must break +# a rule (a deadlock, invariant, property, or assertion), so a fix that should +# promote its rule is noticed; every other config must pass. +set -euo pipefail +shopt -s nullglob +cd "$(git rev-parse --show-toplevel)" + +[ $# -ne 0 ] || set -- rs js +mapfile -t configs < <(git ls-files --cached --others --exclude-standard -- "$@" | grep -E '^(rs|js)/.*/verify/.*\.cfg$' || true) +if [ ${#configs[@]} -eq 0 ]; then + echo "error: no TLA+ config under: $*" >&2 + exit 1 +fi + +failed=() +for cfg in "${configs[@]}"; do + # The directory's spec, or where it holds several, the one the config's name starts with. + dir=$(dirname "$cfg") + specs=("$dir"/*.tla) + if [ ${#specs[@]} -gt 1 ]; then + name=$(basename "$cfg") + specs=() + for spec in "$dir"/*.tla; do + [[ "$name" != "$(basename "$spec" .tla)"* ]] || specs+=("$spec") + done + fi + if [ ${#specs[@]} -ne 1 ]; then + echo "error: no single spec in $dir for $cfg" >&2 + exit 1 + fi + lang=${cfg%%/*} + finding=false + ! grep -q '^\\\* Open finding:' "$cfg" || finding=true + + echo "::group::$cfg" + start=$SECONDS + status=0 + just "$lang" tla "${specs[0]#"$lang"/}" -config "$cfg" || status=$? + echo "::endgroup::" + echo "$cfg: exit $status in $((SECONDS - start))s" + + # TLC exits 11 to 14 for a deadlock, a violated invariant, a violated + # property, and a failed assertion; anything else nonzero is an error. + if $finding; then + case $status in + 11 | 12 | 13 | 14) ;; + 0) failed+=("$cfg: passes, so its finding is fixed: promote its rule as the config says") ;; + *) failed+=("$cfg: exit $status, not a broken rule") ;; + esac + elif [ "$status" -ne 0 ]; then + failed+=("$cfg: exit $status") + fi +done + +if [ ${#failed[@]} -ne 0 ]; then + printf 'error: %s\n' "${failed[@]}" >&2 + exit 1 +fi diff --git a/test/justfile b/test/justfile index d7a8b4deaaf..9faa70454f8 100644 --- a/test/justfile +++ b/test/justfile @@ -294,6 +294,10 @@ json-properties: resume-model: bash ../sh/local.sh bash resume-model.sh +# Model-check every TLA+ config under the given paths (default: all): open findings must still break. +tla *paths: + bash ../sh/tla.sh {{ paths }} + # The TypeScript qmux peer as client and server against the in-tree Rust qmux # interop examples, per draft. The manifest path names the in-tree crate, which # shares its package name with the 0.6 release its tests interoperate with. From bf8ecebd9ec7b20fa17f33d2ef203f7f4a28ddea Mon Sep 17 00:00:00 2001 From: Luke Curley <432854+kixelated@users.noreply.github.com> Date: Tue, 10 Nov 2026 18:42:15 -0800 Subject: [PATCH 3/9] ci: check that verify-* Coverage tables name code that exists Each Code cell is now a repo-relative path, then the symbols it covers, and `sh/coverage-tables.py` fails `just check` when one of those is renamed or deleted, so a model's mapping cannot silently point at code that is gone. Co-Authored-By: Claude Opus 5.5 --- .claude/skills/verify-reconnect/SKILL.md | 14 ++-- .claude/skills/verify-resume/SKILL.md | 18 ++--- .claude/skills/verify-route/SKILL.md | 20 +++--- .claude/skills/verify-subscribe/SKILL.md | 24 +++---- .github/justfile | 1 + quest/m1/route-inductive.md | 1 - quest/m1/route-key-model.md | 1 - sh/coverage-tables.py | 91 ++++++++++++++++++++++++ sh/coverage-tables.test.py | 77 ++++++++++++++++++++ sh/dispatch.sh | 5 ++ 10 files changed, 212 insertions(+), 40 deletions(-) create mode 100644 sh/coverage-tables.py create mode 100644 sh/coverage-tables.test.py diff --git a/.claude/skills/verify-reconnect/SKILL.md b/.claude/skills/verify-reconnect/SKILL.md index b049d4ee3fd..172060ed9d7 100644 --- a/.claude/skills/verify-reconnect/SKILL.md +++ b/.claude/skills/verify-reconnect/SKILL.md @@ -49,16 +49,16 @@ A counterexample is a path through the model, not yet a bug. Replay it on the po ## Coverage -Sync commit: `103052ed074a87f00269ecb0d639905482ecfb6f`. Run `git log 103052ed07.. -- rs/moq-net/src/reconnect.rs rs/moq-net/src/reconnect/ rs/moq-tokio/src/connection.rs` to see what changed since. After a change to a covered function, mirror it in the model, rerun every config, and move the sync commit forward only once the model describes the code at the new commit. +Sync commit: `103052ed074a87f00269ecb0d639905482ecfb6f`. Run `git log 103052ed07.. -- rs/moq-net/src/reconnect.rs rs/moq-net/src/reconnect/ rs/moq-tokio/src/connection.rs` to see what changed since. After a change to a covered function, mirror it in the model, rerun every config, and move the sync commit forward only once the model describes the code at the new commit. `just check` fails when a function or type the table names no longer exists in its file (`sh/coverage-tables.py`), so each Code cell starts with a repo-relative path, then the symbols in it. | Code | Model | | --- | --- | -| `reconnect.rs` `Reconnect::poll` (queue, predecessor, phases) | `Pop`, `Retire`, `IdleClose`, `Dial`, `Abandon`, `BackoffEnds`, `LiveEnds`, `ProbeAsk`, `ProbeAbandon` | -| `reconnect.rs` `connected`, `fallback`, `failed`, `probed` | `Connected`, `Failed`, `ProbeFails`, `ProbeGetsThrough` | -| `reconnect.rs` `end`, `closed`, `done`, `Predecessor` | `EndGoaway`, `EndClosed`, `Done`, `Retire`, `IdleClose` | -| `reconnect.rs` `Restart::Wait` | `LiveEnds` with `Restart = "wait"` (`RestartWait.cfg`) | -| `reconnect/redirect.rs` `Redirect::target` | `Refused` and `Endpoints` | -| `moq-tokio/src/connection.rs` `run`, `Shared::connected`, `migrating`, `predecessor`, `offline`, `end` | `Connected`, `Apply`, `OnMigrating`, `OnRetired`, `OnOffline`, `OnDone` | +| `rs/moq-net/src/reconnect.rs` `Reconnect::poll` (queue, predecessor, phases) | `Pop`, `Retire`, `IdleClose`, `Dial`, `Abandon`, `BackoffEnds`, `LiveEnds`, `ProbeAsk`, `ProbeAbandon` | +| `rs/moq-net/src/reconnect.rs` `connected`, `fallback`, `failed`, `probed` | `Connected`, `Failed`, `ProbeFails`, `ProbeGetsThrough` | +| `rs/moq-net/src/reconnect.rs` `end`, `closed`, `done`, `Predecessor` | `EndGoaway`, `EndClosed`, `Done`, `Retire`, `IdleClose` | +| `rs/moq-net/src/reconnect.rs` `Restart::Wait` | `LiveEnds` with `Restart = "wait"` (`RestartWait.cfg`) | +| `rs/moq-net/src/reconnect/redirect.rs` `Redirect::target` | `Refused` and `Endpoints` | +| `rs/moq-tokio/src/connection.rs` `run`, `Shared::connected`, `migrating`, `predecessor`, `offline`, `end` | `Connected`, `Apply`, `OnMigrating`, `OnRetired`, `OnOffline`, `OnDone` | ## Not covered diff --git a/.claude/skills/verify-resume/SKILL.md b/.claude/skills/verify-resume/SKILL.md index d4b61f328b6..0276e5b97c6 100644 --- a/.claude/skills/verify-resume/SKILL.md +++ b/.claude/skills/verify-resume/SKILL.md @@ -42,17 +42,17 @@ A counterexample is a path through the model, not yet a bug. Replay it as a test ## Coverage -Sync commit: `103052ed074a87f00269ecb0d639905482ecfb6f`. Run `git log 103052ed07.. -- rs/moq-net/src/model/resume.rs rs/moq-net/src/model/track.rs` to see what changed since. After a change to a covered function, mirror it in the model, rerun every config, and move the sync commit forward only once the model describes the code at the new commit. +Sync commit: `103052ed074a87f00269ecb0d639905482ecfb6f`. Run `git log 103052ed07.. -- rs/moq-net/src/model/resume.rs rs/moq-net/src/model/track.rs` to see what changed since. After a change to a covered function, mirror it in the model, rerun every config, and move the sync commit forward only once the model describes the code at the new commit. `just check` fails when a function or type the table names no longer exists in its file (`sh/coverage-tables.py`), so each Code cell starts with a repo-relative path, then the symbols in it. -| Code (`rs/moq-net/src/model/`) | Model | +| Code | Model | | --- | --- | -| `resume.rs` `Reader::sync` (reuse of a route's copy, new copy at `newest`) | `Sync`, `Serve` | -| `resume.rs` `Reader::backfill`, `backfill_gaps` | `Backfill`, `BackfillGaps` | -| `resume.rs` `Reader::poll_lowest`, `deliverable`, `take`, `observe` | `Poll`, `Scan`, `Peek`, `Deliverable`, `Take` | -| `resume.rs` `Reader::bound_at_end`, `let_go`, `Copy::retains` | `BoundAtEnd`, `LetGo`, `Retains` | -| `resume.rs` `Reader::poll_end` | `PollEnd` | -| `resume.rs` `Producer::splice`, `serve_from`, the front's end | `Serve`, `FrontFinish`, `FrontFail` | -| `track.rs` `TrackState::is_complete`, `may_land`, `latest_sequence`, `track::Subscriber::has_unread_group` | `Seal`, `Held`, `MayLand`, `Latest`, `HasUnread` | +| `rs/moq-net/src/model/resume.rs` `Reader::sync` (reuse of a route's copy, new copy at `newest`) | `Sync`, `Serve` | +| `rs/moq-net/src/model/resume.rs` `Reader::backfill`, `backfill_gaps` | `Backfill`, `BackfillGaps` | +| `rs/moq-net/src/model/resume.rs` `Reader::poll_lowest`, `deliverable`, `take`, `observe` | `Poll`, `Scan`, `Peek`, `Deliverable`, `Take` | +| `rs/moq-net/src/model/resume.rs` `Reader::bound_at_end`, `let_go`, `Copy::retains` | `BoundAtEnd`, `LetGo`, `Retains` | +| `rs/moq-net/src/model/resume.rs` `Reader::poll_end` | `PollEnd` | +| `rs/moq-net/src/model/resume.rs` `Producer::splice`, `serve_from`, the front's end | `Serve`, `FrontFinish`, `FrontFail` | +| `rs/moq-net/src/model/track.rs` `TrackState::is_complete`, `may_land`, `latest_sequence`, `track::Subscriber::has_unread_group` | `Seal`, `Held`, `MayLand`, `Latest`, `HasUnread` | ## Not covered diff --git a/.claude/skills/verify-route/SKILL.md b/.claude/skills/verify-route/SKILL.md index 52f60919713..ca5bbc76073 100644 --- a/.claude/skills/verify-route/SKILL.md +++ b/.claude/skills/verify-route/SKILL.md @@ -45,18 +45,18 @@ A counterexample is a path through the model, not yet a bug. Replay it on the ro ## Coverage -Sync commit: `103052ed074a87f00269ecb0d639905482ecfb6f`. Run `git log 103052ed07.. -- rs/moq-net/src/route/` to see what changed since. After a change to a covered function, mirror it in the model, rerun both configs, and move the sync commit forward only once the model describes the code at the new commit. +Sync commit: `103052ed074a87f00269ecb0d639905482ecfb6f`. Run `git log 103052ed07.. -- rs/moq-net/src/route/` to see what changed since. After a change to a covered function, mirror it in the model, rerun both configs, and move the sync commit forward only once the model describes the code at the new commit. `just check` fails when a function or type the table names no longer exists in its file (`sh/coverage-tables.py`), so each Code cell starts with a repo-relative path, then the symbols in it. -| Code (`rs/moq-net/src/route/`) | Model | +| Code | Model | | --- | --- | -| `mod.rs` `feasible`, `selected`, `infeasible`, `recoverable`, `live`, `certifiers` | `Feasible`, `Selected`, `InfeasibleSet`, `Recoverable`, `Live`, `Certifiers` | -| `mod.rs` `certified`, `prune`, `adopted` | `Certified`, `Prune`, `Adopted` | -| `mod.rs` `update`, `record`, `advertise`, `requests` | `Update`, `Record`, `Plan`, `Requests` | -| `mod.rs` `show`, `shown_now` | `Events`, `ShownNow` | -| `mod.rs` `route`, `batch`, `request`, `echo` | `OnRoute`, `OnBatch`, `OnRequest`, `Deliver`, `DeliverAck` | -| `mod.rs` `connect`, `peer_interest`, `disconnect`, `collect`, `change` | `Connect`, `Opened`, `Disconnect`, `Closed`, `Collect`, `ChangeClaim` | -| `view.rs` `View::merge`, `View::restrict` | `Merge`, `Certify` | -| `tests/mod.rs` `Sim` queues and `revivals`, `false_ends` | `q`, `acks`, `revivals`, `falseEnds` | +| `rs/moq-net/src/route/mod.rs` `feasible`, `selected`, `infeasible`, `recoverable`, `live`, `certifiers` | `Feasible`, `Selected`, `InfeasibleSet`, `Recoverable`, `Live`, `Certifiers` | +| `rs/moq-net/src/route/mod.rs` `certified`, `prune`, `adopted` | `Certified`, `Prune`, `Adopted` | +| `rs/moq-net/src/route/mod.rs` `update`, `record`, `advertise`, `requests` | `Update`, `Record`, `Plan`, `Requests` | +| `rs/moq-net/src/route/mod.rs` `show`, `shown_now` | `Events`, `ShownNow` | +| `rs/moq-net/src/route/mod.rs` `route`, `batch`, `request`, `echo` | `OnRoute`, `OnBatch`, `OnRequest`, `Deliver`, `DeliverAck` | +| `rs/moq-net/src/route/mod.rs` `connect`, `peer_interest`, `disconnect`, `collect`, `change` | `Connect`, `Opened`, `Disconnect`, `Closed`, `Collect`, `ChangeClaim` | +| `rs/moq-net/src/route/view.rs` `View::merge`, `View::restrict` | `Merge`, `Certify` | +| `rs/moq-net/src/route/tests/mod.rs` `Sim` queues and `revivals`, `false_ends` | `q`, `acks`, `revivals`, `falseEnds` | ## Not covered diff --git a/.claude/skills/verify-subscribe/SKILL.md b/.claude/skills/verify-subscribe/SKILL.md index 639c9a30260..95f60bd7e1c 100644 --- a/.claude/skills/verify-subscribe/SKILL.md +++ b/.claude/skills/verify-subscribe/SKILL.md @@ -39,20 +39,20 @@ A counterexample is a path through the model, not yet a bug. Replay it on the co ## Coverage -Sync commit: `103052ed074a87f00269ecb0d639905482ecfb6f`. Run `git log 103052ed07.. -- rs/moq-net/src/lite/publisher.rs rs/moq-net/src/lite/subscriber.rs rs/moq-net/src/tail.rs rs/moq-net/src/model/track.rs` to see what changed since. After a change to a covered function, mirror it in the model, rerun both configs, and move the sync commit forward only once the model describes the code at the new commit. +Sync commit: `103052ed074a87f00269ecb0d639905482ecfb6f`. Run `git log 103052ed07.. -- rs/moq-net/src/lite/publisher.rs rs/moq-net/src/lite/subscriber.rs rs/moq-net/src/tail.rs rs/moq-net/src/model/track.rs` to see what changed since. After a change to a covered function, mirror it in the model, rerun both configs, and move the sync commit forward only once the model describes the code at the new commit. `just check` fails when a function or type the table names no longer exists in its file (`sh/coverage-tables.py`), so each Code cell starts with a repo-relative path, then the symbols in it. -| Code (`rs/moq-net/src/`) | Model | +| Code | Model | | --- | --- | -| `lite/publisher.rs` `TrackRun::poll_track` (`Recv::Group`, the re-offer pop), `serve`, `mark_served` | `CursorHand`, `PubReoffer`, `Serve` | -| `lite/publisher.rs` `poll_forward_drop`, `forward_range`, `drop_range`, `replace_stale`, `sent_stale`, `hole` | `CursorGiveUp`, `ReplaceStale` | -| `lite/publisher.rs` `TrackRun::poll_step` (outcomes, `redrop`) | `PubOutcomes`, `PubRedrop` | -| `lite/publisher.rs` `TrackRun::update`, `owe`; `model/track.rs` `reoffer_stale`, `reoffer_groups` | `PubUpdate` | -| `lite/publisher.rs` `GroupServe::poll_serve` (`Serve`, `Closed`), `settle_failed` | `StreamFin`, `StreamFail`, `StreamAck` | -| `lite/subscriber.rs` `TrackEntry::open`, `reopen`, `place`; `GroupRecv::poll_serve` (the duplicate wait) | `SubHeader`, `SubFin`, `SubReset`, `SubResetHeld` | -| `lite/subscriber.rs` `ServeLoop::apply_response` (`Drop`, `Skip`) | `OnDrop`, `OnSkip`, `SubRecv` | -| `lite/subscriber.rs` `buffer_update`; `model/track.rs` `supersede_stale` | `SubUpdate` | -| `tail.rs` `Reading::open`, `Reading::finish`, `Tail::finished`, `updated`, `account`, `unaccount` | `acct`, `finished` | -| `model/track.rs` `Producer::give_up`, `skip_received` | `rec`, `cached` | +| `rs/moq-net/src/lite/publisher.rs` `TrackRun::poll_track` (`Recv::Group`, the re-offer pop), `serve`, `mark_served` | `CursorHand`, `PubReoffer`, `Serve` | +| `rs/moq-net/src/lite/publisher.rs` `poll_forward_drop`, `forward_range`, `drop_range`, `replace_stale`, `sent_stale`, `hole` | `CursorGiveUp`, `ReplaceStale` | +| `rs/moq-net/src/lite/publisher.rs` `TrackRun::poll_step` (outcomes, `redrop`) | `PubOutcomes`, `PubRedrop` | +| `rs/moq-net/src/lite/publisher.rs` `TrackRun::update`, `owe`; `rs/moq-net/src/model/track.rs` `reoffer_stale`, `reoffer_groups` | `PubUpdate` | +| `rs/moq-net/src/lite/publisher.rs` `GroupServe::poll_serve` (`Serve`, `Closed`), `settle_failed` | `StreamFin`, `StreamFail`, `StreamAck` | +| `rs/moq-net/src/lite/subscriber.rs` `TrackEntry::open`, `reopen`, `place`; `GroupRecv::poll_serve` (the duplicate wait) | `SubHeader`, `SubFin`, `SubReset`, `SubResetHeld` | +| `rs/moq-net/src/lite/subscriber.rs` `ServeLoop::apply_response` (`Drop`, `Skip`) | `OnDrop`, `OnSkip`, `SubRecv` | +| `rs/moq-net/src/lite/subscriber.rs` `buffer_update`; `rs/moq-net/src/model/track.rs` `supersede_stale` | `SubUpdate` | +| `rs/moq-net/src/tail.rs` `Reading::open`, `Reading::finish`, `Tail::finished`, `updated`, `account`, `unaccount` | `acct`, `finished` | +| `rs/moq-net/src/model/track.rs` `Producer::give_up`, `skip_received` | `rec`, `cached` | ## Not covered diff --git a/.github/justfile b/.github/justfile index ea4a865d181..22d812ec2a6 100644 --- a/.github/justfile +++ b/.github/justfile @@ -86,6 +86,7 @@ test: python3 sh/large-files.test.py python3 sh/migrate.test.py python3 sh/text.test.py + python3 sh/coverage-tables.test.py python3 sh/dispatch-query.test.py python3 sh/gh/test-inventory.test.py bun test ./sh/gh/setup.test.ts diff --git a/quest/m1/route-inductive.md b/quest/m1/route-inductive.md index 91dcece786b..280de4ab448 100644 --- a/quest/m1/route-inductive.md +++ b/quest/m1/route-inductive.md @@ -50,5 +50,4 @@ Public API: none. Wire: none. ## Related -- [The TLA+ models run nightly and reviews resync them](/quest/m1/model-checks-nightly.md) - the Nightly job this check joins - [Route sweeps are checked against the TLA+ model](/quest/m1/route-trace-validation.md) - ties the same spec to the code diff --git a/quest/m1/route-key-model.md b/quest/m1/route-key-model.md index 5c692d265e7..5046e87fe46 100644 --- a/quest/m1/route-key-model.md +++ b/quest/m1/route-key-model.md @@ -51,5 +51,4 @@ finding changes the signed transcript. ## Related -- [The TLA+ models run nightly and reviews resync them](/quest/m1/model-checks-nightly.md) - the Nightly job and Coverage-table check this model joins - [Routes and announces](/quest/m2/cluster-routing/routes/README.md) - files a peer's routes under the key this proves diff --git a/sh/coverage-tables.py b/sh/coverage-tables.py new file mode 100644 index 00000000000..ce2c4d01565 --- /dev/null +++ b/sh/coverage-tables.py @@ -0,0 +1,91 @@ +#!/usr/bin/env python3 +"""Fail when a `verify-*` skill's Coverage table names code that no longer exists. + +Each row's Code cell is a repo-relative Rust path, then the symbols it covers, +each in backticks; another path starts that file's symbols. Parenthesized notes +are prose and go unchecked. A symbol `A::b` must define `A` and `b` in its file: +an item (`fn`, `struct`, `enum`, ...), a field, or a variant. Lowercase leading +segments name modules and are skipped. A rename or deletion of modelled code +fails here until the table, and so the model's mapping, follows it. + +`--root DIR` checks another tree, for the tests. +""" + +import re +import sys +from pathlib import Path + +TICKED = re.compile(r"`([^`]+)`") +PAREN = re.compile(r"\([^()]*\)") +ITEM = r"\b(?:fn|struct|enum|trait|type|mod|const|static|union)\s+{}\b" +# A field or variant: `name: T`, `Name,`, `Name(..)`, `Name {{`, or `Name` alone. +MEMBER = r"^\s*(?:pub(?:\([^)]*\))?\s+)?{}\s*(?::|,|\(|\{{|$)" + + +def rows(skill: Path): + """Yield (line number, Code cell) for each body row of the Coverage table.""" + inside = False + for number, line in enumerate(skill.read_text().splitlines(), 1): + if line.startswith("## "): + inside = line.strip() == "## Coverage" + continue + if not inside or not line.startswith("|"): + continue + cell = line.split("|")[1].strip() + if cell == "Code" or set(cell) <= set("-: "): + continue + yield number, cell + + +def defines(source: str, name: str) -> bool: + escaped = re.escape(name) + return bool(re.search(ITEM.format(escaped), source) or re.search(MEMBER.format(escaped), source, re.MULTILINE)) + + +def check(root: Path) -> list[str]: + errors = [] + skills = sorted(root.glob(".claude/skills/verify-*/SKILL.md")) + for skill in skills: + where = skill.relative_to(root) + found = False + for number, cell in rows(skill): + found = True + tokens = TICKED.findall(PAREN.sub("", cell)) + source = None + for token in tokens: + if "/" in token: + path = root / token + if not token.endswith(".rs") or not path.is_file(): + errors.append(f"{where}:{number}: `{token}` is not a Rust file in the tree") + source = "" + else: + source = path.read_text() + continue + if source is None: + errors.append(f"{where}:{number}: the Code cell must start with a repo-relative path") + break + if not source: + continue + segments = token.split("::") + for index, segment in enumerate(segments): + if index < len(segments) - 1 and not segment[:1].isupper(): + continue + if not defines(source, segment): + errors.append(f"{where}:{number}: `{token}`: no `{segment}` defined in its file") + if not tokens: + errors.append(f"{where}:{number}: the Code cell names no code") + if not found: + errors.append(f"{where}: no Coverage table") + return errors + + +def main() -> int: + root = Path(sys.argv[2]) if sys.argv[1:2] == ["--root"] else Path(__file__).resolve().parent.parent + errors = check(root) + for error in errors: + print(f"error: {error}", file=sys.stderr) + return 1 if errors else 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/sh/coverage-tables.test.py b/sh/coverage-tables.test.py new file mode 100644 index 00000000000..a74158a9e86 --- /dev/null +++ b/sh/coverage-tables.test.py @@ -0,0 +1,77 @@ +#!/usr/bin/env python3 +"""Check sh/coverage-tables.py against a scratch tree.""" + +import subprocess +import sys +import tempfile +import unittest +from pathlib import Path + +SCRIPT = Path(__file__).resolve().parent / "coverage-tables.py" +SOURCE = """\ +pub enum Restart { + Redial, + Wait, +} +pub struct Reader { + pub(crate) bound: u64, +} +impl Reader { + pub fn sync(&mut self) {} +} +""" +SKILL = """\ +# Verify + +## Coverage + +| Code | Model | +| --- | --- | +| `src/lib.rs` `Reader::sync` (`Unmodelled::thing`), `bound` | `Sync` | +| `src/lib.rs` `Restart::Wait`; `src/other.rs` `run` | `Wait` | + +## Left out +""" + + +class CoverageTablesTests(unittest.TestCase): + def setUp(self): + temp = tempfile.TemporaryDirectory() + self.addCleanup(temp.cleanup) + self.root = Path(temp.name) + self.write("src/lib.rs", SOURCE) + self.write("src/other.rs", "async fn run() {}\n") + self.write(".claude/skills/verify-x/SKILL.md", SKILL) + + def write(self, path, text): + (self.root / path).parent.mkdir(parents=True, exist_ok=True) + (self.root / path).write_text(text) + + def check(self): + return subprocess.run([sys.executable, SCRIPT, "--root", self.root], capture_output=True, text=True) + + def test_items_fields_and_variants_pass(self): + result = self.check() + self.assertEqual(result.returncode, 0, result.stderr) + + def test_a_renamed_function_fails(self): + self.write("src/lib.rs", SOURCE.replace("fn sync", "fn resync")) + result = self.check() + self.assertEqual(result.returncode, 1) + self.assertIn("SKILL.md:7: `Reader::sync`: no `sync` defined", result.stderr) + + def test_a_renamed_type_fails(self): + self.write("src/lib.rs", SOURCE.replace("enum Restart", "enum Policy")) + self.assertIn("no `Restart` defined", self.check().stderr) + + def test_a_moved_file_fails(self): + (self.root / "src/other.rs").unlink() + self.assertIn("`src/other.rs` is not a Rust file", self.check().stderr) + + def test_a_cell_without_a_path_fails(self): + self.write(".claude/skills/verify-x/SKILL.md", SKILL.replace("`src/lib.rs` `Reader", "`Reader")) + self.assertIn("must start with a repo-relative path", self.check().stderr) + + +if __name__ == "__main__": + unittest.main() diff --git a/sh/dispatch.sh b/sh/dispatch.sh index 594b526787e..9f2be7ef1cd 100755 --- a/sh/dispatch.sh +++ b/sh/dispatch.sh @@ -204,6 +204,10 @@ module large_files '' # check; only an explicit --all has none. module migrate '(^|/)MIGRATE\.md$' module text '' +# A verify-* skill's Coverage table against the Rust it names, so a rename +# or deletion of modelled code fails until the table follows it. +module coverage_tables '^(rs/|\.claude/skills/verify-|sh/coverage-tables\.py$)' \ + tools='python3' module toml '' \ tools='taplo' fix module nix '' \ @@ -419,6 +423,7 @@ step() { check:large_files) run sh/large-files.sh "$large_base" ;; check:migrate) [[ "$base" == --all ]] || run sh/migrate.sh "$base" ;; check:text) run sh/text.sh ;; + check:coverage_tables) run python3 sh/coverage-tables.py ;; check:python) files '*.py' '*.pyi' run xargs -0 ruff check --force-exclude <"$listed" From 8a8f8afb6648d63b1e581699fa6468f818416f12 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Tue, 10 Nov 2026 23:43:03 -0800 Subject: [PATCH 4/9] fix(tla): scope Coverage members to their type, and tolerate stray specs and deleted configs A qualified Coverage symbol such as Reader::sync now has to sit in its type's definition or impl blocks, so Mirror::sync no longer hides a rename. sh/tla.sh skips configs deleted from the working tree, ignores TLC's *_TTrace_* specs, and reports an unresolvable config instead of aborting. Co-Authored-By: Claude Opus 5.5 --- sh/coverage-tables.py | 29 ++++++++++++++++++++++++----- sh/coverage-tables.test.py | 8 ++++++++ sh/tla.sh | 19 +++++++++++++------ 3 files changed, 45 insertions(+), 11 deletions(-) diff --git a/sh/coverage-tables.py b/sh/coverage-tables.py index ce2c4d01565..40357b5dc50 100644 --- a/sh/coverage-tables.py +++ b/sh/coverage-tables.py @@ -4,9 +4,11 @@ Each row's Code cell is a repo-relative Rust path, then the symbols it covers, each in backticks; another path starts that file's symbols. Parenthesized notes are prose and go unchecked. A symbol `A::b` must define `A` and `b` in its file: -an item (`fn`, `struct`, `enum`, ...), a field, or a variant. Lowercase leading -segments name modules and are skipped. A rename or deletion of modelled code -fails here until the table, and so the model's mapping, follows it. +an item (`fn`, `struct`, `enum`, ...), a field, or a variant, and `b` must sit +inside `A`'s own definition or `impl` blocks, so a same-named member of another +type does not count. Lowercase leading segments name modules and are skipped. +A rename or deletion of modelled code fails here until the table, and so the +model's mapping, follows it. `--root DIR` checks another tree, for the tests. """ @@ -18,6 +20,8 @@ TICKED = re.compile(r"`([^`]+)`") PAREN = re.compile(r"\([^()]*\)") ITEM = r"\b(?:fn|struct|enum|trait|type|mod|const|static|union)\s+{}\b" +# Where a type's members live: its definition, and each `impl` of it or a trait for it. +OWNER = r"\b(?:(?:struct|enum|union|trait)\s+{0}\b|impl\b[^;{{]*?\b{0}\b)[^;{{]*\{{" # A field or variant: `name: T`, `Name,`, `Name(..)`, `Name {{`, or `Name` alone. MEMBER = r"^\s*(?:pub(?:\([^)]*\))?\s+)?{}\s*(?::|,|\(|\{{|$)" @@ -42,6 +46,19 @@ def defines(source: str, name: str) -> bool: return bool(re.search(ITEM.format(escaped), source) or re.search(MEMBER.format(escaped), source, re.MULTILINE)) +def bodies(source: str, owner: str) -> str: + """Join the brace-matched bodies of `owner`'s definition and `impl` blocks.""" + spans = [] + for match in re.finditer(OWNER.format(re.escape(owner)), source): + depth, start = 0, match.end() - 1 + for end in range(start, len(source)): + depth += {"{": 1, "}": -1}.get(source[end], 0) + if depth == 0: + spans.append(source[start + 1 : end]) + break + return "\n".join(spans) + + def check(root: Path) -> list[str]: errors = [] skills = sorted(root.glob(".claude/skills/verify-*/SKILL.md")) @@ -70,8 +87,10 @@ def check(root: Path) -> list[str]: for index, segment in enumerate(segments): if index < len(segments) - 1 and not segment[:1].isupper(): continue - if not defines(source, segment): - errors.append(f"{where}:{number}: `{token}`: no `{segment}` defined in its file") + owner = segments[index - 1] if index else "" + scope = bodies(source, owner) if owner[:1].isupper() else source + if not defines(scope, segment): + errors.append(f"{where}:{number}: `{token}`: no `{segment}` defined in its {f'`{owner}`' if owner[:1].isupper() else 'file'}") if not tokens: errors.append(f"{where}:{number}: the Code cell names no code") if not found: diff --git a/sh/coverage-tables.test.py b/sh/coverage-tables.test.py index a74158a9e86..12914e525e8 100644 --- a/sh/coverage-tables.test.py +++ b/sh/coverage-tables.test.py @@ -19,6 +19,10 @@ impl Reader { pub fn sync(&mut self) {} } +pub struct Mirror; +impl Mirror { + fn sync(&self) {} +} """ SKILL = """\ # Verify @@ -60,6 +64,10 @@ def test_a_renamed_function_fails(self): self.assertEqual(result.returncode, 1) self.assertIn("SKILL.md:7: `Reader::sync`: no `sync` defined", result.stderr) + def test_a_rename_is_not_hidden_by_another_types_member(self): + self.write("src/lib.rs", SOURCE.replace("pub fn sync", "pub fn resync")) + self.assertIn("`Reader::sync`: no `sync` defined in its `Reader`", self.check().stderr) + def test_a_renamed_type_fails(self): self.write("src/lib.rs", SOURCE.replace("enum Restart", "enum Policy")) self.assertIn("no `Restart` defined", self.check().stderr) diff --git a/sh/tla.sh b/sh/tla.sh index 6386bfee7f5..bb817b9c3b9 100755 --- a/sh/tla.sh +++ b/sh/tla.sh @@ -16,19 +16,26 @@ fi failed=() for cfg in "${configs[@]}"; do - # The directory's spec, or where it holds several, the one the config's name starts with. + # The index still lists a config deleted but not yet staged. + [ -f "$cfg" ] || continue + # The directory's spec, or where it holds several, the one the config's name + # starts with. TLC's trace-exploration output (`*_TTrace_*.tla`) is no spec. dir=$(dirname "$cfg") - specs=("$dir"/*.tla) + name=$(basename "$cfg") + specs=() + for spec in "$dir"/*.tla; do + [[ "$spec" == *_TTrace_* ]] || specs+=("$spec") + done if [ ${#specs[@]} -gt 1 ]; then - name=$(basename "$cfg") + all=("${specs[@]}") specs=() - for spec in "$dir"/*.tla; do + for spec in "${all[@]}"; do [[ "$name" != "$(basename "$spec" .tla)"* ]] || specs+=("$spec") done fi if [ ${#specs[@]} -ne 1 ]; then - echo "error: no single spec in $dir for $cfg" >&2 - exit 1 + failed+=("$cfg: no single spec in $dir") + continue fi lang=${cfg%%/*} finding=false From 862615280013c5cb5ca1e3af05d4af19c2be3018 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Wed, 11 Nov 2026 01:15:37 -0800 Subject: [PATCH 5/9] fix(coverage-tables): keep the owner lookup under the line limit Co-Authored-By: Claude Opus 5.5 --- sh/coverage-tables.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sh/coverage-tables.py b/sh/coverage-tables.py index 40357b5dc50..184e098a1cb 100644 --- a/sh/coverage-tables.py +++ b/sh/coverage-tables.py @@ -87,10 +87,10 @@ def check(root: Path) -> list[str]: for index, segment in enumerate(segments): if index < len(segments) - 1 and not segment[:1].isupper(): continue - owner = segments[index - 1] if index else "" - scope = bodies(source, owner) if owner[:1].isupper() else source - if not defines(scope, segment): - errors.append(f"{where}:{number}: `{token}`: no `{segment}` defined in its {f'`{owner}`' if owner[:1].isupper() else 'file'}") + owner = segments[index - 1] if index and segments[index - 1][:1].isupper() else None + if not defines(bodies(source, owner) if owner else source, segment): + place = f"`{owner}`" if owner else "file" + errors.append(f"{where}:{number}: `{token}`: no `{segment}` defined in its {place}") if not tokens: errors.append(f"{where}:{number}: the Code cell names no code") if not found: From ae5ddcd0b075e8b0c48909631421562fcd098135 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Wed, 11 Nov 2026 11:33:38 -0800 Subject: [PATCH 6/9] fix(sh): attach an impl body only to the type it implements Co-Authored-By: Claude Opus 5.5 --- sh/coverage-tables.py | 21 ++++++++++++++++++--- sh/coverage-tables.test.py | 5 +++-- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/sh/coverage-tables.py b/sh/coverage-tables.py index 184e098a1cb..158770dc2fa 100644 --- a/sh/coverage-tables.py +++ b/sh/coverage-tables.py @@ -20,8 +20,9 @@ TICKED = re.compile(r"`([^`]+)`") PAREN = re.compile(r"\([^()]*\)") ITEM = r"\b(?:fn|struct|enum|trait|type|mod|const|static|union)\s+{}\b" -# Where a type's members live: its definition, and each `impl` of it or a trait for it. -OWNER = r"\b(?:(?:struct|enum|union|trait)\s+{0}\b|impl\b[^;{{]*?\b{0}\b)[^;{{]*\{{" +# Where a type's members live: its definition, and each `impl` whose header `implements` names it. +DEFINITION = r"\b(?:struct|enum|union|trait)\s+{}\b[^;{{]*\{{" +IMPL = re.compile(r"\bimpl\b([^;{]*)\{") # A field or variant: `name: T`, `Name,`, `Name(..)`, `Name {{`, or `Name` alone. MEMBER = r"^\s*(?:pub(?:\([^)]*\))?\s+)?{}\s*(?::|,|\(|\{{|$)" @@ -46,10 +47,24 @@ def defines(source: str, name: str) -> bool: return bool(re.search(ITEM.format(escaped), source) or re.search(MEMBER.format(escaped), source, re.MULTILINE)) +def implements(header: str) -> str: + """The last segment of the type an `impl` header implements, ignoring generics, bounds, and `where`.""" + flat, depth = "", 0 + for char in header: + depth += {"<": 1, ">": -1}.get(char, 0) + if depth == 0 and char != ">": + flat += char + flat = re.split(r"\bwhere\b", flat)[0] + flat = re.split(r"\bfor\b", flat)[-1] + path = re.findall(r"[A-Za-z_][\w:]*", flat) + return path[0].split("::")[-1] if path else "" + + def bodies(source: str, owner: str) -> str: """Join the brace-matched bodies of `owner`'s definition and `impl` blocks.""" spans = [] - for match in re.finditer(OWNER.format(re.escape(owner)), source): + impls = (m for m in IMPL.finditer(source) if implements(m.group(1)) == owner) + for match in sorted([*re.finditer(DEFINITION.format(re.escape(owner)), source), *impls], key=lambda m: m.start()): depth, start = 0, match.end() - 1 for end in range(start, len(source)): depth += {"{": 1, "}": -1}.get(source[end], 0) diff --git a/sh/coverage-tables.test.py b/sh/coverage-tables.test.py index 12914e525e8..0c27dd9fd43 100644 --- a/sh/coverage-tables.test.py +++ b/sh/coverage-tables.test.py @@ -19,10 +19,11 @@ impl Reader { pub fn sync(&mut self) {} } -pub struct Mirror; -impl Mirror { +pub struct Mirror(T); +impl> Mirror where T: Into { fn sync(&self) {} } +impl std::fmt::Debug for Mirror> {} """ SKILL = """\ # Verify From 9c6980b4f3edeab5745f3a79a831de32686d5b09 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Wed, 11 Nov 2026 11:42:38 -0800 Subject: [PATCH 7/9] fix(js/watch): promote the watch rules main fixed back into the passing configs Co-Authored-By: Claude Opus 5.5 --- js/watch/verify/Failover.cfg | 2 +- js/watch/verify/FailoverCrash.cfg | 8 -------- js/watch/verify/Watch.cfg | 4 ++-- js/watch/verify/WatchConnecting.cfg | 5 ----- js/watch/verify/WatchRefused.cfg | 4 ---- 5 files changed, 3 insertions(+), 20 deletions(-) delete mode 100644 js/watch/verify/FailoverCrash.cfg delete mode 100644 js/watch/verify/WatchConnecting.cfg delete mode 100644 js/watch/verify/WatchRefused.cfg diff --git a/js/watch/verify/Failover.cfg b/js/watch/verify/Failover.cfg index 46f421081ba..e896026e35e 100644 --- a/js/watch/verify/Failover.cfg +++ b/js/watch/verify/Failover.cfg @@ -1,8 +1,8 @@ \* Relays as moq-relay runs them: a draining relay sends an empty-URI GOAWAY. -\* OfflineOnlyWhenUnreachable lives in FailoverCrash.cfg while its finding is open. SPECIFICATION Spec CONSTANTS Relays = {1, 2} Redirects = FALSE +INVARIANT OfflineOnlyWhenUnreachable INVARIANT RedialsALiveRelay INVARIANT KeepsReconnecting diff --git a/js/watch/verify/FailoverCrash.cfg b/js/watch/verify/FailoverCrash.cfg deleted file mode 100644 index cbaf03f421e..00000000000 --- a/js/watch/verify/FailoverCrash.cfg +++ /dev/null @@ -1,8 +0,0 @@ -\* Open finding: the viewer's relay crashing shows OFFLINE though the other relay -\* serves the broadcast, so OfflineOnlyWhenUnreachable fails. Once fixed, move -\* the rule into Failover.cfg and delete this file. -SPECIFICATION Spec -CONSTANTS - Relays = {1, 2} - Redirects = FALSE -INVARIANT OfflineOnlyWhenUnreachable diff --git a/js/watch/verify/Watch.cfg b/js/watch/verify/Watch.cfg index ef04fa961d0..cf8940e8c68 100644 --- a/js/watch/verify/Watch.cfg +++ b/js/watch/verify/Watch.cfg @@ -1,4 +1,4 @@ -\* OfflineMeansOffline and RefusalIsExplained live in WatchConnecting.cfg -\* and WatchRefused.cfg while their findings are open. SPECIFICATION Spec INVARIANT NeverFrozenSilently +INVARIANT OfflineMeansOffline +INVARIANT RefusalIsExplained diff --git a/js/watch/verify/WatchConnecting.cfg b/js/watch/verify/WatchConnecting.cfg deleted file mode 100644 index 3ea6404a563..00000000000 --- a/js/watch/verify/WatchConnecting.cfg +++ /dev/null @@ -1,5 +0,0 @@ -\* Open finding: OFFLINE shows while the player connects or the connection is -\* down, so OfflineMeansOffline fails. Once fixed, move the rule into Watch.cfg -\* and delete this file. -SPECIFICATION Spec -INVARIANT OfflineMeansOffline diff --git a/js/watch/verify/WatchRefused.cfg b/js/watch/verify/WatchRefused.cfg deleted file mode 100644 index 9ba30b37f41..00000000000 --- a/js/watch/verify/WatchRefused.cfg +++ /dev/null @@ -1,4 +0,0 @@ -\* Open finding: a refused token shows OFFLINE for good, so RefusalIsExplained -\* fails. Once fixed, move the rule into Watch.cfg and delete this file. -SPECIFICATION Spec -INVARIANT RefusalIsExplained From cb01f7f38a4f5a1e40d07dd644b859b03cee1b28 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Wed, 11 Nov 2026 12:15:34 -0800 Subject: [PATCH 8/9] coverage-tables test: wrap a long line Co-Authored-By: Claude Opus 5.5 --- sh/coverage-tables.test.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sh/coverage-tables.test.py b/sh/coverage-tables.test.py index 1f6dc369a80..3e71d4dc0ae 100644 --- a/sh/coverage-tables.test.py +++ b/sh/coverage-tables.test.py @@ -82,7 +82,8 @@ def test_a_cell_without_a_path_fails(self): self.assertIn("must start with a repo-relative path", self.check().stderr) def test_a_call_is_not_a_definition(self): - self.write("src/lib.rs", SOURCE.replace("pub fn sync(&mut self) {}", "pub fn other(&mut self) {\n sync();\n }")) + caller = "pub fn other(&mut self) {\n sync();\n }" + self.write("src/lib.rs", SOURCE.replace("pub fn sync(&mut self) {}", caller)) self.assertIn("`Reader::sync`: no `sync` defined", self.check().stderr) def test_an_empty_file_fails(self): From 935a77b97c24e46d56b9697c05624bbe4bc80f3b Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Wed, 11 Nov 2026 13:32:28 -0800 Subject: [PATCH 9/9] fix(ci): coverage-tables ignores the > of -> in impl generics Co-Authored-By: Claude Opus 5.5 --- sh/coverage-tables.py | 6 ++++-- sh/coverage-tables.test.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/sh/coverage-tables.py b/sh/coverage-tables.py index 91b4d8574e7..db1090fcf73 100644 --- a/sh/coverage-tables.py +++ b/sh/coverage-tables.py @@ -51,9 +51,11 @@ def defines(source: str, name: str) -> bool: def implements(header: str) -> str: """The last segment of the type an `impl` header implements, ignoring generics, bounds, and `where`.""" - flat, depth = "", 0 + flat, depth, prev = "", 0, "" for char in header: - depth += {"<": 1, ">": -1}.get(char, 0) + if not (char == ">" and prev == "-"): + depth += {"<": 1, ">": -1}.get(char, 0) + prev = char if depth == 0 and char != ">": flat += char flat = re.split(r"\bwhere\b", flat)[0] diff --git a/sh/coverage-tables.test.py b/sh/coverage-tables.test.py index 3e71d4dc0ae..353fb8b4098 100644 --- a/sh/coverage-tables.test.py +++ b/sh/coverage-tables.test.py @@ -16,7 +16,7 @@ pub struct Reader { pub(crate) bound: u64, } -impl Reader { +impl u64> Reader { pub fn sync(&mut self) {} } pub struct Mirror(T);