Problem
There are two schema files in the repo:
memory/schema/schema.sql (157K) — active, used by agent-install.sh via pgschema plan/apply against $SCHEMA_DIR/schema.sql
memory/schema.sql (311K) — stale, last modified 2026-02-28, predates the pgschema migration
Per the 2026-02-28 changelog: "Schema source of truth is now schema/schema.sql, generated by pgschema dump". The old memory/schema.sql is a legacy full pg_dump that's no longer authoritative.
Risk
Currently low — but the stale file:
- Confuses contributors ("which schema is canonical?")
- Silently drifts from the live schema (was unchanged Feb 28 → today, while
memory/schema/schema.sql has multiple updates)
- Is the only thing referenced by
memory/tests/fixtures/load-test-data.sh:50-55. Coincidentally this file currently has the same fixed get_agent_bootstrap function as the active schema, so test fixtures still load correctly — but that's an accidental match, not a guarantee. Future schema changes will desync.
Proposed fix
- Delete
memory/schema.sql
- Update
memory/tests/fixtures/load-test-data.sh to either:
- Read
memory/schema/schema.sql instead, OR
- Apply schema via
pgschema apply (consistent with the production install path)
Related
- Discovered while debugging the May 8
get_agent_bootstrap schema drift (workflow_steps.agent_id removal). Function fix landed in commit 5b20b40.
- The active schema/schema.sql + pgschema flow is working correctly for production installs; this is purely cleanup.
Owner
Database / Agent Design domain (newhart) for the SQL file deletion + Software Engineering domain for the test-fixture script update.
Filed by NOVA on behalf of I)ruid.
Problem
There are two schema files in the repo:
memory/schema/schema.sql(157K) — active, used byagent-install.shviapgschema plan/applyagainst $SCHEMA_DIR/schema.sqlmemory/schema.sql(311K) — stale, last modified 2026-02-28, predates the pgschema migrationPer the 2026-02-28 changelog: "Schema source of truth is now schema/schema.sql, generated by
pgschema dump". The oldmemory/schema.sqlis a legacy full pg_dump that's no longer authoritative.Risk
Currently low — but the stale file:
memory/schema/schema.sqlhas multiple updates)memory/tests/fixtures/load-test-data.sh:50-55. Coincidentally this file currently has the same fixedget_agent_bootstrapfunction as the active schema, so test fixtures still load correctly — but that's an accidental match, not a guarantee. Future schema changes will desync.Proposed fix
memory/schema.sqlmemory/tests/fixtures/load-test-data.shto either:memory/schema/schema.sqlinstead, ORpgschema apply(consistent with the production install path)Related
get_agent_bootstrapschema drift (workflow_steps.agent_id removal). Function fix landed in commit5b20b40.Owner
Database / Agent Design domain (newhart) for the SQL file deletion + Software Engineering domain for the test-fixture script update.
Filed by NOVA on behalf of I)ruid.