feat: 12h status report + behavior choreography (REQ-015,070-076,094-099)#10
Merged
Conversation
…099)
§9.8 idle-triggered 12h status report replaces fixed daily reflection.
Frontend gate requires 12h elapsed AND idle/sleep ≥60s AND not
in-flight; no catch-up. Backend compiles a summary-statistics payload
(event counts, salience, mood distribution, top-3 memories — never
raw user input), runs the LLM with strict JSON validation, falls back
to a deterministic generator on any failure. Reports land under
pet_home/dreams/YYYY-MM-DD-HHMM.md and surface in Settings → "Recent
status reports".
§9.11 behavior choreography. The LLM, at high-salience events, picks
{preset, variant, bubble} from a closed catalog of 8 presets × 1-3
variants over MovementState. Bubbles are restricted to a closed
vocabulary (10 glyphs/onomatopoeia). Free-text replies trigger a
mood×event deterministic fallback so the pet always reacts visibly.
Shares the existing 90s autonomous LLM cooldown with chat (REQ-097).
REQ-015 adds 8 expressive sprites (stretch, peek, tilt_head, shake,
nuzzle, wiggle, dizzy, surprise) generated via codex-cli image_gen,
anchored to mochi-idle.png for tone consistency.
DB migration is non-destructive: pet_state.last_report_at added via
PRAGMA-guarded ALTER; daily_reflections retained alongside the new
status_reports table.
Tests: cargo 41→75, vitest 99→128, svelte-check 0 errors. E2E deferred
to BACKLOG #21 (Tauri webview needs tauri-driver, not stock Playwright).
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.
Summary
statusReportGate.ts) requires12h elapsed AND idle/sleep ≥60s AND not in-flight; no catch-up for missed windows. Backend compiles a summary-statistics payload (event counts, salience sum, mood distribution, top-3 memories — never raw user input), runs the LLM with strict JSON validation, and falls back to a deterministic generator on any failure. Reports land underpet_home/dreams/YYYY-MM-DD-HHMM.md.{preset, variant, bubble}from a closed catalog of 8 presets × 1-3 variants overMovementState. Bubbles are restricted to a closed vocabulary (10 glyphs/onomatopoeia). Free-text replies are rejected and replaced by a deterministicmood × eventfallback so the pet always reacts visibly. Shares the existing 90s autonomous LLM cooldown with chat (REQ-097).MovementStateposes (stretch,peek,tilt_head,shake,nuzzle,wiggle,dizzy,surprise) generated viacodex-cliimage_gen, anchored tomochi-idle.pngfor tone consistency.pet_state.last_report_atadded viaPRAGMA table_info-guardedALTER;daily_reflectionstable retained alongside the newstatus_reportstable.list_status_reports); the manual "Run daily reflection" button becomes "Run status report now".Test plan
cargo test --lib— 75 passing (was 41, +34 new)npm test— 128 passing (was 99, +29 new)npm run check— 0 errors / 0 warnings (303 files)npm run tauri:dev, drop a.mdintoinbox/, approve → observe multi-frame choreography with a closed-token bubble (no human sentences)dreams/, "Recent status reports" populates, pet stays silentlast_report_atis added without data lossNotes
tauri-driver+webdriverio. Pure logic is already covered bystatusReportGate.test.ts(10 tests) andchoreography.test.ts(19 tests).daily_reflectionstable +run_daily_reflectioncommand retained for backwards compatibility but no longer surfaced in the UI.30 files changed, 3062 insertions(+), 64 deletions(-).