Wire cognitive loop into TUI main loop #2

Closed
opened 2026-08-24 11:43:11 +01:00 by conductor · 1 comment
Owner

CLOSED — Rune actually thinks between turns now, and the claim is honest.

The defect the triage found: the issue was HALF-true — the TUI displayed "◆ Cognitive loop active — Rune thinks between turns" but never invoked anything. CognitiveLoop/DreamCycle/AutonomyLoop were instantiated and abandoned: no .think(, no .dream(, no .evaluate( call site anywhere in rune_tui.py. A dead mechanism wearing a live-status costume (the same class as #2481's undo_last).

The fix (commit 169cb63, contract BUILDER-2026-10-08T13:15:49Z-03dc90 walked draft→closed):

  • An idle-cognition ticker on RuneApp (set_interval(240, self._idle_cognition_tick)): think() every tick — consolidates recent memories, probes dead weight, checks drift — with the most recent user message as context; dream() (full consolidation) every third tick (~12 min). Memory work runs on a worker thread; only dim status lines touch the UI thread (the file's established thread-message pattern); failures degrade silently, never crash the session.
  • Input submission captures _cognition_ctx, so between-turn thinking carries the conversation's actual context.
  • Bonus latent-bug kill: logger was never defined module-level in rune_tui.py — 61 F821 NameErrors waiting inside except handlers (any "suppressed exception" path reaching logger.debug would have raised instead of degrading). One module-level logger → 0 F821, the whole latent class dead.
  • tests/test_cognitive_wiring.py 5/5: think() invoked with the captured context; dream() strictly gated to the third tick; real actions surface as status; action-less ticks stay silent; the wiring pinned at source level.
CLOSED — Rune actually thinks between turns now, and the claim is honest. **The defect the triage found:** the issue was HALF-true — the TUI *displayed* "◆ Cognitive loop active — Rune thinks between turns" but never invoked anything. CognitiveLoop/DreamCycle/AutonomyLoop were instantiated and abandoned: no `.think(`, no `.dream(`, no `.evaluate(` call site anywhere in rune_tui.py. A dead mechanism wearing a live-status costume (the same class as #2481's undo_last). **The fix (commit 169cb63, contract BUILDER-2026-10-08T13:15:49Z-03dc90 walked draft→closed):** - An **idle-cognition ticker** on RuneApp (`set_interval(240, self._idle_cognition_tick)`): `think()` every tick — consolidates recent memories, probes dead weight, checks drift — with the most recent user message as context; `dream()` (full consolidation) every third tick (~12 min). Memory work runs on a worker thread; only dim status lines touch the UI thread (the file's established thread-message pattern); failures degrade silently, never crash the session. - Input submission captures `_cognition_ctx`, so between-turn thinking carries the conversation's actual context. - **Bonus latent-bug kill:** `logger` was never defined module-level in rune_tui.py — 61 F821 NameErrors waiting inside `except` handlers (any "suppressed exception" path reaching `logger.debug` would have raised instead of degrading). One module-level logger → 0 F821, the whole latent class dead. - **tests/test_cognitive_wiring.py 5/5:** think() invoked with the captured context; dream() strictly gated to the third tick; real actions surface as status; action-less ticks stay silent; the wiring pinned at source level.
conductor added the growthinfrastructure labels 2026-08-24 11:43:11 +01:00
conductor added this to the Level 10 autonomy milestone 2026-08-24 14:34:00 +01:00
gitea-actions Bot added the custodiangovernancememory labels 2026-09-03 22:53:14 +01:00
conductor added the P2 — medium label 2026-09-04 15:54:08 +01:00
Author
Owner

Priority: P2 (triage 2026-09-04). Overlaps #48 ([P3-05] endogenous meaningful-event triggers) and the cognitive-strata modules already built (Plans 2 + 4). The wiring design should follow the trigger redesign, not precede it.

**Priority: P2** (triage 2026-09-04). Overlaps #48 ([P3-05] endogenous meaningful-event triggers) and the cognitive-strata modules already built (Plans 2 + 4). The wiring design should follow the trigger redesign, not precede it.
gitea-actions Bot added P1 — high and removed P2 — mediumcustodiangrowthinfrastructure labels 2026-10-08 15:27:38 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: conductor/rune#2