Skip to content

feat(mate): offer the Heartbeat on the goal card as one checkbox - #26003

Merged
buluoray merged 2 commits into
mainfrom
feat/mate-goal-heartbeat-checkbox
Oct 30, 2026
Merged

buluoray merged 2 commits into
mainfrom
feat/mate-goal-heartbeat-checkbox

Conversation

@buluoray

@buluoray buluoray commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Setting a crewmate's goal and turning on its Heartbeat becomes one decision, made on the goal card itself.

Today a mate proposes a goal on a crewmate.goal card. After the user applies it, the goal-setup turn (goal_setup.kickoff_heartbeat_tools) makes the mate ask in chat whether it should keep track of the goal on its own, and on yes it proposes a second card (set_check_ins with the Heartbeat on). The user answers the same question twice, on two surfaces, and the Heartbeat (the thing that makes the mate work between chats) is easy to miss.

Why it matters

The Heartbeat is what turns a goal into work the mate moves forward while the user is away. Asking about it in a separate chat turn and a second card adds a round trip at the moment the user is most engaged, and a user who skims past the chat question ends up with a goal nothing works on.

Not a goal

  • Changing the Heartbeat's cadence, cost or wake behaviour. The card uses the mate's existing interval (default 60 minutes).
  • Changing set_check_ins or the Schedules tab's Heartbeat row. They stay the way to change the Heartbeat later.
  • Offering the Heartbeat on the crewmate.create card or on a goal saved from the Goals tab. A Goals-tab save still gets the existing one-time chat question.
  • Clearing a remembered decline. Once declined on a goal card, no later goal card offers it; the user can still turn it on from the Schedules tab.

What changed (motivation → approach → change)

Goal → put the Heartbeat choice where the goal is confirmed → reuse the existing governed write path rather than adding one.

  • Card kind (change_card_catalog_kinds.py): crewmate.goal gains an optional, editable heartbeat boolean (default true).
  • Preview (change_card_catalog_plans.py): while the snapshot reads the Heartbeat off and never declined, the card carries a heartbeat_offer row (after, interval, per_day). Checked, the apply plan is the goal write, then the same PUT /api/members/{slug}/goals/schedules step a crewmate.check_ins card makes (heartbeat: true, expected: {heartbeat: false, interval}). That route is already in HOOKED_ROUTES, so the Heartbeat turns on through the same card hook, owner check and compare-and-set as set_check_ins; no new write path. Unchecked, only the goal is written. Either way the goal write carries heartbeat_offer: accepted|declined.
  • Record (member_goals.py): a new heartbeat_offer field, stored in the same write as the goal. On a goal card's Undo steps only (held_is_done), a schedules write whose changes already hold succeeds without writing; Apply keeps the 409. The goal route (handlers/member_goals.py) validates and passes it through.
  • Undo (change_card_catalog.py, change_cards_readers.py): a card that turned the Heartbeat on undoes in two steps, Heartbeat off first (expected: {heartbeat: true}), then the goal. If the user turned the Heartbeat off by hand since, that step succeeds as a no-op and the goal Undo still runs. resumed_undo_is_stale admits the second step because the goal write is itself a compare-and-set. after_shows_the_write requires the Heartbeat to still read on. The Heartbeat state is left out of the goal card's comparable_state, since its own step is a compare-and-set and a switch flipped later must not block the goal's Undo.
  • Goal-setup turn (goal_setup.py, crewmate_prompts.json): with heartbeat_offer set (written with the goal, so the nudge sees it even before the Heartbeat step lands) or the Heartbeat on, the turn asks nothing about it. The kickoff_heartbeat_tools text now says it applies to a goal saved on the Goals tab. set_goal's tool description and the mate identity prompt say the goal card carries the choice and not to ask again or propose set_check_ins for it.
  • Dashboard (website/src/cards/kindBodies.tsx, cardRegistry.ts, ChangeCard.tsx): GoalBody draws the row as a checkbox, "Keep this moving on its own (Heartbeat)", with the note "Runs about every {interval}. Each run uses credits, and you can turn it off any time." The interval is formatted in the active locale. Toggling re-previews the card with heartbeat, so the plan the gateway runs is the one the box shows. The row is kept out of the change lines. Two new catalog keys in all 12 languages.
  • Specs: crew-mode.md (the goal card, the goal-setup nudge, the welcome flow, the record field) and learn-cron-dashboard.md (the old goal editable list, the resumed-Undo rule) in the same commit.

No decision in docs/decisions/ covers the Heartbeat offer; the one Heartbeat decision (2026-10-22, the switch lives on the Schedules tab) is unchanged.

Backwards compatibility

Compatible: a goal card stored before this change has no heartbeat in its snapshot, so it offers no checkbox and rebuilds to the same plan; rebuild_record accepts its old editable list (["long_term"]) for the goal kind, so its history and Undo survive. A goal record without heartbeat_offer reads as unanswered. Owner routes accept the same bodies as before; heartbeat_offer is optional.

Removes nothing: the change adds an optional param, a record field and a card step; no route, key, validator path or capability is removed, and set_check_ins is unchanged.

Tests

  • test/test_member_goals_heartbeat_card.py (new): checked card sets the goal and turns the Heartbeat on (one heartbeat cron), then Undo turns it off and removes the goal; Undo still removes the goal after the Heartbeat was turned off by hand, while outside Undo the same write stays a conflict; a Heartbeat turned on by hand between preview and Apply makes the card's step 409 and its Undo leaves that Heartbeat on (both fail if the no-op is not limited to Undo); unchecked sets only the goal, records the decline, and a later card offers nothing; no checkbox when the Heartbeat is already on; the row names the mate's own interval; heartbeat is editable and validated; a pre-checkbox stored card still rebuilds; an answered checkbox stops the goal-setup chat question; the goal route refuses an unknown answer; the record keeps only known answers.
  • test/test_member_goals_cards.py: the scrubbing test pins heartbeat: false so it keeps checking only the goal write.
  • website/src/cards/GoalBody.test.tsx (new): the box renders checked by default with the cadence and credit note; it names the mate's interval; toggling calls preview with heartbeat flipped both ways; no box without an offer; locked on a finished card; the row stays out of the change lines; through ChangeCard, toggling sends heartbeat: false to cardsApi.preview.

Proof: not provable -- other: new feature, the new tests exercise new behaviour rather than a reverted fix

Manual verification

Rendered the real ChangeCard from the isolated capture entry website/capture/goal-heartbeat-card.html (script website/scripts/capture-goal-heartbeat-card.mjs) in dark and light, checked, unchecked, no-offer and Chinese. Not exercised end to end against a live mate; the apply and Undo paths run through the real card middleware and routes in the backend tests.

Screenshots / video

Checked (the default), dark:

checked-dark-en

Light, unchecked, no checkbox (Heartbeat already on), Chinese

checked-light-en

unchecked-dark-en

none-dark-en

checked-dark-zh-CN

Related Issues

N/A — requested directly by the owner.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

Contributions are accepted under the project's Apache-2.0 license.

A crewmate's crewmate.goal card now carries a Heartbeat checkbox, checked by
default, while the mate's Heartbeat is off and was never declined. Checked,
the card sets the goal and then turns the Heartbeat on at the mate's interval
through the same hooked schedules route a crewmate.check_ins card writes; its
Undo turns it off before taking the goal back. Unchecked, only the goal is
written and the decline is remembered (the record's heartbeat_offer), so no
later goal card offers it again. The goal-setup turn no longer asks about the
Heartbeat in chat or proposes a second set_check_ins card after a goal card.
@buluoray
buluoray requested review from a team and KiroCrewCaptain as code owners October 30, 2026 00:09
@buluoray
buluoray requested a review from mbriones98 October 30, 2026 00:09
@buluoray
buluoray enabled auto-merge (squash) October 30, 2026 00:10
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 30, 2026
@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of b73cf0d5c6e99effe7cf1ce0acd0705ccf9a0c91 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

No design-level concerns: the Heartbeat step goes through the existing hooked schedules route with compare-and-set, and old stored cards still rebuild.

Notes

  • Undo restores the goal but leaves heartbeat_offer: accepted on the record. After an Undo, a goal saved from the Goals tab no longer gets the chat question about the Heartbeat. Consider clearing the answer when the card's Heartbeat step is undone.

[DESIGN-REVIEWED] b73cf0d

Description read

[DESCRIPTION-READ] dcb0725ee2d2c85442c8cc8bdad3fb41bde047d2e1d34cd36dc3bdc5abd0c9ba

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ human override accepted

@buluoray overrode this lane for b73cf0d5c6e99effe7cf1ce0acd0705ccf9a0c91 via /ai-review override (this commit only).

@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS (a BLOCK with no Trigger and no Outcome does not block)

UX-level review of b73cf0d5c6e99effe7cf1ce0acd0705ccf9a0c91 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

UX-Verdict: PASS

cannot evaluate: missing the applied (locked) goal card with its Heartbeat checkbox. After the user presses "Set goal", this card is their only record of whether the Heartbeat was turned on, and no screenshot shows it.

Evidence gaps

  • The checkbox on a finished card. The diff locks it with disabled={disabled || !editable || !preview}, and the test "locks the box on a finished card" covers it. The five screenshots (checked, light, unchecked, no offer, Chinese) are all pending cards. To close the gap, attach a still of an applied card from capture-goal-heartbeat-card.mjs with the box checked and locked. If the Undo state looks different, attach that too.

Notes

  • The unchecked state in shot-03 still says "Runs about every 1 hr". The blind reader said it "reads as if it will still run". Make the note conditional, e.g. "When on, runs about every {{interval}}…", or swap the wording when the box is unchecked.
  • "you can turn it off any time" doesn't say where. The reader asked "where I'd turn it off later". Name the place: "…turn it off any time on the Schedules tab."
  • "Heartbeat" is easy to tick by default without knowing the cost. The reader "can't see how much one run costs" and is "nervous about pressing Set goal". The note already gives per_day, so add it, e.g. "up to 24 runs a day".

[UX-REVIEWED] b73cf0d

Description read

[DESCRIPTION-READ] 5a3eb0e09d27cde9410dad9df10548e9dbd2db0f36982165a1387ad245048a83

That sha256 names everything this verdict read: the PR description, plus the 8 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of b73cf0d5c6e99effe7cf1ce0acd0705ccf9a0c91 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] b73cf0d

False positive or not applicable? A repository writer can comment:
/ai-review override gpt b73cf0d5c6e99effe7cf1ce0acd0705ccf9a0c91 false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed b73cf0d5c6e99effe7cf1ce0acd0705ccf9a0c91 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] b73cf0d

Verdict parsed from the review's SHA-scoped output markers for commit b73cf0d5c6e99effe7cf1ce0acd0705ccf9a0c91.

False positive or not applicable? A repository writer can comment:
/ai-review override fable b73cf0d5c6e99effe7cf1ce0acd0705ccf9a0c91 false-positive: <reason, 20 to 500 characters>

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 30, 2026
@buluoray
buluoray force-pushed the feat/mate-goal-heartbeat-checkbox branch from 3701491 to aba3e60 Compare October 30, 2026 01:14
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 30, 2026
@buluoray
buluoray force-pushed the feat/mate-goal-heartbeat-checkbox branch from aba3e60 to eaab6f1 Compare October 30, 2026 01:33
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 30, 2026
@buluoray

Copy link
Copy Markdown
Contributor Author

/ai-review override first-principles eaab6f1 product-shape: Owner decision by @buluoray: the Heartbeat offer on the goal card is checked by default, deliberately overriding the RFC's off-by-default. A person who sets a goal usually wants it kept moving, and accepting the card is an explicit consent with the box in plain view. The cost stays visible: the box states the cadence and that each run spends credits and can be turned off any time. Unchecking is remembered, so the offer is never repeated.

@github-actions

Copy link
Copy Markdown
Contributor

AI-review override not recorded: product-shape is not a release class. Use /ai-review override <fable|gpt|design|ux|first-principles|scope|all> <current-sha> <class>[ #N]: <reason, 20 to 500 characters>, where <class> is one of false-positive, not-applicable, pre-existing, evidence-supplied, infra-failure, reissue, deferred, owner-decision. What each class needs: docs/ci/ci-and-reviews.md#risk-release-records.

@buluoray
buluoray force-pushed the feat/mate-goal-heartbeat-checkbox branch from eaab6f1 to 3e2880f Compare October 30, 2026 03:08
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 30, 2026
@buluoray

Copy link
Copy Markdown
Contributor Author

/ai-review override first-principles 3e2880f product-shape: Owner decision by @buluoray: the Heartbeat offer on the goal card is checked by default, deliberately overriding the RFC's off-by-default. A person who sets a goal usually wants it kept moving, and accepting the card is an explicit consent with the box in plain view. The cost stays visible: the box states the cadence and that each run spends credits and can be turned off any time. Unchecking is remembered, so the offer is never repeated.

@github-actions

Copy link
Copy Markdown
Contributor

AI-review override not recorded: product-shape is not a release class. Use /ai-review override <fable|gpt|design|ux|first-principles|scope|all> <current-sha> <class>[ #N]: <reason, 20 to 500 characters>, where <class> is one of false-positive, not-applicable, pre-existing, evidence-supplied, infra-failure, reissue, deferred, owner-decision. What each class needs: docs/ci/ci-and-reviews.md#risk-release-records.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 30, 2026
@buluoray buluoray mentioned this pull request Oct 30, 2026
5 tasks done
On a goal card's Undo steps only, a schedules write whose changes already
hold succeeds without writing, so turning the Heartbeat off by hand no
longer stops the Undo before it takes the goal back. Apply keeps the 409,
so a Heartbeat the user turned on by hand is never claimed by the card.
Also label the checkbox for jsx-a11y, drop the unused heartbeat_offer_open
helper, and replace the one-entry legacy editable registry with a goal-kind
case in rebuild_record.
@buluoray
buluoray force-pushed the feat/mate-goal-heartbeat-checkbox branch from 3e2880f to b73cf0d Compare October 30, 2026 04:31
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 30, 2026
@buluoray

Copy link
Copy Markdown
Contributor Author

/ai-review override first-principles b73cf0d product-shape: Owner decision by @buluoray: the Heartbeat offer on the goal card is checked by default, deliberately overriding the RFC's off-by-default. A person who sets a goal usually wants it kept moving, and accepting the card is an explicit consent with the box in plain view. The cost stays visible: the box states the cadence and that each run spends credits and can be turned off any time. Unchecking is remembered, so the offer is never repeated.

@github-actions

Copy link
Copy Markdown
Contributor

AI-review override not recorded: product-shape is not a release class. Use /ai-review override <fable|gpt|design|ux|first-principles|scope|all> <current-sha> <class>[ #N]: <reason, 20 to 500 characters>, where <class> is one of false-positive, not-applicable, pre-existing, evidence-supplied, infra-failure, reissue, deferred, owner-decision. What each class needs: docs/ci/ci-and-reviews.md#risk-release-records.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 30, 2026
@buluoray

Copy link
Copy Markdown
Contributor Author

/ai-review override first-principles b73cf0d owner-decision: @buluoray decided the goal card's Heartbeat box is checked by default, overriding the RFC's off-by-default: #26003 (comment) . The box states the cadence and that runs spend credits; unchecking is remembered.

@github-actions

Copy link
Copy Markdown
Contributor

Human judgment recorded

@buluoray recorded a owner-decision release (class owner-decision) for the first-principles AI finding on b73cf0d5c6e99effe7cf1ce0acd0705ccf9a0c91.

@buluoray decided the goal card's Heartbeat box is checked by default, overriding the RFC's off-by-default: #26003 (comment) . The box states the cadence and that runs spend credits; unchecking is remembered.

This decision applies only to this commit. A new push requires a new judgment.

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention labels Oct 30, 2026

@chenmingwei23 chenmingwei23 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved: checks green, mergeable.

@buluoray
buluoray merged commit c5d3289 into main Oct 30, 2026
95 of 97 checks passed
@buluoray
buluoray deleted the feat/mate-goal-heartbeat-checkbox branch October 30, 2026 14:50
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 30, 2026
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