[GH-ISSUE #964] [Issue]: LTM actionable retryability and deterministic batch caching #507

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

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

Originally assigned to: @Promansis on GitHub.

Summary

Long-Term Memory batch imports flatten extraction and finalization failures into generic retryable results, so permanent failures can be offered for retry without preserving their actionable service codes. Deterministic Game Mode batch preparation also scans the full vault once per source item instead of reusing a batch-scoped note snapshot.

Affected package

long-term-memory

Expected behavior

  • Imported-source failures preserve a bounded, client-safe error code and classify retryability from the actual failure category. Permanent configuration, identity, destination, and validation failures are not retryable; cancellation, incomplete extraction, transient provider failures, and source-write failures retain their established semantics.
  • Deterministic batch preparation loads the applicable vault-note snapshot once per batch and reuses it across items without weakening destination-scope filtering, deduplication, graph validation, finalization ordering, or concurrency isolation.
  • Single-source processing and LLM extraction behavior remain unchanged except for more accurate failure reporting.

Actual behavior

  • processLongTermMemorySourceBatch() routes preparation and finalization errors through failed(), which emits only extract_failed or finalize_failed and sets every such result to retryable: true.
  • Direct deterministic preparation constructs a new storage service and calls listNotes() for each item. A deterministic batch therefore repeats a full vault directory scan for every source.
  • Source-write conflicts already preserve specific codes and correct retryability. That repaired behavior must not be reimplemented or regressed.

Steps to reproduce

  1. Run a synthetic imported-source batch whose extraction fails with a permanent structured service error, such as invalid model configuration or quota rejection.
  2. Observe that the item result reports generic extract_failed with retryable: true instead of preserving an actionable permanent classification.
  3. Run a multi-item deterministic Game Mode import while counting LongTermMemoryStorage.listNotes() calls. Observe one full-vault scan per prepared item.

Environment

  • Marinara Engine version: package built against 2.4.1
  • Package version: 1.3.5
  • Install type: source inspection
  • OS + version: Linux
  • Browser or app shell: not applicable

Logs, screenshots, or video

No private source data, live-provider calls, screenshots, builds, or test executions were used. The report is based on source inspection at d64911d7a7c709939ab2838bc130f04a56afc197.

Additional context

Scope is limited to phase seven's actionable retryability contract and deterministic batch read reuse. Preserve source-write conflict handling added before this issue, source order, batch concurrency bounds, abort behavior, incomplete-result retryability, finalization serialization, scope isolation, and accounting.

Focused proof should cover permanent versus transient extraction failures, cancellation and incomplete siblings, source-write conflict compatibility, one snapshot read for a multi-item deterministic batch, filtered target reuse, and unchanged single-source/LLM paths. Generated bundles, artifacts, manifests, and catalogs must be changed only through the package builder during a later authorized implementation phase.

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @Promansis on GitHub (Sep 20, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/964 Originally assigned to: @Promansis on GitHub. ## Summary Long-Term Memory batch imports flatten extraction and finalization failures into generic retryable results, so permanent failures can be offered for retry without preserving their actionable service codes. Deterministic Game Mode batch preparation also scans the full vault once per source item instead of reusing a batch-scoped note snapshot. ## Affected package `long-term-memory` ## Expected behavior - Imported-source failures preserve a bounded, client-safe error code and classify retryability from the actual failure category. Permanent configuration, identity, destination, and validation failures are not retryable; cancellation, incomplete extraction, transient provider failures, and source-write failures retain their established semantics. - Deterministic batch preparation loads the applicable vault-note snapshot once per batch and reuses it across items without weakening destination-scope filtering, deduplication, graph validation, finalization ordering, or concurrency isolation. - Single-source processing and LLM extraction behavior remain unchanged except for more accurate failure reporting. ## Actual behavior - `processLongTermMemorySourceBatch()` routes preparation and finalization errors through `failed()`, which emits only `extract_failed` or `finalize_failed` and sets every such result to `retryable: true`. - Direct deterministic preparation constructs a new storage service and calls `listNotes()` for each item. A deterministic batch therefore repeats a full vault directory scan for every source. - Source-write conflicts already preserve specific codes and correct retryability. That repaired behavior must not be reimplemented or regressed. ## Steps to reproduce 1. Run a synthetic imported-source batch whose extraction fails with a permanent structured service error, such as invalid model configuration or quota rejection. 2. Observe that the item result reports generic `extract_failed` with `retryable: true` instead of preserving an actionable permanent classification. 3. Run a multi-item deterministic Game Mode import while counting `LongTermMemoryStorage.listNotes()` calls. Observe one full-vault scan per prepared item. ## Environment - Marinara Engine version: package built against 2.4.1 - Package version: 1.3.5 - Install type: source inspection - OS + version: Linux - Browser or app shell: not applicable ## Logs, screenshots, or video No private source data, live-provider calls, screenshots, builds, or test executions were used. The report is based on source inspection at `d64911d7a7c709939ab2838bc130f04a56afc197`. ## Additional context Scope is limited to phase seven's actionable retryability contract and deterministic batch read reuse. Preserve source-write conflict handling added before this issue, source order, batch concurrency bounds, abort behavior, incomplete-result retryability, finalization serialization, scope isolation, and accounting. Focused proof should cover permanent versus transient extraction failures, cancellation and incomplete siblings, source-write conflict compatibility, one snapshot read for a multi-item deterministic batch, filtered target reuse, and unchanged single-source/LLM paths. Generated bundles, artifacts, manifests, and catalogs must be changed only through the package builder during a later authorized implementation phase. ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-20 17:28:09 +07:00
  • closed this issue
  • added the
    bug
    label
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#507
No description provided.