AI News HubLIVE
站內改寫6 分鐘閱讀

待翻譯:Show HN: Selvedge – an append-only log of what your AI agent already rejected

AI 服務暫時不可用,以下為來源摘要,待恢復後補全翻譯:Notifications You must be signed in to change notification settings Fork 0 Star 18 Add this Action to an existing workflow or create a new one View on Marketplace BranchesTags Open more actions menu Folders and files Na…

來源Hacker News AI作者: masondelan

AI 服務暫時不可用,以下為來源正文,待恢復後補全翻譯。

Notifications You must be signed in to change notification settings Fork 0 Star 18 Add this Action to an existing workflow or create a new one View on Marketplace BranchesTags Open more actions menu Folders and files NameName Last commit message Last commit date Latest commit History 181 Commits 181 Commits .claude-plugin .claude-plugin .github .github .selvedge .selvedge bin bin commands commands docs docs features/src/selvedge features/src/selvedge hooks hooks infra/telemetry-worker infra/telemetry-worker npm npm scripts scripts selvedge selvedge skills/selvedge skills/selvedge tests tests .dockerignore .dockerignore .gitignore .gitignore .mcp.json .mcp.json .mcpbignore .mcpbignore .pre-commit-hooks.yaml .pre-commit-hooks.yaml CHANGELOG.md CHANGELOG.md CLAUDE.md CLAUDE.md Dockerfile Dockerfile LICENSE LICENSE README.md README.md SECURITY.md SECURITY.md action.yml action.yml glama.json glama.json manifest.json manifest.json pyproject.toml pyproject.toml server.json server.json Repository files navigation That reasoning was captured by the agent in the moment — written into Selvedge from the same context that produced the change. Not inferred from the diff afterward by a second LLM. Not a hand-typed commit message. Who Selvedge is for Selvedge has two audiences. Same tool, same pip install, same SQLite file under .selvedge/. Different scale of pain. Teams running long-term, AI-coded codebases. When the project is big enough that you (or someone else) will touch it again in six months, twelve months, three years — but most of it was written by an agent whose context evaporated the day each PR shipped. git blame tells you what changed. Selvedge tells you why — even after the agent session, the prompt template, the developer who asked for it, and the model version are all long gone. This is the original use case: production codebases, schema decisions, migrations, dependency changes that need an audit trail that survives turnover. Solo developers using Claude Code on everyday projects. Side projects, weekend builds, the small internal tool you keep poking at. You don't need enterprise governance — you just need to remember why you (or your agent) did the thing you did yesterday, last week, last sprint. Run selvedge init once. Add four lines to your CLAUDE.md. From then on, selvedge blame is muscle memory — a way to talk to your past self when your past self was an LLM. If you've ever come back to your own AI-built project and thought "what was this for again?", Selvedge is the missing piece. The problem Human-written code leaks intent everywhere — commit messages, PR descriptions, inline comments, the Slack thread that preceded it. AI-written code doesn't. The agent has perfect clarity about why it made each decision, but that context lives in the prompt and evaporates when the conversation ends. Six months later, your team is debugging a schema decision with no trail. git blame tells you what changed and when. It can't tell you why. Selvedge captures the why — live, by the agent itself, as the change is made. The diff is git's job. The why is Selvedge's. What's new in v0.3.10 The memory comes to the agent, and the store gets its dials. Two themes, shipped together because the config half is what the rest needed to read settings from. Delivery. Selvedge already blocked re-edits of reverted entities. What was missing was delivery when there is nothing to veto. Two new hooks: SessionStart injects a compact digest as a session begins — decisions due for a revisit, entities that were tried and reverted, recent changesets. PreCompact fires just before context compaction destroys this session's reasoning and names the watched entities you edited but never logged. Both are quiet when they have nothing to say, size-capped, read-only, and templated. Neither can block anything — PreCompact deliberately declines the veto the hook API offers it. This is the answer to a measured failure mode: two 2026 papers recorded pull-model memory tools going unused entirely (zero voluntary memory operations across 114 turns against a pre-seeded store) while deterministic injection landed every time. selvedge export --format markdown renders the store as a reviewable digest to commit next to it, so captured intent shows up in a pull request instead of hiding inside a binary. Deterministic — regenerating with no new events is a zero-line diff. Config. .selvedge/config.toml is now first-class, with a canonical precedence chain that selvedge doctor prints per setting. It brings: selvedge prune --include-events — the first path that can delete captured reasoning, so it needs both a confirmation and SELVEDGE_DESTRUCTIVE=1. Neither alone is enough, because --yes in a cron entry defeats a prompt and a shell profile defeats an env var. Events retention defaults to never. Event-size bounds (diff_bytes, reasoning_bytes) that truncate loudly — a marker in the text, a warning at write time, a count in selvedge stats. Secret-shape warnings at log_change, extendable via redaction_patterns, plus a doctor row that scans what's already stored. Warn, never reject. Also: five review issues closed. The enforcement hook's allow path is 40% faster (33.6 ms → 20.1 ms per gated call) and SELVEDGE_HOOK_DISABLE=1 finally short-circuits before the imports it was documented to skip; log_change no longer discards revisit_after / constraint / stale_when on renames and supersedes; the CLI's --json and the MCP tools now return identical structures; and the Docker image no longer ships the maintainer's own database. Tests 826 → 984. What's new in v0.3.9.3 Fixes a broken install, and lands a full code-quality pass. mcp 2.0.0 (released 2026-07-28) removed mcp.server.fastmcp, and Selvedge declared mcp>=1.0.0 with no upper bound — so any pip install selvedge after that date pulled 2.0.0 and selvedge-server failed at import. This release pins the dependency. If your server stopped starting, this is why — upgrade. It ships alongside a review that put nine independent passes over the codebase and then tried to disprove every finding before acting on it. Seventeen confirmed defects fixed. The ones you would actually have noticed: The enforcement hook stopped blocking things it shouldn't. Reading a tracked file — cat, git diff, pytest, ruff check — was blocked, and the remediation the error message told you to run was blocked by the same gate, so there was no way out from the CLI. Two more paths fed the same false blocks: a commented-out line of SQL counted as a real deletion, and any commit message merely containing the word "revert" marked every file it touched as reverted. Lookups got fast at scale. The main entity read was scanning every row — measured 7.4 ms → 0.35 ms at 100k events, and the hook had been taking seconds on large stores. selvedge setup can no longer delete parts of your CLAUDE.md, an interrupted backup can no longer destroy your last good one, and upgrading while two Selvedge processes are running no longer crashes with an error that looked like database corruption. Tests went 739 → 826. No schema change and no tool-surface change, so this is drop-in for anyone on 0.3.9.x. Where Selvedge fits AI agents call Selvedge as they work. Selvedge captures the why into a durable, queryable store and emits it back out — as Agent Trace records for cross-tool readers, as observability metadata that links into Sentry/Datadog stack traces, and as compliance artifacts for SOC 2 and EU AI Act audits. Selvedge does not replace git (line-level what/when), PR review tools (review-time quality), agent observability (LLM call traces), or general-purpose code-host AI features. It sits between them — the provenance-as-first-class-citizen layer that everything else references. How Selvedge compares There's a fast-growing "git blame for AI agents" category. Here's where Selvedge fits — and where it deliberately doesn't. Rejected paths Reasoning source Granularity Mechanism Grouping Storage Selvedge Queryable — prior_attempts returns tried → reverted → re-opened Captured live, by the agent in the same context that produced the change Entity — DB column, table, env var, dep, API route, function MCP server — agent calls it as work happens Changesets — named feature/task slugs across many entities SQLite, zero deps OpenLore Purged — rejected is an inactive status, dropped from the queryable store after each decision sync (the annotation survives in the synced spec markdown) Derived — tree-sitter static analysis of code state, plus commit-gated decision notes AST node (18 languages + 12 IaC) MCP server — one-time index + commit-time certificates Call-graph edges SQLite graph in .openlore/ AgentDiff (sunilmallya) None Inferred post-hoc by Claude Haiku from the diff at session end Line Claude Code lifecycle hooks → local daemon Session/task JSONL on disk AgentDiff (codeprakhar25) None ed25519-signed cross-agent provenance Line Per-agent editor hooks + git hooks (sign at commit) None Signed traces in git refs Origin None — rework flags reverted AI code post-hoc, without rationale Prompt receipts, captured live per turn Line Agent lifecycle hooks + git post-commit hook None Git notes + sessions branch Git AI None Attribution metadata Line Agent-invoked checkpoint → Git notes at commit None Git notes BlamePrompt None Prompt receipts — prompt, cost, tools; no stated rationale Line Agent-lifecycle hooks + post-commit hook None Git notes Why "rejected paths" matter — the one that isn't copyable. The expensive failure isn't forgetting why a column exists. It's an agent confidently re-implementing something the team already killed for a good reason, six months after everyone who knew that left the context window. None of the line-attribution tools above surface rejected paths at all, and it isn't a feature gap they can close in a release — a line-oriented store has no notion of an entity that persisted across a try → revert → retry cycle. See docs/demos/prior-attempts.md. Why determinism matters. Selvedge's reasoning is the agent's own intent, written from the same context window that produced the change. There is no model anywhere in the storage or retrieval path, so the same query returns the same answer today and in two years, across model versions. Tools that infer reasoning post-hoc are running a second LLM that never saw the original prompt: what it produces is paraphrase, and re-running it can produce different categories for the same change. As a Hacker News commenter put it about a competing approach, "grep won't find your commit because you rejected 'oauth-library'… unless there is deterministic enforcement" (0x457). Determinism alone is no longer a separator — OpenLore is deterministic-native too, and says so. The compound that separates is append-only testimony: reasoning the agent wrote itself, kept in a store where a rejection is a first-class record rather than an inactive status to be swept up. Why "entity-level" matters. Most tools attribute lines. Selvedge attributes things you actually search for: users.email, env/STRIPE_SECRET_KEY, api/v1/checkout, deps/stripe. The first question after git blame is usually "what's the history of this column", not "what's the history of lines 40–48 of users.py". Why "captured live" matters. Not a differentiator on its own — every tool here claims some flavour of it — but it's the mechanism that makes the reasoning trustworthy. Writing at the moment of the change, from the context that produced it, is the reason there's no second model in the path to hallucinate an explanation. An empty reasoning field is itself an honest signal: the agent didn't have one. Comparison current [truncated for AI cost control]