Skip to content

deploy(convex): thin-path functions on dev deployment reliable-panther-823 - #5

Merged
OCPdev25 merged 3 commits into
masterfrom
deploy/thin-path
Sep 17, 2026
Merged

OCPdev25 merged 3 commits into
masterfrom
deploy/thin-path

Conversation

@obvious-autobuild

@obvious-autobuild obvious-autobuild Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Why

The Shared Child Journal's thin path — capture a dictated entry, validate extracted events, read a per-child timeline — currently exists only as shapes in the published Effect v4 Schema Contract (art_I2TCG08V). This branch deploys the actual functions to the EXISTING Convex dev deployment reliable-panther-823 (created by Gil; the stored deploy key scopes to it — verified before any write) and proves them with a synthetic write→read loop through the Convex CLI.

What

  • convex/contract.ts — canonical Event/Entry Effect v4 schemas (effect@4.0.0-rc.115), mirroring the spike-verified contract: six category literals, unix-ms wire times, confidence ∈ [0,1], non-empty strings, explicit null rejected, empty events allowed (extraction failure never blocks capture).
  • convex/wire.ts + convex/schema.ts — the one-directional schema→validator mapping from the contract's "Convex mapping" section; entries indexed by captureId (idempotency) and [childId, createdAt] (timeline).
  • convex/children.ts — children:create mutation (non-empty name, optional birthDate).
  • convex/entries.ts — entries:createEntry mutation: raw transcript always preserved; each extraction event decoded through the canonical schema; idempotent on captureId retry (original capture wins — a retried submit with a changed payload is absorbed, no second row); validation failures return captured_with_event_errors with per-event detail while the capture itself persists.
  • convex/timeline.ts — timeline:list query, per child, chronological.
  • deploy/contract-smoke.ts — local decode/reject/encode verification run before deploying (7 checks, all pass).

Deployment-verified finding (F1): Convex rejects stored fields starting with _ (reserved for system fields), so the contract's wire-level _tag literal is stripped on write and re-wrapped on read — a correction to the contract's mapping table that other candidates need (the spike never executed a real insert). Also verified: import { Schema } from 'effect/Schema' does not resolve on rc.115 — a namespace import is required.

How to Review

deploy/thin-path-evidence.md holds the full redacted transcripts: deployment-scope verification (npx convex env list → reliable-panther-823), deploy output ("Schema validation complete"), the idempotency loop (duplicate submit → idempotent_hit, same entryId), the timeline showing 2 entries, not 3, and the validation-failure case (schema-precise errors returned, raw transcript preserved, zero events stored). This branch is a deployment-verification vehicle — the winning candidate's shared domain package replaces convex/contract.ts at integration.

Test Evidence

  • Labels: CLOUD DEV deployment (reliable-panther-823) with synthetic data via CLI — NOT live-LLM extraction, NOT native device, NOT browser app UI.
  • Visual-evidence exception: backend-only Convex deployment — no rendered UI surface exists on this branch; evidence is command transcripts + the deployment URL.
  • Local gates: npm run contract:smoke pass, tsc --noEmit clean, deploy completed with schema validation.
  • Full transcripts (shareable): Thin-Path Deployment Evidence — reliable-panther-823
  • Deployed code commit: 94e706c; branch head with evidence: 14a038b.

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

🔗 Obvious Project · 🧵 Obvious Thread

Minimal Convex functions per the published Effect v4 Schema Contract
v0.1 (art_I2TCG08V), effect@4.0.0-rc.115:

- children:create — non-empty name, optional birthDate (unix ms)
- entries:createEntry — raw transcript always preserved; extraction
  events decoded through the canonical Effect schema before storage;
  idempotent on captureId retry (original capture wins, retries are
  absorbed without a second write); validation failures return
  captured_with_event_errors and never block the capture
- timeline:list — per-child entries, chronological by createdAt

Convex validators (wire.ts) are the one-directional schema->storage
mapping from the contract's Convex mapping section; range constraints
(confidence in [0,1]) are enforced by the Effect schema at the
mutation boundary.

This branch is a deployment-verification vehicle — the winning
candidate's shared domain package replaces convex/contract.ts at
integration.

Co-authored-by: Gilbert Polanco <gilbertpolanco42@gmail.com>
ObviousApp and others added 2 commits September 17, 2026 17:45
Deployment-verified finding: Convex rejects stored fields starting with
an underscore (reserved for system fields like _id), so the contract's
wire-level _tag literal cannot be persisted as the mapping table in the
published contract assumed. Keep _tag on the wire in both directions —
createEntry strips it after encode before insert, timeline:list
re-wraps stored rows on read so returned objects still decode through
the canonical Entry/Event schemas unchanged. Table + validator identity
replaces the tag at rest.

Co-authored-by: Gilbert Polanco <gilbertpolanco42@gmail.com>
…er-823

Full redacted transcripts: deployment-scope verification, deploy output,
synthetic write→read loop (idempotent captureId retry, 2-entry timeline,
validation-failure case with raw preserved), Finding F1 (Convex
underscore-field storage constraint vs the contract's _tag mapping),
and the effect/Schema import-style note. Labels the branch as a
deployment-verification vehicle in the README.

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:49
@OCPdev25
OCPdev25 merged commit ecf4018 into master Sep 17, 2026
obvious-autobuild Bot pushed a commit that referenced this pull request Sep 17, 2026
…tract

Port the retired thin-path functions (PR #5) onto backend/convex with
validators derived from the packages/domain contracts via the tested
Effect->Convex adapter:

- contracts: CreateEntryInput gains authorId + optional captureId (the
  capture session id, required for PR #5's idempotency semantic); new
  CreateEntryOutput, CreateChildInput/Output, minimal CreateHouseholdInput/
  Output (children:create needs a household creation path); EntryFields
  gains optional captureId
- schema: entries gains by_capture (idempotency lookup) and
  by_child_createdAt (chronological timeline) indexes
- functions: households:create, children:create (trim + non-empty name,
  household existence check), entries:createEntry (raw-first capture,
  extractionStatus pending, idempotent on captureId - original capture
  wins, retried payload changes absorbed, same entryId returned),
  timeline:list (by_child_createdAt asc, optional limit, rows decode
  through EntrySchema so output is validated contract shape)
- convex codegen (_generated) committed per repo policy (CI has no
  deployment)

Divergence from the thin path: createEntry no longer accepts inline
events - the canonical model captures raw-first and events belong to the
extractor via the AppendEventsInput contract.

Co-authored-by: Gilbert Polanco <gilbertpolanco42@gmail.com>
obvious-autobuild Bot added a commit that referenced this pull request Sep 17, 2026
…tract (#13)

Ports the retired thin-path functions (PR #5) onto backend/convex with validators derived from the packages/domain contracts via the tested Effect->Convex adapter:

- contracts: CreateEntryInput gains authorId + optional captureId (capture session id, required for PR #5's idempotency semantic); new CreateEntryOutput, CreateChildInput/Output, minimal CreateHouseholdInput/Output; EntryFields gains optional captureId
- schema: entries gains by_capture (idempotency lookup) and by_child_createdAt (chronological timeline) indexes
- functions: households:create, children:create (trim + non-empty name, household existence check), entries:createEntry (raw-first capture, extractionStatus pending, idempotent on captureId - original capture wins, retried payload changes absorbed, same entryId returned), timeline:list (by_child_createdAt asc, optional limit, rows decode through EntrySchema so output is validated contract shape)
- convex codegen (_generated) committed per repo policy (CI has no deployment)
- deploy/port-evidence.md: synthetic smoke on reliable-panther-823 - idempotency, contract-shaped timeline, fail-closed negatives - re-run at the rebased head after the v0.3 fold (PR #14) merged mid-flight

Divergence from the thin path: createEntry no longer accepts inline events - the canonical model captures raw-first and events belong to the extractor via the AppendEventsInput contract.

Review: pass-with-notes at c5dc6fb (independent reviewer, th_9CCFeh6U); CI run 35259935719 SUCCESS on c5dc6fb.

Co-authored-by: Gilbert Polanco <gilbertpolanco42@gmail.com>
obvious-autobuild Bot pushed a commit that referenced this pull request Sep 17, 2026
… 7/7; F1 refinement

- qa-convex: standard convex/ functions layout + convex.json + package root;
  entries table gains events column so the F1 probe isolates the _tag question
- driver: route queries to /api/query; neutral F1-probe reporting
- executed against anonymous local backend (anonymous-qa-convex):
  upload URL -> POST (storageId) -> commit (photoId), SHA-256 read-back match
- F1 REFINED: raw /api layer strips _tag as protocol metadata and ACCEPTS the
  entry-carrying commit — the 'Convex rejects _-prefixed fields' interpretation
  from PR #5 F1 does not hold at the wire layer; adapter-layer scope
- QA-DEVICE-PROOF.md: item 9 marked EXECUTED with full evidence + F1 note
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