Skip to content

A seed row's explicit created_at is overwritten with the boot instant on INSERT (seed context sets no preserveAudit), yet written on the upsert UPDATE of a later boot — seeds cannot backdate creation time consistently #21646

Description

@objectstack-fleet

Filing gate: ① product defect with reach measured. Class (a). reach: public door, the seed loader on boot, read back through GET /api/v1/data/crm_case. Measured on @objectstack/* 17.6.0 by a dev run of the repo:hotcrm seat (session_01ER8ntXZhYebyQ66aXWdjfT) for hotcrm#1992.

Who acts on it: objectstack triage routes it, likely to the data/objectql lane. ⛔ Not a claim; triage sets type and grade.

Measured (fresh boot of a scratch artifact built from hotcrm 94668373; no objectstack.config.ts in the cwd, so objectstack#21501 does not apply)

seed row created_at authored after the fresh boot (INSERT) after a second boot on the same DB (upsert UPDATE)
A cel\daysAgo(5)`` 2026-10-03T23:16:44.160Z (boot instant) 2026-09-28T00:00:00.000Z (the authored value)
B '2026-09-01T12:00:00.000Z' 2026-10-03T23:16:44.289Z (boot instant) 2026-09-01T12:00:00.000Z (the authored value)
control none 2026-10-03T23:16:44.033Z unchanged

The explicit value is dropped silently on insert, with no refusal and no warning. It is written on the replay after a restart. A fresh database (a demo reset) therefore shows every seeded record created "now" until the next restart.

Code reading (17.6.0 dist)

  • objectql dist/index.js:21491, in the builtin beforeInsert hook sys_stamp_audit_insert (priority 10): record.created_at = preserveAudit ? record.created_at ?? now : now;
  • spec dist/kernel/index.js:29033: SEED_WRITE_EXECUTION_CONTEXT = { isSystem: true, skipTriggers: true, seedReplay: true }. It has no preserveAudit.
  • sys_stamp_audit_update stamps only updated_at, which explains why the replay writes the authored created_at.
  • defineSeed's shape (object, externalId, mode, env, locale, records) has no option for it.

Why it matters

  • Seeds are how an app's demo reports get history; the hotcrm sources say so in as many words (src/sales/data/_shared.ts). A report or dashboard that buckets by creation day shows all seeded rows on one day after a fresh boot.
  • Apps then keep a duplicate, app-maintained "created date" column to get history. hotcrm#1992 is exactly that: its crm_case.created_date has no writer for user-created records, so real cases drop out of reports.
  • The maintainer ruled to retire the duplicate in favour of created_at. That ruling waits on this card (AGENTS.md §2: a platform defect means wait).

Related, not duplicates

This card asks for the seed path to take that same sanctioned path, consistently on insert and update, or for the platform to refuse an explicit created_at in a seed loudly on both paths. Silently dropping it on one path and writing it on the other is the defect either way.

Duplicate check

Objectstack issues: 5,308, being the earlier 5,268-issue walk since 2026-07-01 plus every issue updated on 2026-10-03, read to the short page. Title and body were grepped for preserveAudit|sys_stamp_audit|seed…created_at|created_at…seed|backdat…(created_at|audit): 9 hits, all closed. #15964 and #16312 are the related pair above; the rest concern readonly-strip ordering and audit-binder prose. Positive control: SeedLoader hit 17.

Dedupe words: seed created_at overwritten · preserveAudit seed context · sys_stamp_audit_insert seed · backdated created_at seed


Generated by Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area:recordsBusiness objects, records, the views that show data, usable forms, searchbugSomething isn't workingdomain:enginepriority:p2Medium: important, M3

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions