Closes the one coverage gap from the final review: the spec's
'one async call per session' efficiency claim is now directly
verified via the reviewer call count, not just implied. Also drops a
stale CarryForward-preview mention from the Review projection in the
design spec to match the shipped (cleaner) behaviour.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The Review screen renders the reviewer's one-line recap (quiet pending
line, then the recap); the Planning screen renders last session's
carry-forward as a 'Last time: …' one-liner, mirroring the knowledge
indicator. Updates the README Status section for M7.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
main injects the AI service as the reviewer alongside the other roles.
A web test drives a session to Review and asserts the recap rides the
state payload, then to the next Planning and asserts the carry-forward
does too.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The controller fetches a reflection asynchronously on enterReview
(generation-guarded, non-blocking, graceful) and caches a one-line
recap plus a latest-wins carry-forward. The recap projects onto Review,
the carry-forward onto the next Planning, and both ride the snapshot.
RequestCoach composes the carry-forward into the coach's existing
free-form grounding string, so ai.Coach is unchanged.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Exposes the last n session summaries (oldest-first) for the reviewer to
read as recent-history context. Missing/empty chain or n<=0 yields nil.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
A fourth leaf role: Review(finished, history) returns a two-line
Reflection (recap + carry_forward) over the same CLI backend as the
coach. Primitive-only, with a JSON prompt and a tolerant parser that
rejects a blank recap but allows an empty carry_forward.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The planning view renders a quiet line for the standing-profile state
(loading/grounded/absent/unreadable) with a "change" affordance to
repoint the file via POST /knowledge/path. The profile text never
reaches the browser — only status, path, and size. Also updates the
README Status section to describe the M6 knowledge port.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
main constructs the FileSource (default via ANTIDRIFT_KNOWLEDGE_FILE)
and injects it. Adds POST /knowledge/path to repoint the profile file at
runtime, and web tests asserting the planning payload carries the
knowledge object (status + path, never the text) and that path selection
reloads.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The controller loads the profile asynchronously on entering planning,
mirroring the tasks fetch: generation-guarded goroutine, status enum
(idle/pending/ready/absent/error), projected into State only while
planning and only when a source is set. The loaded text is cached and
passed to the coach as grounding; SetKnowledgePath repoints the file at
runtime. nil source degrades to no view and an ungrounded coach.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>