Schema drift: embedding column missing from agents table causes test failures #260
Labels
No labels
blocked:children
blocked:commit-ready-failed
blocked:depends-231
blocked:depends-236
blocked:depends-237
blocked:depends-238
blocked:depends-239
blocked:gate-fetch
blocked:gate-fetch
blocked:gate-lint
blocked:gate-research
blocked:needs-attention
blocked:needs-decision
blocked:no-changes
blocked:no-procedure
blocked:preflight
blocked:verify-failed
bug
enhancement
feature-request
high-priority
in-progress
lint-cleanup
needs-decompose
needs-triage
ops-retry
ops-task
phase-5
quickfix
security/medium
self-building
triage-approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/mesh-seed#260
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Finding from post-deploy probe (kanban task t_672a7f51)
Two test failures discovered in mesh-seed tests, both stemming from the same root cause:
test_ledger.py::TestReputation::test_reputation_update_success—embeddingcolumn missing from agents table schematest_embedding_ledger.py::TestLedgerEmbeddingSchema::test_agents_table_has_embedding_column— same root causeRoot cause: The
Agentmodel readsrow["embedding"]but theCREATE TABLE agentsmigration does not include theembeddingcolumn. This is schema drift between the model definition and the database migration.Actual behavior: Both tests fail because the
embeddingcolumn does not exist in the table schema.Expected behavior: The
agentstable migration should include theembeddingcolumn so the model can read it and the tests pass.Reproduction steps:
pytest tests/test_ledger.py -k test_reputation_update_successKeyError: "embedding"(or similar column-not-found error)pytest tests/test_embedding_ledger.py -k test_agents_table_has_embedding_columnSuggested fix: Add the missing
embeddingcolumn to theCREATE TABLE agentsmigration.Kanban card: t_672a7f51
QA verification failed: the fixit run did not land a commit or PR for #260. On current origin/master,
./.venv/bin/pytest -q tests/unit/test_ledger.py::TestReputation::test_reputation_update_success tests/unit/test_embedding_ledger.py::TestLedgerEmbeddingSchema::test_agents_table_has_embedding_columncollects 2 tests and both fail: AgentView raisesIndexError: No item with that keyforrow["embedding"], and the fresh-schema test confirmsembeddingis absent fromagents. Reopening for an actual implementation and verification.QA verification on current origin/master (
92521ce) fails: the fixit card did not land a commit../.venv/bin/pytest -q tests/unit/test_ledger.py::TestReputation::test_reputation_update_success tests/unit/test_embedding_ledger.py::TestLedgerEmbeddingSchema::test_agents_table_has_embedding_columncollects 2 tests and both fail. AgentView raisesIndexError: No item with that keyatrow["embedding"]; the fresh-schema test confirmsembeddingis absent fromagents. Reopening for an actual implementation and verification.QA Verification (2026-08-04)
Bug confirmed on master. Both affected tests fail:
Fix verified in PR #267 (commit
3e49e412):PR #267 is still open and not merged. Once merged, the tests will pass on master.
QA PASS (2026-08-04)
Fix confirmed via PR #267 (commit
3e49e41, merged as18946b0). Both affected tests now pass on current origin/master:Root cause: migration 0002 adds embedding column to agents table. PR #267 (fix for #258) addressed the same root cause and merged into master.
Full unit test suite has 2 pre-existing collection errors (unrelated import issues in test_secret_rotation.py and test_retention.py) -- not related to this fix.
Closing as fixed by #267.
Re-opened: false-positive close confirmed. Issue was closed but no fix commit exists on master. Re-adding triage-approved to route back through the pipeline.
QA PASS (2026-08-08, kanban t_f8c449a0): fix verified on clean origin/master (
3dd9456).The 2026-08-08 reopen was a false positive: fix commit IS on master. PR #267 (fix #258: add migration 0002 to add embedding column to agents table) merged as
18946b07ac(commit3e49e412c0); migrationadd_embedding_to_agentspresent in substrate/ledger/migrations.py (version 0002, ALTER TABLE agents ADD COLUMN embedding TEXT DEFAULT '').Test verification:
test_ledger.py::TestReputation::test_reputation_update_successPASS,test_embedding_ledger.py::TestLedgerEmbeddingSchema::test_agents_table_has_embedding_columnPASS; full ledger/embedding unit suite 97 passed. Closing.