Repository navigation
fix(server): a ledger of another version says where it is, what to do and where to ask - #273
Merged
Merged
Conversation
… and where to ask A runtime that opened a ledger whose tables another version had made stopped with the ledger's own sentence, wrapped twice, which said to delete "the local database" without saying where it was, so a person who ran npx in an empty folder could not find the file, and a ledger in PostgreSQL was told to delete a local database it did not have. The ledger now refuses such a table as a LedgerShapeRefused that names the table, what it holds and the columns found and kept, and the server, which knows where its ledger is kept, answers it in words of its own: where the ledger is, that this version does not yet carry a ledger over from one version to the next, what to do, and where to ask, on Discord. Started in a terminal, the runtime shows this as a notice of its own beneath the logo, as it shows the one that it is ready: what happened, then "What you can do" with the command that deletes the ledger file and the two SQLite keeps beside it, then the Discord invite, then the columns, dimmed. A ledger in PostgreSQL is told to point DATABASE_URL at an empty database instead, with no command. Started as a server, the runtime says the same in its one line on stderr, ending with the command, so nothing follows it when it is copied. Any other failure to start reads as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
rami-hatoum
force-pushed
the
fix/ledger-shape-notice
branch
from
October 21, 2026 11:00
bcfe743 to
6142bb7
Compare
…y shell and says what holds The command that deletes a ledger file names the file, its -wal and its -shm one by one, each quoted for the shell, so it deletes the three files in every POSIX shell; the brace expansion, which a POSIX sh leaves as it is, is gone. Where RUNTIME_DISTRIBUTION is docker, the container has stopped, so the notice gives words instead: delete the three files from the volume mounted at /data when the ledger is in the image's folder /app/data, or from the volume that holds the ledger's folder anywhere else, or remove the volume. The settings read RUNTIME_DISTRIBUTION even when the usage ping is turned off. A server that stops on such a ledger says on its single line of stderr "Auto Runtime could not start:" and the refusal's own words, with no error names before them. This is the line every server prints unless it is given a notice of its own; every other failure prints as before. The words say only what is true of the refused table: this version keeps secrets, or recorded content, in a different shape and cannot read those the ledger holds. They no longer say that a ledger is not yet carried over from one version to the next, and they no longer offer help to keep a ledger, which the runtime cannot give; deleting the ledger, they say, takes everything in it, every playbook, definition, run and connection among it. One function says where the ledger is kept, for the start log and for the refusal, so the refusal reads "The ledger is kept in the file ..." as the log does, and the log's words are unchanged. The invite sits beside the other links in local-banner.ts, the test fixture is a-ledger-of-another-version.ts, and the terminal notice takes its colors and links from stderr, the stream it is written to, so a notice sent to a file holds no escape code. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
rami-hatoum
force-pushed
the
fix/ledger-shape-notice
branch
from
October 21, 2026 11:06
6142bb7 to
b44ff4c
Compare
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 this changes
When the ledger's database was made by another version of Auto Runtime, the runtime refuses to start, as it is meant to: nothing is carried over before launch. But the words it stopped with were the ledger's own sentence wrapped twice,
StartupError: The server's services could not start: Error: ..., telling the person to delete "the local database" without saying where it was, and telling a ledger in PostgreSQL to delete a local file it does not have.Now:
LedgerShapeRefused, naming the table, what it holds, and the columns found and kept. Its message is unchanged.-waland-shmfiles SQLite keeps beside it, each quoted for the shell, so the command works in every POSIX shell and on a path with a space or a quote. In the image, where the files are on a volume, the notice says which files to delete from the volume instead of a command. A ledger in PostgreSQL is told to pointDATABASE_URLat an empty database.main.ts), the runtime says the same thing on its single line of stderr, with no class name before the words, and that line is now the default for every server, the test entries included.StartupErrorkeeps the failure it wraps as itscause, which is how the notice finds the refusal. Colour and link codes follow whether stderr is a terminal.What the terminal shows:
Tests
ledger-of-another-version.test.tscovers the words for a file, a relative path, PostgreSQL and the image, and runs the delete command in a real folder whose name holds a space, a quote and a$.failure-notice.test.tschecks the terminal notice line by line, with and without colours.ledger-database.test.tschecks that the layer turns the refusal into the server's error and passes any other failure through unchanged.run-server.test.ts,ledger-startup.test.tsandterminal-control.test.tsstart a real server and a realauto-runtimeon a ledger of another version and read what each prints, including stderr sent to a file.Checklist
feat(reasoning): .... It becomes the squash commit and the changelog entry.pnpm checkpasses locally, with every file at 100% coverage.