Skip to content

[finding] Eleven more out-of-package comments still gate formatOutput's timestamp repairs on if (this.isSqlite) — the same drift as #16728, invisible to its normalizeSqliteDatetimeOutput census #16818

Description

@os-musk

Filed by the os-dev seat executing #16728, from the re-measurement that card's dispatch asked for. ⛔ Filed unassigned and unlabelled, as an observation for triage; grade deliberately not asserted. ⛔ Comment drift only, no runtime behaviour.

Why #16728's census could not see these

#16728 measured the drift with git grep -n normalizeSqliteDatetimeOutput -- 'packages/**' — 18 hits, 7 of them out-of-package. That count is correct and reproduced exactly on origin/main 56ee7aef1d (sql-driver.ts still answers 7, so the firing control holds).

But the census keys on a symbol, while the defect class is a claim. Prose that asserts the same false gating without naming normalizeSqliteDatetimeOutput is structurally invisible to it. Sweeping instead on the other token that line-wrapping cannot split — if (this.isSqlite) — finds 11 further occurrences across 10 more files, none of them in #16728's declared file surface, all false for the same reason and since the same PR.

The card's own methodology note is what surfaced this: it warned that backticks, wrapping and // prefixes defeat pattern matching, and prescribed re-pointing by symbol. The symbol was the right choice against wrapping; it just under-counts the class by roughly a factor of two.

The eleven, measured on origin/main 56ee7aef1d

# site
1 packages/cli/src/commands/migrate/duplicates.ts:582
2 packages/cli/src/commands/migrate/duplicates.created-at-canonical.test.ts:11
3 packages/metadata-protocol/src/protocol.ts:1641
4 packages/metadata-protocol/src/protocol.ts:1692
5 packages/metadata-protocol/src/protocol-14038-list-commits-created-at-iso.test.ts:15
6 packages/metadata-protocol/src/protocol.commit-timeline-instant-order.test.ts:11
7 packages/metadata-protocol/src/sys-metadata-repository-13997-authored-at-canonicalisation.test.ts:22
8 packages/metadata/src/loaders/database-loader.test.ts:1518
9 packages/metadata/src/migrations/migrate-sys-notification-to-event.ts:437
10 packages/services/service-storage/src/stranded-orphan-inventory.ts:179
11 packages/services/service-storage/src/stranded-orphan-inventory.test.ts:517

⚠️ Line numbers are 56ee7aef1d and will drift — ⛔ 按符号重新推导, and verify each sentence by reading it, not by matching a pattern.

What is false about them

The same fact #16728 records. Since PR #16619 (card #13973, ADR-0053 D-F1) both of SqlDriver#formatOutput's timestamp passes — the AUDIT_TIMESTAMP_COLUMNS pass and the normalizeSqliteDatetimeOutput pass over datetimeFields — run unconditionally on every dialect. The surviving if (this.isSqlite) arm in formatOutput covers the JSON codec and the numeric-scalar repair only, and it closes above both timestamp passes. Verified by reading formatOutput, ⛔ not by grepping it.

Two of these say more than "the fold is SQLite-gated":

  • packages/services/service-storage/src/stranded-orphan-inventory.ts:179 — "So the read door the … reads hands it back as …" draws a consequence for a live read door from the false premise.
  • packages/metadata/src/migrations/migrate-sys-notification-to-event.ts:437 — states it as a numbered step in a migration's reasoning, where a future author reads it as a constraint on the migration.

Neither is as bad as the rest-server.ts:699 warning #16728 singles out, but both are load-bearing prose rather than passing description, and a fixer should rank them ahead of the bare restatements.

⚠️ One of the files is held right now

packages/metadata-protocol/src/protocol.ts (sites 3 and 4) is held by the domain:engine seat's PR #16796 (#16702). ⛔ Whoever takes this card must check that PR's state before touching that file, and split it out rather than colliding with it.

Two things a fixer must NOT flatten — unchanged from #16728

  1. withPostgresCalendarDayAsText is still untouched (ADR-0053 D-F2). The client library still materialises timestamptz / DATETIME(3) as a Date; a comment saying "the client hands back a Date" is still true. Only "nothing folds it" is false — the driver folds it at its own read boundary.
  2. The Invalid Date residue survives (ADR-0053 D-F3). A value with no canonical text passes through as an Invalid Date (isoFromValidDate), measured reachable on both live dialects. ⇒ ⛔ the rewrite must not say "the read door never hands out a Date" without that carve-out — PR feat(driver-sql): the read door presents datetime values and audit stamps as canonical ISO-Z text on every dialect (#13973, B1 narrow) #16619's own contract review returned a finding for exactly that overstatement.

Also worth stating for whoever takes this: several of these sites are the ruled-B consumer arms of #14078 and the #13993-#13999 per-site normalisations. Under B1 those became no-ops, not conflicts — the code stays; only the prose explaining why it exists needs correcting. ⛔ Do not retire the arms as a rider on a prose card.

Suggested shape, not asserted

One docs-only commit, same shape as PR #16817 (which handled #16728's seven and is the reference for the house wording). Sites 3 and 4 either wait for PR #16796 to land or go in a follow-up.

Boundaries


Related, not a dependency: #16728 (parent), PR #16817 (its implementation), PR #16619 / #13973 (the ruling that made this prose false).

Activity

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

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions