Fix: session memory rebuild makes hot.md and index.md disagree on v2 sessions
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 77/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- node.js, typescript
Research direction
Read src/storage/memory.ts, especially regenerateIndex and rebuildHotAndIndex, then inspect the related cases in test/storage-memory.test.ts. Run the storage memory tests and add coverage for a completed session with palee_schema: 2. Done when that session is excluded from both hot.md and index.md during one rebuild.
Written by the indexing model from the issue text.
Description
Session memory rebuild makes hot.md and index.md disagree on v2 sessions
Found this by accident — palee validate said "Skipped (unreadable or
unsupported schema): 1" but hot.md was pointing to that exact skipped
session as last_session. The two derived views of the same rebuild pass
disagree.
Reproduction
# Create a session note with palee_schema: 2 (unsupported, but valid YAML)
# Mark it as completed (status: completed, session_id: S-test)
palee validate --json
# → "Skipped (unreadable or unsupported schema): 1"
# Check hot.md — it lists S-test as last_session
cat .palee/hot.md
# → last_session: S-test
Root cause
src/storage/memory.ts:
regenerateIndex(lines 590-601) skips sessions where
frontmatter.palee_schema !== SUPPORTED_SCHEMA_VERSION:if (frontmatter.palee_schema !== SUPPORTED_SCHEMA_VERSION) { skippedCount++; continue; }rebuildHotAndIndex(lines 714-719) selects the newest session forhot.md
with a predicate that has nopalee_schemacheck:// Comment says: "Match the confirmed-session eligibility predicate from // regenerateIndex" — but it doesn't have the schema check. if (frontmatter && frontmatter.session_id && !...startsWith('DRAFT-') && frontmatter.status !== 'draft') {
The comment at line 711-713 claims it matches regenerateIndex's predicate,
but it doesn't — hot.md includes the session while index.md reports it as
skipped. Both files are written by the same rebuildHotAndIndex call.
ADR / convention
docs/adr/0019-session-memory-lifecycle.md:38: "both views apply the same
confirmed-session eligibility predicate, keeping index.md and hot.md internally
consistent."
Acceptance criteria
rebuildHotAndIndex's newest-session selector applies the same
palee_schemacheck asregenerateIndex.hot.mdandindex.mdcannot disagree about the same session in a single
rebuild pass.- Test in
test/storage-memory.test.ts: apalee_schema: 2completed
session is excluded from bothhot.mdandindex.md.
I did not use AI to generate this issue report.
- Dominant language
- TypeScript
- Stars
- 1
- Forks
- 0
- Avg merge
- 15h 54m
- Merged PRs (30d)
- 163
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Kuldeep2822k/cli
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Kuldeep2822k/cli#550 ·
Maintainers usually reply within 1 day
-
Fix: lapses string-concatenates on each review instead of throwingPossibly taken @Kuldeep2822k claimed this 2 days ago. Openbug core priority: medium
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Kuldeep2822k/cli#547 ·
Maintainers usually reply within 1 day
-
Fix: non-interactive session start prints success but creates no sessionPossibly taken @Kuldeep2822k claimed this 2 days ago. Openbug cli priority: medium
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Kuldeep2822k/cli#546 ·
Maintainers usually reply within 1 day
-
bug cli priority: medium
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Kuldeep2822k/cli#541 ·
Maintainers usually reply within 1 day
-
bug priority: medium storage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Kuldeep2822k/cli#540 ·
Maintainers usually reply within 1 day
All issues in Kuldeep2822k/cli
Similar issues
-
area:plugins area:security area:skills bug has repro
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
anthropics/claude-code#105911 ·
Maintainers usually reply within 1 day
-
openspec-apply-change skill: when blocked, may select a ready artifact unrelated to missingArtifactsOpen
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Fission-AI/OpenSpec#2165 ·
Maintainers usually reply within 1 day
-
🐞 bug 🧐 unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Tencent/tdesign-vue-next#7032 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
gnosis/gnosis_vpn#661 ·
Maintainers usually reply within 1 day
-
content-freshness: staleOwnedContent doc comments still say 'complete receipt' (follow-up to #7912)Opentriage:bug-verified
Difficulty 1/5 Under an hour Newbie friendliness 92/100
Maintainers usually reply within 1 day