fix: restore description and content on registered_entity (kernel 0.2.3) #7
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/registry-columns-0-2-3"
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?
What
Bumps the kernel pin to
==0.2.3and adds migration0002_registry_columns, whichputs
descriptionandcontentback onregistered_entity.The break
Every
POST /documentsagainst haskydocs on the first companyOS instance returned 500:The ADR-009 extraction dropped both columns from the package's
RegisteredEntity.0001_baselinefaithfully built the reduced table, so every companyOS database gota registry that stage apps written against smeos cannot INSERT into. Not a version
skew — both containers ran 0.2.1.
This is the second time
descriptionhas come up here. The smoke-test docstringrecords the first:
POST /entitieswas passing adescriptionkwarg the service doesnot accept, "for a column the
RegisteredEntitymodel does not have", and it was fixedby deleting the caller. That read the reduced model as correct. It was the regression.
Migration
Idempotent by necessity, not by habit. The two entry states diverge here: a fresh
database (homeOS, superclean) needs both columns added; HaskyOS was stamped at
0001_baselineagainst a database smeos built, which already has them. A plainADD COLUMNthere fails and wedges the chain, which is the whole point of the stamppath.
ADD COLUMN IF NOT EXISTSmakes one migration correct for both.Both paths run against Postgres 17:
upgrade headalembic checkclean, both columns presentalembic checkcleanRevision ids are capped at 32 characters. The first draft was
0002_registry_description_content(33), andalembic_version_kernel.version_numisvarchar(32). The failure is not a clear one: the DDL succeeds, the finalUPDATE alembic_version_kernelraisesStringDataRightTruncationError, and the wholetransaction rolls back — so the tables vanish and it reads like a broken migration.
Tests
tests/test_stage_app_writes.pyruns the literal INSERT fromhaskydocs-v2/app/services/entity_registration.py.test_api_smoke.pydrives thisrepo's routes and structurally cannot see the other half of the contract — stage apps
share the database and write kernel tables directly. That blind spot is why this
reached a deployment.
Verified by making it fail:
Verification
Known asymmetry — follow-up, not fixed here
The columns exist and stage apps can write them, but the kernel's own API cannot:
EntityRegistryService.registertakes nodescription/content, andEntityRegisterdoes not expose them. That needs a package change to the service signature plus a
schema field, and it is a wider surface than unblocking the regression. Filed as the
next thing rather than folded in here.