Skip to content

Add a memory directory and search to the memory panel (#3114) - #3170

Merged
Birfy merged 2 commits into
mainfrom
dev/3114-memory-directory
Nov 18, 2026
Merged

Birfy merged 2 commits into
mainfrom
dev/3114-memory-directory

Conversation

@Birfy

@Birfy Birfy commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Written-by: Dev

Fixes #3169
Part of #3114 (the umbrella stays open — this slice closes its own issue).

Owner: Dev
Reviewer: Reviewer
Tier: T1 — expected from the changed paths and size; the enqueue-guard/controller computes the final tier from the diff.

What changed

  • Directory (core/src/client/memory-panel.js): a MemoryNav beside the dialog's pages — <nav aria-label="Memory directory"> with a search input (aria-label="Search memory"), Overview, All entries (the count the view already returned), then one row per scope-and-topic: own rows before team rows, Main memory for untagged entries, in the order the list groups them. topic, query, navTopics, sameTopic and filterMemoryEntries are module-private; nothing is exported for tests.
  • Filtering only the loaded view: a query keeps entries whose text, topic or author holds every whitespace-separated term; a topic row filters by scope + topic (own travel and team travel stay separate). Both filter view.entries locally — no new host read, no new endpoint. The host's trigram/graph recall index (core/src/host/memory-search.js) is a different search and is not asked here. A no-result query draws the existing empty-state styles with No entries match "{query}".
  • Entries gains subset (default false): when filtered, empty scope sections are dropped. The default path is unchanged, so the existing read-only cases keep their shape.
  • Styles (core/src/client/styles.js, +14): .bt-mem-shell, .bt-mem-main, the 200px .bt-mem-nav with the sidebar background and right divider, the search field, and the nav list/group/heading/item/label/count rules. The dialog stays 680px; no collapse button, no [data-nav], no 640px breakpoint.
  • i18n (core/src/client/i18n.js, +6): Overview, Memory directory, Search memory, Main memory, and the two search empty-state sentences.
  • Tests (core/test/memory-panel-readonly.test.js, on the existing esbuild/vm/fake-React harness — no new file): a four-entry fixture (own travel, own untagged, team rituals, team travel) and three UI cases — the directory is named and holds the search field and six rows; search keeps entries holding every term and shows the no-match state; a topic row filters and All entries clears it. The original three P-475 cases are untouched.
  • Docs/changelog: one line in docs/subsystems/core-client.md (memory-panel row) and changelog.d/3114-memory-directory.added.md.

Not in this cut: directory collapse (Hide directory/Show directory, navHidden, [data-nav]), widening 680px → 880px, a max-width:640px breakpoint, the “n entries · m topics” summary line, core/src/shared/memory-catalog.js (a T3 path — the two helpers used here are inlined privately), host-side search, and persisting the directory state. patches/ds-bot/topics.json is untouched (no new source file).

Verification at the tip

Tip SHA: 54db8b98ad8f365c6908470d64fd80a75f21a89b
Base: 8b9e249bcfa4255acc834881f27849c1ded67bb5 (live main when the branch was cut and pushed)

Ran:

  • Red first, with only core/test/memory-panel-readonly.test.js changed: cd core && TZ=UTC node --import ./test/harness-resolve.mjs --test test/memory-panel-readonly.test.js → # tests 6 / # pass 3 / # fail 3, red on AssertionError: the directory is named, TypeError: Cannot read properties of undefined (reading 'props') (no [aria-label="Search memory"] input), and AssertionError: '' !== 'travel1' (no third bt-mem-nav-item).
  • Same command after the implementation → # tests 6 / # pass 6 / # fail 0.
  • Regression, same tree: memory-panel-readonly, memory, memory-empty, i18n, i18n-missing-entries, readonly-reload-lines → # tests 147 / # pass 147 / # fail 0. The five older files on “main implementation + only the new test” → # tests 141 / # pass 141 / # fail 0, so the new cases moved none of the old ones.
  • cd core && node scripts/build-client.mjs → core/client.js 24,252 → 24,370 lines; node core/scripts/build-client.mjs --check → exit 0; git diff --exit-code core/client.js → empty (no uncommitted drift after the build).
  • node scripts/ds-bot-patches.mjs check before generate → ok 10 patches apply cleanly in order and exactly five differing core paths (core/client.js, core/src/client/i18n.js, core/src/client/memory-panel.js, core/src/client/styles.js, core/test/memory-panel-readonly.test.js); after generate → ok core/ equals ds-bot/ + patches/ds-bot/; node scripts/ds-bot-patches.mjs canonical → ok patches/ds-bot/ is what generate writes (generate is a no-op).
  • TZ=UTC TMPDIR=/data/flybot-tmp npm run verify → exit 0: core 3312 tests / 3311 pass / 0 fail / 1 skipped; plane 20/20; social 715/715; tree 149/149; timeline 172/172; workflow 538/538; project 147/147; .github + policy 686/686; interop 37/37; live-e2e 34/34; core lint 89 warnings / 0 errors; arch-docs: OK (11 changed file(s)) re-run after the implementation commit.
  • node .github/scripts/changelog.mjs check → 8 fragment(s) in changelog.d/ are well formed.
  • git diff --name-only origin/main...HEAD → the 11 files below; grep -E '^(\.github/|policy/|core/src/shared/|core/src/host/|plugins/)' → empty; git diff -U0 core/src/client/memory-panel.js | grep -E '^\+.*(actions\.|call\()' → empty (the directory/search only filter view.entries).

Size: 11 files (6 handwritten + 5 generated). Handwritten git diff --numstat: panel +86/−19, styles +14/−0, i18n +6/−0, test +82/−0, docs +1/−1, changelog +1 → 210 lines, under the T1 400-line / 20-file limit. (The spec's 203 counted by grep -c '^+[^+]', which misses added blank lines; the diff's own count is 210.)

Not run (and why):

  • A real-browser visual/click check of the directory. The cases drive the real components through the existing harness, but there is no browser here; the hand-check for this PR is: open a Bot's memory, see own rows before team rows and Main memory for untagged entries, type a word, clear it, and click a topic row and All entries in a narrow and a wide window.
  • The smoke bench (core/dev/bench.sh): no index.js, host or turn-pipeline change.
  • npm ci / npm run harness: node_modules were already installed at this core/package-lock.json and dev/harness/package.json, so no fresh install was needed; verify ran on them end to end.

Checkpoint

{
"pr": 3170,
"claim": "Dev",
"issue": 3169,
"summary": "The memory dialog now has a directory beside its pages: a search over the entries the host already loaded, Overview and All entries, then one row per scope-and-topic (own before team, Main memory for untagged entries, in list order). A query keeps entries holding every term; a topic filters by scope and name. Both only filter view.entries, with no new read; a no-result query draws an empty state. Styles add the 200px directory only — no collapse, no widening. Three UI cases join the existing memory-panel harness (red 3/3 first, then 6/6).",
"files": [
"core/src/client/memory-panel.js",
"core/src/client/styles.js",
"core/src/client/i18n.js",
"core/test/memory-panel-readonly.test.js",
"docs/subsystems/core-client.md",
"changelog.d/3114-memory-directory.added.md",
"core/client.js",
"patches/ds-bot/0001-core-fixes.patch",
"patches/ds-bot/0003-flybot-api-client.patch",
"patches/ds-bot/0008-client-bundle.patch",
"patches/ds-bot/files/test/memory-panel-readonly.test.js"
],
"checks": { "ran": "TZ=UTC TMPDIR=/data/flybot-tmp npm run verify", "result": "green", "at": "54db8b98ad8f365c6908470d64fd80a75f21a89b" },
"next": "none — ready for review"
}

The three cases drive the panel main has today: it names no directory, holds
no search field, and its directory has no topic row. They fail until the panel
reads the loaded view into a directory.

Part of #3114 (the umbrella stays open — this slice closes its own issue).
The memory dialog now carries a directory beside its pages: a search over the
entries the host already returned, Overview and All entries, and one row per
scope-and-topic (own before team, Main memory for untagged entries, in the
order the list groups them). A topic or a query filters the loaded view only —
no new read, and the host recall index is a different search. A no-result
search draws its own empty state.

Fixes #3169
Part of #3114 (the umbrella stays open — this slice closes its own issue).
@Birfy Birfy added the agent-pr Pull request opened by an agent label Nov 18, 2026
@Birfy Birfy self-assigned this Nov 18, 2026
@Birfy
Birfy marked this pull request as ready for review November 18, 2026 14:57
@Birfy
Birfy added this pull request to the merge queue Nov 18, 2026
Merged via the queue into main with commit 25ab31c Nov 18, 2026
17 of 21 checks passed
@Birfy
Birfy deleted the dev/3114-memory-directory branch November 18, 2026 15:10
@github-actions github-actions Bot removed the agent-pr Pull request opened by an agent label Nov 18, 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.

[#3114] 记忆目录与搜索:面板内按主题目录与关键词筛选已载入条目

1 participant