Fix authoritative house schema upgrades before hydration #671
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/house-schema-upgrade-round12a"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Upgrading an existing house from deployed
45a1b9bedb0d43aaec7eafec6cd58dfeed045347to main62456e4c26059728d0f24f2f514e4703b89d2a09failed cold hydration withcolumn akhomed_symbols.created_at does not exist. Ptah never became Ready and Talos #226 restored its prior image. This repair completes the schema upgrade before an authoritative house can publish a usable store pool.Root cause and complete store audit
3c46cfe4445944a9ff7b1dcb4f05b010d082bd96(#655) addedakhomed_symbols.created_at,akhomed_symbols.source, andakhomed_workspace_manifest. Its matchingm20261016_000001_workspace_manifestmigration is correctly registered and ordered. The deployed house config hasrequire_authoritative=trueandmigrate_on_start=false; startup/reconnect consequently skipped that migration and hydration selected the new columns from the old table.The deployed commit's 13 migrations were run with its unmodified migration binary on disposable PostgreSQL 17.11. The checked-in fixture combines that schema-only dump with only the migration-history rows; synthetic test state is inserted separately. Every one of the 30 current SeaORM entities is audited against it. The only drift is the two symbol columns and the absent six-column manifest table (
akh_id,workspace_id,generation,residency_epoch,digest,manifest). Every entity query succeeds after upgrade. No other missing entity columns were found. #670's inaccurate six-column description is corrected: the deployed symbol entity has five columns and main has seven.Resulting behavior
migrate_on_start=false. Non-authoritative hosts retain the optional migration setting. A migration error yields no usable pool and cannot proceed to authoritative hydration.m20261018_000001_house_schema_compatibility, after the original workspace-manifest migration, repairs absent symbol columns or the manifest table if the earlier migration is already recorded. Existing values are preserved; historical migrations remain unchanged. Repair rollback leaves removal to the original migration's down step.created_at=0explicitly means unknown, andsource=NULLmeans unavailable. The old symbol rows contain no reliable creation time: neither snapshot time, house awakening nor an adjacent fact's assertion time establishes symbol birth. We retain the existing documented sentinel without inventing timestamp or source evidence.Regression and validation
The existing
test-session-platformCI job runs both regression targets through its disposable PostgreSQL runner before its other contracts. The runner removes ambientDATABASE_URL, uses its own loopback-only container and uniquely named test databases, and cleans up afterward.init_postgresplus fencedServerState::get_enginecold hydration with the deployed flags: 1 passed, 0 ignored on both versions. Checks denied migration, original symbol IDs/fact, unknown metadata, runtime state and monotonic residency epoch; no agent/provider loop is started.Diagnosis, fixture provenance, review and validation receipt:
docs/ops/house-schema-upgrade-20261018/; operator evidence is recorded under round 12a. Both owned disposable database containers were removed. No production DB reads/writes, merges, deployment or live daemon probe flags were used. The authoritative database role must own its store schema and permit migration DDL. Exact-head CI and a future reviewed main-image rollout/cold-start acceptance remain pending.