Skip to content

v0.3.0: anti-drift, recaps, mono mode, PR-comment Action#1

Merged
gregherbe76 merged 9 commits into
mainfrom
claude/assess-repo-hpmiV
May 19, 2026
Merged

v0.3.0: anti-drift, recaps, mono mode, PR-comment Action#1
gregherbe76 merged 9 commits into
mainfrom
claude/assess-repo-hpmiV

Conversation

@gregherbe76

@gregherbe76 gregherbe76 commented May 19, 2026

Copy link
Copy Markdown
Owner

Brings vibe-memory from a docs-only protocol sketch to a verifiable, installable, multi-agent-aware v0.3.0 with real-time anti-drift, session recaps, mono-file mode, and PR-comment automation.

What's in this PR

Protocol (MEMORY_PROTOCOL.md)

  • Semver version header (Protocol version: 0.3.0)
  • §1 — Tiered reading: architecture.md + progress.md always; decisions.jsonl / drift.jsonl tails only for structural sessions
  • §2 — Logging triggers reframed around structural events (integration activation, DB migration, new secret/dep, first instance of a new pattern, deployment target change, stack swap) instead of "≥2 files"
  • §4Real-time anti-drift: agent MUST stop and ask explicit confirmation before writing code that contradicts any entry in the last 50 decisions. The killer demo moment.
  • §4.5 — Post-change drift detection (kept distinct from §4)
  • §103-line memory recap triggered at every context reset: fresh session, idle > 15 min, after compaction, on /context / "where are we" / "remind me", or when memory is re-read mid-session
  • §11 (new) — Session-end recap: changed / logged / next / open question, so the user can return without scrolling

Entry points

  • replit.md — Replit Agent (was already present, kept)
  • CLAUDE.md — Claude Code (new)
  • lovable.md — Lovable (new) — carves the mem:// (rules) vs memory/ (journal) boundary; documents Cloud activation / publish / secrets--* / lovable_sql as Lovable-specific structural events; provides recommended Core snippet for mem://index.md
  • AGENTS.md — generic entry point for Cursor / Aider / Codex / OpenHands (new)

Verification

  • scripts/validate.py — Python 3 stdlib-only validator with --check-freshness DAYS flag (warn-only)
  • scripts/render.py — renders JSONL logs into a chronological markdown journal (JSONL stays source of truth)
  • scripts/pr_comment.py — diffs memory between two refs, produces a markdown PR comment
  • tests/test_validate.py — 25 unittest cases covering validator, renderer, and pr_comment
  • schemas/decision.schema.json + schemas/drift.schema.json — JSON Schema Draft 2020-12
  • .github/workflows/validate.yml — CI runs validator + tests on root, template, and every example
  • .github/workflows/memory-pr-comment.yml — sticky PR comment summarizing decisions/drifts added (live since this PR's last push)
  • .claude/hooks/session-start.sh + .claude/settings.json — SessionStart hook for Claude Code on the web

Distribution

  • install.sh — one-line installer, supports --mode full|mono and --ref pinning, idempotent
  • template/memory/ — blank starter files (full mode)
  • template/vibememory.md — single self-contained file (mono mode) — lite protocol + memory tables in one place; upgrade path to full mode preserved
  • .pre-commit-hooks.yaml — exposes vibe-memory-validate for downstream projects

Reorganization

  • Stub starter files moved to template/memory/
  • Root memory/ self-describes vibe-memory (eat your own dog food)
  • examples/ contains three worked memory states: web-app (Next.js + Postgres SaaS), cli (Rust), library (Python)

Lifecycle docs

  • LICENSE (MIT, was already advertised in README)
  • CHANGELOG.md (0.1.0 → 0.2.0 → 0.3.0)
  • CONTRIBUTING.md with separate flows for protocol / entry-point / tooling changes

README

  • Quickstart restructured around --mode mono | full choice
  • "When is this worth it?" caveat (when to use, when to skip)
  • Validation, pre-commit, web-hook, multi-agent, journal-rendering sections
  • CI / license / protocol-version badges

Validation matrix (all green)

  • root memory/ — 33 decisions, 0 drifts
  • template/memory/ — empty, valid
  • examples/web-app/memory/ — 5 decisions, 2 drifts
  • examples/cli/memory/ — 4 decisions, 1 drift
  • examples/library/memory/ — 4 decisions, 1 drift
  • 25/25 validator tests pass
  • SessionStart hook runs clean in both remote and local-no-op paths
  • install.sh passes bash -n in both modes

Test plan

  • CI passes on the PR (both validate and memory-pr-comment workflows)
  • After merge, tag v0.3.0 and create the GitHub release (unlocks install.sh --ref v0.3.0 and the rev: v0.3.0 pre-commit pin)

Commits

  • 49ad563 Harden vibe-memory: license, validator, hook, CLAUDE.md, reorganize
  • dda9d0b v0.2.0 polish: CI, tests, schemas, examples, install.sh, AGENTS.md
  • 51f87b4 README: reframe tagline around memory longevity
  • 433d96f Add lovable.md entry point for Lovable projects
  • 26b5f47 Lovable round 1: tiered reading, freshness check, caveats
  • ecde4a4 Lovable round 2: structural-event triggers, mem:// boundary, render.py
  • 3fa6af5 lovable.md: document the validation surface
  • d4da072 v0.3.0: real-time anti-drift, session recaps, mono-file mode, PR-comment Action
  • f374242 Protocol §10: explicit triggers for the memory recap (idle, /context, compaction)

claude added 2 commits May 19, 2026 09:07
- Add MIT LICENSE (README advertised it but file was missing)
- Add CLAUDE.md as a Claude Code entry point alongside replit.md
- Add scripts/validate.py — stdlib-only JSON / line-count checker
- Add .claude/ SessionStart hook that runs the validator on web sessions
- Reorganize: stub starter files moved to template/memory/; root memory/
  now self-describes vibe-memory so the repo eats its own dog food
- Expand README with a quickstart, structure, validation, and web hook
  sections
A — CI + tests
- .github/workflows/validate.yml runs validator on root, template, and
  every example, plus the 16-case unittest suite
- tests/test_validate.py covers bad JSON, wrong type, missing fields,
  bad timestamps, line caps, archive entries, blank-line skipping
- README adds CI, license, and protocol-version badges
- scripts/validate.py refactored to accept a memory_dir positional arg

B — Lifecycle & contribution docs
- AGENTS.md as generic entry point (Cursor, Aider, Codex, OpenHands)
- CONTRIBUTING.md covers protocol, entry-point, and tooling change flows
- CHANGELOG.md starts at 0.1.0 -> 0.2.0
- Protocol version header in MEMORY_PROTOCOL.md

C — Distribution polish
- install.sh one-line installer with --ref pinning
- .pre-commit-hooks.yaml exposes vibe-memory-validate hook
- schemas/decision.schema.json + schemas/drift.schema.json formalize
  the JSON contract independently of the Python validator

D — Filled example states
- examples/web-app — Next.js + Postgres SaaS mid-checkout-migration
- examples/cli — Rust CLI with shipped release + feature in flight
- examples/library — Python library with deprecation in progress
@gregherbe76 gregherbe76 changed the title Harden vibe-memory: add license, validator, hook, CLAUDE.md, reorganize v0.2.0: license, CLAUDE.md/AGENTS.md, validator + CI, hooks, schemas, examples May 19, 2026
claude added 6 commits May 19, 2026 15:20
…eats

In response to Lovable's review of the repo:

- lovable.md: position mem:// as a cache; memory/ wins on conflict.
  Avoids duplication and lock-in; memory/ is portable across runtimes.

- MEMORY_PROTOCOL.md section 1: split into mandatory tier
  (architecture + progress) and conditional tier (decisions + drift
  tails) for trivial sessions. Section 10 confirmation line gains a
  trivial-session variant. Stops wasting tokens on typo-fix sessions.

- scripts/validate.py: optional --check-freshness DAYS flag, warn-only.
  Soft pressure against the append-only-log decay failure mode
  (logs that aren't maintained degrade silently). 4 new tests bring the
  suite to 20.

- README.md: 'When is this worth it?' section. Prevents over-application
  on weekend prototypes, which discredits the approach when memory/
  files don't reflect reality after two weeks.
A — lovable.md expanded
- Explicit boundary: mem:// = rules (applied automatically), memory/ =
  journal (audit log). memory/ wins on conflict; mem:// is a cache.
- Skip protocol section 7 (compression) on Lovable — chat_search covers
  retrieval; rollback entries reserved for architectural reversals
  (Lovable checkpoints cover code-level reverts).
- Lovable-specific structural events to log: integration activation,
  Cloud activation (frontend->fullstack bascule), secrets--*, publish,
  lovable_sql migrations.
- mem://~user/ precedence rules.
- Recommended Core snippet for mem://index.md (short, imperative).

B — MEMORY_PROTOCOL.md section 2 rewritten
Replaced "any change affecting >=2 files" with an explicit list of
structural events: integration activation, DB migration, new secret,
new runtime dependency, first instance of a new pattern, deployment
target change, stack swap, architectural reversal. Explicitly excludes
content pages, buttons, colour changes, typo fixes. Stops noise on
platforms where most prompts touch multiple files.

C — scripts/render.py
Renders decisions.jsonl + drift.jsonl into a chronological markdown
journal grouped by date. JSONL stays source of truth; this is a derived
view for human reading. 2 new tests bring the suite to 22.

Also rejected the "branch per runtime" idea (logged as decision):
portability is the core value prop; runtime-specific behavior is
absorbed via entry-point files (replit.md, CLAUDE.md, lovable.md,
AGENTS.md), not by forking the protocol.
…ent Action

Five changes aimed at making vibe-memory visible to actual users — the
gap between "the agent has a memory" and "the user sees the memory
working".

1. Real-time anti-drift (protocol section 4). Agent MUST stop and
   ask for explicit confirmation before writing code that contradicts
   any entry in the last 50 decisions. This is the killer demo: the
   moment that proves the protocol is doing something useful.
   Drift detection AFTER the change kept as section 4.5.

2. Session-start recap (protocol section 10). First reply is a
   3-line recap: memory marker + stack/conventions + in-flight item
   + open drift. Free in tokens, transforms perceived value.

3. Session-end recap (protocol section 11, new). Before stopping,
   surface 3-5 lines: changed / logged / next / open question. What
   the user sees first when they return — more useful than scrolling
   the diff.

4. Mono-file mode. template/vibememory.md is a single self-contained
   file (lite protocol + memory tables). install.sh --mode mono drops
   that one file. Reduces entry cost for solo / MVP / weekend
   projects; upgrade path to full mode preserved.

5. PR-comment GitHub Action. .github/workflows/memory-pr-comment.yml
   posts a sticky comment on each PR summarizing decisions and drifts
   added. Surfaces vibe-memory in the normal dev workflow without
   requiring users to open JSONL. Backed by scripts/pr_comment.py
   (3 new tests, 25 total).

Protocol version bumped 0.2.0 -> 0.3.0.
@github-actions

github-actions Bot commented May 19, 2026

Copy link
Copy Markdown

🧠 vibe-memory changes in this PR

32 new decision(s):

  • convention [meta] — reorganized repo: stub memory files moved to template/, root memory/ now self-describes vibe-memory
    • why: clearer onboarding — new projects copy from template/, root memory/ demonstrates a real filled state
    • by: claude-code
  • dependency [validation] — added scripts/validate.py (Python 3 stdlib only)
    • why: detect malformed append-only logs early; runnable in CI or SessionStart hooks
    • by: claude-code
  • convention [agent-entry] — added CLAUDE.md alongside replit.md
    • why: multi-agent support — Claude Code users get the same first-step contract Replit users had
    • by: claude-code
  • convention [hooks] — added .claude/hooks/session-start.sh and .claude/settings.json
    • why: auto-validate memory files at session start in Claude Code on the web
    • by: claude-code
  • decision [licensing] — added MIT LICENSE file
    • why: README advertised MIT license but no LICENSE file was present
    • by: claude-code
  • convention [protocol] — added Protocol version header to MEMORY_PROTOCOL.md, starting at 0.2.0
    • why: semver tracking so downstream consumers can pin
    • by: claude-code
  • dependency [validation] — refactored scripts/validate.py to accept a memory_dir positional arg
    • why: makes the validator testable and reusable across template/ and examples/
    • by: claude-code
  • dependency [ci] — added .github/workflows/validate.yml running validator on root + template + examples + tests
    • why: prove the contract holds on every push
    • by: claude-code
  • dependency [validation] — added tests/test_validate.py — 16 unittest cases for the validator
    • why: prevent regressions in validation logic
    • by: claude-code
  • convention [agent-entry] — added AGENTS.md as generic entry point
    • why: support agent-agnostic tooling (Cursor, Aider, Codex, OpenHands)
    • by: claude-code
  • convention [docs] — added CONTRIBUTING.md and CHANGELOG.md
    • why: standardize protocol contribution flow and release tracking
    • by: claude-code
  • decision [distribution] — added install.sh one-line installer with --ref pinning
    • why: reduce install friction below the 'curl | tar' baseline
    • by: claude-code
  • convention [validation] — added .pre-commit-hooks.yaml exposing vibe-memory-validate hook
    • why: let downstream projects wire the validator into pre-commit
    • by: claude-code
  • convention [contract] — added schemas/decision.schema.json and schemas/drift.schema.json
    • why: formalize the log entry contract so other tooling can validate independently
    • by: claude-code
  • convention [examples] — added examples/{web-app,cli,library}/memory worked states
    • why: show new users what well-formed memory looks like in real project shapes
    • by: claude-code
  • convention [agent-entry] — added lovable.md as Lovable-specific entry point
    • why: Lovable has no official instruction-file name but reads project files as long-term context; lovable.md makes vibe-memory adoptable without changing Lovable's behavior
    • by: claude-code
  • convention [lovable] — lovable.md positions mem:// as a cache of memory/; memory/ wins on conflict
    • why: avoid duplication and lock-in; memory/ is portable across Replit/Claude/Cursor while mem:// is Lovable-proprietary
    • by: claude-code
  • convention [protocol] — split section 1 into mandatory (architecture + progress) and conditional (decisions + drift tails) reading tiers
    • why: reading 4 files on a typo-fix session is wasted tokens; protocol now reflects what was implicit in the 'judgment' clause
    • by: claude-code
  • dependency [validation] — added --check-freshness DAYS to scripts/validate.py (warn-only)
    • why: soft pressure against the append-only log decay failure mode raised by Lovable in self-assessment
    • by: claude-code
  • convention [docs] — added 'When is this worth it?' caveat to README
    • why: prevent over-application of the protocol on prototype/weekend projects, which discredits the approach
    • by: claude-code
  • convention [protocol] — section 2 reframed around structural events (integration, DB migration, new dep, new secret, first-instance patterns, deployment target, stack swap) instead of '>=2 files'
    • why: on platforms where most prompts touch multiple files, the old rule fills decisions.jsonl with noise; structural events is a sharper trigger
    • by: claude-code
  • convention [lovable] — lovable.md expanded: mem:// (rules) vs memory/ (journal) boundary; section 7 skip; Lovable structural events (Cloud activation, publish, secrets--*, lovable_sql); mem://~user/ precedence; recommended Core snippet
    • why: Lovable's self-assessment surfaced concrete frictions; absorbed into the entry point rather than forking the protocol
    • by: claude-code
  • dependency [tooling] — added scripts/render.py producing a chronological markdown journal from JSONL logs
    • why: keep JSONL as source of truth for machine-readability while offering a human-friendly view; resolves Lovable's 'JSONL too verbose' critique without giving up the contract
    • by: claude-code
  • decision [distribution] — rejected one-branch-per-runtime split
    • why: portability is the core value prop; per-runtime branches would drift and break multi-agent attribution (section 8). Runtime-specific behavior absorbed via entry-point files instead
    • by: claude-code
  • convention [lovable] — added 'Validation surface' section to lovable.md
    • why: Lovable's round-3 critique missed that validate.py, schemas, pre-commit hook, and CI already exist; making the surface explicit prevents future missed observations
    • by: claude-code
  • decision [protocol] — added real-time anti-drift to MEMORY_PROTOCOL.md section 4 (forbid silent overrides; require quote+confirm before reversing a logged decision)
    • why: this is the most visible value moment of the protocol — agent stopping to confirm a reversal is what makes users feel the memory working
    • by: claude-code
  • convention [protocol] — section 10 confirmation line replaced by a 3-line recap (memory marker + stack/conventions + in-flight + open drift)
    • why: silent memory is invisible; the recap is gratuit and changes the perceived value entirely
    • by: claude-code
  • convention [protocol] — added section 11 — session-end recap (changed/logged/next/open question)
    • why: the user is most likely to return after a stop; the recap is what they will see, more than the diff
    • by: claude-code
  • decision [distribution] — added mono-file mode: template/vibememory.md plus install.sh --mode mono
    • why: reduces the entry cost from 30-min setup to one file edited; upgrade path to full mode preserved for projects that grow
    • by: claude-code
  • dependency [ci] — added scripts/pr_comment.py + .github/workflows/memory-pr-comment.yml posting a sticky PR comment summarizing memory changes
    • why: surfaces vibe-memory inside the normal dev workflow (PR review) without requiring users to open JSONL
    • by: claude-code
  • convention [versioning] — bumped protocol version 0.2.0 -> 0.3.0
    • why: sections 4, 10, 11 are new protocol-level features (anti-drift, session-start recap, session-end recap)
    • by: claude-code
  • convention [protocol] — section 10 recap triggers expanded beyond 'session start': also fires on idle > 15 min, after context compaction, on explicit user request (/context, 'where are we', 'remind me'), and when memory is re-read mid-session
    • why: recap is most valuable when the user has lost context — that happens at more moments than just a fresh session; explicit triggers prevent ambiguity
    • by: claude-code

Posted by the vibe-memory PR-comment workflow. Edit decisions/drift entries before merging if needed.

@gregherbe76 gregherbe76 changed the title v0.2.0: license, CLAUDE.md/AGENTS.md, validator + CI, hooks, schemas, examples v0.3.0: anti-drift, recaps, mono mode, PR-comment Action May 19, 2026
@gregherbe76 gregherbe76 merged commit e9f3795 into main May 19, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants