Skip to content

RDF 3.4.0 — Memory & Context

Choose a tag to compare

@rfxn rfxn released this 15 Jul 19:20
· 73 commits to main since this release

RDF 3.4.0 Release Notes

3.4.0

-- New Features --

[New] session-end-capture.sh — SessionEnd command hook: inline git-only snapshot
appended to .rdf/work-output/session-log.jsonl (the journal /r-start
reads) plus a session-end-.json cache for /r-save; records sessions
that never run /r-save; no model work, always exits 0, no-op outside a
git repo, jq-optional, session_id sanitized (stdin discriminator is
reason per platform docs — spec's trigger corrected)
[New] hooks.json matcher-less SessionEnd entry (5s timeout) composed on top of
the 3.3.x PreCompact/SessionStart-compact entries (left byte-identical);
memory-context.bats (4 tests) covers append, non-git no-op, jq-absent
degrade, path-traversal sanitization
[New] state/rdf-lessons.sh index — assigns stable [] IDs to
lessons-learned.md bullets ( markers, idempotent backfill)
and writes a <=400-byte ~/.rdf/lessons-index.md; single-writer flock
guard, POSIX-portable sed, jq-independent; scan subcommand stubbed for
the consolidation phase
[New] session-start-inject.sh — read-only SessionStart hook injecting the
lessons ID-index as additionalContext; skips resume, re-injects on
compact (intended), 400B cap bounds per-spawn cost, no-op without
jq/index; second matcher-less SessionStart hooks.json entry (5s)
[New] state/rdf-overhead.sh — measure RDF's always-loaded context overhead into
default / --rules / lite figures (bytes/4 estimate); hooks.json reported
only under excluded (runtime config, never model context); scoped
language rules counted dormant; jq-independent; tests/overhead.bats
(8 tests) incl. a README drift guard
[New] T3 context-scoped governance rules: cc_generate_rules emits
output/rules/.md; language profiles get a paths: frontmatter
block derived from registry.json detect globs, core stays unscoped so it
survives compaction (spec §4.3); rules-deploy.bats (6 tests) guards the
rules generation surface
[New] docs/memory-context.md — native-memory vs RDF division of labor (spec
§4.5): native owns conversational memory + MEMORY.md loading, RDF owns
the delta (lessons, insights, governance, session journal); RDF writes
nothing into ~/.claude/projects//memory/
[New] rdf-lite minimal deploy variant — rdf generate claude-code --lite emits
condensed core governance (profiles/lite/governance-lite.md, ~574 tokens)
as rules/core.md, ships only the lifecycle command set, skips hooks;
always-loaded footprint ~674 tokens, under the 1000-token budget;
default (non-lite) generation byte-identical; rdf-lite.bats (6 tests);
doctor doc-stats excludes profiles/lite (deploy source, not a governance
profile)
[New] rdf-lessons.sh scan — deterministic token-Jaccard dedup (>=50%) plus an
order-independent opposing-polarity contradiction heuristic ([25,50%));
flags only, never mutates, jq-optional; governance contract added:
consolidation NEVER auto-resolves a contradiction (anti-crystallization);
never-scope-core adapter contract relocated into governance-contracts
[New] rdf-state.sh --full emits a deterministic diff_categories object
(path-prefix counts: commands/agents/scripts/cli/adapters/specs/docs/
other) so /r-save reads the classification instead of the model
re-classifying changed files by hand

-- Changes --

[Change] README/docs publish all three measured context figures: default deploy
~0.1K tokens, opt-in --rules ~2.1K, rdf-lite ~0.7K (674, bytes/4);
hooks.json (478) reported only under excluded, never model context
[Change] doc surface refreshed for the 3.4 feature set — RDF.md architecture
(hooks across PreCompact/SessionStart/SessionEnd, rules/ generation,
--rules/--lite, rdf-lessons.sh/rdf-overhead.sh), r-context-audit runs
rdf-overhead.sh, ROADMAP marks T3/auto-memory/context-cost/rdf-lite
delivered and references the 3.5 spec, WORKFORCE scripts total 14->16
(=59 primitives)
[Change] /r-save §1 consumes the SessionEnd cache via an RDF_SESSION_ID-first
selection rule (else newest unconsumed session-end-*.json, renamed
*.consumed on hit) and skips the rdf-state --full re-run on a hit;
reads .diff_categories for the diff summary
[Change] /r-save §3/§8 and /r-start auto-act on thresholds — MEMORY.md >=180
auto-runs the /r-util-mem-compact preview and surfaces the proposed
reduction; context >60% renders a fresh-session/half-clone directive
instead of a passive warning; /r-start surfaces the indexed-lessons
count
[Change] deploy: opt-in rules/ symlink via --rules (rdf deploy / rdf generate
--deploy --rules); default off — no behavior change for existing
symlink users