| Age | Commit message (Collapse) | Author |
|
C and C++ were the one language family where the store could only say "a hunk
landed inside this function". A diff line cannot be read for declarations
there: inside a body `foo(bar);` calls something, inside a class body the same
bytes declare a constructor, and pangemma indents both the same way (of 248538
changed lines in its history, 14991 are indented `name(` lines, and the most
frequent are calls). So the file is handed to universal-ctags and the tags of a
commit's blob are diffed against its parent's: present only in the new blob is
an add, only in the old one is a remove, and a name whose tag survives both is
left to hunk context, which is the honest answer for "the change was inside
this".
The cost is bounded by a cache keyed by git object id (new table `blobs`): a
blob's tags can never change, so each file version is parsed once per store.
On the pangemma history (688 commits, 1163 distinct C/C++ blobs) the first full
pass takes 26 s and touches go from 1404 context-only rows to 6888 add, 5125
remove, 1505 context; the second pass takes 11 s and runs no ctags at all.
ctags is optional at run time. Without it the store behaves exactly as before
and `sync` says so once. The Guix package bakes its absolute path into
$AI_MEMORY_CTAGS through wrap-program, and the check phase now builds a
two-commit git repository with one C++ file to prove it end to end: the
function added in the second commit is `add`, the one whose body changed is
`context`.
Details found by running it on a real history, all in this commit:
- lambdas are tagged by default under names ctags derives from a hash of the
file (`__anon426fc91f0102`), so every touched file reported seven functions
added and seven removed per commit; `--extras=-{anonymous}` turns them off.
- `--kinds-C++=+p` is needed or prototypes are invisible and a declaration in a
header would never be seen.
- include guards (`#define CALC_H`, `#define __CALC_H__`) are filtered: they are
bookkeeping, while other macros are kept as `const`.
- merge_decl keyed a commit's declarations by bare identifier, so two files
declaring the same name in one commit collided and one lost its attribution.
It is keyed by (file, name) now -- a bug that applied to Odin and Rust too.
|
|
guix build -f guix.scm prints a path that changes with every rebuild of the
tree, so the practical way to use it has been to copy a store hash into a
script -- and a copied hash outlives the source. That is not hypothetical:
a store on this box was created by a binary that predated the gist column,
and the mismatch surfaced as an empty 'sql error (Error):' at write time.
scripts/install.sh builds from this checkout, GC-roots the result
(AI_MEMORY_ROOT, default ~/.local/state/ai-memory/root) so a guix gc cannot
take it away, links AI_MEMORY_LINK (default ~/.local/bin/ai-memory) so nobody
has to remember a hash, and then runs the binary once to prove it starts.
Two builds in a row give the same store path, which is what makes the root
stable between runs and not merely between rebuilds of the same day.
README and doc/SKILL.md now lead with it, and keep the bare guix build as the
unpinned alternative.
|
|
The project had no README: the only prose was doc/SKILL.md, which is the
working protocol for an assistant already using the tool, not an introduction
to it. README.md now says what the store is for (a session's context is finite
and the conversation is gone when it ends; the diff says what, not why), what
it stores (three derived tables, one authored), how to build it, and the
vocabulary it needs: why / search / record / attach / sync / log / status,
with the topic index and its prefixes, the rules the tool relies on
(append-only reasoning, --supersedes, --basis) and the two limits worth
knowing up front -- the store is per repository and local, so a fact spanning
repos needs recording in each and anything that must outlive the machine
belongs in commits and docs too.
The examples are real output from this deployment's own stores, not invented:
the why entry shows the [fn file.function, context] annotation and the
reasoning under it, log shows the per-commit reasoning counts, status the row
counts. The record examples were run against a scratch store before being
written down.
LICENSE is BSD 3-Clause (Copyright (c) 2026 Pjotr Prins), which also settles
the TODO in guix.scm: the package now declares license:bsd-3 instead of the
placeholder expat. The package installs README.md and doc/SKILL.md beside the
binary under share/doc/ai-memory/; LICENSE travels in
share/doc/ai-memory-<version>/ from the standard install-license-files phase,
so it is not installed twice.
|