[Workshop] Phase 1: State Schema v1 — Timmy's presence as data #360
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Epic: #222 — The Workshop
Refines: #265 (vision issue)
What
Define and implement the canonical state file that Timmy writes as a natural artifact of existing. This is the foundation — everything else in the Workshop reads from this file.
File
~/.timmy/workshop-state.yamlSchema v1
Implementation
~/.timmy/workshop-state.yamlwith the schema abovemood.primaryderived from recent interaction tone + time of day + activitymood.confidencefrom existing confidence modulemood.energydecays 0.01/min without interaction, resets on conversationenvironmentfrom system clockactivityfrom what Timmy is actually doingAcceptance Criteria
~/.timmy/workshop-state.yamlexists and validates against schemaupdated_atreflects actual write time (not stale)python3 -c "import yaml; print(yaml.safe_load(open(...)))"worksDependencies
Blocks
Kimi Instructions for #360 — Workshop State Writer
Overview
Create a state writer module that aggregates Timmy's existing cognitive state + Pip the Familiar + environment into a single YAML file at
~/.timmy/workshop-state.yaml.Files to Create
src/timmy/workshop_state.py— the state writertests/timmy/test_workshop_state.py— testsImplementation Details
src/timmy/workshop_state.py:Read from existing modules:
from timmy.cognitive_state import cognitive_state(singleton tracker)from timmy.familiar import pip_familiar(singleton familiar)The writer should:
~/.timmy/workshop-state.yamlusing PyYAMLwrite_state()function and aget_state_dict()functionMood mapping:
curious→ workshopcontemplativesettled→calmhesitant→uncertainenergized→excitedcalmEnergy: Track internally. Start at 0.5, decay 0.01/min, reset to 0.8 on conversation.
Activity mapping:
idlethinkingwatching-giteatalkingEnvironment: Derive from
datetime.now():Familiar: From
pip_familiar.snapshot().to_dict()State file path:
Path.home() / '.timmy' / 'workshop-state.yaml'. Create directory if missing.Testing (
tests/timmy/test_workshop_state.py)get_state_dict()returns valid schema (all required keys present)write_state()creates file and it's valid YAMLRun Tests
Do NOT
Scope Update for #360
PR #377 merged —
WorkshopHeartbeatnow writes~/.timmy/presence.jsonevery 30s.What #360 still needs:
The heartbeat infrastructure is done. What's missing is the rich state aggregation from the original schema:
get_state_dict()inworkshop_state.pyto include: identity block, activity block (current + detail + duration), attention block, environment block (time_of_day from clock), familiar/Pip state frompip_state_machineTests should cover: full schema validation, energy decay, all mood/activity enum values.