feat: v0.11.0 — forget/correct facts (tombstones) + onboarding & banner polish#15
Merged
Merged
Conversation
…g & banner polish Memory was append-only — a graduated/pinned fact could never be removed, even after PR feedback or QC proved it wrong, and a shared fact lived in .tre-mem/ on every teammate's clone forever. v0.11 adds removal that propagates through git, plus a smoother first run and a clean banner. Forget / correct facts (tombstone propagation): - New `tombstone` sync record (kind, no schema bump — pre-v0.11 clients skip it gracefully). Carries the removed fact's content_hash. - Store deletes (repo.ts): delete pins/graduated by id / observation / content_hash. - Two-pass tombstone-aware import: collect tombstoned hashes first, then insert non-tombstoned + delete targets. Order-independent, idempotent — a removal can never be resurrected by an earlier line. - forget.ts: forgetPin / forgetGraduated write the tombstone at call time (before deleting the row), then delete locally. Unshared facts → local delete, no tombstone. readLiveSyncRecords applies tombstones for the web. - MCP tools unpin_fact / ungraduate_fact (7 → 9); CLI tre unpin / tre ungraduate. Correcting a fact = ungraduate old + graduate fixed. Onboarding & status: - tre init [--all] [--verbose] — guided first run, wires tools + backfills. - tre status — Identity / Memory / Tools / claude-mem sections, mode headline. SessionStart banner: - Cause of duplicate banners: hook registered in both project and global settings. tre doctor flags it by path; tre doctor --fix-hooks collapses it. - Banner defers (TRE_MEM_HOOK_DELAY_MS, default 250ms when claude-mem present) so it renders below claude-mem. Docs: version → 0.11.0 (package.json + src/version.ts), CHANGELOG, PLAN-PHASE8.md, PLAN/CLAUDE chains, tool count 7 → 9, SYNC-FORMAT tombstone spec. 394 tests green; live cross-clone tombstone (1 → 0) + MCP tools/list (9 tools) verified.
…ude-code wiring Two follow-ups after live testing the v0.11 banner fix: - The real duplicate-banner cause is a stale GLOBAL hook (an absolute `…/dist/cli.js hook session-start` in ~/.claude/settings.json that fires this repo's build in every project), alongside the committed, portable project hook. So `tre doctor --fix-hooks` now keeps the **project** copy by default (it's the canonical, team-shared wiring `tre setup` writes) and strips the others. Added `--keep <project|global>` to override. - `tre status` showed `claude-code·` (not wired) because detection looked for the literal "tre-mem", but the hook command is `tre hook session-start`. detectTools now recognizes the session-start hook → `claude-code✓`. 396 tests green.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Memory was append-only — a graduated/pinned fact could never be removed or corrected, even after a leader's PR feedback or a bug found in QC. Worse, once a fact was shared it lived in
.tre-mem/(append-only, content-hash-deduped, git-committed, auto-imported), so deleting the local row left every teammate's clone holding the stale fact forever. v0.11 makes removal propagate through git, and adds a smoother first run + a banner that shows once, below claude-mem.A — Forget / correct facts (tombstone propagation)
kind:'tombstone') — carries the removed fact'scontent_hash. Stays atSYNC_SCHEMA_VERSION = 1: pre-v0.11 clients hit the existing unknown-kindcatchand skip it (the fact just lingers for them until they upgrade). No schema bump.repo.ts) — by id / observation / content_hash, for pins and graduated.readLiveSyncRecordsapplies tombstones so the web layer never surfaces a forgotten fact.forget.ts— writes the tombstone at call time (before deleting the row — once gone,export_memoryhas nothing to emit), then deletes locally. Unshared facts → local-only delete, no tombstone (idempotent append).unpin_fact/ungraduate_fact(7 → 9) + CLItre unpin/tre ungraduate. Correcting a fact = ungraduate the old one +graduate_factthe fixed observation.B — Onboarding &
tre statustre init [--all] [--verbose]— guided first run;--allwires every installed tool + backfills in one step.tre status— regrouped into Identity / Memory / Tools / claude-mem with afull/shared-onlyheadline.C — SessionStart banner (dedup + below claude-mem)
.claude/settings.jsonand global~/.claude/settings.json).tre doctorflags it by exact path;tre doctor --fix-hookscollapses it to one (keeps the global copy by default).TRE_MEM_HOOK_DELAY_MS(default 250 ms when claude-mem is present on Claude Code) so it renders below claude-mem instead of racing it.Compatibility
On-disk format +
SYNC_SCHEMA_VERSIONunchanged (tombstone is a new kind, not a new schema). Old clients skip tombstones; new clients honor them. No claude-mem schema changes.Test plan
format:check,lint,typecheck, 394 tests,build— all green.tools/listreturns all 9 tools includingunpin_fact/ungraduate_fact.tre initguided output, sectionedtre status,tre doctorflags the real duplicate on this machine.Docs
Version → 0.11.0 (
package.json+src/version.ts), CHANGELOG,docs/plan/PLAN-PHASE8.md, PLAN/CLAUDE phase chains, tool-count 7 → 9 across README/README.vi/CROSS-TOOL/DEMO, SYNC-FORMAT tombstone spec.