Repository navigation
gemdb starts the database safely (#115, #126, #134 items 1–3) - #148
Merged
Merged
Conversation
MatiasFernandez
force-pushed
the
mfernandez/gemdb-safe-start
branch
2 times, most recently
from
October 20, 2026 16:27
477e1a0 to
dce7f80
Compare
MatiasFernandez
force-pushed
the
mfernandez/gemdb-safe-start
branch
2 times, most recently
from
October 20, 2026 19:21
1254ee3 to
ea641b1
Compare
MatiasFernandez
marked this pull request as ready for review
October 20, 2026 19:24
The window and the GemDB Shell each had their own copy of "is the external database up", and neither waited for a stone still at Startup. Both now call assertExternalDatabaseUp, which waits as waitForStoneReady does for a database of our own. For an external database the messages no longer name GemDB's own stone log (which has nothing of it) and no longer tell the user to start it again: the administrator runs it. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A file, -c or -m run that found the stone down started it from ~130 lines of bash that duplicated ensureProcesses' lock, start and wait, had drifted from it, skipped assertSafeToStart (so a pin move ended in a raw 4045), and treated an external database differently from the window and the Shell. The wrapper now keeps only the fast path for a stone that reads `ok`. Every other case runs `gemdb-shell.js --ensure-stone`, which goes through bringUp: the same ensureProcesses and guards as the Shell, starting the stone only, since a file run is a linked topaz and never uses NetLDI (ensureProcesses takes a `listener` option for this). - The stone lock now reports that it is waiting, so a CLI run behind a window's start says so instead of printing nothing for up to 150 s. - A mistyped file or a -c with no code fails before anything starts. - The comments that said bash takes the lock now say that only wrappers from 1.7.0 and earlier do, which is why the lock's format must stay as it is. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A database Grail had not been filed into yet answered a file, -c, -m or Shell start with driver compile errors, or a 4051 when there was no account yet. The wrapper now tests the Grail stamp for an own database, before the fast path, and the Shell and --ensure-stone do the same in bringUp. All three say GRAIL_NOT_INSTALLED, which points at "GemDB: Start GemDB". GRAIL_MISSING keeps its own wording: it now only meets a database whose stamp is present and whose Python is gone, which "Start GemDB" does not repair. The message holds double quotes, so the wrapper writes it through shellQuote. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
MatiasFernandez
force-pushed
the
mfernandez/gemdb-safe-start
branch
from
October 20, 2026 21:53
ea641b1 to
9f1b613
Compare
jgfoster
approved these changes
Oct 21, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to a conflict with the base branch
Oct 21, 2026
jgfoster
approved these changes
Oct 21, 2026
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.
Fixes #115
Fixes #126
Part of #134 (items 1–3; 4–6 remain, so not auto-closed)
What changes
When the stone is down,
gemdb file.py/-c/-mused to start it from ~130 lines of bash that had drifted fromensureProcesses, skippedassertSafeToStart(a pin move ended in a raw 4045), and treated external databases differently from the window and the Shell. It also ran against a database Grail was never filed into.Now the wrapper keeps only a stamp test and an
okfast path. Everything else runsgemdb-shell.js --ensure-stone, which goes through the sameensureProcesses+ guards as the Shell.Commits
assertExternalDatabaseUpreplaces the two copies (window, Shell). Waits for a stone still atStartup; says "the administrator runs it" instead of "start it again"; names no GemDB log.ensureProcesses({ listener: false }): the CLI starts the stone only (file mode is a linked topaz and never uses NetLDI).withStoneLocknow reports that it is waiting, so a CLI run behind a window's start isn't silent for up to 150 s. Argument checks (-cwith no code, missing file) run before anything starts. Bash lock/start/wait block deleted.GRAIL_NOT_INSTALLED("Run GemDB: Start GemDB…") for wrapper, Shell and--ensure-stone.GRAIL_MISSINGis untouched: it now means "stamp present, Python gone", which only Reinstall repairs.Review focus
src/cli.tstemplate: the fast path /--ensure-stone </dev/nulllogic and the moved argument checks. The post-run$STATUSis renamedRUN_STATUSto keep it apart fromSTONE_STATUS.execPath, else PATH). A missing one refuses with the Shell's messages; there is no bash fallback.lock.ts/processes.tsnow say so.recordGrailInstalled, otherwise every own-database test gets the new refusal.Verification
Known and left alone (pre-existing or minor, found in review): the fast path takes only
ok, sofrozen/exe deletednow go through Node; a baregemdb -mstill starts the stone before failing; external "stopped while starting" wording.Related, not in this PR: #143 (activation doesn't start the MCP server when the stone is up and NetLDI is down).
🤖 Generated with Claude Code