Skip to content

docs: add epoch ms unit comment to created_at columns - #457

Closed
G0-0000 wants to merge 1 commit into
cortexkit:masterfrom
G0-0000:docs/created-at-epoch-ms
Closed

G0-0000 wants to merge 1 commit into
cortexkit:masterfrom
G0-0000:docs/created-at-epoch-ms

Conversation

@G0-0000

@G0-0000 G0-0000 commented Sep 16, 2026

Copy link
Copy Markdown

created_at uses Date.now() (epoch ms), but schema has no unit comment. This PR adds -- epoch ms (Date.now()) comments to all created_at columns for clarity.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Summary by cubic

Adds -- epoch ms (Date.now()) comments to all created_at columns in the schema to document the timestamp unit, with no behavior change.

Written for commit 6e3751e. Summary will update on new commits.

Review in cubic

Greptile Summary

This PR documents the unit used by created_at columns in the migration and database-initialization schemas.

  • Adds inline epoch-millisecond annotations to migration DDL.
  • Adds matching annotations to the current initialization schema.
  • Does not alter schema structure or runtime behavior.

Confidence Score: 5/5

The PR appears safe to merge because it only adds valid SQL comments and introduces no behavioral changes.

The added comments preserve SQL parsing, match the timestamp unit used by current production writers, and do not change database schemas or data paths.

Important Files Changed
Filename Overview
packages/plugin/src/features/magic-context/migrations.ts Adds epoch-millisecond comments to historical migration definitions without changing executable schema semantics.
packages/plugin/src/features/magic-context/storage-db.ts Adds matching timestamp-unit comments to database initialization DDL without changing schema behavior.

Reviews (1): Last reviewed commit: "docs: add epoch ms unit comment to creat..." | Re-trigger Greptile

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Re-trigger cubic

@magic-alfonso magic-alfonso Bot closed this Sep 16, 2026
@magic-alfonso

magic-alfonso Bot commented Sep 16, 2026

Copy link
Copy Markdown

Thanks — the intent is right (the unit is not written down anywhere a reader of the schema would find it), but I am going to decline this shape rather than merge it, for two reasons.

Applied migrations are history. SQLite stores the CREATE statement text verbatim in sqlite_master.sql, comments included, so editing the SQL of a migration that has already run means a database migrated last month and one migrated today carry different sqlite_master text for the same table. Nothing breaks at runtime, but every schema-equivalence check we run between a fresh install and a replayed upgrade now has to know to ignore that, and the comment never reaches the databases that already exist. Shipped migrations are append-only in this repo; only the fresh-install schema in storage-db.ts and new migrations are editable.

The unit is not uniform enough to assert blanket. We audited several created_at writers this week (historian-promoted facts and memory-mirror rows among them) and found columns that had been written as 0, and paths where the Rust module and the TypeScript host disagreed on the stamp until fixed. A comment that says epoch ms (Date.now()) on 31 columns is a claim about 31 writers; without checking each one it can mislead the next reader more than silence would.

If you want to carry this forward, the shape that would merge: a short table in the storage section of ARCHITECTURE.md (or a docs/ note) listing the timestamp columns with their unit and the writer that stamps them, each entry verified against the writer — and, for fresh installs only, the same comment on the storage-db.ts schema where it is actually verified. Happy to review that.

@G0-0000

G0-0000 commented Sep 16, 2026

Copy link
Copy Markdown
Author

Reshaped per maintainer feedback: timestamp units table (epoch ms, per-column verified writers) added to ARCHITECTURE.md, and -- epoch ms (Date.now()) comments added to the fresh-install schema only — no migration DDL touched. All code changes from the original PR shape removed; new PR: #458 (#458).

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