Skip to content

Uncertainty engine: Drizzle schema + zod companion (#98)#109

Merged
ssilvius merged 2 commits intofeat/uncertainty-migrationfrom
feat/uncertainty-schema
Apr 28, 2026
Merged

Uncertainty engine: Drizzle schema + zod companion (#98)#109
ssilvius merged 2 commits intofeat/uncertainty-migrationfrom
feat/uncertainty-schema

Conversation

@ssilvius
Copy link
Copy Markdown
Contributor

Closes #98. Stacks on #108.

apps/web/src/db/schema/uncertainty.ts mirrors the migration column shapes -- timestamp_ms mode on time fields, json mode on payload columns, enum constraint on state.

apps/web/src/db/schema/uncertainty.zod.ts narrows inserts/selects with bounded confidence and correctness ranges (0..1) and surfaces the predictionState and outcomeLabel enums for handler use.

No barrel files; consumers import from the specific schema file.

Closes #98. Phase 1 of the uncertainty engine spike.

uncertainty.ts mirrors the migration column shapes -- timestamp_ms mode
on the time fields, json mode on the payload columns, enum constraint
on state. uncertainty.zod.ts narrows the inserts/selects with bounded
confidence/correctness ranges (0..1) and surfaces the prediction state
and outcome label enums for handler use.

No barrel files; consumers import from the specific schema file.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ssilvius ssilvius merged commit 90910f4 into feat/uncertainty-migration Apr 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant