275 Commits

Author SHA1 Message Date
felixm 0f1790c8d5 Thread optional grounding into the coach prompt
The ai.Coach interface gains a grounding parameter carrying standing
context about the user (the knowledge port). buildPrompt injects an
"About the user" block only when grounding is non-empty, so an empty
grounding produces a byte-for-byte unchanged prompt. Drift judge and
nudge are untouched.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-01 08:01:03 -04:00
felixm 09061f8e30 Add knowledge port and single-file adapter
The knowledge.Source port answers "who am I; what are my priorities?".
The FileSource adapter reads one profile file (path selectable per call),
treats a missing/blank file as absent (not an error), and caps the text.
Leaf package mirroring tasks.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-01 07:59:48 -04:00
felixm 9e03add01b Add M6 knowledge-port design spec and implementation plan
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-01 07:58:55 -04:00
felixm 9452e54867 Add M5 tasks-port implementation plan
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 22:11:59 -04:00
felixm 8b5121c69d Show today's tasks as seed chips on the planning screen
The planning view renders Marvin's today list as clickable chips;
clicking one fills the intent field, feeding the existing coach flow.
idle/error/empty render nothing, pending shows a quiet loading line.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 22:09:38 -04:00
felixm e832a2da85 Wire Marvin tasks adapter into the daemon
main constructs the Marvin adapter (command overridable via
ANTIDRIFT_MARVIN_CMD) and injects it. Adds a web test asserting the
planning state payload carries today's tasks.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 22:07:20 -04:00
felixm c4eb870808 Test that a stale tasks fetch result is discarded
Exercises the generation/left-planning guard in startTasksFetchLocked
via the fakeProvider gate: a fetch in flight when its generation is
superseded must not clobber the current tasks state.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 22:06:04 -04:00
felixm 8b7bec1173 Fetch today's tasks asynchronously on entering planning
The controller fetches the Marvin task list when entering planning,
mirroring the planning coach: generation-guarded goroutine, status enum
(idle/pending/ready/error), projected into State only while planning and
only when a provider is set. nil provider degrades to no tasks view.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 22:02:28 -04:00
felixm 569264be11 Add tasks port and Amazing Marvin adapter
The tasks.Provider port answers "what should I be doing?". The Marvin
adapter shells out to ampy's `am --json` and parses today's open tasks,
dropping done/empty-title entries. Leaf package mirroring ai.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 21:59:00 -04:00
felixm 267eda59e6 Add M5 tasks-port design spec
Design for the tasks.Provider port: an Amazing Marvin adapter shelling
out to `am --json`, today's tasks seeding the planning intent field.
Read-only, no writeback, graceful degradation — mirrors the ai port.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 21:50:15 -04:00
felixm 6b2a96620c M4: drop stale plan-task reference from CSS comment
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 21:16:11 -04:00
felixm 51cb09c520 M4: presentational review recap
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 21:13:04 -04:00
felixm f5da12362a M4: cockpit HUD with state-driven accent
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 21:10:03 -04:00
felixm 76816ae188 M4: split web UI assets into app.css and app.js
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 21:05:34 -04:00
felixm 93e779348c M4: add look-good implementation plan
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 21:03:34 -04:00
felixm c807a72623 Spec M4: cockpit-style web UI design pass
State-driven accent HUD, stacked bands, CSS/JS split out of the inline
HTML, polished presentational review recap. No behavior changes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 20:57:32 -04:00
felixm 097678e839 Mirror runtime status to ~/.antidrift_status
A window-manager status bar can now read a single-line status file: a
glyph plus minutes-remaining (● 24m / ⚠ DRIFT 24m / ● 24m ·? / ◔ planning
/ ✓ review), empty when idle. Rewritten on a one-minute tick, only when
the line changes, and removed on shutdown. Degrades to no file if $HOME
is unresolvable.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 20:49:48 -04:00
felixm 19654c2b57 Align M3.5 design doc with the nudgeEpoch guard
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 18:52:01 -04:00
felixm 622a1cd401 Tie nudge validity to the on-task stretch
A soft nudge advisory belongs to one continuous on-task stretch in an allowed
app. Guard it with an on-task-stretch epoch (advanced on session reset and on
any non-on-task-match observation) instead of a session-only counter, and clear
the advisory on leaving the allowed app, so a stale 'Heads up' never resurfaces
after a drift episode.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 18:20:22 -04:00
felixm 9dd0bb934e Wire the semantic nudge into the daemon and document M3.5
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 18:11:42 -04:00
felixm 20a102b4a4 Add dismiss-only Heads up tier for semantic nudges
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 18:10:03 -04:00
felixm 97577c003f Assert semantic nudge reaches the state payload
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 18:08:51 -04:00
felixm b43ba5179d Orchestrate semantic nudge on the on-task path
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 18:07:31 -04:00
felixm b96319d847 Add ai.Nudger role for semantic drift within allowed apps
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 17:57:20 -04:00
felixm 4e5e1f3881 Plan M3.5 semantic nudge implementation
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 17:52:31 -04:00
felixm 5818d401c3 Design M3.5 semantic nudge within allowed apps
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 17:44:30 -04:00
felixm 7621093eef Document M3 drift interceptor in README
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 17:23:31 -04:00
felixm fefa72b909 Wire drift judge into the daemon alongside the coach
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 17:23:05 -04:00
felixm f73bb21c80 Add allowed-apps field and active-view drift interrupt UI
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 17:21:12 -04:00
felixm 6ca796dee3 Add /refocus and /ontask routes and carry allowed classes
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 17:18:25 -04:00
felixm 4e7676560d Wire debounced cached async drift judgment into RecordWindow
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 17:16:59 -04:00
felixm 2977b903c2 Add drift state, persistence, and override controls to controller
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 16:53:23 -04:00
felixm 75d31b5fa8 Extend coach proposal with allowed window classes
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 16:49:06 -04:00
felixm 83bae00e45 Add DriftJudge AI role with verdict parsing
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 16:45:59 -04:00
felixm 7e9d00b80b Port allowed-context matching to evidence package
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 16:42:48 -04:00
felixm fccf856054 Add M3 drift interceptor implementation plan
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 16:39:08 -04:00
felixm 4e167744a0 Add M3 drift interceptor design spec
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 16:27:50 -04:00
felixm 571a97e0e2 M2: mark AI planning coach milestone done
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 14:22:08 -04:00
felixm b51ad45c10 M2: wire planning coach backend into the daemon with graceful fallback
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 14:21:37 -04:00
felixm c61c9d46b1 M2: planning-view Sharpen control with non-clobbering coach updates
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 14:20:39 -04:00
felixm 38a62e4c68 M2: POST /coach route wiring the planning coach
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 14:19:12 -04:00
felixm 463ac4f23c M2: controller async coach with generation guard and ephemeral state
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 14:16:28 -04:00
felixm 25a33f027a M2: surface codex empty-output and clean CLI error messages
Addresses code-review follow-ups: codex now returns a specific error when
its -o file is empty rather than degrading to ErrEmptyResponse downstream;
CLI errors omit a dangling stderr suffix when stderr is empty.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 14:14:04 -04:00
felixm 3148fdfa92 M2: ai claude and codex CLI backends with selector
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 14:11:57 -04:00
felixm dea8e6ba78 M2: ai Coach interface and Service over a pluggable Backend
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 14:10:49 -04:00
felixm 5545a4e1cd M2: ai Proposal type, JSON extraction and validation
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 14:09:21 -04:00
felixm ae5a0f123c Add M2 AI planning coach implementation plan
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 13:47:31 -04:00
felixm b2104f6442 Pin M2 spec to verified claude/codex CLI invocations
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 13:39:10 -04:00
felixm 332e17d742 Add M2 AI planning coach design spec
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 13:33:37 -04:00
felixm cd5d69dec5 Reframe roadmap around the gate-first focus loop
Make the OS-level "gate → plan → work → reflect → gate" loop the explicit
destination. Promote the deferred AI reviewer into the loop as M7 (Reflection),
and reframe enforcement as M8 (Enforcement & gate) building toward the Guard
checking for a declared intention before the machine is usable — kept as the
last, heaviest milestone.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 13:22:03 -04:00