Repository navigation
Conversation
Use the ^3.24.1 range apps/website declares, which the lockfile already resolves to zod 3.25.76.
Validators for node schemas, relation type schemas, relation triple schemas, nodes and relations parse JSON into the contract types, refusing unknown keys and ISO dates without an offset. A type test fails tsc when a validator's output drifts from its contract type.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: aca0e5a942
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Reviewer brief
packages/database/src/crossAppValidators.tsholds one Zod validator for each of the five root CrossApp types. Nothing calls them yet. The upsert route (FEE-890) is stacked on this PR and checks its request body with them, importing the file by relative path, so the package exports no new path.Z,+hh:mmor+hhmm). They parse toDate, so validated output is the contract type the converters take. An offsetDatecan't read, such as+24:00, is refused. So is a date whose UTC year is outside 1 to 9999: Postgres can't read the stringtoISOStringwrites for it, and one such row fails the wholeupsert_conceptscall.ridmust passisRid. Other ids and the content hash are checked only as strings.crossAppValidators.test.tsfailstscwhen a validator's output and its contract type differ in either direction, including an optional key, at the root or inslots,assetsormetadata. It does not compare inside the content variants (direct,directAndDescription,full), so a difference there passestsc.jsonb, so one such item fails the wholeupsert_conceptscall. Roam and Obsidian already callupsert_conceptsdirectly with the same exposure.safeParsethrows onmetadatanested about 1,300 to 1,600 levels deep instead of returning a failure. A triple schema with a missing field reports its error at the root path. Roam's relation and triple converters can producemodifiedAt: null, which these validators refuse. That matters when Roam moves onto the route, which has no ticket yet.Verification
pnpm ci:validatepasses: check-types 8/8 tasks, test:unit 6/6 tasks.templateTitlefrom the node schema validator, or adding acolourkey to the relation validator, failstsc.Loom video
eng-2005-terminal-proof.mp4
Setup: a terminal in this PR's worktree at
aca0e5a. Later commits fix review findings: the offset and year checks on dates, which unit tests cover, and removing the unused package export. The video doesn't show them. A small script kept outside the repo feeds JSON bodies to the validators. No app and no database are involved, because nothing calls the validators yet.Datevalues.ridthat is not a RID, and a bad nested content type.pnpm ci:validatepasses on the branch.Scope check
$scope-checkagainst ENG-2005 and the final diff.Done When: Unknown keys are refused, not stripped, which the contract types don't require; maparent decides (see Review focus). Thezoddependency in@repo/database, the date checks (an offset, a valid date, a UTC year from 1 to 9999) and theisRidcheck support the validators.Standards check
$dg-pr-adherence-checkagainst the final diff and PR metadata.Local delegated full review
$dg-delegated-full-reviewwhen no other full-review workflow is available.DiscourseGraphs/review-labat01b07f3) on1a5f004d: two P3 findings (B1, B2), both listed above; nothing blocks review. Review Lab page