Skip to content

feat(home-a): conversation-first parent home prototype (synthetic data) - #32

Draft
obvious-autobuild[bot] wants to merge 3 commits into
masterfrom
candidate/home-a-conversation
Draft

obvious-autobuild[bot] wants to merge 3 commits into
masterfrom
candidate/home-a-conversation

Conversation

@obvious-autobuild

Copy link
Copy Markdown
Contributor

Candidate A of the parent-home A/B comparison — DO NOT AUTO-MERGE.
Human author: Gilbert Polanco (gilbertpolanco42@gmail.com)

  • Evidence artifact: Parent Home Candidate A — Conversation-First Prototype: Evidence & Findings (art_6oQvZxHx)
  • Task: todo_CDoPnsFZ (parent home candidate A — conversation-first)
  • Live preview (E2B session URL, expires with the sandbox session): https://8081-ibr1ped9y83529wciyqg1.e2b.app
  • Synthetic data only. No real user data anywhere; the Polanco household is fictional.

Acceptance criteria

  1. Runnable Expo RN prototype implementing the conversation-first objective: the home IS a conversation — capture, in-thread review of interpreted events, publish with raw-preserved provenance, conversational append-only correction, catch-up digest + month view, and cited read-only questions in one thread surface.
  2. Voice-primary capture with a full text alternative hitting the SAME pipeline (raw transcript → extraction → proposed events); real device voice is not wired (no microphone in this environment) — the text path is fully functional and voice ships as a simulated-transcription demo mode, disclosed in the evidence doc.
  3. Proposed events (type, child, time, amount, audience) are inspectable and editable in-thread before publish; publish confirms in-thread with raw source preserved.
  4. Post-publish correction is conversational and appends lineage; the original stays intact.
  5. Catch-up digest ("what happened since you last checked in"), month view on request, and read-only questions answered from the synthetic history with source citations; answers never write (asserted via store mutation counter).
  6. Vitest coverage: mixed-topic capture through BOTH text and simulated-voice paths; proposal edit before publish; publish → raw-preserved entry + events with provenance; correction appends lineage; read-only answers never write; fail-closed authorization (non-member/anonymous sees nothing).
  7. Repo gates green: pnpm turbo run typecheck && pnpm turbo run test (plus the app's Vitest suite).

Why

The parent-home A/B comparison needs two equally complete candidates to test whether a conversation surface beats a feed-first home for capture→review→correction→catch-up. Candidate A builds the conversation-first thesis end-to-end so the comparison is between real implementations, not stubs.

What changed

New self-contained workspace app apps/home-a (@journal/home-a) — no shared code touched:

  • src/journal/store.ts — in-memory store mirroring Convex adapter semantics: schema-decoded entries/events through packages/domain Effect v4 schemas, raw-before-events capture, captureId replay protection, stale-extraction suppression, reviewable proposals, publish receipts with provenance, append-only corrections, audience-filtered reads, citations, read-only questions, catch-up/month views, mutation counter for no-write assertions.
  • src/conversation/controller.ts — unified text/simulated-voice routing, question detection, review/publish/correct/catch-up/month-view, per-member principal switching (publish/correct are arrow class fields so the UI can pass them as bare references).
  • src/capture/extraction.ts — deterministic rule-based extraction double (no LLM): mixed-topic clause splitting, per-child attribution, six canonical categories + school transition, quantity/time parsing, unknown content (e.g. health) stays raw, v0.3 canonical ExtractionRequest/ExtractionResult envelope with producedBy lineage.
  • src/fixtures/ — synthetic Polanco household + September 1–16, 2026 dataset (24 captures): Sep 2 pre-K start, Sep 5 park photo note, Sep 8 balance-bike milestone, Nana Rosa's Sep 3/10/15 notes, a parents-only entry (Sep 6), the Sep 12 nap 30→60 lineage example, and the two required mixed-topic utterances.
  • src/ui/ + app shell — sign-in (Dana / Gilbert / Rosa / anonymous fail-closed), conversation surface, editable review cards, receipts with correction affordance, answer citations.

Tradeoffs

  • Self-contained app over shared-shell integration: keeps the candidate isolated for A/B (no changes to apps/mobile, backend, domain, CI), at the price of some duplicated UI primitives; consolidation is a post-selection follow-up.
  • Simulated voice over device voice: no microphone exists in this environment; the transcriber seam matches the voice spike's surface so a real transcriber swaps in without UI changes.
  • In-memory store over live Convex: preserves raw-before-events + captureId idempotency + schema-validated data without a backend dependency (backend thin-path port is another owner's lane).

Shared-change requests

None blocking. If Candidate A wins, follow-ups that would touch shared files: wire apps/home-a into CI's affected graph; native voice transcriber behind a device gate.

Verification

All commands run against exact HEAD 0089db9483840ca1881c51a9ced522acea96949c (post-rebase):

  • pnpm install --frozen-lockfile — clean
  • pnpm turbo run typecheck — 11 tasks OK
  • pnpm turbo run test — 8 tasks OK
  • cd apps/home-a && npx vitest run — 2 files, 25/25 passed

Browser walkthrough (Expo web, real Chromium): sign-in ×4 profiles, mixed-topic voice capture → 3 attributed review cards, read-only naps answer with 9 cited records, publish receipt, correction before 50 min → after 60 min, catch-up digest with citations, month view, anonymous fail-closed (empty thread + denied turn), Rosa's digest excluding the parents-only Sep 6 entry. Screenshots: project files home-a tc-1..tc-11 (details in the evidence artifact). The walkthrough also caught and fixed a real defect unit tests missed: bare method references lost this (reading 'now' TypeError) — fixed in 0089db9.

🔗 Obvious Project · 🧵 Obvious Thread

ObviousApp and others added 3 commits September 17, 2026 19:35
Candidate A of the parent-home A/B comparison. One conversation surface
owns capture (text + simulated-voice transcript through the SAME
pipeline), in-thread review/edit/publish of proposed events, append-only
post-publish corrections, read-only catch-up/questions with citations,
and fail-closed authorization for non-members and caregivers.

- in-memory journal store over the canonical v0.3 domain schemas:
  raw-before-events, captureId idempotency, extraction envelope
  (stale suppression / idempotent no-op), publish receipts with
  provenance, audience-filtered reads, append-only lineage
- deterministic rule-based extraction double: clause splitting,
  per-clause child attribution, six canonical categories, numeric
  quantities, health content stays raw, producedBy lineage
- synthetic September 2026 Polanco household (24 captures, 2 children,
  invited caregiver, parents-only example, Sep 12 30->60 correction)
- Expo RN app: sign-in (known members + anonymous), conversation
  screen, proposal review cards, receipts, correction forms
- 25 vitest tests: both input paths, edits before publish, publish
  provenance, correction lineage, read-only answers, fail-closed

Co-authored-by: Gilbert Polanco <gilbertpolanco42@gmail.com>
- drop "type": "module" so Metro loads babel.config.js as CommonJS
- extensionless relative imports (Metro has no .js->.ts mapping)
- add react-dom + react-native-web for the Expo web demo surface

Co-authored-by: Gilbert Polanco <gilbertpolanco42@gmail.com>
…s lost `this`

The conversation screen passed controller.publish/controller.correct as bare
method references, so invoking them from the UI ran with `this` undefined and
`this.now` threw before any turn could be pushed (browser-verified: uncaught
"Cannot read properties of undefined (reading 'now')"). Convert both to arrow
class fields, matching the existing subscribe/getVersion pattern.

Re-verified in Expo web after the fix: publish emits a receipt turn, the
correction form appends lineage (before 50 min → after 60 min), catch-up and
month view render, anonymous entry sees nothing and capture attempts produce
a denied · fail-closed turn, and Rosa's catch-up excludes the Sep 6
parents-only entry. Gates: tsc clean, vitest 25/25.

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