FastAPI app with invite-code signup, message send/relay over
WebSocket, and the DB schema from roadmap.md Phase 1 §2.1 (users,
contacts, conversations, messages, twin_settings, whitelist_rules,
escalation_logs). Defaults to SQLite for local dev, PostgreSQL in
prod per tech-design.md §8.
Verified end-to-end with TestClient: signup, duplicate-invite-code
rejection (409), message persistence, 404 on an unknown conversation,
and WebSocket broadcast delivery all behave as expected.
Push notifications and the AI pipeline integration (item 3) are not
in this commit -- see backend/README.md and roadmap.md's checklist.
tech-design.md §8 settles the stack (Android/Kotlin, Python/FastAPI,
PostgreSQL, WebSocket relay, Room+SQLCipher) so it stops blocking
item 1 of the build order. roadmap.md's Phase 1 breakdown is now
checkboxes instead of prose, and AGENTS.md adds the rule to check/
update that checklist before and after any Phase 1 app-build task,
rather than tracking progress ad hoc.
PoC execution is on hold for now, so this splits Phase 1 into work
that's independent of PoC results (backend infra, client shell, AI
pipeline productionization) vs. values that genuinely need PoC data
(autonomy defaults, whitelist topics, trust UX copy) -- so
infrastructure work isn't blocked while PoC recruiting catches up.
blind_eval.py runs PoC #1's blind-eval methodology over N held-out
corpus dialogues automatically (generate_draft.py refactored to
expose draft_reply() so both share the same drafting logic).
retrieve_style.py implements the keyword/recency search from
tech-design.md §2-1 and wires into generate_draft.py as --history,
replacing hand-curated --style files.
Bash access was intermittently restricted for part of this session
(auto-mode safety classifier), so these were initially written and
committed-pending without live execution. Now verified for real:
generate_draft.py's existing behavior still holds after the
draft_reply() refactor, blind_eval.py runs cleanly against val.jsonl,
and retrieve_style.py's original weighted-sum scoring had a real bug
-- recency drowned out keyword overlap for short Korean messages
(particle attachment means "핀란드" and "핀란드는" don't share a
token), so it was effectively returning the most recent messages
regardless of topic. Fixed by ranking on (overlap, recency) instead
of a weighted sum, confirmed the Finland-related exemplar now ranks
first for a matching query.
escalation_filter.py implements tech-design.md §3's first step as an
actual hard gate, not just a system-prompt instruction: money,
appointment-confirmation, and emotional content stop generate_draft.py
before it ever calls Gemini. Self-test 10/10; measured a 0.93% trigger
rate against 82,305 real corpus utterances (mostly factual price
mentions, not personal money requests -- noted as an upper bound, not
a real-usage estimate).
v1 doesn't train a custom model: it retrieves the closest-matching
past messages from the person's own history and feeds them as
few-shot exemplars to the same prompt contract generate_draft.py
already implements, via the hosted Gemini call. Narrows the AI-Hub
base corpus's role to evaluation and future on-device distillation,
since a hosted LLM already covers general Korean fluency.
Provide .env.example, ignore local .env, and teach generate_draft.py to
load the repo-root .env so PoC #1 can use Gemini without exporting keys
in the shell every time.
Co-authored-by: okuma <o0kuma@users.noreply.github.com>
build_unlabeled_corpus.py pulls the 34,030 raw-source dialogues that
never got speech_act/slot labels (found via the earlier QA
cross-check) into their own unlabeled.jsonl, forward-filling the
per-dialogue metadata that AI-Hub's CSV export only writes on each
dialogue's first row. Verified against the actual data: 176,605
raw - 142,575 labeled = 34,030, matches exactly.
Uses google-genai + GEMINI_API_KEY instead of the Anthropic SDK, per
product decision to run the server-fallback LLM on Gemini. Same
prompt contract and escalation behavior; only the client/env var
name changed. README documents where to actually set the key.
generate_draft.py takes a few style-exemplar messages plus recent
conversation context and drafts a reply via LLM call (the server
fallback path from tech-design.md §2), with escalation baked into
the system prompt for money/appointment/emotional content. Verified
prompt construction against a real corpus dialogue and hand-compared
a generated draft to the withheld real reply (README "샘플 검증") --
no API key in this session, so the live call itself is untested.
Consolidates the AI-Hub "한국어 SNS 멀티턴 대화" TL/VL zip parts into
clean train/val JSONL (142,575 dialogues), with a QA cross-check
against the raw TS/VS source. Script and docs only -- the dataset
itself stays out of git per .gitignore, both for size and because
AI-Hub's terms restrict redistribution.
Consolidates what's ready (doc set, PoC plans/materials, prototype)
vs. what still needs a human to execute (recruiting, interviews,
Go/No-Go calls), plus a Q1-Q7 confirm/revisit checklist for the
actual planning meeting.
poc-materials.md only tests how the recipient reacts to the twin; Q3
asks whether the person delegating to it actually wants to. Adds a
separate screening + interview script for that side, with guidance
on sequencing it before the peer role-play so the two perspectives'
gap becomes a signal in itself.
Recruiting message and data-consent blurb for PoC #1, a role-play
script for the one scenario the click prototype doesn't cover
(emotional escalation), and a shared post-session interview guide —
so participant recruitment can start without drafting these from
scratch.
Built an interactive click-through prototype covering the read-receipt,
identity-confirmation/veto, and escalation scenarios plus the autonomy
settings screen. Link it into PLANNING.md's checklist and poc-plan.md
so PoC #3 role-play can reuse it as stimulus material instead of
building scenario scripts from scratch.
Turns the two highest-priority open risks (on-device tone realism,
impersonation/trust acceptance) into runnable protocols: sample
collection, blind evaluation, role-play scripts, and pass/fail
thresholds, so results can update decision-log.md and risk-log.md.
Update PLANNING.md §2 from empty checkboxes to the working answers in
decision-log, fix the reverse OS/self-app wording, and clarify roadmap
Phase 3 so OS-layer growth does not rewrite the start order.
Co-authored-by: okuma <o0kuma@users.noreply.github.com>
Introduce a single source of truth for agent guidance during the
planning-docs phase: document authority, tentative Q1-Q7 handling,
v1 scope guards, safety invariants, and next PoC priorities.
Co-authored-by: okuma <o0kuma@users.noreply.github.com>
Resolves the open Q1-Q7 questions as tentative decisions (self-app beta
first, target consumers, MVP scenario = read-receipt relief + group-chat
catch-up, autonomy capped at L0-L2) and builds the standard deliverable
set on top of them, ready for review at the next meeting.
Captures the idea-meeting doc and a step-by-step planning process:
confirm the open decisions (Q1-Q7), narrow to one MVP scenario,
sequence technical validation, and phase autonomy levels (L0-L4)
before writing a full PRD.