Skip to content

feat(goals): add path-scoped continuation boundary - #175

Merged
BunsDev merged 7 commits into
mainfrom
feat/path-scoped-goals
Aug 1, 2026
Merged

feat(goals): add path-scoped continuation boundary#175
BunsDev merged 7 commits into
mainfrom
feat/path-scoped-goals

Conversation

@BunsDev

@BunsDev BunsDev commented Aug 1, 2026

Copy link
Copy Markdown
Member

Summary

  • Add a checked, path-scoped GoalStore boundary with atomic progress accounting, active-only transitions, and reconciliation.
  • Add expected-goal continuation accounting, durable transcript events, and terminal-path handling for the desktop query loop.
  • Add an explicit-store GoalCompleteTool while retaining the default unit-struct tool and registry behavior.

Context

  • Related issue/user request: enables the upstream engine boundary for On-device /goal with Live Activity progress coven-pocket#13.
  • Scope: claurst-core, claurst-query, CLI/TUI event handling, and claurst-tools goal completion.
  • Non-goals: Pocket FFI, Swift UI, ActivityKit, and the Pocket dependency pin land separately after this merges.

Changes

  • Goal rows decode fallibly; checked immediate transactions prevent counter overflow, replacement races, and terminal-goal mutation.
  • Continuation has explicit-path APIs and expected-ID guards; goal tokens use a per-turn delta rather than the session-wide total.
  • Finalized assistant/tool-result messages are emitted as durable transcript facts before terminal events, including partial Anthropic stream-stall output.
  • Path-scoped completion completes only active goals in the supplied store.

Validation

  • git diff --check
  • cargo fmt --all --check
  • cargo check --workspace
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test --workspace --quiet
  • Targeted/manual checks: 38 core goal tests, 128 query tests, 6 CLI goal-accounting tests, 96 tools tests; independent review and re-review found no unresolved Critical or Important findings.
  • Not run: Pocket framework/simulator validation; requires the merged engine revision and deliberate Pocket pin update.

PR Readiness

  • Diff is limited to the intended files.
  • Generated files were not edited by hand.
  • User-facing docs/help are not needed; this is an additive engine API used by the following Pocket changes.
  • No secrets, credentials, local paths, or unrelated logs are included.
  • Remaining risk: Pocket integration remains pending until this PR merges.

BunsDev added 3 commits July 31, 2026 19:11
Signed-off-by: Val Alexander <68980965+BunsDev@users.noreply.github.com>
Signed-off-by: Val Alexander <68980965+BunsDev@users.noreply.github.com>
Signed-off-by: Val Alexander <68980965+BunsDev@users.noreply.github.com>
@vercel

vercel Bot commented Aug 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview Aug 1, 2026 5:41am

Signed-off-by: Val Alexander <68980965+BunsDev@users.noreply.github.com>
@BunsDev
BunsDev marked this pull request as ready for review August 1, 2026 05:44
Copilot AI review requested due to automatic review settings August 1, 2026 05:44
@BunsDev
BunsDev merged commit 529c103 into main Aug 1, 2026
4 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a path-scoped, checked GoalStore boundary and updates the query/CLI/TUI flow to (1) account goal progress atomically and active-only, and (2) emit “durable” transcript events so finalized assistant/tool-result messages can survive compaction and terminal paths.

Changes:

  • Add atomic, checked goal progress recording and active-only state transitions (including expected-goal-ID guards and path-scoped APIs).
  • Add QueryEvent::DurableMessage emission for finalized assistant/tool-result messages across terminal paths (stall/error/cancel/budget/unsupported stop reasons), plus broader terminal-guard handling.
  • Add a path-scoped GoalComplete tool constructor (GoalCompleteTool::at_path) while preserving the default unit-struct tool behavior.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src-rust/crates/tui/src/app.rs Adds a new QueryEvent match arm for DurableMessage (currently ignored).
src-rust/crates/tools/src/lib.rs Re-exports PathScopedGoalCompleteTool alongside GoalCompleteTool.
src-rust/crates/tools/src/goal_complete.rs Implements path-scoped goal completion and refactors shared completion logic; adds tests.
src-rust/crates/query/src/lib.rs Adds QueryEvent::DurableMessage and emits durable finalized messages before terminal outcomes; expands terminal stop/error handling and adds extensive tests.
src-rust/crates/query/src/goal_loop.rs Introduces path-scoped and expected-goal continuation APIs; switches completion to active-only transitions; adds tests.
src-rust/crates/core/src/goal.rs Adds fallible decoding, checked/atomic progress accounting, and active-only transitions with richer GoalError; adds reconciliation and tests.
src-rust/crates/cli/src/main.rs Adds per-turn goal token baselining and expected-goal accounting to convert tracker deltas into goal-absolute totals.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

_ => {}
}
}
QueryEvent::DurableMessage { .. } => {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants