Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 26 additions & 3 deletions scripts/check-specs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)"
Expand Down
1 change: 1 addition & 0 deletions specs/gha-lifecycle/GATES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
1 change: 1 addition & 0 deletions specs/log-groups/GATES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
1 change: 1 addition & 0 deletions specs/rate-limit/GATES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
1 change: 1 addition & 0 deletions specs/span-tree/GATES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
1 change: 1 addition & 0 deletions specs/sync-bounds/GATES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
1 change: 1 addition & 0 deletions specs/timing-clamp/GATES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
1 change: 1 addition & 0 deletions specs/tui-reload/GATES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Loading