Skip to content

feat(bestie): hourly notes and a nightly review in place of the hourly check-in - #3428

Merged
rileycrane merged 9 commits into
mainfrom
rileycrane/bestie-memory-v2
Nov 16, 2026
Merged

rileycrane merged 9 commits into
mainfrom
rileycrane/bestie-memory-v2

Conversation

@rileycrane

Copy link
Copy Markdown
Contributor

Goal

Local Bestie's one hourly check-in does every memory job in one model turn, and its roughly 4 KB of steps ride in the instructions of every chat turn. Most hourly wakes find nothing new yet still cost a turn and write memory, mem/user grows without a bound, and there is no slow pass that checks claims against their source or separates a guess from a fact.

This replaces it with two independent Attention-backed features and a small always-on memory section (memory v2, plugin only, no new primitive).

What changes

  • src/bundled/bestie/features.ts
    • checkinHourly is gone. New notes (bestie-notes, every hour) and dream (bestie-dream, daily). Each is a timer plus an Interest whose instructions hold the steps, so only that wake carries them. Both require memory and nothing else, so Nightly review works with Hourly notes off.
    • Hourly notes reads only channels Bestie is already a member of (channel_list), since per-channel marks in mem/heartbeat. It never joins or adds itself to a channel, so the old self-add step is removed. With no new events, no new channel and no due follow-up it stops with no memory write, no receipt and no message. Otherwise it appends quoted, sourced lines to mem/notes/YYYY-MM-DD and to entity cards, and messages the owner only when a follow-up they asked for is due.
    • Nightly review is silent. It checks claims it changes against their source events, applies the hypothesis rule (owner confirmation, or 3 or more observations on 3 or more days with none against; one contradiction retires), rewrites mem/user to at most 4 KB, organizes cards with the conflict and at-most-2-changes rules, rebuilds the mem/memory index and "Now", appends a reflection to the day's notes, and only advances last_dream if it finished.
    • memory is now v2: the slug map with sizes and writers, add-then-organize, fact versus guess, and check-against-source. That is all that stays in every turn.
    • Feature.text is optional (a feature may be only a timer and Interest), timer.atHour anchors a daily timer, and LEGACY names the old checkin.hourly so it can be removed.
  • save.ts: a feature with a timer reads as on only while its Interest and timer are both there; a daily timer is armed at the latest local atHour, so its first wake is the next 03:00; new replaceCheckIn (see Migration).
  • former.ts: the existing reconciler (stopFormerCheckIns) also runs the migration for the saved Bestie, and stops a non-Bestie agent's old or new check-ins.
  • BestieTab.tsx: the Check-ins group now lists Hourly notes and Nightly review. The "timer is still saved" row became "is partly saved" (either half left behind, Remove clears it).
  • prompt.ts: dropped the second copy of the hourly steps. It belongs to the hosted setup, which no longer sends the "Hourly upkeep wake" it waited for, so nothing consumed it.
  • README.md: documents both check-ins, memory v2, the migration, and the timer behavior.
  • Tests: features.test.ts, save.test.ts, former.test.ts, BestieTab.test.tsx, plus test-helpers.ts (the old check-in as it was saved, including its self-add step).

Copy in the tab: Hourly notes and Nightly review.

Migration

For the saved Bestie, once the account's choice is known, an old checkin.hourly that was on (its section whole and its timer present) with Remembers you on is replaced: Hourly notes and Nightly review are turned on in the DM the old timer ran in, and only then are the old section, Interest (bestie-hourly-check-in) and timer removed, so a failure leaves the old check-in to retry. An old check-in that read as off (section without timer, timer without section, or no memory) is only removed. Other agents' old check-ins are stopped like any former Bestie's. For an agent also in another community only the timers change, since its instructions are shared. The existing v1 memory section is left as it is (any version reads as on) until Remembers you is turned off and on; the new Interests carry the rules they need.

Tests

Run at 6cc1f408c1220859c4b349b85f426dca1c16d80b:

  • bin/pnpm check (biome check with warnings as errors, tsc --noEmit, design typecheck, design check): pass.
  • bin/pnpm exec vitest run src/bundled/bestie: 12 files, 168 tests pass (before the final lint and type fixes; the full run below covers the final tree).
  • bin/pnpm exec vitest run (full unit suite): 1087 files passed, 2 failed, 8 skipped; 21514 tests passed, 2 failed, 25 skipped. Both failures are outside this change and fail the same way on origin/main at 17da600be: browser-host/media-preparation.integration.test.mjs (tiled HEIC dimensions) and src/bundled/channels/ChannelLifecycleDialog.test.tsx (paused delete Retry).
  • Pre-push hooks ran and passed. Browser journeys, native Rust tests and the Tauri app were not run, and the changed flow was not exercised in the running app.

New coverage: no self-add text in any step; section-less features; Interest and timer both required; Nightly review armed at 03:00 (before, after and at 03:00) and due within 25 hours; Nightly review on and off without Hourly notes, and memory off removing both; migration order, DM reuse, no-memory and half-state cases, failure retry, and the other-community case; rollback for a feature with both a section and a timer, now covered at saveFeature level.

Not in this PR / follow-ups

  • v2.1: per-slug size limits enforced in mem_set (sizes are text-only here), a timer that keeps its clock time (Nightly review is anchored only on arming, then the runner schedules the next run a day after each run, so a late run drifts), and a code-level skip when nothing is new (Hourly notes still starts a model turn that decides to stop).
  • Remote and hosted check-ins.
  • Capability registry.
  • Read scope: this reads only channels Bestie is already in. The broader policy is being settled separately against docs/practical-information-flow-for-buzz-agents.md and docs(vision): add information flow vision for agents buzz#9290.
  • Upgrading an existing v1 memory section in place, and an "edited" state with Restore for a changed Interest.

🤖 Generated with Claude Code

…y check-in

Replace the single hourly check-in, whose ~4 KB of steps rode in every chat
turn's instructions, with two independent Attention-backed features:

- Hourly notes (bestie-notes, every hour): reads what is new in the channels
  Bestie is already a member of, since per-channel marks in mem/heartbeat. With
  nothing new it writes nothing and sends nothing. Otherwise it appends quoted,
  sourced lines to mem/notes/YYYY-MM-DD and entity cards, and messages the owner
  only when a follow-up they asked for is due.
- Nightly review (bestie-dream, daily, armed at 03:00 local): silent. Checks
  changed claims against source events, applies the hypothesis promotion rule,
  keeps mem/user to 4 KB, organizes cards, rebuilds the index and reflects.

Each is a timer plus an Interest that holds its steps, so only its wake carries
them; the always-on memory section (now v2) keeps just the memory map and
rules. The channel self-add step is gone. Nightly review does not need Hourly
notes. A feature may now have no instructions section.

For the saved Bestie, an old checkin.hourly that was on with memory is replaced
by both new features in the DM it ran in, then its section, Interest and timer
are removed; other agents' old check-ins are stopped. The hosted prompt drops
its unused copy of the hourly steps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Riley Crane <rileycrane@squareup.com>

@rileycrane rileycrane left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🤖 Princess Donut’s independent local review at 6cc1f408c: two must-fix findings and one non-blocking copy correction. Inspected the changed prompts/UI and their fixture consumers, plus logs from all 12 failed browser jobs. Existing inline comments/reviews were empty when checked after the independent pass. No source files changed; no local test suite or live-app exercise performed. The PR description otherwise accurately discloses timer drift, prompt-only limits, the retained v1 section and deferred hosted support.

Comment thread src/bundled/bestie/features.ts Resolved
Comment thread src/bundled/bestie/features.ts Resolved
Comment thread src/bundled/bestie/features.ts Resolved

@rileycrane rileycrane left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🤖 Carl’s independent local review at 6cc1f408c: not ready; existing must-fix findings remain.

My source pass found the removed-export fixture regression independently. After finishing that pass, I compared the existing review and am linking its inline findings rather than duplicating them:

  • P2 · error · MUST-FIX: features.ts:65 / tests/fixtures/bestie-tab.tsx:8: the fixture still imports removed checkinHourly. Downloaded Chromium/WebKit traces show the missing-export SyntaxError. All 66 failed executions across the two journey shards and ten failing flake-check shards belong to this fixture. Update its feature state and preserve all three layout variants.
  • P2 · error · MUST-FIX, found by the existing review: features.ts:102: confirmed that the no-notes return bypasses step 3’s elapsed-time hypothesis maintenance. Three quiet nights cannot retire an already-reviewed stale hypothesis under these steps.

No additional confirmed blocker found in the migration, legacy cleanup retry, feature dependency saves, or timer/storage boundaries I traced. The description accurately discloses initial-only daily anchoring, later drift, prompt-only budgets and retained v1 memory. The empty-wake token wording also deserves the existing optional correction.

Validation at the exact reviewed SHA, clean isolated worktree: bin/pnpm exec vitest run src/bundled/bestie — 12 files / 169 tests passed. Browser failure evidence is from CI run 43341980938; no local browser execution, full-suite rerun or live/native model workflow acceptance performed. No source changes.

rileycrane and others added 3 commits November 13, 2026 14:39
… guesses

- The browser fixture still imported the removed checkinHourly, so the tab
  never mounted. It now seeds Hourly notes' Interest and timer instead.
- Nightly review stopped whenever no note was new, so a stale hypothesis
  never reached its third stale night. It now stops only with no new note,
  no newer line in mem/user and no stale or overdue hypothesis, and writes
  its reflection to today's note when it reviewed none.
- Hourly notes says every wake uses tokens, an empty one too.

Co-authored-by: eggboy <3986e5374b8c11a274f4a53fa9a68e1e18b53e712f8aa5218add2485bf5a2b09@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Riley Crane <rileycrane@squareup.com>
Nightly review reads only the cards its notes name, and stops when there is
no note. A card written in a conversation had no note, so with Hourly notes
off it could stay out of the index for good. Every card write now appends a
sourced line to mem/notes/<today> that links the card as
[[mem/entities/<type>/<id>]], in chat and in Hourly notes, and Nightly review
reads the cards linked that way. The notes stay the one index of new work.

Co-authored-by: eggboy <3986e5374b8c11a274f4a53fa9a68e1e18b53e712f8aa5218add2485bf5a2b09@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Riley Crane <rileycrane@squareup.com>
Notes and mem/user lines carry a day, not a time, so a line written after
the 03:00 review on the same date was neither "since" nor "after"
last_dream, and the next review skipped it. Nightly review now reads notes
and mem/user lines dated on or after last_dream, and ignores its own
"Dream" sections when deciding whether to stop. At worst a day is read on
two nights.

Co-authored-by: eggboy <3986e5374b8c11a274f4a53fa9a68e1e18b53e712f8aa5218add2485bf5a2b09@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Riley Crane <rileycrane@squareup.com>

@rileycrane rileycrane left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🤖 Princess Donut rechecked 64ccbb3275dc891e0afbaff4de780b02e2a254e2 against the prior findings. Ready from my review; no remaining confirmed blocker. Chat card writes and Hourly notes now supply sourced card links in daily notes, and Nightly review explicitly loads those linked cards, closing the standalone discovery gap. The inclusive date comparison covers same-day notes/user facts, and the stop rule excludes Dream-only material while retaining stale-hypothesis maintenance. The earlier fixture and token-copy fixes remain present. Validation for this follow-up: inspected both fix commits and confirmed GitHub's head; I did not rerun the author's reported 169 unit tests / six browser cases / check command. CI and live-model acceptance remain separate validation gates.

A "Dream" section had no end, so a card link appended below one could be
read as part of it, and a review with no other work skipped it. Each
reflection now starts with a "<!-- dream:start -->" line and ends with a
"<!-- dream:end -->" line, and the stop check leaves out only what lies
between them: anything after the end line is new work.

Co-authored-by: eggboy <3986e5374b8c11a274f4a53fa9a68e1e18b53e712f8aa5218add2485bf5a2b09@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Riley Crane <rileycrane@squareup.com>

@rileycrane rileycrane left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🤖 Princess Donut: ready from source review at 9fcfe80ae6f2d496519ee5075932bbe3bfa583ba. Rechecked the fix for r4569562806: step 6 bounds each reflection with explicit start/end lines, and step 1 excludes only that bounded region. Reflection-only notes remain eligible for the no-op path; a sourced card link appended after the closing marker counts as work and remains discoverable by READ. Prior fixes remain intact. No additional confirmed finding. This follow-up inspected the exact commit and confirmed GitHub head; I did not rerun the author's checks or exercise live-model behavior. CI remains a separate gate.

@rileycrane rileycrane left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🤖 Carl’s follow-up review: ready from code review at 9fcfe80ae6f2d496519ee5075932bbe3bfa583ba; no remaining findings.

The explicit dream:start / dream:end lines match between REFLECT and the stop rule. A reflection-only note remains a no-op; ordinary note lines appended after the closing marker remain eligible and their linked cards are loaded. This addresses my Dream-boundary finding. The earlier card-discovery, same-day eligibility, stale-hypothesis, fixture and token-copy fixes remain intact. No material regression found in the fix diff.

Validated the exact head in a clean isolated worktree: bin/pnpm exec vitest run src/bundled/bestie — 12 files / 169 tests passed; git diff --check passed for the fix. Consumed the reported passing browser checks rather than rerunning them. Prompt text assertions do not establish live-model behavior; live/native acceptance and hosted CI remain separate validation gates. No source changes.

@rileycrane
rileycrane marked this pull request as ready for review November 14, 2026 00:11
@rileycrane
rileycrane requested a review from a team as a code owner November 14, 2026 00:11
Resolve the Remembers you description in src/bundled/bestie/features.ts:
keep main's "To clear a memory, ask Bestie to forget it." with this branch's
memory section version 2.

Co-authored-by: eggboy <3986e5374b8c11a274f4a53fa9a68e1e18b53e712f8aa5218add2485bf5a2b09@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Riley Crane <rileycrane@squareup.com>

@rileycrane rileycrane left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🤖 Carl’s merge-only follow-up: ready at 21b8a5b7422fa28102cc8478bfc2eab3ca32889b; no merge-resolution findings.

Verified the merge parents and remerge diff. The sole conflict resolution preserves memory version 2 and adopts main’s Remembers you description. Against the previously reviewed 9fcfe80ae, features.ts changes only that description; the memory text, notes/dream instructions, timers and legacy feature metadata are unchanged. The save/reconciliation code and browser fixture are also unchanged. The resolution does not change the notes/dream behavior covered by prior acceptance.

Scoped diff check passed. This was a source-only merge check; no tests or live-model workflow rerun, and no claim about current hosted CI.

@kazemek21 kazemek21 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.

Kyle reviewed the PR and the Nexus review-tracker notes. Approved with the non-blocking comment below.

Posted by Codex (gpt-6.1-sol) on behalf of kylez

Comment thread src/bundled/bestie/save.ts Resolved
If Every hour was paused in Attention, by its timer or its Interest, the
upgrade still turned Hourly notes and Nightly review on with enabled timers,
so their background wakes started. A paused old check-in now gives both new
ones a disabled timer and a paused Interest; the rest of the upgrade is the
same. saveFeature takes a `paused` option for this.

Co-authored-by: eggboy <3986e5374b8c11a274f4a53fa9a68e1e18b53e712f8aa5218add2485bf5a2b09@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Riley Crane <rileycrane@squareup.com>

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 Star Lord: changes needed at 21b8a5b; the existing pause-state finding also remains. Product-scope decision: confirm that nightly hypothesis/entity curation and its automatic enablement belong in bundled Bestie, or keep that expansion unbundled. Source review only; no runtime validation, and one first-pass review lane was unavailable.

Comment thread src/bundled/bestie/save.ts Resolved
Comment thread src/bundled/bestie/features.ts Resolved
rileycrane and others added 2 commits November 15, 2026 16:18
…mory

The upgrade from Every hour saved Hourly notes, then Nightly review, then
removed the old timer, each its own Attention change. At 249 of 250 watches
and timers the second save failed on the limit and the old timer was never
removed, so old and new upkeep both ran. The old Interest and timer are now
removed in the same Attention change that adds the new ones, ahead of them,
so the replacement saves whole or not at all and the old timer's room is
free for the new ones.

The upgrade also left a v1 memory section, whose chat turns keep prose in
mem/memory, beside a nightly review that rebuilds that slug as an index.
The same instructions save that takes out the old section now replaces a
whole v1 memory section in place with the current one. Nightly review
moves each claim in mem/memory that is not a card line, a "Now" line or a
lesson to its card or to mem/hypotheses before it rebuilds the index, so
nothing a v1 section saved there, or still saves, is dropped.

Co-authored-by: eggboy <3986e5374b8c11a274f4a53fa9a68e1e18b53e712f8aa5218add2485bf5a2b09@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Riley Crane <rileycrane@squareup.com>
…pped

The upgrade from Every hour replaced any v1 memory section with whole
markers by the current one. Whether a section is edited is read from its
markers alone, so a rule the owner added, changed or removed inside intact
markers was deleted with it, even when the upgrade only removed what was
left of an old check-in.

Remembers you now keeps the text of version 1 as it shipped, and a section
is upgraded only while its text is still that, apart from line endings and
trailing spaces. A section the owner edited stays as it is, and the
nightly review still moves what it kept in mem/memory before rebuilding
the index.

Co-authored-by: eggboy <3986e5374b8c11a274f4a53fa9a68e1e18b53e712f8aa5218add2485bf5a2b09@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Riley Crane <rileycrane@squareup.com>
@rileycrane

Copy link
Copy Markdown
Contributor Author

🤖 On the product-scope question in the review above: the author confirms that nightly hypothesis and entity curation, including its automatic enablement, stays in bundled Bestie as this PR ships it. It runs only while Remembers you is on and turns off with it.

@rileycrane
rileycrane merged commit c385ac6 into main Nov 16, 2026
66 checks passed
@rileycrane
rileycrane deleted the rileycrane/bestie-memory-v2 branch November 16, 2026 22:58
rileycrane added a commit that referenced this pull request Nov 16, 2026
* origin/main: (86 commits)
  feat(emoji): instant preview strip and Add emoji in the picker (#3560)
  feat(messages): highlight the message for the active thread (#3656)
  feat(bestie): hourly notes and a nightly review in place of the hourly check-in (#3428)
  feat(channels): let owners transfer channel ownership (#3120)
  Let DMs drag into saved sidebar groups (#2149)
  fix(messages): underline misspellings in the Mac composer by default (#3596)
  feat(identity): use neutral NIP-FA agent grant identifiers (#2648)
  feat(plugins): read up to 256 managed plugins (#3630)
  feat(communities): show other communities' unread in the switcher (#3459)
  feat(host-process): forward chosen login-shell variables to agents (#3381)
  fix(channels): label capped chat list fold "Show fewer" (#3266)
  feat(activity): show an unread count on the sidebar Activity row (#3641)
  feat(solo): reorder workspaces like channel sections (#3524)
  update feedback community invite link (#3652)
  Keep the AppImage's bundle paths out of host processes (#3653)
  Keep custom status emoji inline in the profile preview and mark agents in the full profile (#3534)
  feat(solo): rename workspaces in settings (#3531)
  Compact superseded thread summaries before memory admission (#3583)
  Skip retained thread events before replay reconciliation (#3584)
  feat(messages): replace the forward-like thread icon (#2166)
  ...

Signed-off-by: Riley Crane <rileycrane@squareup.com>
rileycrane added a commit that referenced this pull request Nov 17, 2026
* commit 'a70208f83': (86 commits)
  feat(emoji): instant preview strip and Add emoji in the picker (#3560)
  feat(messages): highlight the message for the active thread (#3656)
  feat(bestie): hourly notes and a nightly review in place of the hourly check-in (#3428)
  feat(channels): let owners transfer channel ownership (#3120)
  Let DMs drag into saved sidebar groups (#2149)
  fix(messages): underline misspellings in the Mac composer by default (#3596)
  feat(identity): use neutral NIP-FA agent grant identifiers (#2648)
  feat(plugins): read up to 256 managed plugins (#3630)
  feat(communities): show other communities' unread in the switcher (#3459)
  feat(host-process): forward chosen login-shell variables to agents (#3381)
  fix(channels): label capped chat list fold "Show fewer" (#3266)
  feat(activity): show an unread count on the sidebar Activity row (#3641)
  feat(solo): reorder workspaces like channel sections (#3524)
  update feedback community invite link (#3652)
  Keep the AppImage's bundle paths out of host processes (#3653)
  Keep custom status emoji inline in the profile preview and mark agents in the full profile (#3534)
  feat(solo): rename workspaces in settings (#3531)
  Compact superseded thread summaries before memory admission (#3583)
  Skip retained thread events before replay reconciliation (#3584)
  feat(messages): replace the forward-like thread icon (#2166)
  ...

Signed-off-by: Riley Crane <rileycrane@squareup.com>

# Conflicts:
#	src/bundled/goose/runtime.test.ts
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.

3 participants