fix(server): repair installs that skipped the default-thread-env-mode column - #43
Merged
Merged
Conversation
… column An earlier build shipped ProjectionThreadSessionLifecycle as migration 41. This branch later settled on 41 = ProjectionProjectsDefaultThreadEnvMode, 42 = ProjectionProjectFaviconPath, 43 = session lifecycle. The runner only applies ids above the highest one a database records, so those installs report 41 as done, run 42 and 43, and never run 41 — leaving projection_projects without default_thread_env_mode. That is not a cosmetic gap: every project query then fails with `no such column`, and the server dies during startup. Reproduced against a real ~/.pylon-code database, which logged "Migrations ran successfully ['42_…','43_…']" and then took the server down. Renumbering is what caused this, so the fix cannot be another renumber — those databases would still skip anything below their high water mark. Migration 44 sits above it and re-adds the column, guarded by a table_info check so a correctly migrated database is untouched. Verified end to end: the same database that crashed now applies 44 and starts clean with its 4 projects and 25 threads intact. Also corrects two lines in the install doc that read "installs beside Pylon" and "Pylon continues using its own .t3" — both meant T3 Code, from an over-eager rename.
Thread transfer impact
This comment will update automatically after the next completed run. |
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.
An earlier build shipped
ProjectionThreadSessionLifecycleas migration 41.This branch later settled on 41 =
ProjectionProjectsDefaultThreadEnvMode,42 =
ProjectionProjectFaviconPath, 43 = session lifecycle.The runner only applies ids above the highest one a database records, so a
database written by that earlier build reports 41 as done, runs 42 and 43, and
never runs 41 — leaving
projection_projectswithoutdefault_thread_env_mode.That is not a cosmetic gap. Every project query then fails with
no such column, which takes the server down during startup. I hit this against a real~/.pylon-codedatabase while verifying something else:Anyone upgrading an install from around that build hits it on first launch.
The fix
Renumbering is what caused this, so the fix cannot be another renumber — those
databases would still skip whatever sits below their high water mark. Migration
44 sits above it and re-adds the column, guarded by a
table_infocheck soa correctly migrated database is untouched.
Verification
Two unit tests: one reproduces the skip (stop at 40, claim 41, run through 43,
assert the column is missing, then run 44 and assert it is back), one asserts a
correctly migrated database is unchanged.
End to end against a copy of the real database that crashed: it now applies
44_RepairProjectsDefaultThreadEnvMode, starts with zero errors, and keeps its4 projects and 25 threads.
Server typecheck and lint clean; all 12 migration test files pass.
Also corrects two lines in
docs/user/install.mdthat read "installs besidePylon" and "Pylon continues using its own
.t3" — both meant T3 Code, from anover-eager rename. Noticed while following that doc to build a DMG.
Claude Opus 5 (1M context) in Claude Code.
Need help on this PR? Tag
@codesmithwith what you need. Autofix is disabled.