selvedge.sh
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
·
DevHunt
·
PyPI
·
GitHub
**Persistent decision memory for AI agents.**
Save why you chose an approach, what you rejected, and what would change your
mind. Retrieve that context in the next coding session, using a function,
database column, API route or dependency as the lookup key.
Selvedge is for anyone using a compatible agent. Connect through local MCP
over stdio, or use the CLI from an agent with shell access. Decisions stay in
the same SQLite store in .selvedge/ when you switch tools.
No hosted account is required; core storage and retrieval make no LLM calls.
**Get started** · Documentation · Agent compatibility
Requires uv and Python.
Python 3.11–3.14 is recommended; Python 3.10 remains compatible but is end of life.
The demo uses a temporary database. Follow the quickstart
to connect your agent to a real project.
Use selvedge demo --mcp to save through a local stdio MCP server, restart it
and retrieve the same record. Add --json for the checked IDs and versions.
This tests the Python installation running Selvedge with disposable data;
your agent's configuration, activation and hooks still need a separate check.
Who Selvedge is for
- **Solo developers** returning to a project after the original conversation is gone.
- **Teams** that need to pass recorded decisions between sessions and coding tools.
The problem
Code shows the chosen approach. It may leave out the constraint that shaped it
or the alternative you ruled out. Selvedge gives those explanations a place in
the project and tools to retrieve them before the next edit.
Only explicitly saved decisions can be recalled. A saved explanation is an
account supplied by a person or agent; Selvedge does not verify that it is true
or guarantee that an agent will consult it. Verify one decision across two
sessions to test your setup.
---
What's new in v0.3.17
**Check recorded decisions before a review.** Generate a Markdown digest, then
run selvedge export --format markdown -o DECISIONS.md --check to catch drift.
An identical digest exits 0 silently; a stale or missing digest exits 1 with a
unified diff and regeneration guidance. Check mode preserves the digest and
stored records. Review exported reasoning before publishing it.
selvedge demo --mcp saves a synthetic rejection through a real local MCP
server, restarts it and retrieves the same record. It uses disposable state;
it does not verify your agent's configuration or hook activation.
CLI output now preserves literal brackets in user data, and blame and Markdown
exports distinguish rejected approaches from changes that were tried and reverted.
Python 3.10 compatibility remains for this patch, but that runtime is now
upstream end of life; use tested,
supported Python 3.11–3.14 for new installations. No new runtime dependencies,
migrations or MCP tools.
---
What's new in v0.3.16
**Bring recorded decisions into code review.** selvedge ledger shows who
recorded each decision and which later record explicitly revised it. The optional
PR review Action adds reasons and rejected alternatives
for touched files from publication-approved base history. Attribution is
self-reported; the Action is opt-in and never executes PR-head code.
selvedge doctor --agent CLIENT checks project hook configuration for all six
setup targets, with concrete next steps. Configuration checks do not prove that
a client has activated its hooks.
The matched injection pilot completed
24 synthetic trials: still-valid rejected choices recurred in 4/6 eligible runs
without memory and 0/6 with injected records. Both conditions passed the stale
and unrelated controls. Two synthetic tasks do not establish general coding
performance or superiority over maintained files; the earlier four-arm tie is
still disclosed. No new runtime dependencies, migrations or MCP tools.
---
Where Selvedge fits
1. **Save a decision.** You or your coding agent record a choice, its reason,
and any rejected approaches through MCP or the CLI.
2. **Keep it with the project.** Selvedge stores the record in local SQLite,
keyed to the function, column, route or other entity it concerns.
3. **Recall it before the next edit.** A later session queries the same store
and checks whether the earlier constraint still applies.
Git keeps the code history; review tools check changes; observability shows
runtime behavior. Selvedge adds the recorded reasons behind decisions.