Skip to content

feat(ledger): a layout number, written at creation and checked at open, replaces the shape checks - #281

Merged
rami-hatoum merged 3 commits into
mainfrom
feat/the-ledger-carries-a-layout-number
Oct 22, 2026
Merged

rami-hatoum merged 3 commits into
mainfrom
feat/the-ledger-carries-a-layout-number

Conversation

@rami-hatoum

Copy link
Copy Markdown
Contributor

What this changes

Before launch nothing stored is carried over: a ledger made in another layout of its tables is refused at start, and the person deletes it. Until now that rule was enforced table by table, for the content tables and kept_secrets alone, by comparing their columns with the columns this server keeps, while every other table and index the ledger makes was created with IF NOT EXISTS and never checked, and a refusal named columns, which nobody can act on.

Now one number names the layout of everything the ledger makes.

  • ledgerLayout is one constant in the ledger, raised by hand with any change to a table or an index the ledger itself creates. A test pins the catalog of a fresh SQLite ledger, every table and index that is the ledger's own with its statement, Emmett's left out as its own schema's concern, and fails in words that say to raise the number and pin again, so a change to the layout cannot pass unnumbered.
  • Written once, at creation, before any table. SQLite keeps it in PRAGMA user_version, as the first step of the store's migrate; PostgreSQL in the one row of ledger_layout, inside Emmett's migration transaction right after the advisory lock is taken, so servers that start together agree and a refusal rolls everything back.
  • One rule at every open. A database in the layout kept opens, and what it lacks is created as before. A database with no number and no table at all is new: it is given the number. A database in another layout, or one that holds tables but no number, is refused as LedgerLayoutRefused, which carries the layout found, or none, and the layout kept. The per-table column checks and the test fakes that answered column queries are gone.
  • The server says it in its own words, as before: where the ledger is kept, that it was made by another version of Auto Runtime, which keeps the ledger in layout n and cannot read a ledger in layout m, or one that carries no layout number, then what to do and where to ask. The terminal notice ends with the help line.
  • The docs no longer promise a migration. The self-host pages say that a release which keeps the ledger's layout opens it as it is, and that before launch one which changes it refuses the ledger and says what to delete, or to point DATABASE_URL at an empty database.

Every ledger made before this release carries no number, so the first start on it refuses it with the notice that names the files to delete, or the database to empty. The word is layout, since shape names the JSON Schema of a definition's output and version names the runtime's release in the same sentence.

Tests

  • The layout behaviour runs on both stores: a new database is given the number and opens again in it; a database in another layout is refused with the layout found and kept, in the refusal's words, and left as it was; a database that holds a table but no number is refused the same way and left as it was.
  • The pin test fails, with its own words, when a column is added to kept_secrets.
  • The PostgreSQL hook is covered on fakes without a database, and the ledger's suite ran against PostgreSQL 18 with and without the connection URL at 100% coverage.
  • The server's tests that start a real runtime on a ledger of another layout read what it prints, in a terminal and as a server.

Checklist

  • The PR title is a conventional commit with a workspace scope, such as feat(reasoning): .... It becomes the squash commit and the changelog entry.
  • pnpm check passes locally, with every file at 100% coverage.
  • I've signed the Contributor License Agreement (the CLA bot asks on your first PR).

rami-hatoum and others added 3 commits October 21, 2026 21:40
…n, replaces the shape checks

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…e the layout found and kept

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…t refuses the older ledger

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@rami-hatoum
rami-hatoum merged commit a48be0e into main Oct 22, 2026
20 checks passed
@rami-hatoum
rami-hatoum deleted the feat/the-ledger-carries-a-layout-number branch October 22, 2026 07:26
rami-hatoum pushed a commit that referenced this pull request Oct 22, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.17.0](v0.16.0...v0.17.0)
(2026-10-22)


### Features

* **api:** the instructions and the playbook tools claim a request for a
playbook ([#288](#288))
([e4e6f86](e4e6f86))
* **connections:** a client names the scopes it may ask, and a way takes
the one covering its scope
([#289](#289))
([e05a127](e05a127))
* **connections:** a connect link names what its page cannot know, and
the agent shows it as a link
([#290](#290))
([8d1de91](8d1de91))
* **definitions:** the overview is its author's markdown, and a read
names what uses a definition
([#287](#287))
([7c1c637](7c1c637))
* **ledger:** a layout number, written at creation and checked at open,
replaces the shape checks
([#281](#281))
([a48be0e](a48be0e))


### Bug Fixes

* **operations:** a version 7 uuid made in the same millisecond as the
last sorts after it
([#285](#285))
([846a36d](846a36d))
* **prediction:** a model loads with the telemetry of onnxruntime off,
so its process leaves nothing
([#283](#283))
([ea1a6d8](ea1a6d8))
* **server:** the start's waits run on Effect's clock and the restart
mark names its port
([#282](#282))
([db6c858](db6c858))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: beonautobot[bot] <298957281+beonautobot[bot]@users.noreply.github.com>
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