Skip to content

feat: scaffold pnpm + Turborepo monorepo with Effect v4 domain contracts - #9

Merged
obvious-autobuild[bot] merged 7 commits into
masterfrom
feat/monorepo-scaffold
Sep 17, 2026
Merged

obvious-autobuild[bot] merged 7 commits into
masterfrom
feat/monorepo-scaffold

Conversation

@obvious-autobuild

Copy link
Copy Markdown
Contributor

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

  • pnpm 10.34.5 (Corepack) + Turborepo 2.10.13 workspace: 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 via Schema.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 the captureId/attempt extraction envelope (interruption tolerance, stale-result suppression, idempotent completion) included; JSON Schema draft 2020-12 tool contracts derived via Effect's own SchemaRepresentation (verified with real round trips on this exact pin).
  • One tested Effect→Convex validator adapter (@journal/domain/convex): Convex table annotations on the Effect fields drive v.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/convex schema defines the four flat blueprint tables (children, households, entries, events) with validators + indexes derived through that adapter — no competing domain model.
  • packages/extraction stub: TranscriptEventExtractor over the envelope contract + the single decode path all extractor output must take; no LLM call yet.
  • apps/mobile: Expo 57 / RN 0.86, ConvexProvider wired to EXPO_PUBLIC_CONVEX_URL (compiles without a deployment).
  • Thin-path integration (PR deploy(convex): thin-path functions on dev deployment reliable-panther-823 #5): per that PR's own README ("the winning candidate replaces this branch's convex/ + package.json at integration"), the standalone root convex/ tree, npm package.json, package-lock.json, root tsconfig.json, and deploy/contract-smoke.ts are retired; deploy/thin-path-evidence.md and its deployment-verified findings are preserved, with the record carried in the README. Porting the thin-path functions onto the canonical contract in backend/convex is explicit follow-up work.
  • Confect: evaluated and rejected — @confect/* 9.4.3 declares effect ^3.21.2 as 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

  • Start at packages/domain/src/ (entry.ts, event.ts, ids.ts, convexAdapter.ts) — the contract decisions live there. test/roundtrip.test.ts is 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.
  • The one place touching undocumented Effect AST internals is packages/domain/src/schemaAst.ts (plus the boundary passthrough in jsonSchema.ts) — every property is pinned by tests against effect@4.0.0-rc.115.
  • Intentionally deferred: backend function implementations (needs Convex codegen/deployment), porting thin-path functions onto the four-table contract, CI rebases of sibling branches.

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 tasks
  • pnpm turbo run test — 11 pass, 0 fail
  • pnpm turbo run build — 3/3 tasks

Backend-only change; no visual evidence applicable.

Human author: Gilbert Polanco (gilbertpolanco42@gmail.com)

🔗 Obvious Project · 🧵 Obvious Thread

ObviousApp and others added 5 commits September 17, 2026 17:55
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>
@obvious-autobuild
obvious-autobuild Bot marked this pull request as ready for review September 17, 2026 17:56
ObviousApp and others added 2 commits September 17, 2026 17:57
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>
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.

2 participants