Skip to content

Sleep Architecture Phase 1 (Avenue 1 from research memo)#129

Closed
TSchonleber wants to merge 2 commits into
mainfrom
sleep-architecture-phase-1
Closed

Sleep Architecture Phase 1 (Avenue 1 from research memo)#129
TSchonleber wants to merge 2 commits into
mainfrom
sleep-architecture-phase-1

Conversation

@TSchonleber
Copy link
Copy Markdown
Owner

Summary

Operationalizes Avenue 1 from PR #125. 5-stage sleep state machine with per-stage permitted_operations encoding what canonical memory operations are appropriate.

awake → NREM1 → NREM2 → NREM3-SWS → REM → NREM2 → ...  (ultradian cycle)

What's in

  • Migration 074 — 3 tables + 5 seeded stages with permitted_operations CSV.
  • 5 MCP toolssleep_status, sleep_transition, sleep_advance (canonical), sleep_operation_permitted (stage-gating query), sleep_history.
  • 10 tests, all green.

What's NOT in

  • No ARAS-driven auto-progression (Phase 2).
  • No enforcement (consolidation/dream code doesn't yet check sleep_operation_permitted) — Phase 3.

Live

  • Backup at ~/agentmemory/backups/brain.db.pre-sleep-*.db
  • Migration 074 applied.

🤖 Generated with Claude Code

TSchonleber and others added 2 commits May 20, 2026 01:15
5-stage sleep state machine: awake / NREM1 / NREM2 / NREM3-SWS / REM.
Each stage has permitted_operations encoding what canonical memory
operations are appropriate (SWS = SWR replay; REM = bisociation + DMN
simulate; NREM2 = spindle consolidation).

Phase 1 = manual transitions + permission queries. Phase 2 auto-
progresses through ultradian cycles from ARAS signal. Phase 3 stage-
gates consolidation_run / dream_cycle / replay calls.

- Migration 074: 3 tables (catalog with 5 seeded stages + state + transitions)
- mcp_tools_sleep_architecture: 5 tools (status, transition, advance,
  operation_permitted, history)
- 10 tests; all green
- Operationalizes Avenue 1 from PR #125 research-avenues memo

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@TSchonleber
Copy link
Copy Markdown
Owner Author

Superseded by #138 (brainctl-consolidation-v2), which already merged this work into main as part of the v2 tool surface consolidation. Closing as redundant.

@TSchonleber TSchonleber deleted the sleep-architecture-phase-1 branch May 21, 2026 08:15
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