Skip to content

[codex] Honor soft archive state in partner memory snapshots - #2153

Open
sriv144 wants to merge 1 commit into
HKUDS:devfrom
sriv144:codex/partner-snapshot-archive-state
Open

sriv144 wants to merge 1 commit into
HKUDS:devfrom
sriv144:codex/partner-snapshot-archive-state

Conversation

@sriv144

@sriv144 sriv144 commented Oct 29, 2026

Copy link
Copy Markdown

Description

Partner memory snapshots currently recognize only sessions renamed to _archived_...jsonl. Web sessions use PartnerSessionStore.set_archived() instead, which keeps the history filename and stores the flag in _index.json. Archiving such a session therefore leaves its snapshot metadata at archived: false, and the unchanged fingerprint produces no snapshot modification.

Read the selected sessions directory's archive flags once and combine them with filename-based archive detection. Include archived state in fingerprints so archive/restore transitions are detected without editing history. Existing active-session fingerprints, IDs, history content, timestamps, and retention behavior are preserved. Archived sessions remain included as before. Missing, corrupt, or malformed sidecars do not hide readable history, and the adapter performs no writes.

Modules affected

  • Memory snapshot adapter and regression tests only.
  • Targets dev.

Validation

  • Twelve new regression cases use the real PartnerSessionStore in disposable directories. Cover soft archive metadata, archive/restore diffing, legacy renamed archives, malformed/missing indexes, read-only behavior, and isolation between partners and between admin/private-user session directories.
  • Against unchanged production source: 4 new cases fail and 8 pass. With the fix: all 12 pass.
  • Combined new tests, partner runtime, and partner memory-tool checks: 90 passed.
  • Whole memory directory on Windows: 212 passed, 4 skipped, 4 existing fixture failures. The same four fail in the existing adapter test module against unchanged production source: those fixtures write colon-containing filenames that become NTFS alternate data streams. They are unchanged by this patch; new tests use the actual portable session store.
  • Whole-repository Ruff 0.16.0 lint and format checks pass (2282 files). Scoped pinned mypy and Bandit checks pass; repository hygiene passes with the active Python interpreter.
  • All-files pre-commit was attempted. Node/Prettier setup stalled, so the completed all-files run skips Prettier. It reports the Windows-only missing python3 hook executable, an existing EOF blank line in an unrelated web test, and 27 broad mypy errors. The exact same 27 mypy errors were reproduced with unchanged production source. The unrelated hook formatting edit was preserved locally and restored. Changed-file hooks pass with those environment/baseline hooks skipped; direct hygiene and scoped mypy checks pass. Full pre-commit is not wholly green.
  • Local secret scanning reports no findings. AI assistance was used to develop and validate the change.

Checklist

  • Targets dev and follows the contribution guidelines.
  • Relevant regression tests added; unchanged-source failures reproduced.
  • Only snapshot metadata/change detection is corrected; history retention and access scope are preserved.
  • Full pre-commit is wholly green; see the explicit baseline/environment limitations above.

No running app, account, API credentials, model call, or GPU is required for these tests. No claim about model answer quality or memory consolidation quality is made.

@sriv144
sriv144 marked this pull request as ready for review October 29, 2026 06:42

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant