Skip to content

Publishing a field change on a live object updates the metadata but not the table: date → datetime keeps a DATE column (times silently truncated), and required: true → false keeps NOT NULL (create refused with "<field> 不能为空") #32590

Closed
1 of 1 issue completed

Description

@objectstack-fleet

eval#1 · os-bob · session_012dn2AcTB69pEwZ9ugr1g1w

Filing gate: ① product defect, reproduced on public entries (Studio publish, then MCP update_record and the Console create form) in the os-dev-test environment. ⛔ Not a claim; triage decides lane and grade.

Edition

Not sure (seen in the os-dev-test environment, objects authored through the MCP build door and published in Studio > Changes)

Version

18.3.0

What happened / What you expected

Two field edits on an already-published custom object (c982_leave_request) were published from Studio > Changes. After publish, describe_object reports the new field contract, but the physical column was not changed, so the running app behaves against the OLD contract:

1. date → datetime keeps the DATE column; the time part is silently dropped.

  • start_date / end_date were changed from type: 'date' to type: 'datetime' (the field-type docs list date ↔ datetime as a change that "passes cleanly").
  • After publish, update_record with { start_date: '2026-11-13T01:00:00.000Z', end_date: '2026-11-13T10:00:00.000Z' } succeeds, but the returned (and stored) row reads start_date: '2026-11-13', end_date: '2026-11-13' — no time, no warning.
  • A formula over those fields (isoDate(record.start_date)) reads null on every row.

2. required: true → false (with storage.notNull: false) keeps NOT NULL; creates are refused.

  • title was changed to required: false, hidden: true, storage: { notNull: false }. describe_object reports required: false.
  • Creating a record from the Console form without the (now hidden) field fails with the form banner 「申请标题不能为空」.

Expected: either the publish applies the column change (a date → datetime widening and a NOT NULL drop are both non-destructive), or the publish/save is refused up front naming the migration it needs — never a published contract the table silently does not honour.

Steps

  1. Create and publish an object with start_date: { type: 'date', required: true } and title: { type: 'text', required: true }; add a record.
  2. Change start_date to type: 'datetime', and title to required: false (+ storage: { notNull: false }); publish.
  3. Update the record with start_date: '2026-11-13T01:00:00.000Z' → the stored value is 2026-11-13.
  4. Create a record without title → refused as "title must not be empty".

Notes

  • Workaround used in the app: add NEW datetime fields (fresh columns are created with the right type) and give the old NOT NULL field a literal defaultValue.
  • The field-type decision tree (content/docs/data-modeling/field-type-decision-tree.mdx) promises date ↔ datetime passes cleanly; that is true of the save, not of the column.

Filing notes


Generated by Claude Code

Sub-issues

Sub-issues

1 of 1 Issues completed
Loading 1 sub-issues

Activity

  1. added
    domain:server
    on Nov 12, 2026
  2. objectstack-fleet commented on Nov 12, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Path: none

    Triage: first touch → domain:server · p1 · pm:queue · 2026-11-12T07:49Z

    ⛔ Not a claim.

    • Lane: domain:server (the publish path that applies a field change to a live object's table, packages/objectql / drivers).
    • Grade: p1. Two published field changes leave the physical column on the old contract: date → datetime silently drops the time from every write (data loss with no signal), and required: true → false keeps NOT NULL, so creates are refused. The field-type docs list date ↔ datetime as passing cleanly. Reproduced on public entries.
    • Direction: declared ≠ enforced: the table follows the published field contract, or the publish refuses the change it cannot apply. Which one, per change kind, is the lane's to read from the field-type change table. Changing that table's promises comes back as a decision.

    Generated by Claude Code

  3. added
    pm:queue
    priority:p1
    on Nov 12, 2026
  4. objectstack-fleet commented on Nov 12, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#4 · os-sales · session_01L6bhgWRcTEB3toGxnWvuvX

    Claim: PM loop round 3
    Session: session_01L6bhgWRcTEB3toGxnWvuvX
    Account: os-sales
    Branch: claude/issue-32590-publish-column-follows-field (the card thread's harness branch replaces it by a restated claim)
    Worktree: objectstack-issue-32590
    Domain: domain:server
    Seat: domain:server#4
    File surface: packages/drivers/driver-sql/src/** (schema sync / drift: sql-driver-schema-sync.ts, schema-drift.ts and tests), the publish path that asks it (packages/objectql/src/**, packages/metadata-protocol/src/**, read first, edited only where the sync is invoked), content/docs/data-modeling/field-type-decision-tree.mdx only to make its promise true, .changeset/** (stop on breach; explain in the report)
    Container & model: M, mode:thread, model: default (dispatch-gates --tier: no path-derived mandate; floor sonnet · default opus · ceiling fable), effort: xhigh (p1)
    Clause-②: no
    Metadata-protocol: none
    Responsibility: objectstack: the SQL driver's schema sync keeps a published field's old column type and NOT NULL after a field change | the platform path that already covers it: fresh columns are created with the right type; the field-type change table names date ↔ datetime as passing | every app iterated after its first publish; reached today (data loss: times truncated)
    Thread-read: 6817920608
    Premise: holds (card's measured reproduction; the dev re-measures on 9af0766 first)
    Serial constraints cleared: open PR #32690 (domain:server#1, stored-expression fill) touches packages/metadata-protocol/src/protocol-history-and-publish.ts; the dev reads that file and merges main again if #32690 lands first. Floor (triage 6817920608): changing the field-type change table's promises comes back as a decision.


    Generated by Claude Code

  5. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 12, 2026
  6. objectstack-fleet commented on Nov 12, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#4 · os-sales · session_01L6bhgWRcTEB3toGxnWvuvX

    Claim: PM loop round 3
    Session: session_01L6bhgWRcTEB3toGxnWvuvX
    Account: os-sales
    Branch: claude/project-thread-i1qy0g
    Worktree: objectstack-issue-32590
    Domain: domain:server
    Seat: domain:server#4
    File surface: packages/drivers/driver-sql/src/** (schema sync / drift: sql-driver-schema-sync.ts, schema-drift.ts and tests), the publish path that asks it (packages/objectql/src/**, packages/metadata-protocol/src/**, read first, edited only where the sync is invoked), content/docs/data-modeling/field-type-decision-tree.mdx only to make its promise true, .changeset/** (stop on breach; explain in the report)
    Container & model: M, mode:thread, model: default (dispatch-gates --tier: no path-derived mandate; floor sonnet · default opus · ceiling fable), effort: xhigh (p1)
    Clause-②: no
    Metadata-protocol: none
    Responsibility: objectstack: the SQL driver's schema sync keeps a published field's old column type and NOT NULL after a field change | the platform path that already covers it: fresh columns are created with the right type; the field-type change table names date ↔ datetime as passing | every app iterated after its first publish; reached today (data loss: times truncated)
    Thread-read: 6817920608
    Premise: holds (card's measured reproduction; the dev re-measures on 9af0766 first)
    Serial constraints cleared: open PR #32690 (domain:server#1, stored-expression fill) touches packages/metadata-protocol/src/protocol-history-and-publish.ts; the dev reads that file and merges main again if #32690 lands first. Floor (triage 6817920608): changing the field-type change table's promises comes back as a decision.

    Restates: 6832440742 so the claim's own Branch: line names the card thread's branch (same session, same seat; not a second claim).


    Generated by Claude Code

  7. objectstack-fleet commented on Nov 12, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#4 · os-sales · session_01L6bhgWwN7doasrBSHNAPGB
    os-dev-report

    {
      "issue": 32590,
      "status": "done",
      "branch": "claude/project-thread-i1qy0g",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/32848",
      "session": "session_01L6bhgWwN7doasrBSHNAPGB",
      "premise_still_valid": true,
      "summary": "Publishing a changed object now brings its table to the declaration for the changes the field-type table says pass cleanly. SqlDriver.applyPublishedColumnChanges applies the safe column drift (new widen_date_to_datetime: Postgres timestamptz, MySQL DATETIME(3)) plus the relax of a NOT NULL column whose field explicitly declares storage.notNull false, and the date/datetime/time registries are rebuilt on every registration so SQLite reads a retyped field with its time. ObjectQL.applyPublishedColumnChanges is a separate engine door (syncObjectSchema and its spec contract are unchanged); ensureObjectStorage calls it after the additive sync and answers an object-column-changes-not-applied warning advisory when a change does not reach the table. number to text is still refused at the save with 409 DESTRUCTIVE_CHANGE (field_type_change), now pinned end to end.",
      "tests": "On head 58501571, TZ America/New_York, live Postgres 16 and MySQL 8.0.46 at +08:00, OS_EXPECT_LIVE_DIALECT_MATRIX=1. Pins: pnpm --filter @objectstack/driver-sql exec vitest run src/sql-driver-published-column-changes.test.ts: Tests 34 passed (34), sqlite + live pg + live mysql cells; pnpm --filter @objectstack/runtime exec vitest run src/domains/meta-object-publish-column-changes.test.ts: Tests 3 passed (3), also 3 of 3 on live pg via a temporary uncommitted copy. Full suites: driver-sql 6373 passed, 1 failed (sql-driver-11565-row-byte-budget InnoDB page-limit on live MySQL, identical on base ee230a25 source, environmental), 5 skipped; after the main merge and a full pnpm build (119 of 119): objectql 12591 passed, metadata-protocol 22786 passed 36 skipped, driver-turso 2523 passed 34 skipped, runtime 10250 passed 19 skipped; typecheck driver-sql, driver-turso, objectql, metadata-protocol, runtime: 0 errors. Repro before the fix on base ee230a25 via syncSchema v1 to v2: sqlite and pg read 2026-11-13 for an update to a datetime, pg kept the date column, a create without title was refused (SQLITE_CONSTRAINT_NOTNULL, pg 23502). Ablations with scripts/ablation-replace.mjs, each restored blob == HEAD and git diff HEAD empty: A1 explicit relax not selected 12 of 34 red; A2 pg/mysql widen arm off 10 of 34; A3 date registry accumulates 6 of 34; A4 differ widen branch never matches 10 of 34; B1 publish never calls the door, through the built metadata-protocol dist (ablation-dist-preflight: marker absent from all 22 dist files, present again after restore and rebuild): 1 of 3 runtime red, 3 of 3 green after restore. Driver conformance ledger (node scripts/check-driver-conformance.mjs) before and on head: 66 covered, 6 DEBT, 0 exempt; dialect axis 11 of 11; unchanged.",
      "gates": "node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack on committed head 58501571 derived 73 families; each run with its exit code recorded, all 73 exit 0; --ran: 73 derived famil(ies) accounted for, 73 run, 0 NOT-MEASURED, 0 UNRUN, exit 0. pnpm lint exit 0 (under os-verify-lock, VERDICT command-exit 0). node scripts/check-nul-bytes.mjs exit 0. check-plugin-teardown-shape --self-test was a reading after fetching its pinned fixture commit 621a4876 into the shallow clone. CI check-runs on PR 32848: not yet concluded at report time; the seat reads them at ACCEPT.",
      "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
      "mcp_calls": "6 — all reads, no write tool: mcp__github__issue_read get 32590, issue_read get_comments 32590 (2), issue_read get 11535, pull_request_read get_files 32690, pull_request_read get 32848",
      "api_writes": "2 relay writes — pr_create through scripts/pm/fleet-write/dispatch.mjs (run 43314536983: POST /repos/objectstack-ai/objectstack/pulls, then POST issues/32848/assignees os-sales; read-back identical, 14267 bytes) and this report through scripts/pm/post-stamped.mjs (POST /repos/objectstack-ai/objectstack/issues/32590/comments); git push is not a REST write",
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": [
        "class: a · reach: public door, the metadata publish of a datetime field changed to date on a live Postgres object whose server time zone is ahead of UTC, answers a wrong value: a date written 2026-11-12 after the publish reads back 2026-11-11 and the column stays timestamptz · evidence: measured on live Postgres 16 at +08:00 with the process in America/New_York; the result is identical on base ee230a25, so it predates this diff; SQLite and MySQL read the day correctly · dedupe words: datetime to date publish reads a day early on Postgres timestamptz",
        "carrier: PR and server 席 C · noted, not filed"
      ],
      "line_budget": "945 changed lines (+928 / -17) in 14 files against main, under the human-merge threshold 3000; production source 487 (+470 / -17), tests 433, changeset 25",
      "deviations": [
        "pnpm lint was run locally because the card brief asks for it, although os-dev.md leaves the lint workflow's check families to CI",
        "the driver-sql full suite has one red on this box, sql-driver-11565-row-byte-budget 'reports InnoDB page-limit refusals' on live MySQL 8.0.46 (Ubuntu); it fails the same way on base ee230a25 source, so it is environmental, not this diff",
        "the runtime end-to-end pin was also measured on live Postgres through a temporary uncommitted copy of the file; the committed file runs on better-sqlite3 only, and the Postgres and MySQL column work is pinned at the driver door on every live dialect",
        "the Turso REMOTE face's end-to-end outcome (a SQLite relax that needs a table rebuild comes back skipped and reaches the advisory) is not pinned by a new test; its REMOTE_FACE_ANSWERS row is pinned by turso-remote-inherited-members.test.ts"
      ],
      "files_changed": [
        ".changeset/32590-publish-column-changes.md",
        "packages/drivers/driver-sql/src/schema-drift.ts",
        "packages/drivers/driver-sql/src/sql-driver-declared-rename.ts",
        "packages/drivers/driver-sql/src/sql-driver-published-column-changes.test.ts",
        "packages/drivers/driver-sql/src/sql-driver-rotation.ts",
        "packages/drivers/driver-sql/src/sql-driver-schema-sync.ts",
        "packages/drivers/driver-sql/src/sql-driver.ts",
        "packages/drivers/driver-turso/src/turso-driver.ts",
        "packages/metadata-protocol/src/host-engine.ts",
        "packages/metadata-protocol/src/protocol-registry-hydration.ts",
        "packages/objectql/src/engine-compatibility-api.ts",
        "packages/objectql/src/engine.ts",
        "packages/objectql/src/federated-injected-column-readers.test.ts",
        "packages/runtime/src/domains/meta-object-publish-column-changes.test.ts"
      ]
    }
  8. objectstack-fleet commented on Nov 12, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Path: none

    Release blocker for 18.4.0 · target:18.4.0 · p1 → p0 (temporary) · 2026-11-12T22:38Z

    ⛔ Not a claim; the card's claim, if any, is unchanged.

    • Maintainer, verbatim, in session session_01Q4EjjMnyLqJdzuktEmRPXH: 「如果我希望 24 小时内发版本呢」, 「从 18.3.0 发 18.4.0」, and, on the blocker list, 「…改为 p0 ?」 (the maintainer's own proposal); new p2 work is already stopped fleet-wide (「已经通知不接新的 p2」).
    • What it means: 18.4.0 ships when every target:18.4.0 card is closed and main, the nightly and the 4-hourly full runs are green. This card is one of them, so it is dispatched now, ahead of p1 and p2 work.
    • Limits: a main or queue red still outranks it. Same-file serial order and the claim protocol still hold.
    • After 18.4.0 ships (or if the card is taken off the list), triage returns it to p1.

    Generated by Claude Code

  9. added
    priority:p0
    and removed
    priority:p1
    on Nov 12, 2026
  10. objectstack-fleet commented on Nov 12, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Path: none

    Correction (#32590) · target:18.4.0 removed · 2026-11-12T22:47Z

    The maintainer, verbatim: 「阻塞卡升 p0,不需要打 target:18.4.0」. The release-blocker mark is the p0 grade alone (for the security cards, the security lane's grade). Everything else in the note above stands; after 18.4.0 ships, triage returns p0 to p1.


    Generated by Claude Code

  11. removed
    pm:dispatched
    on Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:datadomain:serverpriority:p0

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions