mirror of
https://github.com/Pasta-Devs/Marinara-Agents.git
synced 2026-12-03 18:55:07 +07:00
[GH-ISSUE #1449] [Issue]: Long-Term Memory: record the reconciliation outcome for every candidate group #735
Labels
No labels
agent: chess
agent: conversation-calls
agent: eightball
agent: haptic
agent: hierarchical-maps
agent: hierarchical-maps
agent: illustrator
agent: poker
agent: rock-paper-scissors
agent: tic-tac-toe
agent: uno
artifacts
bug
bugfix
build
catalog
ci
client
dependencies
docs
documentation
enhancement
feature
fixed-in-staging
in-pr
normal-scope
packages
pull-request
qol
regression
roadmap
scope-risk
server
soup
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Agents#735
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Promansis on GitHub (Oct 18, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1449
Originally assigned to: @Promansis on GitHub.
Summary
Candidate reconciliation decides, for every non-character candidate group, whether it reuses an existing note, creates a new one, or leaves it for review. Only the match and the warning outcomes are ever recorded. The "no match, so create a new note" outcome, which is the duplicate-creation path, leaves no trace, so the duplicate rate cannot be measured from the debug log. (Tracker item EX-I3; extraction stages audit F4 part 1, pipeline plan step 9.)
Affected package
long-term-memory1.4.48 (upstream/staging1f7954305).S=packages/long-term-memory/src/engine/packages/server/src/services/long-term-memoryExpected behavior
Every extraction that runs reconciliation records one
candidate_reconciliationdebug event with counts for every outcome (groups, matched, created, ambiguous, incomplete) and the match kind (identity or content) for each match, so the create rate can be read from the Activity tab and the debug log.Actual behavior
reconcileEvidenceUnitCandidates(S/candidate-reconciliation.ts:55) returnsunits,diagnostics,remapsandmatches(:39-44). A group with no retrieved candidatescontinues silently (:134), and "zero plausible targets in a complete window" falls through with no remap and no diagnostic (:205).source-extraction.ts:644-661records thecandidate_reconciliationevent only whenremaps.size > 0 || diagnostics.length > 0, with countsreconciledNotesandambiguousCandidates. A create-only run records nothing.subjectIdand no echoed title, a near-verbatim text (Jaccard 1.00) matches, but Jaccard 0.60 and 0.50 rephrasings do not (probe C), so creates are the expected failure mode and the one that is not logged.Checked at
1f7954305.Steps to reproduce
reconciledNotesonly.Minimal fix
One PR, patch bump.
S/candidate-reconciliation.tsCandidateReconciliationMatch(:34-37) amatchKind: "identity" | "content", already computed at:163and:178.counts: { groups, matched, created, ambiguous, incomplete }toCandidateReconciliationResult(:39-44). Count a group ascreatedat both silent exits (:134,:205),ambiguousandincompletewhere those diagnostics are pushed,matchedwhere a remap is recorded. Every group ends in exactly one bucket.S/source-extraction.ts:644-661: drop theif; always record the event. ReplacereconciledNotes/ambiguousCandidateswith the new counts (keep the two old keys if the Activity tab's labels depend on them;ActivityView.tsx:94labels the action, and counts render generically). Status stayswarningwhen ambiguous or incomplete is above zero.CHANGELOG under
## Unreleased: one bullet, that the Debug tab now shows how many memories an import reused versus created.Not included
source-processing.tsand the same reconciliation file and follows this PR.Regression proof
tests/long-term-memory-candidate-reconciliation.regression.ts: a create-only run (the single-create case at:262) returnscounts.created === 1andcounts.matched === 0; the match at:230carriesmatchKind: "identity"; the ambiguous (:278) and incomplete (:690) cases count in their buckets;groupsequals the sum of the four.tests/long-term-memory-reconciliation-recall.regression.ts, thepreparedrun at:274), read the debug log after a create-only preparation and assert onecandidate_reconciliationevent with the counts.tests/long-term-memory-debug-log.regression.tsshows how events are read.extraction-reliability,debug-logandroutes-drafts.Environment
staging2039583ca)upstream/staging1f7954305)Logs, screenshots, or video
None. Found by the extraction stages audit (probe C) and confirmed by reading the code at
1f7954305.Additional context
Tracker item EX-I3. Prerequisite for EX-I10 and the pipeline plan's duplicate-rate measurement. Shares no source file with the other batch-1 issues.
Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked: