verify-row-life
Check RowLife.tla, a queue row's status and go; use when changing work.status, queue.MOVES, queue.derive or the go verbs.
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- verify-row-life
- paths
- features/jbus/spec/RowLife.tla, features/jbus/src/jbus/work.py, features/jbus/src/jbus/queue.py, features/jbus/src/jbus/restated.py, features/jbus/src/jbus/dispatch.py, features/jbus/src/jbus/watch.py, features/jbus/src/jbus/asks.py, features/jbus/src/jbus/reverts.py
- description
- Check RowLife.tla, a queue row's status and go; use when changing work.status, queue.MOVES, queue.derive or the go verbs.
03 SKILL.md 正文
verify-row-life
features/jbus/spec/RowLife.tla follows one row of jbus's queue from jbus queue add to its end, in two regions at once: the status a pass derives from the facts (work.status, written by queue.derive), and the go the verbs move (_grant, _hold, _lift, _void).
- The rule,
FinalStays: a row that is over stays over; adonerow may only becomemerged, and amergedone stays so but for one reland per merge a revert took back. - The harm if it breaks: the queue,
watch.finaland jmerge all readwork.over, so a row seen over and then not is launched, merged or judged again. - The table:
queue.MOVESis each change of status one step of TLC's graph of the spec makes, so a pass marks"legal": falseonly a fault.
It holds because queue.derive keeps the status of a row that is over (work.kept), so the check is of the code's derive and not only of the table.
The record
Model: features/jbus/spec/RowLife.tla
Sync: d3f642c80a2c52ebbf134aa981d95894e892201a
Covers:
features/jbus/src/jbus/work.py:status,kept,over,FINAL,PATTERNS,VALUESfeatures/jbus/src/jbus/queue.py:MOVES,derive,_grant,_hold,_lift,_void,_take_out,_launching,relandfeatures/jbus/src/jbus/asks.py:_asksfeatures/jbus/src/jbus/restated.py:restatefeatures/jbus/src/jbus/dispatch.py:Turns.takefeatures/jbus/src/jbus/watch.py:gone,unwritten,KNOWN,unlandedfeatures/jbus/src/jbus/reverts.py:reland
The first sync, 228c1436c, read the model against each of these, step by step: every pattern of ValueOf against work.PATTERNS in order, StatusOf against work.status, Kept against work.kept, the go verbs, remove's guard (out in asks._asks, _launching), and the launch's approved and depends guards in Turns.take.
At this sync, main's tip when this branch last took main in, the four covered changes since were read against the model.
#1720 (7e68838af) and #1759 (d3f642c80) changed the model with the code: Moves is queue.MOVES move for move, StatusOf gives a launched row whose thread is none, missing or settled stale and an unlaunched one queued, as work.status and _THREAD do, and a launch derives with a starting thread, as watch.gone leaves it.
#1726 (ee2657c3a) changed only the order a pass launches in (queue.order, Turns.take's ranking), which the model does not follow.
#1724 (1bf7b41df) changed work.PATTERNS, and the upkeep below changed the model with it.
features/jbus/tests/test_rowlife_spec.py passed there (6 passed).
features/repo-guards/tests/test_model_sync.py fails when a file or name above is gone.
Move Sync: forward only after you read every change to these files since it against the model, as /maintain-formal-verification-skill says, and never because the check passes.
Does a change touch it
Rerun it when the diff touches a file of the record, a new writer of a row's status or go, or docs/jbus/row-moves.md.
features/jbus/tests/test_rowlife_spec.py also fails when queue.MOVES and the status edges of TLC's graph differ, or when work.VALUES gains a value the spec neither has nor names as joined.
Run it
uv run pytest features/jbus/tests/test_rowlife_spec.py -q
It runs TLC in a copy of the spec folder and prints 7 passed in a few seconds; it skips where no Java runs TLC.
The bare TLC command is in features/jbus/spec/RowLife.md, "Check the rule"; run it in a copy of the folder, since TLC writes states/ where it runs.
- Bounds: one row, a scout's or a crewmate's,
Fault = "none", 12716 distinct states,TypeOKandFinalStays. - The canaries:
Fault = "no-latch"takeswork.keptout, andFinalStaysbreaks (test_a_derive_that_writes_over_a_final_status_breaks_the_rule);Fault = "any-hand-over"lets the hand-over take a crewmate's done row, andFinalStaysbreaks (test_a_hand_over_of_a_crewmates_done_row_breaks_the_rule);Fault = "settled-queued"gives a settled thread's rowqueuedagain, and its graph has status edgesqueue.MOVESlacks. - Assumptions: a fact's change and the pass that sees it are one step (no restate drift between passes, no one-source pass); the facts are folded (an open pull request's eight steps are
check,quietisworking); no clock, sowatch.unwritten's stale to left is out; a scout's row only as far as its role and the hand-over, and nomerge_after. The rest is in the README's "What the model leaves out".
A real bug or a modeling error
Each step of a trace must be a move the code makes.
Replay it against the record's files: a fact's change is one input work.status reads, the pass is queue.derive, and a go step is the verb of queue.py its name gives.
A step no code makes is a modeling error, and the model is what gets fixed.
When every step is backed, it is a bug: tell it as the row's moves in the code's words, and leave the rule as it is.
Change the model when the code changes on purpose
- A new status or value: add it to
ValueOfandStatusOfin the order ofwork.PATTERNS, then rerun. - A new move in
queue.MOVES: the test fails until the spec's graph makes it. - A new writer of the status: model it as a step, or say in the README why it moves nothing.
- Show a changed rule failing on a scratch break before you trust a pass: take the guard out in your own worktree, uncommitted, see the trace,
git restorethe file.
The last upkeep
/maintain-formal-verification-skill ran at 228c1436c (st-model-upkeep-run) and fixed two drifts in the model:
- Remove's guard followed
Moves, which names the removals seen and guards none; it now followsoutinasks._asks: no thread at work, no open or merged pull request. Adonerow may be removed, soFinalStayslets adonerow leave for good asremoved(queue.py's doc: "removetakes a row out for good";rows.remove(row)), and a removed row stays removed. Old:status \in Final => status' \in Final; new:status \in Final => status' \in Final \cup {"removed"}, andremovedstays. The break: dropping the merged guard lets a merged row be removed, andFinalStaysfails. - An add's new depends:
Dependsmoves an approved row between free and behind with its line unchanged (restated.restatekeeps an approved facet beside another), andPasswrites the line again with no fact changed.
The row was then rebased onto st-model-sync, whose merge of main brought main to 8f4c21b6f, and the upkeep diffed the covered code again from 228c1436c to it: #1724 drifted the model: a thread at work with no pull request is now at work whatever its last Result says (work.py's WORKING, and the leftover pattern's apart), so ValueOf reads a leftover of a thread at work with no pull request as working, and every rule still holds with each canary breaking its rule.
#1726's order (queue.order, Turns.rest) is not in what this model covers.
The sync commit moved there.
st-model-sync then merged main again, to 2fb4e2587, and the row was rebased onto it; the upkeep diffed the covered code from 8f4c21b6f: #1720 made queue.MOVES hold every move work.status makes and added MovesKnown here, guarding Remove by Moves as before.
With this row's Remove, which follows asks.out, MovesKnown broke at once (queued, then gate on a question, then removed), since a removal is the remove verb's, which derive never judges (queue.py's MOVES docstring); MovesKnown now judges every move but a removal, and both rules hold over 2502 distinct states with each canary breaking its rule.
The sync commit moved there.
st-model-sync then merged into main as #1734, and the row's own commits moved onto main at cf26d3e5f, where #1759 had moved the sync to d3f642c80 with the model: its stale launch and settled-queued canary stand beside this row's Remove, ValueOf and MovesKnown, and both rules hold with each canary breaking its rule.
st-code-conforms then took main in at 74f067be2.
There queue.MOVES is the graph's status edges, so Moves and MovesKnown are gone, and remove refuses a row that is over (queue.py {verb.slug} is {row['status']}, and a row that is over stays).
So Remove guards on status \notin Final \cup {"removed"} alone, and FinalStays is again status \in Final => status' \in Final.
remove's other refusals, a thread at work, an open or merged pull request, a launch with no answer yet, read T3 Code and GitHub at the verb, not the facts a pass last saw, so the spec leaves them out (RowLife.md's "What the model leaves out"), and the graph keeps each removal a replayed log can show.
Depends, Pass and #1724's ValueOf stand, and FinalStays holds over 3092 distinct states with each canary breaking its check.
st-hand-over-line then gave the row a role, scout or crew, and a HandOver step, the add of a crewmate's brief over a scout's done row, which queue._hand_over writes as a line marked handed.
FinalStays lets a scout's done row leave only by it (status' \in Final \/ (role = "scout" /\ role' = "crew")), and holds over 6184 distinct states with each canary breaking its check.
reverted-row-reland then gave the row a reverted fact and a Reland step: once the revert jbus opened of a merged row's merge merges, reverts.reland moves the row from merged to left with a line marked reverted, and watch.unlanded reads that merge as no merge of the row's, so its pull request reads as closed or none and the row's redo goes the normal path.
FinalStays lets a merged row leave only by it, once (Reopened == ~reverted /\ reverted'), queue.MOVES holds merged to left, and the rule holds over 13256 distinct states with each canary breaking its check.
The Sync line stays where it was: this row read only its own change against the model.
reverted-row-reland-twice then let a redo's merge be taken back too: queue.reland refuses only the merge the row's reverted column names, and the model's reverted goes back to false once the row reads a merge anew (Derive), so a revert of the redo's merge is a second Reland.
FinalStays keeps Reopened == ~reverted /\ reverted', which now allows one reopen per merge, and holds over 12716 distinct states with each canary breaking its check; test_jbus_reverted_row_reland.py replays a row's two relands.
The Sync line stays where it was: this row too read only its own change against the model.
04 同仓库更多 Skills
no-key
A skill its skills.json lists as hidden that a model may still call by itself, kept broken so the lint is seen to catch it.
fake-skill
A FAKE skill in a FAKE tree, named for its folder until the test renames the folder.
extra-key
A skill its skills.json does not list as hidden that a model still cannot call, kept broken so the lint is seen to catch it.
unslop
Cut AI tells from writing. Use when the user says text reads like AI, asks to unslop it, or before prose ships to people.
technical-writing
Write or review docs, READMEs, RFCs, PR descriptions and commit messages to a layered standard: Diataxis structure, Google developer style, STE rules and Global English.
why
Find why code is the way it is, from its history and every evidence source this session can query, with citations. Use for 'why does X work this way', 'why did we pick Y', regressions and postmortems. Use how for runtime behavior.