computer reinvention / 01 · trie · pre-alpha
The host is your git repo.
Agents start every session from zero: they re-derive your codebase by grep and guesswork, then record nothing for the next session. trie fixes both with a meaning + intent index committed next to your code. What every symbol does. Why it is that way. Fresh by sync. Honest by a commit gate. No services.
uv tool install
git+https://github.com/computer-reinvention/trie
One record, two halves. Both live in triefacts/,
both are plain Markdown, both are gated at commit. Here is the
same symbol on both sides:
One section per symbol, one triefact per source file. Regenerated when the source changes. Drifted prose blocks the commit.
source: src/auth/middleware.py
## `require_auth(handler) -> handler`
Wraps a route handler with a session check.
Requests with a missing or expired token are
rejected with 401 before the handler runs.
Called by: routes/admin · routes/api
One note per changed symbol, recorded at edit time. A missing note blocks the commit. Archived per commit as a digest.
## Expired sessions must fail closed
2026-07-25 · commit fade5436
~ src/auth/middleware:require_auth
"expired tokens must 401, not 500 (see #241)"
~ tests/test_auth:test_expired_token_401
"pins the fail-closed contract"
trie read src/auth/middleware:require_auth answers
what. Add --history and it answers
why: every note ever recorded against the symbol, in
commit order.
Each session writes the context the next session reads. Enforced, not hoped for.
Normal tools. trie never generates or edits code.
$ trie patch create src/auth:require_auth \
-n "expired tokens must 401, not 500 (see #241)"
git commit
└─ trie gate
├─ verify prose ↔ source, both directions offline
├─ intent every changed symbol has a note offline
└─ diff --write the commit's digest, staged with it
Same push, same PR, same merge. One file per commit in
triefacts/triediffs/.
An end-of-turn hook runs it automatically. The graph the next query hits reflects the edit that just happened.
$ trie read src/auth:require_auth --history
Current prose plus every intent note ever recorded against the symbol, in commit order. Why the code is the way it is, answered from the repo.
trie setup overrides the agent's grep and
read and adds the graph tools. A dozen speculative
file reads become two or three round-trips of prose.
grepSearches symbols, not bytes. Hits carry qname, signature, one-liner, and inbound count. Relevance is decided in the result row, not by opening files.
read
One call returns a symbol's prose plus one-liners for every
caller and callee. --history appends the intent
trail.
traceBlast radius before a change. Call paths between two symbols. Structural questions, answered structurally.
trie is built with itself: every commit in
its repository
passes the gate it ships, and its triefacts/ tree is
generated and enforced by its own loop.
If you can clone the repo, you have all of it.
your-project/
├── src/ ← your code, untouched
├── triefacts/ ← meaning (Markdown)
│ ├── src/
│ │ ├── auth/middleware.md
│ │ └── slugify.md
│ └── triediffs/ ← intent (one digest per commit)
│ └── 20260725T114949Z-fade5436….md
├── TRIE_DIFF.md ← symlink to the latest digest
├── trie.toml ← config, committed
└── .trie/ ← local cache, gitignored,
delete anytime
verify and
intent run offline: pre-commit hook or any CI
runner, no API key.
cat renders it.
Python 3.11+, uv, ripgrep. An Anthropic
key for prose generation; the gates run offline. Optionally, a
language server per language (pyright, gopls, rust-analyzer, clangd,
…) for type-aware reference precision — trie falls back
to tree-sitter without one.
$ uv tool install git+https://github.com/computer-reinvention/trie
$ cd your-project
$ trie init # config + symbol graph + pre-commit hook
$ trie setup # wire the agent: tools + turn hook
$ trie plan # cost preview, free
$ trie sync --limit 10 # bootstrap; sample quality first
$ trie sync # day-to-day: only what drifted
$ git commit # the gate takes it from here