Files
Maven/docs/plans/02-pattern-proposal.md
kami 5fe8f228c1 feat(mavweb): /ecosystem page consuming Nexus/Praxis/Hexis + shell fixes
Add a read-only /ecosystem page that consumes the sibling services'
JSON APIs (Nexus entities, Praxis attention, Hexis capabilities),
fetched concurrently with honest per-panel error states. Siblings stay
headless — mavweb is their human surface (arch §16). Wired via mavweb
-nexus/-praxis/-hexis flags; mavweb joins the ecosystem compose network.

Fix mobile horizontal overflow across all pages: .content is a flex
child with default min-width:auto, so it refused to shrink below the
tables' intrinsic width. min-width:0 lets wide tables pan inside .scroll
instead of dragging the page sideways. Verified via CDP geometry check
(scrollWidth === clientWidth at 430px).

Also includes in-progress Ethos UI redesign, ecosystem deploy compose,
and planning docs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-19 22:04:23 +04:00

29 lines
2.3 KiB
Markdown

# Plan: Background Pattern Detection & Proactive Proposal
**Goal:** Maven continuously monitors facts written to the store, detects recurring patterns (behavioral, operational, temporal), and proposes new routines, reminders, or config changes back to the user via the existing `ProposedRoutine` / tool-proposal mechanism.
**Done when:**
- Background analyzer reads `RecentFacts` and `Events` on a slow cadence (every 10min, not every tick)
- New patterns beyond the existing action-lexicon `internal/pattern/extractor.go` — e.g. time-of-day correlations, service-down + user-awake sequences, repeated tool invocations
- Proposals land as `ProposedRoutine` rows in the store (reusing `store.CreateProposedRoutine`) or `ProposeTool` calls
- User confirms via voice or mavweb — existing `pendingRoutineConfirm` / `resolveConfirm` path re-used
- False-positive rate measured and acceptable (proposals are parked, never auto-enabled)
**Scope:**
- New `internal/analyzer/` package — runs on a separate ticker (10-30min), reads from `ipc.CoreAPI` (or direct `store.Store` for performance)
- Extends `internal/pattern/` detector with multi-signal patterns (not just action+object interval)
- Reuses existing `store.Events`, `store.ProposedRoutine`, `store.Tools` tables
- Daemon wiring: new `analyzer` goroutine in `cmd/mavend/main.go` alongside tick loop
**Steps:**
1. Create `internal/analyzer/` with periodic scan — `Analyzer.Run(ctx)` goroutine
2. Implement new detectors:
- Time-of-day behavioral patterns ("you always water plants at 9pm" → remind at 8:45pm)
- Service-down + user-present correlation ("service X died while you were away, you fixed it when you sat down" → propose auto-remediation tool)
- Repeated tool use patterns ("you restart plex every Tuesday" → propose a routine)
3. Register proposals via existing `store.CreateProposedRoutine` (reuses `internal/voice/reactiveHandler:detectPattern` pattern) and `ipc.ProposeTool`
4. Wire analyzer goroutine in `cmd/mavend/main.go` — starts after unlock alongside `tl.run(ctx)`
5. Add `analyzer_interval` to `config.Config` (default 10min)
6. Add voice confirm path — proposals detected in background trigger a nudge with a yes/no prompt, reusing `pendingRoutineConfirm` from `cmd/mavend/voice.go:resolveConfirm`
7. Test with seeded events in `internal/store/events_test.go` pattern