feat(team-member): edit and remove individual memory entries - #168
Open
subhangR wants to merge 3 commits into
Open
feat(team-member): edit and remove individual memory entries#168subhangR wants to merge 3 commits into
subhangR wants to merge 3 commits into
Conversation
Team member memory previously only supported append/list/clear, so
trimming a bloated memory meant clearing everything and re-appending the
keepers. Add per-entry edit and delete across all three packages.
Server:
- TeamMemberService.editMemoryEntry / removeMemoryEntry: atomic
read-modify-write by 0-based index, range-checked (404 out of range),
edit text trimmed + validated non-empty.
- Routes: PATCH /team-members/:id/memory/:index (body {projectId,entry})
DELETE /team-members/:id/memory/:index?projectId=
- validation.ts: memoryEntryParamSchema + editMemoryEntrySchema (Zod).
- Seed the two new command ids in default commandPermissions.
CLI:
- `memory edit <id> <index> --entry` and `memory remove <id> <index>`.
Index is 1-based (matches `memory list` output), converted to the
0-based API index; non-positive/non-numeric indices are rejected before
any request. Registered in command-catalog + prompts.
UI:
- Move memory into its own editable "Memory" tab in the Team Member editor
(was a cramped inline block). Per-entry inline edit (Cmd/Ctrl+Enter save,
Esc cancel) and delete, persisted via updateTeamMember({memory}) with
optimistic local state.
Tests:
- Jest: 9 service tests + 7 supertest route tests (Zod 400s, 404s).
- Vitest: 4 CLI tests (1->0 index conversion, method/URL/body, validation).
- Updated prompt-composer snapshots for the 2 new commands.
Memory stays string[] (no schema migration); entries addressed by index,
which `memory list` prints alongside each entry.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Team member memory only supported
append/list/clear(maestro team-member memory --help). There was no way to edit or delete an individual entry, so trimming a bloated memory meant clearing everything and re-appending the keepers — lossy, irreversible, and awkward for an agent told to "keep memory lean". Raised by Bhargav while trimming the Droplet Steward's memory (6 long entries, no way to drop individual ones).What changed
Per-entry edit and delete across CLI, server, and UI.
Server (
maestro-server)TeamMemberService.editMemoryEntry/removeMemoryEntry— atomic read-modify-write addressed by 0-based index, range-checked (404NotFoundErrorwhen out of range); edit text is trimmed and validated non-empty.PATCH /team-members/:id/memory/:index— body{ projectId, entry }DELETE /team-members/:id/memory/:index?projectId=validation.ts:memoryEntryParamSchema(coerced non-negative int) +editMemoryEntrySchema(Zod).commandPermissions.CLI (
maestro-cli)maestro team-member memory edit <teamMemberId> <index> --entry "<new text>"maestro team-member memory remove <teamMemberId> <index>memory listoutput, converted to the 0-based API index. Non-positive / non-numeric indices are rejected before any request. Registered in the command catalog + prompts.UI (
maestro-ui)updateTeamMember({ memory }); optimistic local state keeps the tab open after each change.Design note
Memory stays
string[]— no schema migration, no changes toTeamMemberSnapshot/mobile. Entries are addressed by index rather than stable id (low-risk);memory listprints the index alongside each entry so edit/remove are usable.Testing
team-member-memory.test.ts(9 service tests) +team-member-memory-routes.test.ts(7 supertest route tests incl. Zod 400s and 404s).team-member-memory.test.ts(4 tests — 1→0 index conversion, correct method/URL/body, pre-request validation).tsc -bclean. Updated prompt-composer snapshots for the 2 new commands.Acceptance
🤖 Generated with Claude Code