Repository navigation
Releases
Releases · tjp72/pi-billion-memory
v0.7.1
v0.7.0
Added
- Concept tables from a file:
conceptsFileloads a runtime-generated table
(concepts/deprecated/filtered/scope/watermark) as read-only user data —
~-expanded, mtime+size cached, capped at 1 MB and bounded field by field; inline
conceptswin on conflicts.mode: "concepts"reports the source, scope, watermark,
keyword count and filtered-word count. /memory elevationcommand: prints a scoped work package for the keyword-table workflow in
docs/ELEVATION.md— row count, window count, the 2,000-row budget brake, the vocabulary
watermark and how many rows are newer than it. Numbers only: no block text is pulled into the
session by the command itself.- Bounded timeline preview:
preview: trueappends one redacted sentence (≤120 chars) per
line and is honoured only for windows of at most 80 entries. docs/ELEVATION.md: the keyword-table workflow (scope → deconstruct → cluster/keywordize →
screen → outline/tasks → incremental), keyword rules K1–K6, and the elevation artifact schema.
Filtering is a per-scope judgment recorded in the table'sfilteredlist — the repository
hardcodes no stopword list. This document is repository-only and is not shipped in the package.
Changed
sanitizeCfgacceptsconceptsFile(≤500 chars) and merges the table with inline vocabulary.- Related-evidence stopwords moved to the
stopwordsconfig key (user data; empty by default).
The bundle now ships no word list at all. - The
memory_searchprompt guidance is slimmed to calling-time rules; the keyword-table workflow
lives indocs/ELEVATION.mdand the/memory elevationcommand instead of the tool prompt.
Removed
memory_gettool removed (breaking change):block+detail: trueonmemory_search
replaces it — registration, schema and prompt references removed.
Fixed
Vocabulary hintsnow append totimeline/related/decomposeresults too (previously
only the default and concept paths) and consider bothconceptandqueryat once.- A broken
conceptsFileis now cached after the first failure (mtime+size, or a stable entry
when the file disappears) instead of being re-read and re-logged on every search. mode: "concepts"now reportsconfig/file/config+filebased on what the file
actually contributes, not just on whether inline concepts exist.
v0.6.2
Added
- Runtime vocabulary guidance:
deprecatedinpi-billion-memory.jsonmaps a retired term to
its replacement (empty string = none). When a query contains one,memory_searchappends a
boundedVocabulary hintsline, andmode: "concepts"lists the table beside the configured
concepts. The prompt guidance now tells the agent to record concept mappings and retired terms
there, so the vocabulary is generated at runtime instead of being hardcoded.
Changed
sanitizeCfgbounds thedeprecatedtable (MAX_DEPRECATED_TERMS, per-term length caps) and
drops non-string replacements.
v0.6.1
Added
- Concept search (user-defined):
memory_searchtakes aconceptname that
expands to the concrete terms the corpus actually uses — the vocabulary comes
from theconceptskey ofpi-billion-memory.json(the extension ships none),
searches every term, merges the hits, ranks by how many distinct terms matched,
and reportsMatched terms;mode: "concepts"lists what is configured. - Requirement decomposition:
decompose: truesplits a conjunctive query
(Chinese commas/semicolons,and) into clauses and searches each clause
separately, grouping the hits per clause. timelineacceptsfrom/toas ISO 8601 strings (date-only = the local day) as
well as epoch milliseconds; an unparsable bound is rejected instead of ignored.
Changed
timelinerenders local time (the header statestimes local UTC±hh:mm), tags
non-pi entries with[opencode]/[bili], and reportslisted/totalwith merged
duplicates;limit: 0returns the full catalog and a positive limit keeps the
newest N instead of silently slicing.
Removed
- The built-in concept vocabulary (
src/concepts.data.ts). Vocabulary is user
runtime data, not repository content (AGENTS.md §1), so 0.6.1 retires the
bundled table: define concepts under"concepts"inpi-billion-memory.json.
v0.6.0
Added
bili-sessionadapter: indexes billion-context proxy session files
(<host>_<hash>.json, blocks underpayload.state.blocks, e.g. WorkBuddy/codebuddy sessions).
The project name is the file's<host>segment, or the envelope's ownupstreamOrigin/protocol
when present; bili blocks are stored as not expandable, like opencode state files.- Upstream lifecycle/lineage metadata is now stored when the source provides it:
active,
direct_block_ids(compression lineage),duration_ms,generation,survived_count, and
compress_call_id;sourcesalso recordsformat_version/producer. A force rescan refreshes
these fields in place without touching stored summaries. memory_searchgains amode:timelinereturns the complete memory catalog (one line per
memory — time, project, block id, tier, topic — date-grouped, never truncated, unplaced rows
included), andrelatedcompares the sentence containing the query words in each block (with
conservative stopwords and a data-driven IDF gate against generic-token noise) and shows that
evidence sentence. The defaultblocksbehavior is unchanged. A new read-onlymemory_gettool
opens a catalog/search line and returns the stored, already-redacted summary (never raw messages).- Optional expansion (
expandEnabled) now also works for billion-context sessions:memory_expand
reads the envelope's ownpayload.blockContents(full/one manifest) instead of the host session
log. It stays two-step, bounded, redacted and read-only. - Identical memories copied across source files (fork/copy artifacts) merge into a single result
that lists the alternate sources; blocks from the same source are never collapsed, so multi-tier
parent/child pairs survive. relatedcompares a bounded text window (minimum 20, maximum 800 characters) at sentence level,
drops candidates with no query-word sentence or no evidence, and never deletes content words;
generic tokens are demoted by the IDF gate. A newexcludePathsconfig skips test/temp source
paths across every adapter.
Changed
CONTRIBUTING.mddocuments themainbranch-protection rule and how to lift force-push
protection for the length of a deliberate history rewrite.- Upgraded the pi compatibility test target from
@earendil-works/pi-coding-agent0.85.1 to
1.3.0; the extension continues to use only public extension APIs. This also picks upundici
8.10.2 and its security fixes. - Adapters now honor upstream format versions: billion-context-pi sidecars carry
schemaVersion
(missing = v1) and billion-context session envelopes carryversion(1-3). An unknown newer
version is skipped and logged once, never rewritten, and never advances the watermark. - Auxiliary store files that live next to session files (
.content-store.json,*.fb.json,
SQLite files) are skipped without being read, so a broad allow-list glob cannot turn them into
repeating failed sources. - Block expansion now reads the session only until the referenced messages are found and falls
back to a tail window when the references sit near the end of a long file; the byte budget is
unchanged.pi-sidecarallow-list entries also accept optionalproject/cwdhints that skip
the lazy session-header read. - Model-facing output (
memory_searchresults,relatedevidence,memory_get, and the timeline
topic) is re-passed through the secret filter as defense-in-depth, so a row ingested before the
current filter cannot surface a value that would be redacted today. Stored rows are not rewritten
(delete*.db*and rescan to scrub durably). - Hardening for untrusted input: upstream metadata (project label,
producer,
compress_call_id, lineage ids) is length-capped andgenerationaccepts onlyyoung/old;
the query is length/token capped; the full timeline catalog refuses (with a hint) above 20000
rows instead of silently truncating or exhausting memory.
v0.5.2
Fixed
- A background scan can no longer reopen the store after
session_shutdown, including a shutdown
that lands while the allow-list is being read: the scan captures the session generation before
its firstawait, andMemoryDb.open()refuses a latched store (getDb()already did). - Allow-list patterns are matched against paths relative to the source root, so a directory prefix
(sub/*.json,2026/**/*.jsonl.acp.json) narrows the scan instead of silently widening it into
a recursive scan of the whole root. - Symlinks are ignored consistently. The non-recursive listing now uses
withFileTypeslike the
recursive walk, so a link inside the root can no longer pull in a file from outside the
allow-list. - An unreadable or missing allow-list directory is counted as a failed source and logged (with the
path redacted) instead of silently looking like an empty source. The 0.5.1 note promised this;
it now holds. The scan budget now bounds visited entries (200,000) and matches (20,000)
separately, so non-matching session files cannot starve the real sidecars. readCappedre-stats the handle after reading, sotruncatedmeans "bytes exist past the
buffer": a session file that shrank while it was read no longer reports a stale truncation and
loses its last complete line. A file that exists but cannot be opened (EACCES/EPERM/EISDIR)
degrades to missing instead of failing the tool.mode: "full"counts indices the manifest never offered (or that hold no text) as skipped, so a
selection that resolves to nothing reportstruncatedinstead of a clean empty result.withoutPathscoversC:/, UNC roots,file:///and paths containing spaces
("C:\Program Files...", "/home/alice/My Docs/..."). The tool details no longer carry the full
database path, and log lines that quote raw errors/stacks pass through it as well, so the 0.5.1
"logs have no absolute paths" note now holds for them too.collectMsgIdsskips a first field whose entries are all unusable instead of letting it shadow a
valid second field.- A
session_shutdownthat is still finishing (grace period or final scan) when a new
session_startlands no longer closes and latches the new session's store; it detects that it was
superseded and leaves the store open. configureForTestsresets the cached connection, session generation, background scan and latch,
so tests no longer depend on every test file owning its own process.package.jsondrops the leftoverpublishConfigandprepublishOnly(the package isprivate
and distributed through git tags), and the README update examples use the same.gitURL as the
install section.
v0.5.1
Changed
- Distribution is git-only. The release workflow no longer publishes to npm: it checks that the
tag matchespackage.json, re-checks the committeddist/, and creates the GitHub release from
the matchingCHANGELOG.mdsection.pi install git:...is the only documented install path,
and the npm badge and npm install/uninstall sections were removed from both READMEs. - The store file is created
0600where the OS supports it (ignored on Windows). - Errors returned to the model by
memory_search/memory_expandno longer contain absolute local
paths; the full trace stays in the extension log. - CI limits the workflow token to
contents: read, the release workflow extracts release notes
with a literal version match instead of a regular expression, and the declared
billion-context-pipeer range is>=0.1.65to match the documented tested version. - The install docs are written for the public repository: HTTPS first (no credentials required),
SSH as the alternative, plus an "Update" section and a release badge. - Both workflows pin
actions/checkoutandactions/setup-nodeto commit SHAs. The repository
also gained issue forms (bug report with version/Node/pi fields), a pull-request template,
Dependabot configuration, and a Code of Conduct.
Added
- README "Scope: single user, single machine" section: no accounts, server, sync, or per-user
permissions; one store per OS user; SQLite WAL locking is single-host only, so the database file
must never be shared; ephemeral homes rebuild the index; redaction is best-effort over a
plaintext, permission-unhardened store; sync sidecars, not the database, across machines.
Fixed
memory_expandhardening after an external review of 0.5.0:mode: "full"now requires a non-emptyselectinstead of rendering the whole block,
which contradicted the documented two-step contract.expandMaxReadBytesis a real read cap again: the session file is opened and read in bounded
chunks instead of being slurped whole and sliced afterwards.- A per-entry trim is reported as
truncatedagain (a later assignment always cleared the
flag), and the rendered text is guaranteed to stay withinmaxChars. - A missing/renamed session file degrades to
missingreferences instead of throwing, matching
the documented behavior. custom_messageentries (extension-injected context such as ACP compaction notices) are
expandable again; unknown content-item types render an explicit[unsupported ...]
placeholder instead of being dropped from the entry.- Re-ingesting a sidecar clears stored pointers the sidecar no longer lists, so expansion can no
longer return messages that are no longer part of the block. - The 0.5.0 pointer migration now clears a freshly seeded watermark row, so an orphaned source
row still gets its pointers backfilled. ~indbPath/sourcesPath/logPathexpands to the home directory instead of creating a
literal~directory.- The ambiguous-block message reports the real number of matches instead of the page size.
- Manifests no longer print an absolute session path, and generated
acp_summary_*references
are labelledsyntheticrather than counted as recoverable text.
- Scan and store lifecycle hardening after a follow-up review:
- A background scan can no longer reopen the closed store after
session_shutdown: the scan
aborts per file when the session generation moved on, andgetDb()refuses to open a latched
store instead of recreating it. - One failing allow-list source (unreadable root, corrupt opencode DB, adapter bug) no longer
aborts every remaining source; failures are counted and logged per source. - An allow-list entry with an unknown
adapteris rejected and logged when the list is read,
instead of falling through to the permissive scan-time path. /memory prunewrites its tombstones and deletes in one transaction, so a crash cannot leave
the two halves inconsistent, and a failingVACUUMis logged instead of failing the prune.- An ingest that finishes reading a file after
session_shutdownreturnsstore closedinstead
of touching a null handle and then failing again inROLLBACK. - A scan whose allow-list root holds more than 20,000 entries stops at the cap and logs it,
instead of walking an accidentally over-broad tree to the end. - Log lines no longer contain absolute session or working-directory paths unless
debugis on
(the store path is logged as a file name) — logs are what users paste into public issues. SECURITY.mdno longer points "above" at a section that sits below it.
- A background scan can no longer reopen the closed store after