feat: add durable on-device goals - #36
Merged
Merged
Conversation
Define the upstream path-scoped goal boundary, bounded iOS lifecycle, privacy-safe ActivityKit surface, and release acceptance criteria. Record the completed Familiar bead and claim issue #13 for implementation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds a durable on-device /goal workflow to Coven Pocket by extending the Rust FFI with goal storage + lifecycle operations, integrating an autonomous goal runner into the existing query loop, and wiring a Swift slash-command/UI layer plus a WidgetKit Live Activity presentation.
Changes:
- Introduces a checked, path-scoped goal SQLite store (
goals.sqlite) and integrates goal cleanup with session lifecycle in the Rust persistence layer. - Adds Rust FFI goal APIs (start/pause/resume/clear/status/reconcile) and a goal-capable query-loop runner that supports durable message journaling and a goal-only
GoalCompletetool. - Adds Swift
/goalcommand parsing, in-app goal card controls, and a WidgetKit Live Activity target wired via ActivityKit.
Reviewed changes
Copilot reviewed 17 out of 20 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| rust/ffi/src/sessions.rs | Adds GoalStorage wrapper over checked storage; validates goal DB sidecars; clears goals during session cleanup. |
| rust/ffi/src/lib.rs | Exposes goal types/FFI surface and adds PocketEngine.reconcile_goals. |
| rust/ffi/src/goals.rs | New Rust goal lifecycle module (FFI-facing types + blocking-backed operations + continuation). |
| rust/ffi/src/chat.rs | Integrates goal runner into ChatSession, adds goal-only tool registry, durable message journaling, and cumulative cost tracking. |
| rust/Cargo.toml | Bumps pinned coven-code engine rev to include upstream goal/path APIs. |
| rust/Cargo.lock | Updates lockfile sources to match the new engine pin. |
| project.yml | Adds widget extension target + Live Activity entitlements/versions. |
| docs/superpowers/specs/2026-07-31-on-device-goals-design.md | Adds approved design spec for on-device goals and Live Activity behavior. |
| app/Tests/GoalCommandParserTests.swift | Adds unit tests for /goal parsing and local error handling. |
| app/Sources/Views/ChatView.swift | Adds a goal status card and routes /goal commands to model operations. |
| app/Sources/Support/Goals/GoalCommandParser.swift | Implements local /goal command parsing per documented syntax. |
| app/Sources/Support/Goals/GoalActivityCoordinator.swift | Adds an ActivityKit coordinator for goal progress presentation. |
| app/Sources/Support/Goals/GoalActivityAttributes.swift | Defines ActivityKit attributes/content state for goal Live Activity. |
| app/Sources/Support/ChatModel.swift | Adds goal state to the model, bridges FFI callbacks to @MainActor, and coordinates ActivityKit updates. |
| app/Sources/Generated/coven_pocket_ffi.swift | Regenerates UniFFI bindings to include goal APIs and records/types. |
| app/GoalWidgets/Info.plist | Adds widget extension Info.plist for WidgetKit target. |
| app/GoalWidgets/GoalLiveActivityWidget.swift | Implements the goal Live Activity/Dynamic Island widget UI. |
| .beads/issues.jsonl | Updates beads issues to track goal work items. |
| .beads/interactions.jsonl | Records beads interaction updates related to milestones/status changes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements on-device
/goalexecution with durable FFI-backed lifecycle, checked SQLite goal storage, autonomous continuation, slash-command UI, and a Live Activity widget.Validation:
Simulator interaction remains behind the app's existing local unlock screen; the binary launches successfully.