Commit Graph

18 Commits

Author SHA1 Message Date
felixm d068e2f79c Split evidence-stats accounting into stats.go
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-01 17:46:15 -04:00
felixm a0f144968b Split session views into views.go
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-01 17:42:53 -04:00
felixm f13f33cf74 Add knowledge stale-discard characterization test
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-01 17:39:40 -04:00
felixm 47f1167247 Minimize the off-task window on confirmed drift at the block level
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-01 12:43:30 -04:00
felixm 41c0a5fbbc Thread per-commitment enforcement level through to the snapshot
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-01 12:41:09 -04:00
felixm e3cfe8c70c Assert the reviewer fires exactly once per session
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>
2026-06-01 09:47:27 -04:00
felixm a4f0c00cac Reflect on entering Review and ground the next coach
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>
2026-06-01 09:36:50 -04:00
felixm 8bd37ed46d Load the knowledge profile on planning and ground the coach
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>
2026-06-01 08:04:13 -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 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 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 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 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 df384afb7c M1: controller evidence stats, accumulation, replay, audit-at-End
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 12:49:19 -04:00
felixm a8216095de Make Complete atomic and guard zero deadline
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 11:49:03 -04:00
felixm 18108c3da3 Add session controller with snapshot persistence
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 11:45:46 -04:00