Skip to content

fix(memory): retain working state after read failures and admit valid recall candidates #994

Closed

Description

@loveRhythm1990

Existing issue search

Checked existing issues for Memoria purge and memory recall; no matching report found.

Version and environment

Reproduced against Astra commit 2873a950f2c9fea00343757933e96070d1631596 (0.2.11), using deterministic in-process Memoria fixtures. No production data is required.

Actual behavior

  1. Session-end governance can purge working memories after its final snapshot read fails. The snapshot loader collapses read errors to None, and governance leaves safe_to_purge_working enabled. With default session facts, no episode is stored, but purge still runs.
  2. Session-start recall caps profile/episode candidates before validating the typed prompt-memory protocol. Three high-scoring invalid rows can displace a fourth valid row, producing no prompt evidence.

Expected behavior

  • Distinguish a successful empty snapshot read from failed or denied reads. Failed reads must retain working memories and must not permit destructive cleanup.
  • Validate prompt eligibility before applying each recall bucket's cap. Keep the existing ownership, consent, protocol validation, ranking and latency boundaries.

Steps to reproduce

  1. Use a MemoriaPort whose snapshot read returns Failed, whose writes are admitted, and whose purge succeeds. Invoke run_session_end_governance with default SessionFacts. Observe zero episode writes and one purge call.
  2. Return four profile rows from the session-start query: three higher-scoring unstructured rows followed by a valid tagged preference. Observe zero admitted entries despite the valid candidate.

Proposed scope

Fix the canonical snapshot read/governance path and recall admission order; add deterministic regressions for failed/denied reads, successful empty reads, and mixed valid/invalid recall results. No deployment, database-schema or credential changes.

Activity

  1. added
    kind/bug
    on Oct 13, 2026
  2. added a commit that references this issue on Oct 13, 2026
    9611cfb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions