Files
felixm 7d69a1f320 Generalize the focus controller into a harness hosting swappable modes
Loosen AntiDrift's session controller into Keel's general collect→brain→act
loop. A new internal/harness runs at most one mode.Mode at a time, fanning
async completions out to the web SSE and status-bar surfaces.

- internal/mode: the Mode contract (Kind/Command/View/Active) plus optional
  EvidenceConsumer and Expirer ports, and the surfacing Envelope.
- internal/mode/focus: the former session/domain/statemachine packages moved
  under the mode, now satisfying the harness contracts unchanged.
- internal/mode/offscreen: a one-shot away-from-desk mode built on the new
  ai.Proposer, which turns a life-domain brief into one off-screen action.
- cmd/keeld replaces cmd/antidriftd; daemon wires focus + offscreen factories
  with per-mode persistence under ~/.keel/modes/<kind>.
- Finish the rename: KEEL_* env refs in the README, /keeld build artifact
  ignored, stale antidriftd binary removed.

Include the design + implementation plan this refactor was built from under
docs/superpowers/{specs,plans}/2026-06-04-controller-refactor*.md.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-05 18:00:49 -04:00

3.1 KiB

Keel — Agent Context

You are working in Keel, Felix's human-harness. Read this, then treat docs/keel-architecture.md as the source of truth for anything architectural.

What this is

The inversion of an agent harness: instead of a harness watching a model work, a model (the brain) helps observe and steer a human. Felix is the observed subject; the brain is the operator. The thing we build is the harness — the framework that collects Felix's real state, hands it to a swappable brain, and acts on the reply.

  • Brain — swappable, rented compute: claude / codex / Hermes (real, on another machine). Not the point; interchangeable behind one interface.
  • StorageActivityWatch buckets (keel.state, keel.events). No new DB / event store. Buckets hold pointers, not copies.
  • Frame~/owc (values, goals, resources/bug-*.md life-bugs). Reference, never duplicate.
  • Surfaces — a phone-friendly web UI + the WM status bar (~/.keel_status).
  • Effectors — gated writes (Marvin tasks, capture, AntiDrift enforce; later Beeminder datapoints, ~/owc notes). Start propose-and-confirm; trend toward autonomy. The gate is per-effector config — Felix's agency-vs-cage dial.

What runs today

AntiDrift, Keel's first mode: a Go focus daemon (ports-and-adapters) — evidence.Source (perception) · tasks.Provider (Marvin) · knowledge.Source (the ~/owc-derived profile) · ai.Backend (the brain) · enforce.Guard (window-minimize). The cockpit work is loosening its session controller into a general collect → brain → act loop where a focus-session is one mode among many.

go run ./cmd/keeld   # local web UI at http://localhost:7777
go test ./...

Naming / rename status

The rename is complete. Directory, git repo, Go module, binary, runtime, and env are all keel: module keel, binary keeld, runtime ~/.keel/, KEEL_* env. If you have a live ledger under the old ~/.antidrift/ directory, move it manually to ~/.keel/ — there is no automated migration tool.

How to work here

  • Reuse before building. Read the code before claiming something is missing. AntiDrift already is the harness skeleton; widen it, don't rebuild.
  • Reference, don't duplicate. ~/owc and each tool's store stay source of truth; Keel never becomes a hidden second source.
  • Ship visible proof. Every session ends with a real artifact — reframing and planning are not progress. Felix's named failure mode is tooling-as-avoidance; resist it.
  • Concise coaching. The status line is one signal / one action / one question. Not "nice summaries" — that was explicitly rejected.
  • Local-first; mind secrets. The operator runs as the full Unix user with no sandbox; window titles and on-disk keys can leak. Filter at the assembler.

Pointers

  • docs/keel-architecture.md — authoritative architecture (components, data flow, AW-as-storage, the open questions in §8).
  • docs/superpowers/ — AntiDrift focus-mode feature specs/plans (historical).
  • README.md — project front door.