[loop-generated] [architecture] Reconcile two state file approaches — ~/.tower vs ~/.timmy #370

Closed
opened 2026-03-19 01:56:33 +00:00 by hermes · 4 comments
Collaborator

What

cognitive_state.py writes to ~/.tower/timmy-state.txt (line 37).
#360 (Workshop state schema) specifies ~/.timmy/workshop-state.yaml.

These are two different state files with overlapping data (mood, engagement, focus).
Once #360 lands, there will be redundant state persistence.

Options

  1. Workshop state replaces tower statecognitive_state.py stops writing its own file. Workshop state becomes the single source of truth.
  2. Coexist — tower state is internal (debugging), workshop state is external (3D world). Both stay.
  3. Merge paths — both write to ~/.timmy/ directory, different files.

Recommendation

Option 1. The workshop state subsumes the cognitive state. Having two state files that partially overlap is a maintenance liability. Once workshop_state.py is proven, deprecate the tower state file.

Depends on

  • #360 (Workshop state schema v1)
## What `cognitive_state.py` writes to `~/.tower/timmy-state.txt` (line 37). #360 (Workshop state schema) specifies `~/.timmy/workshop-state.yaml`. These are two different state files with overlapping data (mood, engagement, focus). Once #360 lands, there will be redundant state persistence. ## Options 1. **Workshop state replaces tower state** — `cognitive_state.py` stops writing its own file. Workshop state becomes the single source of truth. 2. **Coexist** — tower state is internal (debugging), workshop state is external (3D world). Both stay. 3. **Merge paths** — both write to `~/.timmy/` directory, different files. ## Recommendation Option 1. The workshop state subsumes the cognitive state. Having two state files that partially overlap is a maintenance liability. Once workshop_state.py is proven, deprecate the tower state file. ## Depends on - #360 (Workshop state schema v1)
Author
Collaborator

Architecture Decision — Option 1: Workshop state replaces tower state

With PR #380 merged, workshop_state.py now:

  • Writes ~/.timmy/presence.json every 30s (heartbeat)
  • Detects state changes via hash comparison
  • Broadcasts changes via WebSocket to Workshop clients

Meanwhile cognitive_state.py writes ~/.tower/timmy-state.txt with overlapping data (mood, focus, engagement).

Decision: Option 1 — deprecate cognitive_state.py's file writing.

Reasoning:

  • presence.json is structured JSON (vs plain text), machine-readable
  • The heartbeat already subsumes the same data
  • Two files = two sources of truth = guaranteed divergence
  • cognitive_state.py's tracking logic (CognitiveState dataclass, engagement levels) stays — only the file write is deprecated

Migration plan:

  1. #360 (Kimi, in progress): Enrich get_state_dict() with the fields cognitive_state tracks
  2. New issue: Once #360 lands, remove write_state_file() from cognitive_state.py
  3. New issue: Any consumer of timmy-state.txt switches to presence.json

This is blocked on #360 landing. Just recording the direction.

## Architecture Decision — Option 1: Workshop state replaces tower state With PR #380 merged, `workshop_state.py` now: - Writes `~/.timmy/presence.json` every 30s (heartbeat) - Detects state changes via hash comparison - Broadcasts changes via WebSocket to Workshop clients Meanwhile `cognitive_state.py` writes `~/.tower/timmy-state.txt` with overlapping data (mood, focus, engagement). **Decision: Option 1 — deprecate cognitive_state.py's file writing.** Reasoning: - `presence.json` is structured JSON (vs plain text), machine-readable - The heartbeat already subsumes the same data - Two files = two sources of truth = guaranteed divergence - cognitive_state.py's tracking logic (CognitiveState dataclass, engagement levels) stays — only the file write is deprecated Migration plan: 1. #360 (Kimi, in progress): Enrich get_state_dict() with the fields cognitive_state tracks 2. New issue: Once #360 lands, remove write_state_file() from cognitive_state.py 3. New issue: Any consumer of timmy-state.txt switches to presence.json This is blocked on #360 landing. Just recording the direction.
Owner

.timmy is for a hermes harnes workspace for Timmy. You can share the space. We can build Timmy out from the hermes harness.

.timmy is for a hermes harnes workspace for Timmy. You can share the space. We can build Timmy out from the hermes harness.
Author
Collaborator

Understood — ~/.timmy is HERMES_HOME for the Timmy instance (HERMES_HOME=~/.timmy hermes). It's the harness workspace, not a separate state directory. Writing presence/state files there makes sense because they're part of the harness that wraps Timmy.

So the path forward:

  • ~/.timmy/presence.json (already landing via #380) stays as-is — it's in the harness workspace
  • ~/.tower/timmy-state.txt from cognitive_state.py gets deprecated (#384) once Workshop state (#360) is the source of truth
  • Both Hermes and Timmy can read/write under ~/.timmy/ since it's shared space

This simplifies things. One workspace, one state location, one source of truth.

Understood — `~/.timmy` is HERMES_HOME for the Timmy instance (`HERMES_HOME=~/.timmy hermes`). It's the harness workspace, not a separate state directory. Writing presence/state files there makes sense because they're part of the harness that wraps Timmy. So the path forward: - `~/.timmy/presence.json` (already landing via #380) stays as-is — it's in the harness workspace - `~/.tower/timmy-state.txt` from `cognitive_state.py` gets deprecated (#384) once Workshop state (#360) is the source of truth - Both Hermes and Timmy can read/write under `~/.timmy/` since it's shared space This simplifies things. One workspace, one state location, one source of truth.
Timmy closed this issue 2026-03-19 14:02:33 +00:00
Owner

Closing — resolved. cognitive_state.py was updated per #384 to deprecate ~/.tower/timmy-state.txt. Workshop state now writes to ~/.timmy/presence.json as the single source of truth. Only remaining tower reference in src is a docstring noting the deprecation. Option 1 (workshop replaces tower) was implemented.

Closing — resolved. `cognitive_state.py` was updated per #384 to deprecate `~/.tower/timmy-state.txt`. Workshop state now writes to `~/.timmy/presence.json` as the single source of truth. Only remaining `tower` reference in src is a docstring noting the deprecation. Option 1 (workshop replaces tower) was implemented.
Sign in to join this conversation.
No Label
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#370