Repository navigation
fix(integrations): local Postgres fixtures no longer drop numeric, character and timestamp modifiers - #370
Merged
Conversation
allisonmahmood
force-pushed
the
fix/340-array-elements
branch
from
September 24, 2026 15:20
8d19388 to
20ee62b
Compare
…d timestamp modifiers Discovery now records each column's validated type modifiers as structured integers on the snapshot's column type (numeric(8,2) is [8, 2]), decoded from atttypmod rather than the formatted type string. Fixture DDL and the fixture header render them for numeric, varchar, bpchar, timestamp and timestamptz (and their arrays), so local inserts round and refuse like the source. Domains still resolve to their base without their own modifiers; drift checks keep comparing modifier-free types. Co-Authored-By: Claude Opus 5.5 <[email protected]>
allisonmahmood
force-pushed
the
fix/336-fixture-modifiers
branch
from
September 24, 2026 15:29
e567dea to
bbf2b84
Compare
allisonmahmood
added a commit
that referenced
this pull request
Sep 24, 2026
Stacked on #370 (branch fix/336-fixture-modifiers). `Patches.sharedTables` had no production caller. It kept its own `sharedSources` query and listing loop alive, while discovery already goes through `read`/`companyInventory` and declaration resolution uses singular `sharedTable`. Closes #325. This deletes the plural service member, the `sharedSources` query, the implementation and the returned property, plus the one `sharedTables` assertion in the lifecycle test. The rest of that test stays. Singular `sharedTable`, `read`, `companyInventory` and `readInventory` are unchanged. Caller check: a repo-wide grep for `sharedTables`/`sharedSources` (all file types) hit only the deleted code and that one assertion. There is no bracket or type-index access. The helpers the code used (`serving`, `dieOnSchemaError`, `readInventory`) still have other callers. The glossaries don't name the member. Tests: `pnpm typecheck` and `pnpm lint` pass, and `Patches.test.ts` passes 31/31. The full `pnpm test` run gave 960 passed and 2 failed: two 5s timeouts in `packages/integrations/src/postgres/{Operations,Runtime}.test.ts` while other suites were running on the machine. Re-run alone, both files pass 9/9. Implemented by Claude Opus 5.5 via Claude Code (foreman run orchestrated by Claude Fable 5.1).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Local Postgres fixtures dropped the source's type modifiers. A
numeric(8,2)column became plainnumericunder.patchy/dev, so inserting 9.995 read back as"9.995"locally but"10.00"from the source.timestamp(0)kept fractions,character(4)lost its padding, andvarchar(4)accepted values the source refuses. Closes #336.Stacked on #369 (branch fix/340-array-elements).
Discovery now reads each column's
atttypmod, decodes it and stores the result as structured integers on the snapshot's column type.numeric(8,2)becomesmodifiers: [8, 2]; for arrays the modifiers apply to the element. Fixture DDL and the fixture header render range-checked modifiers for numeric, varchar, bpchar, timestamp and timestamptz. For example,"pg_catalog"."numeric"(8,2)or"pg_catalog"."timestamptz"(3)[]. The source's formatted type string is still never executed. A modifier that fails validation excludes the column asunsupported_type. Domains still resolve to their base type without their own modifiers, and the schema-drift check still compares types without modifiers. Snapshots discovered before this change carry no modifiers until they are rediscovered.The snapshot schema change is in
docs/API.md.docs/product.mdand thepatchy-postgresproject skill now describe the new fixture types.Tests:
Parity.test.tscase runs the same reads natively and against the dev fixture overnumeric(8,2),numeric(4),timestamp(0),timestamptz(3),character(4),varchar(4)andnumeric(8,2)[]. It failed on the base branch with the values the issue reports and passes now. It also checks that an over-lengthvarchar(4)fixture row is refused locally with SQLSTATE 22001.Mapping.test.tscase covers decoding (including a negative numeric scale), rendering, rejected modifiers and the unchanged drift check.pnpm typecheckandpnpm lintpass. On a loaded machine,pnpm testhad 959 passed and 2 failed, both 5-second timeouts (Operations.test.ts,Runtime.test.ts). Re-run alone, both files pass.Implemented by Claude Opus 5.5 via Claude Code (foreman run orchestrated by Claude Fable 5.1).