Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
"name": "TerminallyLazy"
},
"description": "Claude Code plugin marketplace for Tree Ring Memory.",
"version": "0.1.0",
"version": "0.2.0",
"plugins": [
{
"name": "tree-ring-memory",
"source": "./",
"displayName": "Tree Ring Memory",
"description": "Local-first memory lifecycle guidance for Claude Code using Tree Ring Memory.",
"version": "0.1.0",
"version": "0.2.0",
"author": {
"name": "TerminallyLazy",
"url": "https://github.com/TerminallyLazy"
Expand Down
2 changes: 1 addition & 1 deletion .claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tree-ring-memory",
"displayName": "Tree Ring Memory",
"version": "0.1.0",
"version": "0.2.0",
"description": "Local-first memory lifecycle guidance for Claude Code using Tree Ring Memory.",
"author": {
"name": "TerminallyLazy",
Expand Down
64 changes: 49 additions & 15 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,58 @@ on:
branches:
- main

permissions:
contents: read

env:
TREE_RING_VERSION: "0.13.0"
TREE_RING_LINUX_X86_64_SHA256: "cbe4c108c8881b2df1b72a26bfc86396dcdccba66fc8b976f340012e8c095e7d"

jobs:
validate:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1

- name: Validate JSON
- name: Install checksum-pinned Tree Ring v0.13
shell: bash
run: |
jq -e . .claude-plugin/plugin.json >/dev/null
jq -e . .claude-plugin/marketplace.json >/dev/null
set -euo pipefail
archive_name="tree-ring-memory-${TREE_RING_VERSION}-linux-x86_64.tar.gz"
archive_path="${RUNNER_TEMP}/${archive_name}"
release_url="https://github.com/TerminallyLazy/Tree-Ring-Memory/releases/download/v${TREE_RING_VERSION}/${archive_name}"
extract_root="${RUNNER_TEMP}/tree-ring-${TREE_RING_VERSION}"

- name: Validate plugin shape
run: |
test -f .claude-plugin/plugin.json
test -f .claude-plugin/marketplace.json
test -f skills/tree-ring-memory/SKILL.md
test -f commands/tree-ring-recall.md
test -f commands/tree-ring-capture.md
test -f commands/tree-ring-audit.md
grep -q '"name": "tree-ring-memory"' .claude-plugin/plugin.json
grep -q '"source": "./"' .claude-plugin/marketplace.json
curl \
--proto '=https' \
--tlsv1.2 \
--fail \
--location \
--silent \
--show-error \
--output "${archive_path}" \
"${release_url}"
printf '%s %s\n' \
"${TREE_RING_LINUX_X86_64_SHA256}" \
"${archive_path}" \
| sha256sum --check --status

while IFS= read -r entry; do
case "${entry}" in
/*|../*|*/../*|*/..) exit 1 ;;
esac
done < <(tar -tzf "${archive_path}")

mkdir -p "${extract_root}"
tar -xzf "${archive_path}" -C "${extract_root}"
binary_path="${extract_root}/tree-ring-memory-${TREE_RING_VERSION}-linux-x86_64/tree-ring"
test -x "${binary_path}"
test "$("${binary_path}" --version)" = "tree-ring ${TREE_RING_VERSION}"
printf 'TREE_RING_BIN=%s\n' "${binary_path}" >> "${GITHUB_ENV}"

- name: Validate plugin guidance
run: python3 scripts/validate.py
Comment thread
coderabbitai[bot] marked this conversation as resolved.

- name: Smoke Tree Ring v0.13 integration
shell: bash
run: bash scripts/smoke_v013.sh
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.DS_Store
__pycache__/
*.py[cod]
*.log
tmp/
dist/
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ action is useful, source-linked, and privacy-safe.
- Evidence-backed outcomes through `tree-ring evidence`.
- Explicit forgetting, redaction, and supersession guidance.
- DOX and Revolve adapter usage with dry-run-first guardrails.
- Same-host multi-agent identity, idempotency, filtered fan-in, and optional
coordinator write-policy guidance.

## Install Tree Ring Memory

Expand All @@ -30,6 +32,18 @@ brew tap TerminallyLazy/tree-ring
brew install tree-ring
```

The multi-agent and coordinator guidance requires Tree Ring Memory v0.13.0 or
newer:

```bash
tree-ring --version
tree-ring policy --help
```

Before a v0.13 binary upgrades an existing store to schema v3, stop every
Tree Ring process, checkpoint and back up the complete store, and upgrade every
CLI, plugin, and bundled worker. Mixed v0.12/v0.13 operation is unsupported.

For other install paths, use the canonical project README:
<https://github.com/TerminallyLazy/Tree-Ring-Memory#install>

Expand Down Expand Up @@ -65,6 +79,11 @@ The skill looks for project-local `.tree-ring/SKILL.md` and `.tree-ring/CLI.md`
first. If they are absent, it falls back to the public CLI commands documented
in the main framework repository.

For fan-out/fan-in, the supported shared-root boundary is cooperative Tree Ring
processes on one host and a local filesystem. Identity and scope route memory;
they are not read access-control boundaries. Cross-host and network-filesystem
workflows need per-host stores plus explicit, source-preserving fan-in.

## Canonical Project

- Framework repo: <https://github.com/TerminallyLazy/Tree-Ring-Memory>
Expand All @@ -76,4 +95,8 @@ in the main framework repository.
This plugin ships instructions only. It does not include remote MCP servers,
webhooks, analytics, credentials, or networked runtime code.

Coordinated mode uses a one-time capability only through
`TREE_RING_COORDINATOR_TOKEN`. Keep it out of prompts, command arguments,
memory, logs, source references, and ordinary worker environments.

See [SECURITY.md](SECURITY.md) for disclosure and privacy guidance.
13 changes: 13 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,19 @@ details without explicit user instruction.
Use `tree-ring audit`, `tree-ring forget`, redaction, and supersession when
memory is wrong, sensitive, stale, or replaced by newer evidence.

## Coordinated Mode

Tree Ring Memory v0.13 Coordinated mode uses a one-time capability supplied
only through `TREE_RING_COORDINATOR_TOKEN`. Never place its value in a prompt,
CLI argument, memory event, log, source reference, committed file, or ordinary
worker environment. Tree Ring stores only a hash of the capability.

The policy is operational write authorization in official Rust and CLI paths.
It is not a read ACL, an operating-system security boundary, or protection
against an adversary who controls the database files or process environment.
The supported shared-root boundary is cooperative processes on one host using a
local filesystem; it does not establish cross-host or network-filesystem safety.

## Reporting A Vulnerability

Open a private vulnerability report on the canonical framework repository:
Expand Down
33 changes: 29 additions & 4 deletions commands/tree-ring-audit.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,24 @@ allowed-tools: ["Bash"]
Audit memory when work is closing, when privacy may matter, or when older
entries may be stale.

Start with a non-destructive audit:
Before any v0.13 command other than `policy status` or `policy audit` opens an
existing pre-v0.13 store, stop every Tree Ring process, checkpoint and back up
the complete store, and upgrade every CLI, plugin, and bundled worker.
Mixed-version operation is unsupported.

These policy preflight commands never create or migrate a store:

```bash
tree-ring policy status
tree-ring policy audit --limit 100
```

After the verified schema-v3 upgrade, start with non-mutating inspection:

```bash
tree-ring audit --audit-type sensitive
tree-ring consolidate --period-type manual --dry-run
tree-ring maintain --repair-fts
tree-ring maintain
```

If the user names a focus, use it to narrow recall before changing memory:
Expand All @@ -27,8 +39,21 @@ Use explicit forget operations only when justified:

```bash
tree-ring forget mem_example --mode redact --reason "remove sensitive detail"
tree-ring forget mem_example --mode supersede --reason "newer decision replaced this"
tree-ring forget mem_example --mode delete --reason "should not be retained"
```

Do not delete, redact, or supersede memory without a clear reason.
The CLI forget modes are `redact` and `delete`. For an explicit supersession,
use the TUI's `/supersede <old_id>` lifecycle action.

In Coordinated mode, forget/redact, supersede, persisted consolidation, and
applied maintenance such as `--repair-fts` require
`TREE_RING_COORDINATOR_TOKEN` in the coordinator process environment. Never put
the capability value in a prompt, CLI argument, memory, log, source reference,
or committed file. `policy status`, `policy audit`, ordinary audit,
consolidation dry-run, and plain `maintain` do not change memory content on an
already-upgraded schema-v3 store. Only the two policy commands are guaranteed
not to create or migrate a store.

Do not delete, redact, or supersede memory without a clear reason. The
coordinator policy is not a read ACL, and its shared-root support is bounded to
cooperative processes on one host using a local filesystem.
37 changes: 34 additions & 3 deletions commands/tree-ring-capture.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,39 @@ allowed-tools: ["Bash"]
Capture only durable, useful memory. Do not store transcripts, secrets,
credentials, raw chain-of-thought, or unverified claims as truth.

Use the user's argument as the memory summary:
Read project-local `.tree-ring/SKILL.md` and `.tree-ring/CLI.md` first when
present. Verify `tree-ring --version`; the coordination fields and policy
commands require v0.13.0 or newer.

For a single agent or a store in Open mode, use the user's argument as the
memory summary:

```bash
tree-ring remember "$ARGUMENTS" \
--event-type lesson \
--scope project
```

Adjust `--event-type`, `--project`, and `--tag` values to match the actual
memory:
For an ordinary worker in Coordinated mode, use agent scope with the
server/task-derived identity and stable retry metadata:

```bash
tree-ring remember "$ARGUMENTS" \
--event-type lesson \
--scope agent \
--agent-profile "$TREE_RING_AGENT_PROFILE" \
--workflow-id "$TREE_RING_WORKFLOW_ID" \
--session-id "$TREE_RING_SESSION_ID" \
--operation-id "<stable logical write id>" \
--source-ref "<durable task, run, or result reference>"
```

Do not invent identity values. Reuse the same session and operation IDs only
for an exact retry; conflicting reuse fails closed. Keep
`TREE_RING_COORDINATOR_TOKEN` unset in ordinary worker environments.

Adjust `--event-type`, scope, project, identity, source, and tags to match the
actual memory:

- `decision` for selected architecture, release, storage, or policy choices
- `lesson` for validated work patterns
Expand All @@ -28,3 +51,11 @@ memory:

If the memory comes from a run, test, evaluation, incident, PR, or checkpoint,
prefer `tree-ring evidence` with an `--evidence-ref` and outcome.

In Coordinated mode, project/shared writes, `tree-ring evidence`, heartwood,
and lifecycle mutations require the one-time coordinator capability already
present only in the coordinator process environment. Never put its value in the
prompt, a CLI argument, memory, logs, source references, or committed files.

The shared-root concurrency contract covers cooperative processes on one host
and a local filesystem. Identity and scope are routing fields, not read ACLs.
21 changes: 18 additions & 3 deletions commands/tree-ring-recall.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ Recall useful project memory before acting on context-dependent work.
1. Check for project-local guidance first:

```bash
test -f .tree-ring/SKILL.md && sed -n '1,220p' .tree-ring/SKILL.md
test -f .tree-ring/CLI.md && sed -n '1,220p' .tree-ring/CLI.md
test -f .tree-ring/SKILL.md && sed -n '1,520p' .tree-ring/SKILL.md
test -f .tree-ring/CLI.md && sed -n '1,520p' .tree-ring/CLI.md
```

2. Use the user's argument as the focused recall query when present:
Expand All @@ -24,6 +24,21 @@ Recall useful project memory before acting on context-dependent work.
3. If no argument is provided, choose a narrow query from the current task and
include project scope when known.

4. Treat recall as context, not authority. Prefer source-linked,
4. In a fan-out worker, filter recall with its agent profile plus the shared
workflow and current session. At coordinator fan-in, omit only the
agent-profile filter deliberately so all worker results remain visible:

```bash
env -u TREE_RING_AGENT_PROFILE tree-ring recall "$ARGUMENTS" \
--workflow-id "$TREE_RING_WORKFLOW_ID" \
--session-id "$TREE_RING_SESSION_ID" \
--scope agent
```

5. Treat recall as context, not authority. Prefer source-linked,
high-confidence, non-superseded entries and verify drift-prone facts before
relying on them.

Identity and scope partition and route local memory; they are not read ACLs.
The supported shared-root boundary is cooperative processes on one host and a
local filesystem, not cross-host or network-filesystem coordination.
Loading
Loading