Skip to content

feat: 12h status report + behavior choreography (REQ-015,070-076,094-099)#10

Merged
cskwork merged 1 commit into
mainfrom
feat/status-report-choreo
May 4, 2026
Merged

feat: 12h status report + behavior choreography (REQ-015,070-076,094-099)#10
cskwork merged 1 commit into
mainfrom
feat/status-report-choreo

Conversation

@cskwork
Copy link
Copy Markdown
Owner

@cskwork cskwork commented May 4, 2026

Summary

  • §9.8 idle-triggered 12h status report (REQ-070..076) replaces the fixed daily reflection. Frontend gate (statusReportGate.ts) requires 12h 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 under pet_home/dreams/YYYY-MM-DD-HHMM.md.
  • §9.11 behavior choreography (REQ-094..099) — LLM 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 are rejected and replaced by a deterministic mood × event fallback so the pet always reacts visibly. Shares the existing 90s autonomous LLM cooldown with chat (REQ-097).
  • REQ-015 expressive sprites — 8 new MovementState poses (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 table_info-guarded ALTER; daily_reflections table retained alongside the new status_reports table.
  • Settings UI — Sandbox tab replaces "Last dream" with "Recent status reports" (powered by list_status_reports); the manual "Run daily reflection" button becomes "Run status report now".

Test plan

  • cargo test --lib75 passing (was 41, +34 new)
  • npm test128 passing (was 99, +29 new)
  • npm run check0 errors / 0 warnings (303 files)
  • Manual: npm run tauri:dev, drop a .md into inbox/, approve → observe multi-frame choreography with a closed-token bubble (no human sentences)
  • Manual: Settings → Sandbox → "Run status report now" → file lands under dreams/, "Recent status reports" populates, pet stays silent
  • Manual: stop Ollama, click "Run status report now" again → deterministic fallback prose still produces a 200-400 char paragraph
  • Manual: legacy DB migration — open with a pre-§9.8 user database to verify last_report_at is added without data loss
  • Manual: 30+ minute return → existing chat path still works (USER_RETURNED branch unchanged)

Notes

  • E2E deferred to BACKLOG #21 — Tauri webview e2e cannot be driven by stock Playwright; needs tauri-driver + webdriverio. Pure logic is already covered by statusReportGate.test.ts (10 tests) and choreography.test.ts (19 tests).
  • Sprites are 1024x1024 (Codex's smallest supported size). Rendered at ~140px so file size impact is minor; a build-time downscale could trim disk usage if needed.
  • daily_reflections table + run_daily_reflection command retained for backwards compatibility but no longer surfaced in the UI.

30 files changed, 3062 insertions(+), 64 deletions(-).

…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).
@cskwork cskwork merged commit 41e8313 into main May 4, 2026
2 checks passed
@cskwork cskwork deleted the feat/status-report-choreo branch May 4, 2026 13:48
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.

1 participant