Skip to content

fix(T11546): exodus type coercion + no-swallow (P0 data-loss)#888

Merged
kryptobaseddev merged 2 commits into
mainfrom
task/T11546-exodus-coerce
Jun 1, 2026
Merged

fix(T11546): exodus type coercion + no-swallow (P0 data-loss)#888
kryptobaseddev merged 2 commits into
mainfrom
task/T11546-exodus-coerce

Conversation

@kryptobaseddev
Copy link
Copy Markdown
Owner

Per-column value transform for type/format-drifted columns (conduit created_at epoch->ISO-8601 so CHECK passes), strict no-swallow on per-row INSERT failures, brain_usage_log consolidated mapping. Validated via orchestrator re-validation workflow.

Changes

  • Per-column epoch→ISO coercion: detectEpochToIsoColumns() reads target table DDL from sqlite_master, identifies columns with ISO-8601 GLOB CHECK constraints, and injects strftime('%Y-%m-%dT%H:%M:%fZ', col[/1000.0], 'unixepoch') for INTEGER-typed source columns. Fixes silent data loss where epoch integers failed GLOB checks and were dropped by INSERT OR IGNORE.

  • No-swallow assertion: after bulk INSERT, compares changes vs sourceCount. Full-table drops (rowsCopied=0) return a hard table-level error with details. Partial drops emit a warning for verifier follow-up. Eliminates the silent success: true, rowsCopied: 0 P0 bug.

  • brain_usage_log migration: added to consolidated cleo-project + cleo-global Drizzle schema (migration 20260531000002_t11546-brain-usage-log) + identity mapping in BRAIN_DB_MAP so 8471 quality-feedback rows are copied during exodus migration.

  • No-home-table fixes: schema_meta → tasks_schema_meta (was missing from TASKS_DB_MAP, fell through to identity which doesn't exist) + brain_schema_meta identity mapping.

  • 46 regression tests: all passing locally.

…w + brain_usage_log mapping (P0 data-loss)

- detectEpochToIsoColumns(): reads target DDL from sqlite_master, applies
  strftime('%Y-%m-%dT%H:%M:%fZ', col[/1000.0], 'unixepoch') for INTEGER
  epoch source columns targeting TEXT+ISO-GLOB CHECK columns (conduit.messages
  created_at, brain_observations created_at, etc.)
- No-swallow assertion: after INSERT OR IGNORE, compares changes vs sourceCount;
  full-table drops (rowsCopied=0) return hard error instead of silent success
- brain_usage_log: added to consolidated cleo-project + cleo-global Drizzle
  schema (migration 20260531000002) + BRAIN_DB_MAP identity mapping so 8471
  quality-feedback rows are copied during exodus migration
- schema_meta -> tasks_schema_meta + brain_schema_meta identity mapping (no-home fixes)
- 46 regression tests added + all passing
…tiple migration folders

resolveMigrationSql was hardcoded to expect exactly 1 migration folder;
now that T11546 adds a second migration (20260531000002), the helper
readAllMigrationSql collects and applies all folders in sorted order.
21 previously-failing AC1/AC2/AC4 tests now pass.
@kryptobaseddev kryptobaseddev merged commit 4009035 into main Jun 1, 2026
67 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant