Skip to content

PostgreSQL Stores: no attach; one view, Runs on, and a connection you can edit - #37

Merged
yifanxuaaa merged 3 commits into
layerfs_v2_0_0from
pg-implicit-attach
Nov 17, 2026
Merged

yifanxuaaa merged 3 commits into
layerfs_v2_0_0from
pg-implicit-attach

Conversation

@yifanxuaaa

Copy link
Copy Markdown
Contributor

What changes

LayerFS drops store.attach and store.detach in Ephemeral-AI-Lab/layerfs#733: a PostgreSQL Store's Sandboxes run on any machine that reaches its server. The UI follows.

  • Runs on: each PostgreSQL Store has a default machine, kept by the plugin in <root>/store-machines.json (docker when it exists and runs PostgreSQL Sandboxes, else native). New sessions of its projects start there.
  • Stores, PostgreSQL side: one view, database cards under a thin server header. The Servers and Databases toggle is gone.
  • Connect a database: one dialog; after connecting it runs the check from the Runs on machine.
  • Check from a machine: on demand (store.status --machine), nothing recorded. A failed reach offers to give that machine its own address; a stopped machine says it is stopped.
  • Edit connection: the Store's URL, password reference and synchronous_commit, or one machine's own connection (store.update).
  • Store page: a Connection tab with the connection, Runs on, and the machines that have a connection of their own.
  • Attach and detach are removed from routes, menus, create steps and Health.

Routes: POST /api/stores/:s/connection, GET /api/stores/:s/check?machine=, POST /api/stores/:s/runs-on.

Needs

A LayerFS runtime that has store.update (the LayerFS pull request above). With an older runtime, Edit connection and the check fail.

Checks

  • tsc, node scripts/build.mjs.
  • Unit tests: 687 of 689 pass, 1 skipped. "every pinned CLI call is classified as its kind" fails on home.init, as it does without this change.
  • On the 3080 server, with a runtime built from the LayerFS change over c5751130a3: the PostgreSQL Stores view, Connect a database (wrong port, then right), Check from native and from a running and a stopped docker machine, Runs on change, a Sandbox for a PostgreSQL project on docker, a machine's own connection (two refusals, save, remove), the Store page's Connection tab and a machine page's Stores tab.

Not verified

  • The project-create wizard by clicking through it; project create and Sandbox create were driven through the same routes.
  • The Health page and the Chinese locale.
  • A check from a lima or apple-container machine.

Known gaps

  • The check view finds the failed step by matching LayerFS's message text.
  • The check's host has no port.

🤖 Generated with Claude Code

yifanxuaaa and others added 3 commits November 17, 2026 23:45
… can edit

LayerFS no longer has store.attach and store.detach: a PostgreSQL Store's
Sandboxes run on any machine that reaches its server (LayerFS branch
claude/pg-implicit-attach). The UI follows.

- Each PostgreSQL Store has a "Runs on" machine, kept by the plugin in
  <root>/store-machines.json: docker when it exists and runs PostgreSQL
  Sandboxes, else native. New sessions of its projects start there.
- Stores, PostgreSQL side: one view, database cards under a thin server
  header. The Servers and Databases toggle is gone.
- One Connect a database dialog. After connecting it runs the check from
  the Runs on machine.
- Check from a machine: store.status --machine, on demand, nothing
  recorded. A failed reach offers to give that machine its own address; a
  stopped machine says it is stopped instead.
- Edit connection: store.update for the Store's URL, password reference
  and synchronous_commit, or one machine's own connection.
- Store page: a Connection tab with the connection, Runs on, and the
  machines that have a connection of their own.
- Project create in a PostgreSQL Store: connect, init, runs-on, start the
  machine, open.
- Attach and detach are removed from routes, menus, steps and Health.

Routes: POST /api/stores/:s/connection, GET /api/stores/:s/check?machine=,
POST /api/stores/:s/runs-on.

Needs a LayerFS runtime with store.update. Spec:
docs/specs/layerfs-postgresql-connection.md replaces
layerfs-postgresql-attach.md.

Tests: 687 of 689 pass, 1 skipped; "every pinned CLI call is classified as
its kind" fails on home.init, as it does without this change.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
On a server that already has a Store, the password toggle has three
options, and its segments are all as wide as the longest label. "Same as
<store>" made the toggle wider than the dialog: the note beside it wrapped
one word per line, and in the Type and Reference modes the input was
squeezed to nothing.

- The first option is a fixed short label, "Saved"; no label carries a
  Store's name.
- The sentence naming the Store is the field's hint, under the row at
  full width.
- The toggle wraps under the input when the row is too narrow for both.

Checked on 3080 in the 560 px dialog and a 400 px window, all three
modes: nothing overflows the dialog.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The new-server form was 867 px tall: the URL, then the same host, user
and database again as three more fields, a hint under most of them, and
the machine tiles. It is now 647 px.

- A new server is given as one connection URL, which is required. The
  separate Host and port, User and Database fields are gone; the Store's
  name still defaults to the database's.
- A URL that names no server or no database is refused inline once
  Connect is tried; a password in it is refused as before, now also when
  the scheme is left out.
- On a known server the form still asks only for the database.
- Shorter hints: one line under the URL, the database and Runs on; none
  under the Store name, whose field already shows the default.

Checked on 3080: both forms, an incomplete URL, a URL with a password,
and an unreachable server (LayerFS's refusal shows inline).
Tests: 689, 687 pass, 1 skipped, 1 fails as before this change ("every
pinned CLI call is classified as its kind", on home.init).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@yifanxuaaa
yifanxuaaa merged commit dd444cf into layerfs_v2_0_0 Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant