Repository navigation
feat(store): PostgreSQL Stores run on any machine; store.update replaces attach/detach - #733
Merged
Merged
Conversation
…ces attach/detach A PostgreSQL Store's Sandboxes now run on any machine the support table allows. sandbox.create's own reach check (the server answers, holds this Store, has the project) is the proof; the separate attach step repeated it and added a second record of the same fact. This returns to #536 C4 and keeps H9 (a machine's own URL) as an optional override. - store.attach and store.detach are removed (85 -> 84 calls). - store.update changes a PostgreSQL Store's URL, password reference or synchronous_commit; with --machine it gives that machine its own connection, checked from that machine before it is saved, and --clear removes it. A failed check saves nothing. - store.status --machine runs the check from a machine on demand and records nothing; the answer gains `check`. - The Store record's `machines` holds only own connections (url, password). An old `checked` entry reads as no own connection. - machine.remove no longer refuses for a PostgreSQL Store; it drops that machine's own connections. machine list/get lose `postgresql`. - A stopped machine's check answers its worker's own refusal, which names `machine start`. Tests: api/crates/layerfs-api/tests/postgres_attach.rs is deleted with the calls it drove; postgres_update.rs covers what survives (refusals before any connection, the own connection checked before it is saved, another Store and a limited role refused, live against LAYERFS_TEST_PG_URL). The inventory test that a PostgreSQL Store holds its attached machine is replaced by a_postgresql_store_holds_no_machine. calls_table, sandbox_machines, typed_records and the Node, Python and MCP call lists follow the table. Docs: SDK store and machine pages, control and engine PostgreSQL pages, 2.0.0 versioned guides, the JS SDK skill, generated Node and Python stubs. Production LOC: 187394 -> 187546 (delta +152) Scope and method: tools/production_loc.py at this commit, first parent 6bca861 against the committed tree; core 40408 -> 40408, engine 89386 -> 89386, control 51073 -> 51230, api 6527 -> 6522; reference absent (retired R9c; last counted 65,417 at tree 498dd19). 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.
What changes
A PostgreSQL Store's Sandboxes run on any machine the support table allows.
sandbox.createalready checks that the machine reaches the server, that the server holds this Store and that it has the project;store.attachrepeated that check and kept a second record of it. This returns to #536 C4 (every machine, automatically) and keeps H9 (a machine's own URL) as an optional override.store.attach <store> <machine>before any Sandbox theresandbox.createchecks reach itselfstore.detachmachines.<m>.checkedin the Store recordmachines.<m>holds only{url?, password?}store.update <store> [--url] [--password] [--synchronous-commit]store.update <store> --machine <m> --url …,--clearremoves itstore.status <store> --machine <m>checks now, records nothingmachine.removerefused for an attached StoreThe call table goes from 85 to 84 calls. An existing record's
checkedentries read as no own connection, so no migration is needed.Checks
cargo +1.85.1 fmt --check, Clippy-D warningson layerfs-store, layerfs-machine, layerfs-sandbox, layerfs-control and layerfs-api (with and withoutmachine).postgres_update(including the live case against a PostgreSQL 17 server and a limited role),calls_table,sandbox_machines,inventory,typed_records;tools/check_product_boundary.pypasses.c5751130a3: a Sandbox for a PostgreSQL project started on a docker machine that was never attached; the check passed from native and from the docker worker (store.reach); a machine's own connection was refused for a wrong port and for another Store's database with nothing saved, then saved for the right address and cleared.Not verified
gen-coveragewas not run; the Python stubs were generated from the Node table.Tests removed
api/crates/layerfs-api/tests/postgres_attach.rsgoes with the calls it drove.postgres_update.rscovers what survives.Production LOC
187394 -> 187546 (delta +152): control 51073 -> 51230, api 6527 -> 6522, core and engine unchanged.
tools/production_loc.py, first parent6bca86167fagainst the committed tree.The dsh-layerfs side is Ephemeral-AI-Lab/dsh-layerfs branch
pg-implicit-attach.🤖 Generated with Claude Code