Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
1235494
docs(projects): scaffold codec-owned-defaults project (spec, plan, re…
SevInf May 20, 2026
cec494c
feat(sql)!: M1 — make renderSqlLiteral required on every SQL codec
SevInf May 20, 2026
df011fb
refactor(contract)!: re-home ColumnDefault to SQL contract and reshap…
SevInf May 20, 2026
f1423d3
feat(sql-contract)!: update Arktype validators for new ColumnDefault …
SevInf May 20, 2026
065f45e
fix(sql-contract): enforce strict union arms on ColumnDefault schemas
SevInf May 20, 2026
253e6a5
feat(sql-contract): re-export ColumnDefault types from public barrel
SevInf May 20, 2026
1821ec9
feat(sql-contract-ts)!: trait-gated autoincrement() sentinel + Author…
SevInf May 20, 2026
b49c1ac
refactor(sql-contract-ts): re-home ColumnDefault import + thread auth…
SevInf May 20, 2026
2613ac5
feat(sql-contract-ts)!: emitter dispatches column defaults through co…
SevInf May 20, 2026
db4cf70
test(sql-contract-ts): pin codec-owned default dispatch + autoincreme…
SevInf May 20, 2026
83b94a8
feat(framework-components)!: surface codec descriptor traits through …
SevInf May 20, 2026
3ff7a4d
feat(framework-components)!: reshape AuthoringColumnDefaultTemplate t…
SevInf May 20, 2026
bc87016
refactor(sql-contract-ts): remove preset-default bridge; pin trait ga…
SevInf May 20, 2026
0d30ab2
feat(sql-contract-psl)!: route literal defaults through codec.decodeJ…
SevInf May 20, 2026
c362024
test(sql-contract-psl): cover D3 codec-owned default lowering cases
SevInf May 20, 2026
6ba7c9a
fix(sql-adapters): flip control-mutation-defaults to new AuthoringCol…
SevInf May 20, 2026
0badb2c
feat(family-sql)!: switch PSL printer mapDefault onto new ColumnDefau…
SevInf May 20, 2026
8d8cdc0
refactor(family-sql)!: lower raw-default parser + schema verify to ne…
SevInf May 20, 2026
42db021
test(family-sql): update existing tests for new ColumnDefault union
SevInf May 20, 2026
4fcf0ba
test(family-sql): pin PSL printer round-trip across new ColumnDefault…
SevInf May 20, 2026
8b68368
fix(family-sql): use result.ok for PSL parse assertion in round-trip …
SevInf May 20, 2026
568a53e
refactor(target-postgres)!: switch buildColumnDefaultSql to new Colum…
SevInf May 20, 2026
ae82401
test(adapter-postgres): update fixtures for new ColumnDefault union (…
SevInf May 20, 2026
d8c72a3
feat(sqlite): flip DDL renderer to new ColumnDefault union + INTEGER-…
SevInf May 20, 2026
78bea1e
test(adapter-sqlite): flip DDL fixture shapes to new ColumnDefault union
SevInf May 20, 2026
6955613
feat(fixtures)!: D7 — regenerate all contract fixtures for new Column…
SevInf May 20, 2026
73050f1
fix(demo)!: flip migration-history snapshots to new ColumnDefault union
SevInf May 20, 2026
7f1e7f3
fix(sql-contract-emitter)!: emit new ColumnDefault union shape in gen…
SevInf May 20, 2026
b2bc891
fix(framework-components): surface optional traits on ColumnTypeDescr…
SevInf May 20, 2026
195ec10
fix(extension-arktype-json): thread descriptor.traits through arktype…
SevInf May 20, 2026
c923409
test(extension-pgvector): flip planner test fixtures to new ColumnDef…
SevInf May 20, 2026
f59b6db
test(extension-sql-orm-client): flip inline contract fixture to new C…
SevInf May 20, 2026
9aaa538
fix(fixtures)!: re-emit generated contract.d.ts onto new ColumnDefaul…
SevInf May 20, 2026
956ea0c
style: satisfy biome lint hints introduced by new ColumnDefault dispa…
SevInf May 20, 2026
286df49
test(extension-pgvector): update DDL expectation for parenthesised DE…
SevInf May 20, 2026
f4aea38
test(e2e): migrate Postgres fixture to autoincrement() sentinel + wir…
SevInf May 20, 2026
993de0a
fix(demo)!: flip migration-history snapshot .d.ts files to new Column…
SevInf May 20, 2026
1a74cff
test(emitter): flip canonicalization fixtures to new ColumnDefault union
SevInf May 20, 2026
1fa7198
feat(family-sql): codec-aware default comparison in verifySqlSchema
SevInf May 20, 2026
5abfa43
feat(target-postgres): parsePostgresDefaultValue for codec-aware verify
SevInf May 20, 2026
0bececf
feat(target-sqlite): parseSqliteDefaultValue for codec-aware verify
SevInf May 20, 2026
8c2d970
feat(family-sql): SqlControlAdapter.parseSchemaDefaultValue + control…
SevInf May 20, 2026
971c38f
test(e2e): update DDL snapshot for codec-rendered defaults
SevInf May 20, 2026
83074e7
chore(family-sql): drop transient project ID from codec-defaults test…
SevInf May 20, 2026
3cbdd29
fix(telemetry-backend)!: regenerate emitted contract for new ColumnDe…
SevInf May 21, 2026
a8d42ba
feat(contract-ts): extract .default TInput from codec descriptor
SevInf May 21, 2026
e822570
test(contract-ts): branded-type cases prove .default open-set extractor
SevInf May 21, 2026
1cbed38
docs(drive): record F6 closed-set typing failure mode
SevInf May 21, 2026
a71c480
refactor(framework-components): delete dead codecValue arm from Autho…
SevInf May 21, 2026
dd56e65
refactor(sql-contract-psl): narrow emitFunctionFormColumnDefault to 2…
SevInf May 21, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions apps/telemetry-backend/src/prisma/contract.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions apps/telemetry-backend/src/prisma/contract.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions drive/calibration/failure-modes.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,25 @@ Patterns to **catch** the F-family modes live in [`grep-library.md`](./grep-libr

**Reference incident.** 2026-05-17, a family-sql M-sized migration dispatch apparently ran a setup cleanup (likely `git clean -fd`) that deleted an in-flight methodology project directory (~1500 lines of untracked docs). Survived only because the orchestrator had the content in conversation context and could re-write it.

### F6. Closed-set typing that satisfies enumeration-only tests while violating open-set spec promise

**Symptom.** The implementation types a value as a closed union of N concrete shapes (e.g. `string | number | Date | bigint | Uint8Array`). The tests exercise exactly those N shapes — strings, numbers, Dates, bigints, Uint8Arrays — and they compile, so the gate goes green. But the spec or NFR demands an *open set* defined by some structural extractor (a codec descriptor's `TInput`, a target's column-type contract, an extension-provided schema). Values outside the closed union but inside the extractor's range fail to compile despite the spec promising they will. The reviewer sees green tests + matching enumeration in the implementation and signs off; the orchestrator's intent-validation step does not probe whether the test set non-trivially exercises the spec's open-set promise.

**Detection signal.**

- The implementation's value-input type is a finite union literal (no `extends infer T`, no extractor at the type level).
- Every test case's value is a member of the implementation's union literal — bytewise.
- The spec or NFR uses words like "codec-defined", "target-defined", "extension-defined", "user-defined", "any shape the X admits", "open-set", "branded types".
- Test names enumerate the spec's example list ("accepts string", "accepts number", "accepts Date") rather than probe the open-set property ("accepts an arbitrary branded type", "accepts an extension-owned class instance").

**Mitigation.**

- When a spec NFR / AC references "codec-defined / target-defined / extension-defined / branded" types, the test set must exercise **at least one type the implementation cannot enumerate** — a branded type, a synthetic codec's `TInput`, an extension-owned class instance, or any other value that fails to compile under the closed union and only compiles when the extractor is real.
- The reviewer's checklist asks: "is at least one test case impossible to satisfy under a hand-coded closed union of the spec's example list?" If no — the test set is enumeration-only and the open-set promise is unverified.
- The orchestrator's intent-validation step probes whether the test set is tautological: name each test case's value, name each implementation-union member, and check whether the two sets are identical. Identical sets are a red flag.

**Reference incident.** 2026-05-21 D10. The SQL DSL `.default(value)` parameter was typed `SqlDslLiteralInput = ColumnDefaultLiteralInputValue | bigint | Uint8Array` (a closed enumeration). The existing AC test (`contract-builder.default.test-d.ts`) exercised exactly those shapes — a string, a number, `null`, an object, a `Date`, a `bigint`, a `Uint8Array` — all members of the closed union. The spec NFR2 said: "JS-native default values pass through without JSON round-trips in the TS DSL. Date, bigint, Buffer, Uint8Array, **and codec-defined branded types** are accepted by `.default(...)` directly, where the codec's `TInput` admits them." The reviewer passed the dispatch (D2 R1); the orchestrator's intent-validation step did not probe the codec-defined arm. Caught by the user reading the implementation. Fixed by replacing the closed union with `CodecInputForDescriptor<FieldDescriptor<State>>`, which reads the codec's `TInput` off the descriptor's `codecFactory` slot, and by adding branded-type / nominal-class test cases that fail to compile under the closed union.

## Slice-shape scope traps

Patterns that have produced scope creep in the past — catch these at triage or slice-spec time, not at execution time.
Expand Down
3 changes: 0 additions & 3 deletions examples/cipherstash-integration/src/prisma/contract.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions examples/paradedb-demo/src/prisma/contract.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 6 additions & 9 deletions examples/prisma-next-demo-sqlite/src/prisma/contract.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions examples/prisma-next-demo-sqlite/src/prisma/contract.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading