feat: scaffold pnpm + Turborepo monorepo with Effect v4 domain contracts - #9
Merged
Merged
Conversation
pnpm 10.34.5 (corepack), Turborepo 2.10.13, TypeScript ~6.0.3, strict tsconfig base, hoisted node_modules for Expo/Metro compatibility, and a root README covering layout, run commands, and the Confect decision. Co-authored-by: Gilbert Polanco <gilbertpolanco42@gmail.com>
…pter packages/domain is the single source of truth: executable Effect v4 schemas for Child, Household, Entry, and Event; operation input/output schemas for Convex queries/mutations; TS types inferred via Schema.Type, never hand-written. Includes the one tested Effect->Convex validator adapter (table annotations drive v.id targets), JSON Schema draft 2020-12 tool contracts via Effect's own SchemaRepresentation, and the captureId/attempt extraction envelope plus per-entry visibility from contract v0.2. Entry/Event round-trip tests are the repo's first tests. Co-authored-by: Gilbert Polanco <gilbertpolanco42@gmail.com>
…mitives packages/extraction defines the TranscriptEventExtractor contract over the captureId/attempt envelope with a no-op stub (no LLM call) and the decode path all external extractor output must take through the domain schemas. packages/ui is the minimal shared React Native primitive placeholder. Co-authored-by: Gilbert Polanco <gilbertpolanco42@gmail.com>
Expo React Native (TypeScript) entry screen rendered through the shared UI package, ConvexProvider connected to a dev deployment URL from EXPO_PUBLIC_CONVEX_URL (no deployment required to compile), Metro monorepo resolver, and .env.example without secrets. Co-authored-by: Gilbert Polanco <gilbertpolanco42@gmail.com>
backend/convex/schema.ts defines the four flat tables (children, households, entries, events) with validators and indexes derived from the canonical Effect v4 fields through the domain adapter — one contract representation, no competing models. Co-authored-by: Gilbert Polanco <gilbertpolanco42@gmail.com>
The domain and extraction test scripts run bun test, which is preinstalled in the dev sandbox but not on ubuntu-latest runners. Pin the same version via oven-sh/setup-bun so CI executes the exact runtime the local validation used. Co-authored-by: Gilbert Polanco <gilbertpolanco42@gmail.com>
The domain and extraction test scripts run bun test, which is preinstalled in the dev sandbox but not on ubuntu-latest runners. Pin the same version via oven-sh/setup-bun so CI executes the exact runtime the local validation used. Co-authored-by: Gilbert Polanco <gilbertpolanco42@gmail.com>
This was referenced Sep 17, 2026
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.
Why
Shared Child Journal needs its real foundation: a runnable monorepo where the canonical Effect v4 contracts, the Convex backend, the Expo capture app, and the extraction pipeline can evolve against ONE source of truth. Until now the repo held only CI config, a threat model, the thin-path deployment vehicle, and the eval corpus — no shared application structure.
What
apps/mobile,backend/convex,packages/{domain,extraction,ui}; strict TypeScript ~6.0.3 base config; hoisted node_modules for Expo/Metro compatibility.packages/domain— the canonical contracts package (effect 4.0.0-rc.115): executable schemas for Child/Household/Entry/Event plus operation input/output schemas; all TS types inferred viaSchema.Type— none hand-written; entry visibility (contract v0.2: publication state only — audience is resolved from household/relationship grants, never stored on the entry) and thecaptureId/attemptextraction envelope (interruption tolerance, stale-result suppression, idempotent completion) included; JSON Schema draft 2020-12 tool contracts derived via Effect's ownSchemaRepresentation(verified with real round trips on this exact pin).@journal/domain/convex): Convex table annotations on the Effect fields drivev.id('table')targets; covers ids, literal unions, arrays of ids, records, and both optional forms. Fails loudly on unsupported schema vocabulary instead of silently mis-validating.backend/convexschema defines the four flat blueprint tables (children, households, entries, events) with validators + indexes derived through that adapter — no competing domain model.packages/extractionstub:TranscriptEventExtractorover the envelope contract + the single decode path all extractor output must take; no LLM call yet.apps/mobile: Expo 57 / RN 0.86,ConvexProviderwired toEXPO_PUBLIC_CONVEX_URL(compiles without a deployment).convex/+package.jsonat integration"), the standalone rootconvex/tree, npmpackage.json,package-lock.json, roottsconfig.json, anddeploy/contract-smoke.tsare retired;deploy/thin-path-evidence.mdand its deployment-verified findings are preserved, with the record carried in the README. Porting the thin-path functions onto the canonical contract inbackend/convexis explicit follow-up work.@confect/*9.4.3 declareseffect ^3.21.2as a peer; install fails with ERESOLVE against Effect v4, so Convex validators are derived from the Effect contracts through the tested adapter instead.How to Review
packages/domain/src/(entry.ts,event.ts,ids.ts,convexAdapter.ts) — the contract decisions live there.test/roundtrip.test.tsis the executable spec (11 tests): decode/encode round trips, typed rejections (bad category, out-of-range/NaN confidence, empty transcript), adapter validator shapes, envelope decode, JSON Schema derivation.packages/domain/src/schemaAst.ts(plus the boundary passthrough injsonSchema.ts) — every property is pinned by tests against effect@4.0.0-rc.115.Test Evidence
Local run of the exact CI sequence (Node 20.20.2, bun 1.3.14, pnpm 10.34.5):
pnpm install --frozen-lockfile— clean (503 packages, no peer conflicts)pnpm turbo run typecheck— 7/7 taskspnpm turbo run test— 11 pass, 0 failpnpm turbo run build— 3/3 tasksBackend-only change; no visual evidence applicable.
Human author: Gilbert Polanco (gilbertpolanco42@gmail.com)
🔗 Obvious Project · 🧵 Obvious Thread