[GH-ISSUE #1273] [Feature]: long-term-memory Debug outcome breakdowns (PR 3) #649

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

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

Originally assigned to: @Promansis on GitHub.

What problem does this solve?

The Long-Term Memory Debug workspace can show an operation and its timeline, but troubleshooting also requires a clear answer to what was kept, what was not, why, and what to try next. Extraction outcomes, recall exclusions and skipped apply mutations are already logged; presenting only step facts makes those results difficult to interpret.

This is PR 3: Breakdowns from scratch/audits/ltm-debug-tab-ui-audit.md, revision 2, sections 1a and 4. It builds on the tested data helpers (#1255) and two-pane Debug workspace (#1259), rather than reopening their layout work.

Proposed package or change

Add result-first breakdowns and problem callouts to the selected operation's details pane in the existing downloadable long-term-memory package. Client UI and English locale copy are the required scope (about 25 keys, not a quota). Reuse existing outcome helpers, Review Queue reason labels, navigation and status surfaces.

Acceptance criteria

  • Preserve the agreed details order: status/title/time, Copy JSON, a problem callout with What to try when applicable, Result, the applicable Not kept / Not added / Not saved breakdown, Details facts, and What happened timeline. No nested operation expanders or on-screen raw JSON.
  • Extraction Result shows the logged candidate/unit/mutation/target-note counts and relevant mutation kinds/target notes. Read evidence_units_compiled fields rather than deriving invented totals. Duplicates are count-only: their text is not logged.
  • Extraction Not kept groups draft_deferred.details.extractionOutcome.droppedCandidates[] by reason, reusing ui.longTermMemory.reviewqueue.rejectionReason* labels. Show available messages and optional candidate quotes; missing snippet values must not produce blank quote UI. Respect logged truncation and show an accurate and N more notice when its count is available, without implying the displayed samples are exhaustive.
  • Offer a link to the existing Review Queue while the related draft is pending. Do not copy its recovery actions into Debug or offer recovery for a draft known to be no longer pending.
  • Recall leads with a concise count line and Added / Not added candidates, with a localized reason on each rejected row and no repeated generic “below the cutoff” sentence. Handle the actual recorded reasons: budget, lower_rank, duplicate_text, score_threshold, missing_chunk, and prompt_budget; do not introduce the mockup's invented max_chunks or below_threshold reasons. Preserve existing memory navigation.
  • Put the settings actually recorded for that recall after its results. Express relevance and minimum relevance consistently as percentages with the same rounding; keep other recorded settings and diagnostic facts available without presenting current settings as historical ones.
  • Apply Not saved uses mutations_selected.details.skippedMutationIds. Do not invent mutation text, reasons, or successful-save counts when the records do not supply them.
  • Problem callouts explain the recorded problem and offer actionable What to try guidance appropriate to it. Preserve existing output-limit/context/response-size/partial-failure problem information; do not diagnose missing evidence as a confirmed cause or duplicate mutation/review actions in Debug.
  • Missing, older or truncated outcome records render honestly without crashing, fabricated counts or an implied complete breakdown. Recorded recall rows can contain at most 20 rejected candidates and can have gaps: recording-off and pre-ranking skipped attempts need not have a logged explanation. Do not recreate a pinned “latest recall” panel to fill those gaps.
  • Candidate quotes may appear as model-output evidence, but raw responseSnippet never appears on screen. Copy JSON continues copying the selected operation's unchanged raw records, including real IDs and any response snippet.

Regression proof

  • Extend the existing Debug browser fixture with extraction outcomes spanning multiple reasons, optional/missing quotes and truncation; verify Result counts, grouping, the remaining-count notice, and the pending-draft Review Queue link.
  • Cover recall Added / Not added, actual rejection reasons and historical settings, including consistent percentage wording and no repeated generic cutoff message. Cover apply skipped mutation IDs and incomplete/older outcome records without fabricated information.
  • Cover problem callouts and guidance while preserving token wording, full-operation status/problem text, no invented duration, no on-screen response snippets, raw clipboard content and existing memory navigation guarantees.
  • Update tests/long-term-memory-feedback-clarity-ui.regression.mjs for the new content without weakening unrelated contracts. Reuse existing helper tests where new outcome transformation logic requires focused proof.
  • Exercise the details on desktop and mobile through the existing workspace switcher; retain no-horizontal-overflow checks, including long candidate quotes/IDs. Compact Chat Settings remains unchanged.

Why should this be optional?

These are package-specific troubleshooting views inside the existing optional Long-Term Memory package. Retrieval, outcome interpretation, settings and copy belong in Marinara-Agents, not Engine core.

Alternatives considered

Raw JSON and additional expanders do not meet the agreed result-first two-pane design. Reimplementing Review Queue recovery actions would duplicate an existing workflow. New server endpoints are unnecessary for the required breakdowns because the data is already logged.

Additional context

Dependencies: #1255 (PR 1 data helpers) and #1259 (PR 2 workspace) are closed. #1260 tracks the separately completed Vault-to-Debug navigation slice. Reuse the landed implementation; reconcile historical audit references against current staging before coding.

Source fields:

  • Extraction: evidence_units_compiled.counts (totalCandidates, units, mutations, targetNotes, deduplications), details.mutationKinds and targetNoteIds (up to 80); draft_deferred.details.extractionOutcome.droppedCandidates (reason, message, optional snippet up to 280 characters) and logged dropped-candidate truncation metadata.
  • Recall: recall_explanation.details selected/rejected candidates, recorded settings and relevance/threshold fields; up to 20 rejected candidates.
  • Apply: mutations_selected.details.skippedMutationIds.

Optional, not required for acceptance: expose the debug-log byte cap in /status with the smallest package server/shared-schema change if the UI needs an exact capacity. /status.events.bytes already supplies current size; otherwise show size alone, never a hard-coded “of 2 MB”. The health-line UI is PR 4 scope. No Engine changes are authorized by this issue.

Non-goals: redesigning the workspace, new grouping/filtering/title-resolution mechanisms, PR 4 controls/save-flow/export/announcements/health-line polish, compact Chat Settings or chat-surface latest recall changes, Korean UI catalog, Engine warning/contrast tokens, new retention/pagination/terminal-event behavior, or storage/retrieval/ranking changes.

Evidence limits: the audit baseline was staging f140047, LTM 1.4.6, with a shipped-bundle/mock-API harness rather than a real running Engine. Its browser run passed the Debug fixture but stopped at an unrelated compact-select height assertion before the mobile Debug pass. Optional quotes and mockup reason corrections are noted in the audit. These are historical findings, not fresh implementation validation. At issue preparation local HEAD was fe7889dc6640c36f77709ecfc89fee80671fd819; remote staging was 6685887b56c91db38b557c3fd33922bc2358983f. No implementation, build or browser validation was performed to create this issue.

Release and validation requirements: executable client code is security-sensitive; include explicit positive/negative validation notes and manual host/lifecycle proof gaps. Bump from the then-current staging package version, add the package's patch 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 regressions, the LTM browser and feedback-clarity tests, 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 checkout is read-only. If the optional server/schema change is taken, add focused status-contract proof and explicit validation notes for that boundary.

Template check

  • I DID NOT read this template and provide the requested details.
Originally created by @Promansis on GitHub (Oct 8, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1273 Originally assigned to: @Promansis on GitHub. ## What problem does this solve? The Long-Term Memory Debug workspace can show an operation and its timeline, but troubleshooting also requires a clear answer to **what was kept, what was not, why, and what to try next**. Extraction outcomes, recall exclusions and skipped apply mutations are already logged; presenting only step facts makes those results difficult to interpret. This is **PR 3: Breakdowns** from `scratch/audits/ltm-debug-tab-ui-audit.md`, revision 2, sections 1a and 4. It builds on the tested data helpers (#1255) and two-pane Debug workspace (#1259), rather than reopening their layout work. ## Proposed package or change Add result-first breakdowns and problem callouts to the selected operation's details pane in the existing downloadable `long-term-memory` package. Client UI and English locale copy are the required scope (about 25 keys, not a quota). Reuse existing outcome helpers, Review Queue reason labels, navigation and status surfaces. ### Acceptance criteria - [ ] Preserve the agreed details order: status/title/time, **Copy JSON**, a problem callout with **What to try** when applicable, **Result**, the applicable **Not kept / Not added / Not saved** breakdown, **Details** facts, and **What happened** timeline. No nested operation expanders or on-screen raw JSON. - [ ] **Extraction Result** shows the logged candidate/unit/mutation/target-note counts and relevant mutation kinds/target notes. Read `evidence_units_compiled` fields rather than deriving invented totals. Duplicates are count-only: their text is not logged. - [ ] **Extraction Not kept** groups `draft_deferred.details.extractionOutcome.droppedCandidates[]` by reason, reusing `ui.longTermMemory.reviewqueue.rejectionReason*` labels. Show available messages and optional candidate quotes; missing `snippet` values must not produce blank quote UI. Respect logged truncation and show an accurate **and N more** notice when its count is available, without implying the displayed samples are exhaustive. - [ ] Offer a link to the existing Review Queue while the related draft is pending. Do not copy its recovery actions into Debug or offer recovery for a draft known to be no longer pending. - [ ] **Recall** leads with a concise count line and **Added / Not added** candidates, with a localized reason on each rejected row and no repeated generic “below the cutoff” sentence. Handle the actual recorded reasons: `budget`, `lower_rank`, `duplicate_text`, `score_threshold`, `missing_chunk`, and `prompt_budget`; do not introduce the mockup's invented `max_chunks` or `below_threshold` reasons. Preserve existing memory navigation. - [ ] Put the settings actually recorded for that recall after its results. Express relevance and minimum relevance consistently as percentages with the same rounding; keep other recorded settings and diagnostic facts available without presenting current settings as historical ones. - [ ] **Apply Not saved** uses `mutations_selected.details.skippedMutationIds`. Do not invent mutation text, reasons, or successful-save counts when the records do not supply them. - [ ] Problem callouts explain the recorded problem and offer actionable **What to try** guidance appropriate to it. Preserve existing output-limit/context/response-size/partial-failure problem information; do not diagnose missing evidence as a confirmed cause or duplicate mutation/review actions in Debug. - [ ] Missing, older or truncated outcome records render honestly without crashing, fabricated counts or an implied complete breakdown. Recorded recall rows can contain at most 20 rejected candidates and can have gaps: recording-off and pre-ranking skipped attempts need not have a logged explanation. Do not recreate a pinned “latest recall” panel to fill those gaps. - [ ] Candidate quotes may appear as model-output evidence, but raw `responseSnippet` never appears on screen. **Copy JSON** continues copying the selected operation's unchanged raw records, including real IDs and any response snippet. ### Regression proof - [ ] Extend the existing Debug browser fixture with extraction outcomes spanning multiple reasons, optional/missing quotes and truncation; verify Result counts, grouping, the remaining-count notice, and the pending-draft Review Queue link. - [ ] Cover recall Added / Not added, actual rejection reasons and historical settings, including consistent percentage wording and no repeated generic cutoff message. Cover apply skipped mutation IDs and incomplete/older outcome records without fabricated information. - [ ] Cover problem callouts and guidance while preserving token wording, full-operation status/problem text, no invented duration, no on-screen response snippets, raw clipboard content and existing memory navigation guarantees. - [ ] Update `tests/long-term-memory-feedback-clarity-ui.regression.mjs` for the new content without weakening unrelated contracts. Reuse existing helper tests where new outcome transformation logic requires focused proof. - [ ] Exercise the details on desktop and mobile through the existing workspace switcher; retain no-horizontal-overflow checks, including long candidate quotes/IDs. Compact Chat Settings remains unchanged. ## Why should this be optional? These are package-specific troubleshooting views inside the existing optional Long-Term Memory package. Retrieval, outcome interpretation, settings and copy belong in Marinara-Agents, not Engine core. ## Alternatives considered Raw JSON and additional expanders do not meet the agreed result-first two-pane design. Reimplementing Review Queue recovery actions would duplicate an existing workflow. New server endpoints are unnecessary for the required breakdowns because the data is already logged. ## Additional context **Dependencies:** #1255 (PR 1 data helpers) and #1259 (PR 2 workspace) are closed. #1260 tracks the separately completed Vault-to-Debug navigation slice. Reuse the landed implementation; reconcile historical audit references against current staging before coding. **Source fields:** - Extraction: `evidence_units_compiled.counts` (`totalCandidates`, `units`, `mutations`, `targetNotes`, `deduplications`), `details.mutationKinds` and `targetNoteIds` (up to 80); `draft_deferred.details.extractionOutcome.droppedCandidates` (`reason`, `message`, optional `snippet` up to 280 characters) and logged dropped-candidate truncation metadata. - Recall: `recall_explanation.details` selected/rejected candidates, recorded settings and relevance/threshold fields; up to 20 rejected candidates. - Apply: `mutations_selected.details.skippedMutationIds`. **Optional, not required for acceptance:** expose the debug-log byte cap in `/status` with the smallest package server/shared-schema change if the UI needs an exact capacity. `/status.events.bytes` already supplies current size; otherwise show size alone, never a hard-coded “of 2 MB”. The health-line UI is PR 4 scope. No Engine changes are authorized by this issue. **Non-goals:** redesigning the workspace, new grouping/filtering/title-resolution mechanisms, PR 4 controls/save-flow/export/announcements/health-line polish, compact Chat Settings or chat-surface latest recall changes, Korean UI catalog, Engine warning/contrast tokens, new retention/pagination/terminal-event behavior, or storage/retrieval/ranking changes. **Evidence limits:** the audit baseline was staging `f140047`, LTM 1.4.6, with a shipped-bundle/mock-API harness rather than a real running Engine. Its browser run passed the Debug fixture but stopped at an unrelated compact-select height assertion before the mobile Debug pass. Optional quotes and mockup reason corrections are noted in the audit. These are historical findings, not fresh implementation validation. At issue preparation local HEAD was `fe7889dc6640c36f77709ecfc89fee80671fd819`; remote staging was `6685887b56c91db38b557c3fd33922bc2358983f`. No implementation, build or browser validation was performed to create this issue. **Release and validation requirements:** executable client code is security-sensitive; include explicit positive/negative validation notes and manual host/lifecycle proof gaps. Bump from the then-current staging package version, add the package's patch 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 regressions, the LTM browser and feedback-clarity tests, `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 checkout is read-only. If the optional server/schema change is taken, add focused status-contract proof and explicit validation notes for that boundary. ## 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#649
No description provided.