[GH-ISSUE #909] [Issue]: Harden LTM thread lifecycle and resolved-thread fanout validation #477

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

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

Originally assigned to: @Promansis on GitHub.

Summary

The Long-Term Memory extraction pipeline can reject valid unresolved thread candidates because validation requires resolution-oriented wording, and its resolved-thread fanout diagnostic compares raw subjects instead of canonical timeline note targets. Together these rules can drop valid open threads and report false missing-history warnings for valid resolutions.

Affected package

Long-Term Memory (long-term-memory), server-side extraction validation and compilation.

Expected behavior

  • An unresolved thread remains valid when it clearly describes an open situation, question, tension, or goal even when its text does not contain one of the current resolver keywords.
  • A resolution that identifies an existing thread target continues to update that thread note in place rather than creating a separate resolved identity.
  • A resolved thread that has a retained timeline event representing its resolution does not emit resolved_thread_missing_fanout.
  • A genuinely missing resolution event continues to produce the diagnostic.

Actual behavior

  • isVagueThread rejects thread text solely because it does not match THREAD_RESOLUTION_PATTERN, coupling validity to a lexical heuristic.
  • The compiler already groups units by the canonical thread note ID and the focused probe confirms exact existing-thread target reuse and in-place status updates; this behavior needs a regression assertion while the validator fix is made.
  • Fanout validation compares thread subject/link values with timeline subjects. Timeline note IDs are namespaced (timeline_<subjectId>), so valid retained timeline events can be reported as missing fanout.

Steps to reproduce

  1. Submit a synthetic extraction containing an unresolved thread whose text describes an open condition without one of the resolver-pattern keywords.
  2. Submit a synthetic extraction containing a resolved thread and a matching retained timeline_event whose canonical target is timeline_<subjectId>.
  3. Run the focused Long-Term Memory extraction-graph regression harness.

Environment

  • Marinara Engine version: 2.4.1-compatible Long-Term Memory package baseline
  • Package version: 1.3.3
  • Install type: source regression harness
  • OS + version: not applicable to the pure server validation contract
  • Browser or app shell: not applicable

Logs, screenshots, or video

Not applicable. The evidence is in the server-side validator/compiler path and should be covered with synthetic fixtures only.

Additional context

Investigation of phase three of the LTM extraction reliability plan classified this as a code-confirmed contract mismatch. The narrow implementation scope is:

  • evidence-unit-validation.ts: remove the hard validity dependency on resolver keywords while preserving genuine invalid-thread safeguards; compare fanout against canonical timeline note IDs.
  • evidence-unit-compiler.ts: preserve its existing exact-target/in-place status behavior; change it only if a focused regression exposes a real gap.
  • tests/long-term-memory-extraction-graph.regression.ts: add synthetic positive and negative regression assertions for resolver-free threads, exact target reuse, and canonical fanout.

Prompt wording changes are maintained separately in Marinara Engine and are not part of this repository issue. Do not include private user data or live-vault repair work.

Focused proof target: tests/long-term-memory-extraction-graph.regression.ts. The investigation did not execute provider calls or live-vault operations.

Template check

  • I DID NOT read this template and provide the requested details.
Originally created by @Promansis on GitHub (Sep 18, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/909 Originally assigned to: @Promansis on GitHub. ## Summary The Long-Term Memory extraction pipeline can reject valid unresolved thread candidates because validation requires resolution-oriented wording, and its resolved-thread fanout diagnostic compares raw subjects instead of canonical timeline note targets. Together these rules can drop valid open threads and report false missing-history warnings for valid resolutions. ## Affected package Long-Term Memory (`long-term-memory`), server-side extraction validation and compilation. ## Expected behavior - An unresolved thread remains valid when it clearly describes an open situation, question, tension, or goal even when its text does not contain one of the current resolver keywords. - A resolution that identifies an existing thread target continues to update that thread note in place rather than creating a separate resolved identity. - A resolved thread that has a retained timeline event representing its resolution does not emit `resolved_thread_missing_fanout`. - A genuinely missing resolution event continues to produce the diagnostic. ## Actual behavior - `isVagueThread` rejects thread text solely because it does not match `THREAD_RESOLUTION_PATTERN`, coupling validity to a lexical heuristic. - The compiler already groups units by the canonical thread note ID and the focused probe confirms exact existing-thread target reuse and in-place status updates; this behavior needs a regression assertion while the validator fix is made. - Fanout validation compares thread subject/link values with timeline subjects. Timeline note IDs are namespaced (`timeline_<subjectId>`), so valid retained timeline events can be reported as missing fanout. ## Steps to reproduce 1. Submit a synthetic extraction containing an unresolved thread whose text describes an open condition without one of the resolver-pattern keywords. 2. Submit a synthetic extraction containing a resolved thread and a matching retained `timeline_event` whose canonical target is `timeline_<subjectId>`. 3. Run the focused Long-Term Memory extraction-graph regression harness. ## Environment - Marinara Engine version: 2.4.1-compatible Long-Term Memory package baseline - Package version: 1.3.3 - Install type: source regression harness - OS + version: not applicable to the pure server validation contract - Browser or app shell: not applicable ## Logs, screenshots, or video Not applicable. The evidence is in the server-side validator/compiler path and should be covered with synthetic fixtures only. ## Additional context Investigation of phase three of the LTM extraction reliability plan classified this as a code-confirmed contract mismatch. The narrow implementation scope is: - `evidence-unit-validation.ts`: remove the hard validity dependency on resolver keywords while preserving genuine invalid-thread safeguards; compare fanout against canonical timeline note IDs. - `evidence-unit-compiler.ts`: preserve its existing exact-target/in-place status behavior; change it only if a focused regression exposes a real gap. - `tests/long-term-memory-extraction-graph.regression.ts`: add synthetic positive and negative regression assertions for resolver-free threads, exact target reuse, and canonical fanout. Prompt wording changes are maintained separately in Marinara Engine and are not part of this repository issue. Do not include private user data or live-vault repair work. Focused proof target: `tests/long-term-memory-extraction-graph.regression.ts`. The investigation did not execute provider calls or live-vault operations. ## Template check - [ ] I DID NOT read this template and provide the requested details.
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#477
No description provided.