Repository navigation
lab/server: Slice 3 durable control plane (#131) - #483
Merged
Merged
Conversation
SQLite (stdlib sqlite3) becomes the source of truth for leases, request records, tickets and events: migrations by PRAGMA user_version, an owner-only file, and every change in one BEGIN IMMEDIATE transaction. acquire/renew/release with opaque tokens (TTL 1200 s; agent_running never expires), a UI Start/Stop in state.json revokes agent leases into a user lease that only the operator CLI ends, idempotent (client, tool, request_id) records, next_events with durable cursors, request_status, restart reconciliation, and compaction that keeps active cursors and unresolved tickets. Tests cover restarts, racing threads and processes, kills mid-write, stable retries and gap-free catch-up. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
dayfine
added a commit
that referenced
this pull request
Nov 14, 2026
Moves the seven open questions to settled with their recommended answers, writes the nine answers from the 2026-11-14 implementation review into the resources, lease, tool and slice text, corrects the legacy Lab/state fields and what 7c44e72 does, and records Slices 0-3 as built (#478, #481, #482, #483) and Slice 4 as approved on PokemonAutomation#1881's branch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
…e allowlist, lease column check, roadmap refs out of docstrings
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.
Depends on #482
Base
lab/server-slice2; the diff shows only Slice 3 of #131.The lab server had no memory: a lease was only inferred from the app's last transition, so a user lease was lost on app restart and nothing kept request results or event cursors. This adds the durable control plane in SQLite (stdlib
sqlite3): migrations, leases (acquire_console/renew_console/release_console, TTL 1200 s,agent_runningnever expires), a UI Start/Stop turning into auserlease that only the operator CLI (python3 -m pa_lab lease ... release-user) ends, idempotent request records withrequest_status, tickets,next_eventswith durable cursors, restart reconciliation, and compaction that keeps every active cursor and unresolved ticket. Every change is oneBEGIN IMMEDIATEtransaction, so racing clients or a restarted daemon cannot both win. Tested withpython3 -m unittest discover -s lab/server/tests -t lab/server(119 tests: db, control, control_concurrency with racing threads/processes and kills mid-write, control_mcp end to end); no console was touched.Contract gaps for #131's owner (v1 contracts in #478 left unchanged):
lease_changedcarries an extrareasonfield the contract does not name; there is no refusal code for a cursor behind compaction (sent asinvalid_arguments, fieldafter_seq) nor for an operator-only action; there is no ticket kind (tickets arependingrequest records); and theacquire_consoleresult shape (lease_token,expires_at,ttl_s) is not frozen.🤖 Generated with Claude Code
https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss