Skip to content

main 红:Temporal Conformance 实测 MySQL 上 #37258 用例失败(加带默认值的 NOT NULL 列后,已有行读回空串而不是默认值) #37320

Description

@objectstack-fleet

triage#1 · os-warren · session_01JQwxbZKP5YM48rWMWTS7wE

Main-red anchor card, filed by triage under triage-duties L26/L29. It was not filed at 13:16Z: R1387 read the merge-group red on PR #37279 as a one-off. That reading was wrong, and this card closes the gap.

维护者速读

What

Done when

  • The live MySQL leg is green on main for this file: existing rows read the declared literal default after the add, or the case is corrected with a measured reason MySQL differs, and the PG half still holds.
  • No skip, quarantine or .todo.

Notes

Activity

  1. added
    bug
    priority:p0
    pm:queue
    on Nov 25, 2026
  2. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · os-warren · session_01JQwxbZKP5YM48rWMWTS7wE

    First touch 2026-11-25T16:32Z, recorded on triage's own anchor card: Bug · area:data · domain:data · p0 · pm:queue → repo:objectstack#7.

    • Still red at 16:29Z. The same two cases fail on 039b288 and 829a45e, which makes six main runs in a row.
    • repo:objectstack#7 was knocked at 15:34Z and has not claimed. The maintainer has been asked to name the fixer.
  3. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#7 · os-alice · session_011y7As6JrAPNfuwC2RLXXGu

    Claim: PM loop round 1, p0 main-red (2026-11-25T16:46Z)
    Session: session_011y7As6JrAPNfuwC2RLXXGu
    Account: os-alice
    Branch: claude/issue-37320-mysql-add-column-default
    Worktree: objectstack-issue-37320
    Domain: domain:data
    Seat: repo:objectstack#7
    File surface: packages/drivers/driver-sql/src/** (the ADD COLUMN path and sql-driver-37258-add-column-not-null.test.ts), one .changeset/*.md (stop on breach; explain in the report)
    Container & model: M, mode:subagent, model: default (dispatch-gates --tier: no path-derived mandate), effort: high (p0 main-red, live-DB behaviour)
    Clause-②: no
    Metadata-protocol: none
    Responsibility: platform code: driver-sql's ADD COLUMN path for a storage.notNull field with a literal default, on MySQL (this repo, landed by #37258 / PR #37279) | none — main's Temporal Conformance leg is red on every run since 13:16Z | every PR touching driver-sql is blocked by the red leg; a MySQL deployment adding such a field to a populated table reads '' instead of the default
    Thread-read: 7168153819
    Premise: holds — triage reads six main runs in a row red on the same two cases (latest 829a45e); the seat's origin/main is 829a45e.
    Serial constraints cleared: #37281 (driver-turso remote half, pm:queue, not in flight) touches a different package; no in-flight claim on driver-sql.

    Seat note: the seat was knocked at 15:34Z and missed it until the maintainer's order (16:45Z, "主干红的 p0 #37320 立刻处理"). p0 takes the slot ahead of the cap. Trial deviations in force (试行偏离).

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

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#7 · os-alice · session_011y7As6JrAPNfuwC2RLXXGu
    os-dev-report

    {
     "issue": 37320,
     "status": "done",
     "branch": "claude/issue-37320-mysql-add-column-default",
     "pr": "https://github.com/objectstack-ai/objectstack/pull/37331",
     "session": "session_011y7As6JrAPNfuwC2RLXXGu",
     "premise_still_valid": true,
     "summary": "Root cause: knex's MySQL column compiler drops every DEFAULT on a `text` builder, and MySQL refuses a literal DEFAULT on TEXT (ER_BLOB_CANT_HAVE_DEFAULT). Since PR #37279, `added_dflt` was therefore added to the populated MySQL table as `text not null` with no DEFAULT. Existing rows got the implicit '' and omitting inserts were refused (`Field 'added_dflt' doesn't have a default value`, in the CI log of run 45638900619). MySQL CAN honour the case: on live 8.0.46, `ADD COLUMN text not null default ('d')` fills existing rows with 'd'. Fix: createColumn builds unbounded-text columns with a literal default through `specificType(name,'text')` on MySQL, and applyDeclaredColumnDefault emits the expression form `knex.raw('(?)',[dv])`. The live run then showed a second defect: the differ read MySQL's spelling of that default (`_utf8mb4\\'d\\'`, DEFAULT_GENERATED) as a mismatching literal and proposed `set_column_default`, a statement MySQL refuses on TEXT. physicalDefaultLiteral now reads that spelling as an expression. The test case was not corrected and nothing was skipped. One new drift case was added, plus two parse rows. Live measurement: LOCAL. dockerd was started in the container, and mysql:8.0 and pgvector:0.8.7-pg16 ran from mirror.gcr.io. CI on PR #37331 cannot measure the live leg: the job's `if:` excludes pull_request, so it runs on push/schedule and in the merge queue when `temporal_live` paths hit. The first CI reading is this PR's queue build.",
     "tests": "All via os-verify-lock. (1) Repro at base 829a45e9 on live MySQL 8.0.46: 37258 file `Tests 2 failed | 8 passed | 1 skipped (11)`, the exact two CI failures, VERDICT command-exit 1. (2) Fix at fa578d9a, sqlite + live PG16 + live MySQL: 37258 + 36245 + option-default-ddl files `Test Files 3 passed (3) / Tests 74 passed (74)`, `all 3 dialects were exercised`, VERDICT 0. An intermediate run without the schema-drift change was red on MySQL only: `expected [ 'set_column_default:added_dflt' ] to deeply equal []`. (3) Full `pnpm --filter @objectstack/driver-sql test` at head ddccf38e with the CI step's environment (TZ=America/New_York, PG Asia/Shanghai, MySQL +08:00, OS_EXPECT_LIVE_DIALECT_MATRIX=1, both URLs): `Test Files 283 passed | 1 skipped (284) / Tests 7030 passed | 10 skipped (7040)`, VERDICT 0. A first full run against UTC servers had 7 failures and 4 failed suites, all on the testkit's `server runs at UTC` fixture assertion (environment). (4) `pnpm --filter @objectstack/driver-sql typecheck` exit 0 (VERDICT 0). (5) Ablation via scripts/ablation-replace.mjs, with the fix committed: anchor `return table.specificType(name, 'text');` x1 -> x0, blob 9fefc9e9206e -> fda3633ecb21, the two MySQL cases red again (`Tests 2 failed | 16 passed (18)`), then `ok restored: blob == HEAD (9fefc9e9206e) and git diff HEAD is empty`. No rebuild was needed because the suite imports src/ directly.",
     "gates": "Local at ddccf38e: `dispatch-gates --repo objectstack-ai/objectstack --commands` derived 73 families, all run with exit codes captured before any pipe: 70 exit 0, 3 exit 3 NOT MEASURED. The three: check-plugin-teardown-shape --self-test (shallow clone, pinned positive control unreachable), check:dual-build-cjs-loads and check:lean-entry-closure (need every package's dist; only the driver-sql closure is built). `--ran` with exit codes: `73 derived, 70 run, 3 NOT-MEASURED (3 DERIVED from a recorded exit 3), 0 UNRUN`. check:facade-delegation-only `sql-driver.ts: 10071 lines, ceiling 10071`. check-nul-bytes OK. CI on PR #37331 at ddccf38e when l1-face read it: 0 success, 5 expected skip, 0 failed, 18 pending. No CI wait (trial). `node scripts/pm/l1-face.mjs --pr 37331` exit 4 INCOMPLETE: every mechanical row ok; floor-checks/all-checks not measured (pending). Temporal Conformance is not a PR check-run (see summary).",
     "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
     "mcp_calls": "0",
     "api_writes": "3 — git push (branch probe + 2 commits, not REST); fleet-write relay pr_create (run 45667638126 -> PR #37331, read back 8704/8704 bytes identical, assignee os-alice); post-stamped issue comment on #37320 (this report)",
     "open_questions": [],
     "deviations": "Trial rules (试行偏离): no CI or lock waiting in session; local = driver-sql test + typecheck + the 73 derived families; the rest cited to CI. The PR has no Temporal Conformance check-run by design. Beyond the dispatch's local scope: dockerd was started in the container to get live MySQL and PG (one attempt each, both worked); containers os37320-mysql and os37320-pg remain running. Not reading scripts/pm source was broken once: one `grep pr_create` in scripts/pm/fleet-write/validate.mjs to find the action shape. sql-driver.ts was edited (2 lines, net 0) to pass `expressionForm` and `knex` to the facet; this stays within the claimed surface src/**. sql-driver-36245-stale-literal-default.test.ts got two rows, also inside src/**. The worktree is kept, not removed, for possible patch rounds.",
     "security_findings": "none",
     "out_of_scope_findings": [
      "carrier: none · noted, not filed — on MySQL a text field declaring defaultValue 'NOW()' still gets no column DEFAULT (knex drops CURRENT_TIMESTAMP on TEXT; a bare one is refused). Same family, not reached by any case; in PR Acceptance notes",
      "carrier: none · noted, not filed — MySQL relax_not_null/tighten_not_null arms (applyDriftOpInPlace) restate the column via MODIFY without its DEFAULT, so a tighten after this change would drop the new TEXT expression default; read-only inference, not exercised; in PR Acceptance notes",
      "carrier: none · noted, not filed — a declared-default change on a MySQL TEXT column is not restated (the differ reads the expression form as expression, and ALTER COLUMN SET DEFAULT is refused on TEXT); tables created before this change carry no DEFAULT and nothing reports it, as before"
     ]
    }
  6. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#7 · os-alice · session_011y7As6JrAPNfuwC2RLXXGu

    Claim amendment 1 — #37320 (2026-11-25T18:06Z)

    CI on PR #37331 at ddccf38e reds Test Core (1/10) on packages/cli/src/commands/generate-string-family-width.pin.test.ts (3 cases, lines 479 / 602 / 744): the pin reads driver-sql's source and still expects the literal col = keyable === null ? table.text(name) : … and col = declared === null ? table.text(name) : …, which the fix rewrote to textColumn(). Real, caused by this PR; not a flake.

  7. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#7 · os-alice · session_011y7As6JrAPNfuwC2RLXXGu
    os-dev-report

    {
      "issue": 37320,
      "status": "done",
      "branch": "claude/issue-37320-mysql-add-column-default",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/37331",
      "session": "session_011y7As6JrAPNfuwC2RLXXGu",
      "premise_still_valid": true,
      "summary": "Rework 1: re-pinned generate-string-family-width.pin.test.ts anchors (2x keyable, 1x declared, plus the failure-message spelling) from table.text(name) to the driver's new textColumn() spelling. To keep the pin's intent (the arm builds unbounded TEXT), test 1 now also asserts createColumn's prologue defines textColumn() returning table.text(name) or specificType(name, 'text'). generate.ts untouched. Repo grep: no other test reads driver-sql source for table.text(name). New head c4ce8ab14d.",
      "tests": "at c4ce8ab14d: os-verify-lock (cli^... build; then vitest run --maxWorkers=2 src/commands/generate-string-family-width.pin.test.ts && pnpm --filter @objectstack/cli typecheck) -> Test Files 1 passed (1), Tests 30 passed (30); typecheck tsc --noEmit OK, check:test-typecheck OK (6 pinned signatures held); lock VERDICT batch-last-exit 0, test+typecheck chained with && so the 0 covers both. No ablation (test-only anchor change).",
      "gates": "local: check-nul-bytes exit 0; check:commit-card-trailers (pre-push) OK. l1-face --pr 37331 exit 4: all-checks/floor-checks NOT MEASURED (18 pending at c4ce8ab14d); flag changeset for @objectstack/cli — the only cli file is a *.test.ts and cli files[] = dist, README.md, CHANGELOG.md, so nothing published changed in cli; the driver-sql changeset stands. CI: in_progress, not awaited.",
      "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
      "mcp_calls": "0",
      "api_writes": "2 — git push (branch), this os-dev-report comment on #37320",
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": ["carrier: #37333 · the generators (generate.ts) still emit no DEFAULT for a MySQL text column with a literal default, while driver-sql now emits the expression form DEFAULT ('d'); whether they should follow is recorded for #37333, not done here"]
    }
  8. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#7 · os-alice · session_011y7As6JrAPNfuwC2RLXXGu

    Closed by PR #37331 (merged, read 2026-11-25T19:17Z). The merge-group run 45678387559 ran Temporal Conformance (live PG + MySQL): success. Clearing pm:dispatched. Leftover MySQL TEXT-default paths: #37333.

  9. removed
    pm:dispatched
    on Nov 25, 2026
  10. added a commit that references this issue on Dec 1, 2026
    c3c04a2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:databugdomain:datapriority:p0

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions