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

Memory tidy: surface dropped ops and dedupe duplicate adds in the index

Open
#351 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@abhishek09827 is already working on this.

Since Oct 13, 2026.

  • #353 by @abhishek09827 — open

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
ai

Research direction

Start in src/shared/memoryIndex.ts: validateOps silently discards malformed ops and applyOps adds duplicates. Run the repro script in the issue through test/load-ts.cjs to see the current counts. Open PR #353 already targets this, so check it before writing code. Done means dropped ops are counted by reason and deduped adds are skipped and counted, both visible in the tidy result and the memory-tidy log event.

Written by the indexing model from the issue text.

Description

bug os:linux
What happened?

The background memory tidy-up asks a Haiku model for itemised ops (add/update/delete/procedure) against each agent's memory index. Two failures on the app side make the index drift and hide model quality:

  1. validateOps (src/shared/memoryIndex.ts) drops malformed ops unknown ops, unknown ids, bad kinds, missing text with no count and no log line. The memory-tidy event in the hive log reports added/updated/deleted, so a tidy run that discarded half the model's reply is indistinguishable from a clean one. Expected: the number of dropped ops (per reason) visible in the tidy result and the memory-tidy log event.

  2. applyOps has no dedup on add. If the model returns the same fact twice in one response or under different casing both become index entries. Expected: a normalized-text duplicate add is skipped and counted, keeping one entry against the fixed 2000-token index budget.

Steps to reproduce
  1. Clone the repo at main (c7a191ad), run npm install.

  2. From the repo root, run the following with Node 22 (no Claude CLI needed):

    node -e "
    const mi = require('./test/load-ts.cjs')('src/shared/memoryIndex.ts');
    const e=(id,kind,text,source='task',date='2026-09-01',expires)=>({id,kind,text,source,date,...(expires?{expires}:{})});
    const entries=[e('m1','fact','Supplier cutoff is Thursday noon','task','2026-09-01','2026-10-01')];
    console.log('5 ops in ->', JSON.stringify(mi.validateOps({ops:[
    {op:'add',kind:'fact',text:'Weekly payroll runs Friday',source:'task'},
    {op:'add',kind:'secret',text:'bad kind'},
    {op:'update',id:'m99',text:'unknown id'},
    {op:'rewrite',text:'unknown op'},
    {op:'add',kind:'fact',text:''}]}, entries)));
    const out = mi.applyOps(entries,[
    {op:'add',kind:'fact',text:'Weekly payroll runs Friday',source:'task'},
    {op:'add',kind:'fact',text:'weekly payroll runs friday',source:'task'},
    {op:'add',kind:'fact',text:'Weekly payroll runs Friday',source:'task'}],'2026-10-13');
    console.log('stats ->', out.stats);
    out.entries.forEach(x=>console.log(' ', mi.entryLine(x)));
    "

  3. First block: 5 ops in, 1 valid op out; 4 dropped ops are invisible (no count anywhere).

  4. Second block: the same fact lands three times (m2/m3/m4) and stats report added:3.

Screenshot or screen recording
Image
Logs / stack trace
5 ops in -> [{"op":"add","kind":"fact","text":"Weekly payroll runs Friday","source":"task"}]
stats -> {"added":3,"updated":0,"deleted":0,"procedures":0,"repeats":0}
 - [m1] fact | Supplier cutoff is Thursday noon | task | 2026-09-01 | expires 2026-10-01
 - [m2] fact | Weekly payroll runs Friday | task | 2026-10-13
 - [m3] fact | weekly payroll runs friday | task | 2026-10-13
 - [m4] fact | Weekly payroll runs Friday | task | 2026-10-13
Operating system

Linux

OS version

Ubuntu 24.04 (WSL2)

Don't Be Michael version

0.1.9

Node version

v22.23.3

Agent CLI and version (if relevant)

n/a repro is pure functions, no agent CLI

Pre-flight
  • I attached a screenshot or recording above.
  • I'm on the latest release, or I've said above why I can't be.
  • I re-ran npm install so node-pty is rebuilt for the current Electron ABI (source installs only).
  • I searched existing issues and this isn't a duplicate.
Dominant language
TypeScript
Stars
273
Forks
211
Avg merge
14h 24m
Merged PRs (30d)
203

Getting set up

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 agentvivekkumar/dontbemichael

All issues in agentvivekkumar/dontbemichael

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.