Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Fix: session memory rebuild makes hot.md and index.md disagree on v2 sessions

Open Beginner friendly
#542 0 comments 0 reactions 0 assignees View on GitHub

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
Domain
backend, cli

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

bug priority: medium storage

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 for hot.md
    with a predicate that has no palee_schema check:
    // 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_schema check as regenerateIndex.
  • hot.md and index.md cannot disagree about the same session in a single
    rebuild pass.
  • Test in test/storage-memory.test.ts: a palee_schema: 2 completed
    session is excluded from both hot.md and index.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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Kuldeep2822k/cli

All issues in Kuldeep2822k/cli

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.