[GH-ISSUE #1275] [Feature]: long-term-memory Debug controls and polish (PR 4) #650

Closed
opened 2026-10-20 17:29:21 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @Promansis on GitHub (Oct 9, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1275

Originally assigned to: @Promansis on GitHub.

What problem does this solve?

The Long-Term Memory Debug workspace needs controls that communicate unsaved changes, progress, completion and export risks without making users lose their place. Remaining wording, heading, status and target-size issues make troubleshooting harder, especially with a keyboard, screen reader or touch input.

This is PR 4: Controls and polish from scratch/audits/ltm-debug-tab-ui-audit.md, revision 2: D05, D06, D07, D13, D14 (icon and weight only), D18, D20, D21, D23–D27, D32, D33, and the health line. Apply the findings to the landed two-pane workspace, not the audit's original expander layout.

Proposed package or change

Polish the existing downloadable long-term-memory package's Debug controls and copy, with the explicitly scoped shared summary/compact Chat Settings fixes below. Client plus about 10 English UI locale keys, an estimate rather than a quota. Reuse existing buttons, status surfaces, localization helpers, save flow and query data. No server, shared-schema, Engine, permissions or storage changes.

Acceptance criteria

  • D05 — Toggle-local save feedback. When longTermMemoryDebug differs from the saved setting, show a neutral unsaved cue and an inline Save action beside/below “Record recall explanations,” wired to the existing saveSettings flow. Show its save success/error feedback in the Debug panel without requiring a scroll to the page header. Visibly explain that extraction, draft and apply events are always recorded and the recall setting takes effect after saving. Preserve Save/Discard, other unsaved settings and the existing leave-with-unsaved-changes guard; do not add autosave or a second persistence path.
  • D06 — Busy, success and focus. Refresh, Export and Clear show a pending spinner using the existing reduced-motion pattern. Keep keyboard focus on the initiating control during/after the action, including the host confirmation flow, while preventing duplicate pending actions. Preserve Export/Clear mutual exclusion. Announce Export and Clear success through the existing status surface; retain actionable failure feedback. Use the existing shared primitives rather than introducing a new feedback system.
  • D07 — Honest, safer export. Label the action Export full log and visibly warn that it may include model output and should be reviewed before sharing. Filtering or search must not imply a filtered export. Use the same-origin response filename or a timestamped ltm-debug-log-<timestamp>.jsonl fallback, not the fixed filename. Surface the server's JSON {error} when supplied, with a useful fallback for other failed responses. Do not change the exported records or server endpoint.
  • D13 — Copy announcement. Preserve the already-landed polite “Copied” live-region confirmation for the selected operation's Copy JSON action and its reset. Preserve the accessible name beginning with Copy JSON and the unchanged raw clipboard records; no on-screen response snippets or JSON.
  • D14 — Warning icon and weight. Make warning/completed-with-warning states scannable with an existing warning icon and stronger label weight, retaining text alternatives and aria-hidden decorative icons. Preserve the existing navigator status icons and improve remaining details/timeline cues where needed. Do not rely on color or the undefined warning token. Defining/fixing the token across the package or Engine is separate scope.
  • D18 — Touch targets. Preserve the Debug candidate links' existing 44px targets. Give remaining recalled-memory buttons and noncompact Retry controls at least 44px targets, using existing conventions; compact LastInjectionSummary Retry is at least 24px. Compact Chat Settings has no new memory-link UI. Do not broaden this into a package-wide control redesign.
  • D20 — Labels and plurals. Render known camelCase count/weight names as readable localized labels (for example 812 used tokens and Semantic weight 0.4), pluralize “1 recent message scanned” through the existing plural helper, and use the appropriate localized operation/step status vocabulary rather than developer-style humanized statuses. Preserve the established estimated/provider-reported/reasoning/output/total token wording and compact token-count strings.
  • D21 — Separators. Compose operation metadata/count parts with a consistent spaced · separator; remove glued timestamp separators and separator prefixes from any still-used locale keys. Do not resurrect obsolete expander markup merely to fix its old strings.
  • D23 — Historical steps. Timeline steps use their own Started / Succeeded / Warning / Failed / Skipped wording as applicable. A recorded start step inside a completed operation must not say Running. Keep whole-operation status and stale/no-completion behavior unchanged.
  • D24–D26 — Names, titles and headings. Keep the tab Debug, use Activity log consistently for the log heading and related copy, keep the toggle Record recall explanations, and name the toolbar Log actions. Localize user-meaningful operation/action labels such as apply_draft, draft_deferred and candidate_reconciliation where displayed; every navigator row retains a useful title. Do not turn steps sharing an operation ID into separate operations. Use a logical heading hierarchy without skipping levels; keep info-popover buttons outside heading elements so accessible heading names equal the heading text.
  • D27 — Refetch without a loading-title flash. Debug no longer renders LastInjectionSummary; do not add it back. In compact Chat Settings, use initial-load state rather than background-fetch state for the summary's loading title. Preserve existing data while refetching and retain error/Retry behavior. This is not permission to change global query defaults or refetch policy.
  • D32 — Clear scope. Confirmation explicitly says clearing permanently removes all recorded debug events for every chat, and recommends exporting first if a copy is needed. Preserve destructive confirmation, cancellation with no DELETE, and the server error path; clearing the log must not delete memories or settings.
  • D33 — Visible status/error surfaces. Preserve the already-landed load/action error surfaces immediately below the toolbar and keep new busy/success feedback nearby. Feedback must not disappear below the navigator/details content. Retain alert/status semantics and an accessible Retry target.
  • Health line. Add one compact line under the toolbar showing events loaded, log size, index health, and semantic-search availability. Reuse existing log-window data, /status query/cache and existing host status interpretation; loaded events are not the full-log total. Show the available byte size without inventing a capacity (“of 2 MB”) or treating missing/pending status as healthy. Distinguish semantic availability from a recorded recall's outcome and from the current semantic weight setting. No new endpoint/schema or duplicate health-card layout.

Regression proof

  • Extend the existing Debug browser regression for toggle-local dirty/save feedback and the PUT body; delayed toolbar actions with visible spinners, duplicate-action guards, retained focus and success; timestamped export filenames, full-log/privacy copy and server JSON error text; Copy JSON's live-region confirmation/reset; and near-toolbar alerts. Exercise Clear cancellation and successful clearing without changing memory/settings data.
  • Cover warning icon/weight cues, target bounding boxes (44px noncompact, 24px compact Retry), readable count/weight labels, singular message wording, spaced metadata, historical Started wording, localized action titles and heading accessible names/order. Verify the health line with available and missing/unhealthy status data. Update feedback-clarity source/locale assertions without weakening unrelated contracts.
  • Retain full-operation filtering/status, no invented duration, established token wording, raw clipboard records, no on-screen response snippets, memory navigation and workspace selection guarantees. Cover compact Chat Settings background-refetch behavior and existing Retry flow, plus desktop/mobile switcher, light/dark and no-horizontal-overflow checks.
  • Verify actual Engine-host confirmation focus and scrolled save feedback where possible; record unavailable real-host/screen-reader/manual checks as gaps rather than claiming that the mock harness proves them.

Why should this be optional?

This is troubleshooting UI inside the existing optional Long-Term Memory package, not new Engine core functionality. Package-specific controls, settings presentation and copy remain in Marinara-Agents.

Alternatives considered

Autosaving the recall toggle would change the established settings contract. A new toast system, duplicate query mechanism or broader package-wide redesign is unnecessary when existing save/status/query primitives cover this work. Restoring the old expanders, raw JSON or latest-recall panel would conflict with the agreed two-pane direction.

Additional context

Related work / sequence: #1255 (PR 1 data helpers), #1259 (PR 2 workspace) and #1260 (Vault-to-Debug navigation) are closed. #1273 is PR 3's result/outcome breakdown work; integrate this polish with its final details content and avoid parallel edits to the same client/tests. This issue does not reopen their data/layout scope.

Current-state reconciliation: the audit baseline was staging f140047, LTM 1.4.6. At issue preparation, local HEAD and remote staging were 4aa93c530e53f5d15cc48639084070308e1d4fd0, LTM 1.4.19. Copy JSON already has a role="status" announcement, Debug candidate links already use min-h-11, navigator status icons exist, and load/action errors already sit below the toolbar. Keep these as regression guarantees rather than duplicate implementations. Historical audit line numbers and harness measurements are not fresh runtime proof; reconcile again against then-current staging before implementation.

Expected source/test scope: packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/{ActivityView.tsx,MemorySettings.tsx,LastInjectionSummary.tsx,ChatSettings.tsx,locales/en.json}; reuse display-labels.ts, localization.tsx, shared-controls.tsx and the existing /status consumer, changing shared helpers only if needed for the named behavior. Extend tests/long-term-memory-browser.regression.ts and tests/long-term-memory-feedback-clarity-ui.regression.mjs rather than adding a new harness.

Non-goals: Korean UI catalog (D22), Engine warning-token definition or cross-cutting fallbacks (the rest of D14), host muted/destructive contrast tokens (D30), chat-surface latest recall, PR 3 breakdown/recovery logic, retrieval/ranking/storage changes, new retention/pagination/terminal-event behavior, and global refetch-policy changes. The only compact Chat Settings changes are D18's Retry target and D27's loading-state polish.

Evidence limits: the audit used a shipped-bundle/mock-API harness, not a real running Engine; it did not observe the real confirmation modal/focus restoration or use a real screen reader. Its browser run passed the Debug fixture but stopped at a compact-select height assertion before the mobile Debug pass. No source implementation, build or browser validation was performed to create this issue.

Release and validation requirements: executable client changes are security-sensitive; include explicit positive/negative validation notes and real-host/lifecycle proof gaps. Patch-bump from the then-current staging package version, add the package CHANGELOG entry, and rebuild with node scripts/build-feature-packages.mjs long-term-memory. Never hand-edit generated bundles, archives, catalog entries or hashes. Run focused proof, the LTM browser and feedback-clarity regressions, npm run typecheck:packages, npm run check, node scripts/test-catalog-lanes.mjs, node scripts/validate-package-locales.mjs, node scripts/validate-catalog.mjs, node scripts/tests/catalog-release-notes.regression.mjs, and git diff --check, plus applicable repository-required validation. For every LTM build/test, use the issue-linked Agents workspace as workdir and prefix both explicit assignments: MARINARA_AGENTS_ROOT="<absolute Agents workspace>" MARINARA_ENGINE_ROOT="/home/damo/dev/Marinara-Engine". The shared Engine host is read-only. Record compatible Engine install/update and relevant lifecycle verification or gaps.

Template check

  • I DID NOT read this template and provide the requested details.
Originally created by @Promansis on GitHub (Oct 9, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1275 Originally assigned to: @Promansis on GitHub. ## What problem does this solve? The Long-Term Memory Debug workspace needs controls that communicate unsaved changes, progress, completion and export risks without making users lose their place. Remaining wording, heading, status and target-size issues make troubleshooting harder, especially with a keyboard, screen reader or touch input. This is **PR 4: Controls and polish** from `scratch/audits/ltm-debug-tab-ui-audit.md`, revision 2: **D05, D06, D07, D13, D14 (icon and weight only), D18, D20, D21, D23–D27, D32, D33, and the health line**. Apply the findings to the landed two-pane workspace, not the audit's original expander layout. ## Proposed package or change Polish the existing downloadable `long-term-memory` package's Debug controls and copy, with the explicitly scoped shared summary/compact Chat Settings fixes below. **Client plus about 10 English UI locale keys**, an estimate rather than a quota. Reuse existing buttons, status surfaces, localization helpers, save flow and query data. No server, shared-schema, Engine, permissions or storage changes. ### Acceptance criteria - [ ] **D05 — Toggle-local save feedback.** When `longTermMemoryDebug` differs from the saved setting, show a neutral unsaved cue and an inline Save action beside/below “Record recall explanations,” wired to the existing `saveSettings` flow. Show its save success/error feedback in the Debug panel without requiring a scroll to the page header. Visibly explain that extraction, draft and apply events are always recorded and the recall setting takes effect after saving. Preserve Save/Discard, other unsaved settings and the existing leave-with-unsaved-changes guard; do not add autosave or a second persistence path. - [ ] **D06 — Busy, success and focus.** Refresh, Export and Clear show a pending spinner using the existing reduced-motion pattern. Keep keyboard focus on the initiating control during/after the action, including the host confirmation flow, while preventing duplicate pending actions. Preserve Export/Clear mutual exclusion. Announce Export and Clear success through the existing status surface; retain actionable failure feedback. Use the existing shared primitives rather than introducing a new feedback system. - [ ] **D07 — Honest, safer export.** Label the action **Export full log** and visibly warn that it may include model output and should be reviewed before sharing. Filtering or search must not imply a filtered export. Use the same-origin response filename or a timestamped `ltm-debug-log-<timestamp>.jsonl` fallback, not the fixed filename. Surface the server's JSON `{error}` when supplied, with a useful fallback for other failed responses. Do not change the exported records or server endpoint. - [ ] **D13 — Copy announcement.** Preserve the already-landed polite “Copied” live-region confirmation for the selected operation's Copy JSON action and its reset. Preserve the accessible name beginning with **Copy JSON** and the unchanged raw clipboard records; no on-screen response snippets or JSON. - [ ] **D14 — Warning icon and weight.** Make warning/completed-with-warning states scannable with an existing warning icon and stronger label weight, retaining text alternatives and `aria-hidden` decorative icons. Preserve the existing navigator status icons and improve remaining details/timeline cues where needed. Do not rely on color or the undefined warning token. Defining/fixing the token across the package or Engine is separate scope. - [ ] **D18 — Touch targets.** Preserve the Debug candidate links' existing 44px targets. Give remaining recalled-memory buttons and noncompact Retry controls at least 44px targets, using existing conventions; compact `LastInjectionSummary` Retry is at least 24px. Compact Chat Settings has no new memory-link UI. Do not broaden this into a package-wide control redesign. - [ ] **D20 — Labels and plurals.** Render known camelCase count/weight names as readable localized labels (for example **812 used tokens** and **Semantic weight 0.4**), pluralize “1 recent message scanned” through the existing plural helper, and use the appropriate localized operation/step status vocabulary rather than developer-style humanized statuses. Preserve the established estimated/provider-reported/reasoning/output/total token wording and compact token-count strings. - [ ] **D21 — Separators.** Compose operation metadata/count parts with a consistent spaced **·** separator; remove glued timestamp separators and separator prefixes from any still-used locale keys. Do not resurrect obsolete expander markup merely to fix its old strings. - [ ] **D23 — Historical steps.** Timeline steps use their own **Started / Succeeded / Warning / Failed / Skipped** wording as applicable. A recorded start step inside a completed operation must not say **Running**. Keep whole-operation status and stale/no-completion behavior unchanged. - [ ] **D24–D26 — Names, titles and headings.** Keep the tab **Debug**, use **Activity log** consistently for the log heading and related copy, keep the toggle **Record recall explanations**, and name the toolbar **Log actions**. Localize user-meaningful operation/action labels such as `apply_draft`, `draft_deferred` and `candidate_reconciliation` where displayed; every navigator row retains a useful title. Do not turn steps sharing an operation ID into separate operations. Use a logical heading hierarchy without skipping levels; keep info-popover buttons outside heading elements so accessible heading names equal the heading text. - [ ] **D27 — Refetch without a loading-title flash.** Debug no longer renders `LastInjectionSummary`; do not add it back. In compact Chat Settings, use initial-load state rather than background-fetch state for the summary's loading title. Preserve existing data while refetching and retain error/Retry behavior. This is not permission to change global query defaults or refetch policy. - [ ] **D32 — Clear scope.** Confirmation explicitly says clearing permanently removes all recorded debug events **for every chat**, and recommends exporting first if a copy is needed. Preserve destructive confirmation, cancellation with no DELETE, and the server error path; clearing the log must not delete memories or settings. - [ ] **D33 — Visible status/error surfaces.** Preserve the already-landed load/action error surfaces immediately below the toolbar and keep new busy/success feedback nearby. Feedback must not disappear below the navigator/details content. Retain alert/status semantics and an accessible Retry target. - [ ] **Health line.** Add one compact line under the toolbar showing **events loaded, log size, index health, and semantic-search availability**. Reuse existing log-window data, `/status` query/cache and existing host status interpretation; loaded events are not the full-log total. Show the available byte size without inventing a capacity (“of 2 MB”) or treating missing/pending status as healthy. Distinguish semantic availability from a recorded recall's outcome and from the current semantic weight setting. No new endpoint/schema or duplicate health-card layout. ### Regression proof - [ ] Extend the existing Debug browser regression for toggle-local dirty/save feedback and the PUT body; delayed toolbar actions with visible spinners, duplicate-action guards, retained focus and success; timestamped export filenames, full-log/privacy copy and server JSON error text; Copy JSON's live-region confirmation/reset; and near-toolbar alerts. Exercise Clear cancellation and successful clearing without changing memory/settings data. - [ ] Cover warning icon/weight cues, target bounding boxes (44px noncompact, 24px compact Retry), readable count/weight labels, singular message wording, spaced metadata, historical Started wording, localized action titles and heading accessible names/order. Verify the health line with available and missing/unhealthy status data. Update feedback-clarity source/locale assertions without weakening unrelated contracts. - [ ] Retain full-operation filtering/status, no invented duration, established token wording, raw clipboard records, no on-screen response snippets, memory navigation and workspace selection guarantees. Cover compact Chat Settings background-refetch behavior and existing Retry flow, plus desktop/mobile switcher, light/dark and no-horizontal-overflow checks. - [ ] Verify actual Engine-host confirmation focus and scrolled save feedback where possible; record unavailable real-host/screen-reader/manual checks as gaps rather than claiming that the mock harness proves them. ## Why should this be optional? This is troubleshooting UI inside the existing optional Long-Term Memory package, not new Engine core functionality. Package-specific controls, settings presentation and copy remain in Marinara-Agents. ## Alternatives considered Autosaving the recall toggle would change the established settings contract. A new toast system, duplicate query mechanism or broader package-wide redesign is unnecessary when existing save/status/query primitives cover this work. Restoring the old expanders, raw JSON or latest-recall panel would conflict with the agreed two-pane direction. ## Additional context **Related work / sequence:** #1255 (PR 1 data helpers), #1259 (PR 2 workspace) and #1260 (Vault-to-Debug navigation) are closed. #1273 is PR 3's result/outcome breakdown work; integrate this polish with its final details content and avoid parallel edits to the same client/tests. This issue does not reopen their data/layout scope. **Current-state reconciliation:** the audit baseline was staging `f140047`, LTM 1.4.6. At issue preparation, local HEAD and remote staging were `4aa93c530e53f5d15cc48639084070308e1d4fd0`, LTM **1.4.19**. Copy JSON already has a `role="status"` announcement, Debug candidate links already use `min-h-11`, navigator status icons exist, and load/action errors already sit below the toolbar. Keep these as regression guarantees rather than duplicate implementations. Historical audit line numbers and harness measurements are not fresh runtime proof; reconcile again against then-current staging before implementation. **Expected source/test scope:** `packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/{ActivityView.tsx,MemorySettings.tsx,LastInjectionSummary.tsx,ChatSettings.tsx,locales/en.json}`; reuse `display-labels.ts`, `localization.tsx`, `shared-controls.tsx` and the existing `/status` consumer, changing shared helpers only if needed for the named behavior. Extend `tests/long-term-memory-browser.regression.ts` and `tests/long-term-memory-feedback-clarity-ui.regression.mjs` rather than adding a new harness. **Non-goals:** Korean UI catalog (D22), Engine warning-token definition or cross-cutting fallbacks (the rest of D14), host muted/destructive contrast tokens (D30), chat-surface latest recall, PR 3 breakdown/recovery logic, retrieval/ranking/storage changes, new retention/pagination/terminal-event behavior, and global refetch-policy changes. The only compact Chat Settings changes are D18's Retry target and D27's loading-state polish. **Evidence limits:** the audit used a shipped-bundle/mock-API harness, not a real running Engine; it did not observe the real confirmation modal/focus restoration or use a real screen reader. Its browser run passed the Debug fixture but stopped at a compact-select height assertion before the mobile Debug pass. No source implementation, build or browser validation was performed to create this issue. **Release and validation requirements:** executable client changes are security-sensitive; include explicit positive/negative validation notes and real-host/lifecycle proof gaps. Patch-bump from the then-current staging package version, add the package CHANGELOG entry, and rebuild with `node scripts/build-feature-packages.mjs long-term-memory`. Never hand-edit generated bundles, archives, catalog entries or hashes. Run focused proof, the LTM browser and feedback-clarity regressions, `npm run typecheck:packages`, `npm run check`, `node scripts/test-catalog-lanes.mjs`, `node scripts/validate-package-locales.mjs`, `node scripts/validate-catalog.mjs`, `node scripts/tests/catalog-release-notes.regression.mjs`, and `git diff --check`, plus applicable repository-required validation. For every LTM build/test, use the issue-linked Agents workspace as workdir and prefix both explicit assignments: `MARINARA_AGENTS_ROOT="<absolute Agents workspace>" MARINARA_ENGINE_ROOT="/home/damo/dev/Marinara-Engine"`. The shared Engine host is read-only. Record compatible Engine install/update and relevant lifecycle verification or gaps. ## Template check - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-20 17:29:21 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Agents#650
No description provided.