Skip to content

Port Goal lifecycle --notify hook onto current main - #205

Open
ByBrawe wants to merge 20 commits into
mainfrom
feat/goal-notify-current
Open

ByBrawe wants to merge 20 commits into
mainfrom
feat/goal-notify-current

Conversation

@ByBrawe

@ByBrawe ByBrawe commented Sep 20, 2026

Copy link
Copy Markdown
Owner

Ports the useful design from contributor PR #196 onto the post-1.3.33/current-main persistence and runtime architecture. Credit to @rubenxyz for the original --notify proposal and implementation direction.

Part of #201.

Contract

  • /goal ... --notify "<command>" stores an optional user-authored lifecycle command.
  • {goal} expands to the Goal ID.
  • {reason} is completed, blocked, paused, or rejected.
  • waiting_user, budget-limited, and usage-limited states map to paused.
  • queued Goals preserve the command through promotion; /goal edit preserves it unless explicitly replaced.

Safety / current-main invariants

  • Notification dispatch happens only after durable Goal persistence.
  • Suppress semantic no-op GoalStore writes #202 semantic no-op saves do not emit notifications or advance storage generation.
  • Same-status semantic updates do not duplicate lifecycle notifications.
  • Notification failures are advisory and cannot roll back Goal state/completion.
  • Persisted notifyCommand is validated fail-closed.
  • Persist runtime fingerprints for Goal diagnostics #203 runtime fingerprint stamping/validation remains intact.
  • Model-facing opencode_goal_* tool schemas expose no notifyCommand mutation field; configuration stays on the user-authored Goal Contract command surface.
  • The current waiting-user, budget/usage, restart recovery, restricted-agent, host-limit and completion paths are wired through the current persistence architecture rather than copying the old pre-1.3.32 store layout.

Tests

  • parser/multiline/malformed contract behavior
  • persisted create/edit validation
  • post-persistence lifecycle emission + no-op/same-status suppression
  • callback failure cannot break persistence
  • paused restore notification
  • spawn substitution/failure behavior
  • queued Goal preservation/promotion
  • rejected completion classification
  • model-facing Goal tool schema ownership boundary

Supersedes the old implementation branch only after this current-main port passes the full required CI/real-host/release-readiness gates.

Copilot AI lite review requested due to automatic review settings September 20, 2026 22:33

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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