Repository navigation
ci: model-sync checks (models track the code) - #260
Conversation
🤖 Codex Code Review
All 27 existing self-tests pass; both gaps were reproduced separately. Automated review by OpenAI Codex · gpt-6.1-sol · custom prompt |
🤖 Gemini Code ReviewOverall, this is a well-structured and well-tested addition for keeping the TLA+ models, trace specs, and Rust implementation in sync. A few minor issues and edge cases found in the script and docs:
|
🤖 Claude Code ReviewPR #260 review: model-sync CI checkThis PR adds no Rust runtime code, so actor lifecycle and concurrency concerns don't apply. My review covers the Python checker, the map, and the workflow. Overall it is well structured: the checks fail closed when the script cannot tell, there are negative-control tests, and it uses only the standard library. I found a few correctness gaps. Correctness1. return None, f"{rel} exists but no recorded event reaches it"This
2. Action arguments that mix literals and non-literals pass silently ( The check collects every string literal anywhere in the argument span. Two cases slip through:
A stricter check would accept only argument spans whose masked text, with literals and 3. Deleting Removing only the attribute line produces a single
4. Coverage floor counts every baseline entry, not action keys ( The docs and the map comment say the floor is the number of 5. False positives in the struct-literal check ( Destructuring outside
Also, Weaknesses in what the check enforces
Robustness
Workflow
The Docs
Suggested tests
Automated review by Claude · claude-opus-5-5 · custom prompt |
🤖 DeepSeek Code ReviewThe PR mostly adds CI/scripts for model sync. The overall approach is reasonable, but the Python scanner has a few correctness issues worth fixing before relying on this in CI.
Overall this is a useful enforcement layer, but fixing the Automated review by DeepSeek · deepseek-v4-pro · custom prompt |
🤖 Grok Code ReviewThe model-sync gate is well tested and fail-closed in the common cases. It does not touch actor runtime code, so lifecycle, ordering, and cancellation concerns do not apply. A few holes let the check pass while models still drift, and one scanner bug can hang the job. Bypass / correctness
elif c == "'":
if src.startswith("\\", i + 1):
j = src.find("'", i + 3)
blank(i + 1, j)
i = j + 1
Smaller gaps
Tests cover the happy path, waiver, placeholder reason, and coverage-floor regression well. Add cases for a shrunk Automated review by Grok (xAI) · grok-4.7 · custom prompt |
edf5342 to
ed46d11
Compare
🤖 Kimi Code ReviewFindings
Automated review by Kimi (Moonshot AI) · kimi-k3.1-pro · custom prompt |
ed46d11 to
cb1aa77
Compare
cb1aa77 to
43f14c8
Compare
…ment-only model edits, robustness)
43f14c8 to
39ac3f9
Compare
Models track the code: a PR that changes modelled behaviour updates the TLA+ model in the same PR. Two mechanical checks enforce it, in a new
model-syncjob (.github/workflows/model-sync.yml, a new file; no existing workflow changed).1. Paths (
scripts/check-model-sync.py paths).verification/model-map.tomlmaps code to the models covering it (Lifecycle: actor loops,actor_cleanup,link,monitor,child_handle,mailbox*; Supervision/Cohorts/NestedSupervision:supervision.rs,supervision/**; Coordinator:system.rs; DeferredReplies/DeferredJobs:reply/**,*/jobs.rs;lifecycle_trace.rs→ every traced model). A PR changing a mapped file without touching any covering model (model, MC configs,*Ind, coverage or trace modules) fails, unless:#[cfg(test)] mod(anything the script cannot classify needs the waiver);no-model-changelabel AND a body lineModel: no change because <reason>.It passes on
merge_group(the PR run enforced it). It re-runs onlabeled/unlabeled/edited.2. Trace events (
scripts/check-model-sync.py events). Every action string the code passes toEvent::new/Event::sup/TreeEvent::new(and, once #240 lands,LifeEvent/JobEvent/reply events, pre-configured) must be ane.a = "..."arm of its trace spec, or declared translated (trace_check.pymust mention it) or rejected (Unmodelled). It also fails on non-literal action names, an unconfigured*Eventstruct, or a cohort filter list (COHORT_EVENTS,cohort_trace.rs) that differs fromTraceCohorts.tla. Warnings: spec arms no code emits; modelNextactions no trace spec takes (except declared unlogged ones:WindowExpire,Deliver). The events are&'static str, not an enum, and the mapping lives in TLA+, so this is a source scan rather than an exhaustivematch. Turning them into an enum would rewritesupervision.rs, which conflicts with #240.3. Models checked against real runs (
check-model-sync.py models). Every model inverification/tlaneeds a map entry and trace validation, meaning aTrace*.tlathattrace_check.pyruns and that recorded events reach. Otherwise it needs atlc_onlyallowlist entry withreasonandtracking. TLC-only today: Coordinator (abstract fault model, no events recorded), Lifecycle, DeferredReplies and DeferredJobs (their trace validation is on #240; a warning asks to drop the entries once it merges) and DynamicSupervisor (pre-allowlisted for #245).4. Coverage floors.
coverage_floorper trace-validated model is the number of action keys incoverage-baseline.json: Supervision 36/40, Cohorts 40/46, Nested 11/11. The existingtlajob fails when a baseline key is lost. This check fails when the baseline shrinks below the floor, so coverage only grows.Checked against the #240 and #245 trees with this map unchanged:
eventsandmodelspass on both. On #240,pathsflagssystem.rs(Coordinator unchanged).Self-tests:
scripts/tests/test_model_sync.py(27 tests: injected unmapped, branch and non-literal events, an unconfigured struct, filter drift, a ghost arm warning; path failures and passes on a temp git repo, covering comment-only and test-module changes, the label and reason pair,merge_groupand an Actions event payload). Runs under Python 3.9 (a TOML subset fallback) and in thefeature-checkunittest discovery.Docs: TESTING (verification layers row + "Model sync"),
verification/tla/README.md, ROADMAP "Verification rule".model-syncis a required-check candidate. It is not added to the ruleset.Model: no change because this PR only adds CI checks and docs.