SIGN IN SIGN UP

goal: agent-registered thread goals with harness enforcement (#497)

Replaces the /grind text directive with a first-class goal system: create_goal, get_goal, and update_goal tools register one active goal per thread — only on explicit user request, never inferred — and while a goal is active the harness answers a stop with a continuation prompt carrying a completion-audit discipline (objective wrapped as user data rather than higher-priority instructions, completion treated as unproven, requirement-by-requirement verification, explicit anti-scope-shrink language). Opting out has deliberate friction: 'blocked' requires a stated impasse and is accepted only on the third claim across distinct continuation rounds, 'complete' is refused while the work floor is unmet, a token cap triggers a single wind-down prompt that never fakes completion, and five stalled rounds with zero new tool calls auto-waive with a visible note. Goals persist as session entries and rehydrate on the next turn; the old directive parsing — where a mid-sentence '/grind for 10 minutes' silently did nothing — is removed.

This PR intentionally carries two commits: the first adds the interim /grind directive, the second replaces it with the goal tools. They land together so the directive is superseded within the same PR and never ships in a release on its own.

**Deployment notes**

Goals persist as session system entries and rehydrate on later turns — additive persisted format; old code replaying a session with goal entries ignores them (verify the system-entry replay path tolerates unknown kinds). Rollback: active goals silently stop being enforced, nothing breaks. New harness enforcement loop (turn cannot end while a goal is active) only triggers on explicit create_goal calls — no ambient behavior change.

<!-- codesmith:footer -->
---
<a href="https://app.blacksmith.sh/yc-software/codesmith/qm/pr/477"><picture><source media="(prefers-color-scheme: dark)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v2.svg"><source media="(prefers-color-scheme: light)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-light-v2.svg"><img alt="View with [code]smith" src="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v2.svg"></picture></a> <a href="https://backend.blacksmith.sh/track/enable-autofix?expires=1789248966&installation_model_id=19911&pr_number=477&repository=yc-software%2Fqm&return_to=https%3A%2F%2Fgithub.com%2Fyc-software%2Fqm%2Fpull%2F477&signature=6b6b87f01812d67d26af7f24dfe5e7bcdb39b767f8cf39e4014419ee99d31c0d"><picture><source media="(prefers-color-scheme: dark)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-light.svg"><img alt="Autofix with [code]smith" src="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark.svg"></picture></a>
<sup>Need help on this PR? Tag <code>@codesmith-bot</code> with what you need. Autofix is disabled.</sup>

<!-- codesmith:autofix:disabled -->
<!-- /codesmith:footer -->
R
Regan Bell committed
d285af6c5a7556e970ed5bccbec06d8f7961076a
Parent: 95ce87d
Committed by GitHub <noreply@github.com> on 8/13/2026, 10:26:33 PM