Skip to content

fix(goals): "ready to close" asks the number, not the task list (v0.456.1) - #860

Merged
vikasprogrammer merged 1 commit into
mainfrom
feat/goal-close
Oct 6, 2026
Merged

vikasprogrammer merged 1 commit into
mainfrom
feat/goal-close

Conversation

@vikasprogrammer

Copy link
Copy Markdown
Owner

The bug

A goal was offered for closing as soon as every task filed under it was done:

goalComplete = status === 'active' && progress.counted > 0 && progress.done === progress.counted

No reference to the metric. On the live instapods clicks goal that rendered a green "Ready to close" pill directly beside a metric panel reading "59 of 100 · Not moving" — the same page contradicting itself — and the scheduler's completion sweep had already carded the owner that the goal was finished while it was 41 clicks short.

The rule predates metrics, and its own comment is the argument against it: "all the filed tasks are done" is a weaker claim than "the outcome was achieved". Once a goal says what number it is about, the task list is the weakest evidence it has.

Fix

  • GoalStore.readyToClose — and therefore Automations.sweepCompletedGoals, which reads it — excludes a goal with a metric unless metricStatus().verdict === 'achieved'.
  • The console derives the same way (goalComplete now takes the metric status; the goals list already carries metrics on its payload).
  • A goal with no metric is untouched — same behaviour as today.
  • The quieter fact is still surfaced: a measured goal whose filed work ran out gets a muted note that the plan ran out before the number did, close it only if the outcome is good enough or plan the gap. Nobody having planned the rest is worth knowing; it just is not a close.

Testing

scripts/goal-metric-review-test.cjs grows a section pinning all four cases: no-metric goal still closes on tasks, a measured goal short of target is not offered, a measured goal at target is, and no "goal is finished" card is raised for the short one. Note the third case uses a direction: 'down' metric, so the guard is achieved, not value >= target. Full npm run test:governance passes; cd web && npm run build passes.

🤖 Generated with Claude Code

…56.1)

A goal was proposed for closing — and its owner carded that it was finished — as
soon as every filed task was done, with no reference to its metric. On the
instapods clicks goal that put a green "Ready to close" pill beside a metric
panel reading "59 of 100 · Not moving", and an Inbox card saying the goal was
finished while it was 41 clicks short.

Task completion is the weakest evidence a measured goal has, so it no longer
gets a vote: readyToClose (and the scheduler sweep that reads it) excludes a
goal with a metric unless its verdict is `achieved`; the console derives the
same way. A goal with no metric is unchanged.

The quieter fact is still said, because it is worth knowing: a measured goal
whose filed work ran out gets a muted line that the plan ran out before the
number did — close it only if the outcome is good enough, or plan the gap.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@vikasprogrammer
vikasprogrammer merged commit b6d29ce into main Oct 6, 2026
@vikasprogrammer
vikasprogrammer deleted the feat/goal-close branch October 6, 2026 14:35
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.

1 participant