Repository navigation
fix: close the races that the new TLA+ models found, and add the models - #11
Merged
Merged
Conversation
A lease renewal that failed before the start was confirmed left a cancel in the adapter that no turn took. When the task was leased again, the adapter cancelled its turn at the start, and the task ended as unknown_result although no agent turn ran. run_execution now calls Agent::forget after the renewal thread stops. ExecutionLease.tla models the kept cancels and the single cancel of the renewal thread, and checks NoSpuriousCancel. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…rosters and admin changes DirectInvite, Admission, EventPaging, ConnectedAgent, ManagedRoster and PendingChange. specs/README.md lists what each model checks and each property that TLC finds false, with the reason. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Invites: one sign_direct_invite call at a time. Admission: per-peer limit by endpoint, no early replay eviction, node-made IDs on a task ID clash. Connected agent: no cancel before its task, no turn on a connection that is over, no cancel kept after its turn. Outbox: follow reads to the last event page. Rosters: a revoke stays, a resolved record is for the agent asked for, directory sync skips a record it cannot use, a revoked record cannot be published again. Admin: MCP policy changes that widen access need confirmation, and a change is stored with its revision and audit record before it goes live. Each model now checks the property that was false. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Only four node protocols had a TLA+ model. This adds models for the rest of the core (connecting, admission, reading a task's events, the agent socket, rosters, local administration) and fixes what TLC found with them. Every property that the code is meant to keep is now checked.
What changes
Six new models:
DirectInvite,Admission,EventPaging,ConnectedAgent,ManagedRoster,PendingChange.ExecutionLeaseis back in line with the cancel code.specs/README.mdlists what each one checks.The fixes, by model:
ExecutionLeaseAgent::forget, called when a run endsDirectInvitesign_direct_invitecalls for one person undid each otherSIGNINGininvites.rs)Admissioncountgoes by the caller's endpointAdmissionOverloaded;REPLAY_LIMITis 2408, all that the rate limit lets through in one TTLAdmission018_task_caller_ids)ConnectedAgentrun_turnholds thependinglock until the task line is written;Turns::close;EarlyCancels::enddrops the kept cancelEventPagingfollowstopped before the last page of eventsfollowreadsaetherMoreEventsManagedRosterrevoked_atManagedRosterrequest_via_directorytook a record of another agentvalidate_resolvedcompares the agent IDManagedRosterManagedRoster006_directory_record_marks)PendingChangeUpdatePolicysaved a workspace or a higher limit with no confirmationPendingChangePendingChangequeue_changeremoves expired rowsBehaviour that changes for an owner or an agent:
aether.settings.update_policyanswersstatus: "pending"when it changes the task folder root or raises a limit.Look at:
keep_changeincrates/aether-store/src/admin.rsandapply_now/settleincrates/aether/src/admin.rs;own_idsincrates/aether-store/src/tasks.rs;run_turnandserveincrates/aether/src/agent/connected.rs.Evidence
mise run tla: all ten models pass, 4 min 55 s in total.mise run fmt,mise run lint: pass.mise run test: passes (429 unit tests inaether, 75 inaether-store, 96 feature scenarios).settle), and the ID mapping ina2a_transport.rs(the store half is tested). The models cover both paths.mise run server-test, the hub-side features and the container proofs. No Elixir file changes.ConnectedAgenthas one task ID;ManagedRosterhas a directory log of three events (a run with four passed for the invariants only);Admissionhas one data value. The models do not read the code.Merge danger
Door: one-way
Blast radius: every node and control service that upgrades
Two migrations add a column pair to the node's
taskstable and a table to the control store; an older binary on an upgraded store was not tested. The wire formats do not change, so a node from this branch talks to released nodes and the hub as before. An MCP client that raised limits throughupdate_policynow has to wait for the owner.mise run checktakes about 5 minutes longer because of the models.🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.