From 72d31b243af4d0c51dc2895936b270e7f6ad9b7a Mon Sep 17 00:00:00 2001 From: Stefan Penner Date: Fri, 10 Jul 2026 17:02:38 -0600 Subject: [PATCH] check-specs + GATES: first-class Rust peer on agent day-path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - check-specs runs Go↔Rust name parity and cargo duals before TLC - each per-core GATES.md cites gates::* symbols (same Decision.tla) --- scripts/check-specs.sh | 29 ++++++++++++++++++++++++++--- specs/gha-lifecycle/GATES.md | 1 + specs/log-groups/GATES.md | 1 + specs/rate-limit/GATES.md | 1 + specs/span-tree/GATES.md | 1 + specs/sync-bounds/GATES.md | 1 + specs/timing-clamp/GATES.md | 1 + specs/tui-reload/GATES.md | 1 + 8 files changed, 33 insertions(+), 3 deletions(-) diff --git a/scripts/check-specs.sh b/scripts/check-specs.sh index 40d53fd..2cfdbc4 100755 --- a/scripts/check-specs.sh +++ b/scripts/check-specs.sh @@ -15,11 +15,11 @@ # # Toolchain: # Prefer `tlc` on PATH (dotai CLI). Else fall back to java -cp tla2tools.jar. -# Order: SSOT wires + *spec duals first (fast), TLC last (slow). +# Order: SSOT wires + *spec duals + Rust peer first (fast), TLC last (slow). # Does not re-codegen by default — use //tools/decision:update. # -# Without TLC toolchain: still runs wires/duals; skips model-check (exit 0 if -# those pass). Green TLC at these bounds = strong bug hunt, not proof. +# Without TLC toolchain: still runs wires/duals/Rust parity; skips model-check +# (exit 0 if those pass). Green TLC at these bounds = strong bug hunt, not proof. # # Usage: scripts/check-specs.sh [spec-name ...] # default: all specs @@ -231,6 +231,29 @@ else echo "go not on PATH — skip dual package tests" fi +# Rust peer (same Decision.tla SSOT): name parity + duals when tools present. +echo +echo "--- rust peer (Go↔Rust parity + cargo duals) ---" +if [ -x "$REPO_ROOT/scripts/gen-decision-rust.sh" ]; then + if ! "$REPO_ROOT/scripts/gen-decision-rust.sh" --parity-committed; then + fail=$((fail + 1)) + fi +else + echo "scripts/gen-decision-rust.sh missing — skip parity" + fail=$((fail + 1)) +fi +if command -v cargo >/dev/null 2>&1; then + if ! env CC=cc RUSTFLAGS='-C linker=/usr/bin/cc' \ + cargo test -p decision_cores --quiet; then + echo "cargo test -p decision_cores FAIL ✗" + fail=$((fail + 1)) + else + echo "cargo test -p decision_cores ok" + fi +else + echo "cargo not on PATH — skip rust duals" +fi + if [ "$SKIP_TLC" -eq 1 ]; then echo echo "specs: $pass ok (TLC skipped), $fail failed (SSOT/duals)" diff --git a/specs/gha-lifecycle/GATES.md b/specs/gha-lifecycle/GATES.md index c4f436e..bb63ed6 100644 --- a/specs/gha-lifecycle/GATES.md +++ b/specs/gha-lifecycle/GATES.md @@ -13,4 +13,5 @@ Load this for code changes. Full TLC for multi-attempt runs: `GhaLifecycle.tla`. Skip/cancel filter stays in production (outside decision domain). **Rule:** pending never failed; queue only non-pending (and not skipped/cancelled). +**Rust peer:** `gates::is_job_pending` / `counts_failed` / `counts_queue` → `gha_lifecycle`. **Check:** `scripts/decision-check.sh` diff --git a/specs/log-groups/GATES.md b/specs/log-groups/GATES.md index d23874e..0780e24 100644 --- a/specs/log-groups/GATES.md +++ b/specs/log-groups/GATES.md @@ -12,4 +12,5 @@ Load this for code changes. Full TLC for timestamps/gaps: `LogGroups.tla`. Production `splitGroups` uses unbounded (maxDepth=0). **Rule:** never underflow depth (stray endgroup is no-op). +**Rust peer:** `gates::can_open_group` / `can_close_group` → `log_groups` module. **Check:** `scripts/decision-check.sh` diff --git a/specs/rate-limit/GATES.md b/specs/rate-limit/GATES.md index 5bb41dc..2013bce 100644 --- a/specs/rate-limit/GATES.md +++ b/specs/rate-limit/GATES.md @@ -11,4 +11,5 @@ Load this for code changes. Full TLC only for multi-goroutine races: `RateLimit. **SSOT:** production `rateLimitWaitNeeded` calls generated `WaitNeeded`. **Rule:** after sleep, recheck; do not fire blind while still exhausted. +**Rust peer:** `gates::rate_limit_wait_needed` → `rate_limit` module. **Check:** `scripts/decision-check.sh` diff --git a/specs/span-tree/GATES.md b/specs/span-tree/GATES.md index 84eb864..b6aca6c 100644 --- a/specs/span-tree/GATES.md +++ b/specs/span-tree/GATES.md @@ -10,4 +10,5 @@ Load this for code changes. Full TLC for pipeline/cycles: `SpanTree.tla`. **SSOT:** twin shape runs generated `DedupChoose`; drop API when `kept=="runner"`. **Rule:** when group is exactly {1 API, 1 runner}, drop the API span. +**Rust peer:** `gates::drop_api_for_runner_twin` → `span_tree` module. **Check:** `scripts/decision-check.sh` diff --git a/specs/sync-bounds/GATES.md b/specs/sync-bounds/GATES.md index df76079..a4ff710 100644 --- a/specs/sync-bounds/GATES.md +++ b/specs/sync-bounds/GATES.md @@ -10,4 +10,5 @@ Load this for code changes. Full TLC for multi-run sync: `SyncBounds.tla`. **SSOT:** production `acceptJobsAttempt` calls generated `AcceptAllowed`. **Rule:** accept if `incoming==0` (unknown) or `incoming==stored`. SQL is atomic twin. +**Rust peer:** `gates::accept_jobs_attempt` → `sync_bounds` module. **Check:** `scripts/decision-check.sh` diff --git a/specs/timing-clamp/GATES.md b/specs/timing-clamp/GATES.md index 9f92c96..fef474f 100644 --- a/specs/timing-clamp/GATES.md +++ b/specs/timing-clamp/GATES.md @@ -9,4 +9,5 @@ Load this for code changes. Full TLC for pipeline faults: `TimingClamp.tla`. **SSOT:** production calls generated `DoClamp` (not a hand formula). +**Rust peer:** `gates::clamp_span_to_parent` → `timing_clamp` module. **Check:** `scripts/decision-check.sh` diff --git a/specs/tui-reload/GATES.md b/specs/tui-reload/GATES.md index c6df2ef..df5fb91 100644 --- a/specs/tui-reload/GATES.md +++ b/specs/tui-reload/GATES.md @@ -10,4 +10,5 @@ Load this for code changes. Full TLC only for race redesign: `TuiReload.tla`. **SSOT:** production calls generated `CanFetchAccept` (after msg job match). **Rule:** accept only if job matches in-flight and `msgGen == reloadGen`. +**Rust peer:** `gates::log_fetch_result_fresh` → `tui_reload` module. **Check:** `scripts/decision-check.sh`