Repository navigation
buddie 2.0.0
Upgrading from 1.1.1: nothing to change for a 1.x setup. receipt-v0 stays the default with the same keys, outcome
words and statuses; the CLI's exit codes, the MCP tools' arguments, the hooks' registration and existing buddie.toml
files keep working. What can differ, each said where it happens:
buddie.toml[mandate]patterns that backtrack exponentially, orrefs[].doctemplates with more than{name}
fields, now make the file unusable (every answer returned with the reason) instead of holding the hook.- A git that does not answer, a
ci:ref that resolves to another commit, or check suites that disagree give
UNCHECKABLE, notHOLDSorBROKEN. - buddie's git reads no system or global git configuration but
safe.directory, and runs nothing a repository's
config names. - A
fact=anchor is alwaysUNCHECKABLE(1.1.1 ran the checked repo'stools/anchors.pyto compute it), and a
file anchor whose path leads out of the repo (../x#sha) isUNCHECKABLEand not read (1.1.1 hashed the file).
Where 1.1.1 saidHOLDSfor these, 2.0.0 saysUNCHECKABLE, and the outcome can go fromPASStoGAPS; their
receipt-v0 reasons inwhyandgapsread differently (commit 8cb7273, audit R1 and R2). This is intended and
stays; docs/release-hardening.md, RH-5, records the decision.
Environment diagnostics (docs/environment.md, "Diagnostics"; docs/design/environment-diagnostics.md):
buddie snapshot --category ...and the local MCP toolenvironment_snapshotobserve the parts of this machine a
task needs: OS, shells, privilege level, CPU, memory, GPU, storage, Python interpreters, runtimes, package managers,
GPU driver and CUDA/ROCm stack, catalog tools, Docker/Podman, a project's manifests, a repository. Only what the
person granted inenvironment.toml(their user configuration directory) and an ACTIVE protected policy's new
[environment] allow(androots, for the path-scoped categories) permits is collected; a request grants nothing, and an MCP argument outside the schema (a
consent) is an error. Each category uses only its declared, fixed methods (OS interfaces, fixed files, programs at
fixed places or on PATH with fixed arguments, an allowlisted environment, timeouts and output limits), adapts within
itself (nvidia-smi after an NVIDIA adapter) and records every attempt. The environment-diagnostics-v1 document keeps
observed values with their basis, unavailable reasons and the caller's task apart; network, proxy, port and
application categories are answered as unsupported. environment-v0,buddie snapshotwithout--categoryand
freshness are unchanged; freshness also reads the v0 snapshot inside a diagnostics document. The remote server
does not offer the tool.buddie snapshot --list,--grants,--grant-template.
Publication approval:
release.yml'sauthorizejob runs in the protected environmentpypi, so every publishing run, the recovery
runsonly: mcp-registryandonly: github-releaseincluded, waits for the environment's reviewers before any
stage. It protects only while the environment has required reviewers (docs/release.md, "Who approves a
publication").- docs/release.md: checking a published release's files (the flat assets put back where
release-manifest.json
says, thensha256sum -cand the manifest check); recovery after a partial publication uses only the approved
candidate, a rebuild never (its bytes differ), and stops for the owner when that candidate is gone; recovery is a
new, approved dispatch; a final pre-release checklist. CITATION.cff leavesdate-releasedout until the release
commit dates the release.
Release candidate and distribution (PR #38):
- The release workflow publishes nothing on a tag push. A pushed tag
vX.Y.Zbuilds a candidate (sdist, wheel and
the Claude Desktop bundle from that commit, validated, installed into clean venvs and run) and records it in
release-manifest.jsonandSHA256SUMS. Publishing is a manual run on the tag that names the candidate run and
typespublish buddie X.Y.Z; it checks the tag, the version, that the commit is onmainand the candidate's
files byte for byte, then sends those same files to PyPI (trusted publishing), the MCP Registry and a GitHub
Release, each stage repeatable and completing only what is missing. CI builds the same candidate on every pull
request. The TestPyPI target is gone: the candidate is the dry run. docs/release.md. - The publish run's decisions live in scripts/release_publish.py, tested against a fake GitHub API and recorded
PyPI and registry answers:authorizealso checks the candidate run's repository, tag, status and the artifact's
own record; PyPI is checked before uploading (identical files: done; any other file: stop); an existing registry
entry must match server.json; the GitHub Release is found by tag or as the single draft, re-read by id, completed
with only missing files, never changed once published, and stops on an asset that differs, did not finish
uploading, or cannot be checked. docs/release.md: partial publication, recovery per stage, the owner's checklist. - README rewritten as the landing page: what buddie verifies and what it does not, the outcomes, installs per client,
enforcement versus advice, the protected policy, receipts, security and privacy, research results, with badges for
CI, PyPI, Python, license, release and the MCP Registry. Its examples are run bytests/test_readme.py. The detail
moved to docs/claude-code.md, docs/configuration.md and docs/research.md. The old README said aGITHUB_TOKEN
in the environment was used for GitHub; buddie has not read it since 1.1. - docs/distribution.md: every channel's public version, source, update path and review, with the MCPRush, Glama and
Anthropic directory audits. The repository's plugin marketplace followsmain, so it serves 2.0.0 already. - The MCP tools
snapandsource_textdescribe each parameter.scripts/make_icon.pytakes its output path.
Remote verification, the landing page and release finalization (PRs #42, #44 and the release commit):
- Fix remote public GitHub
ci:verification: allow commit resolution and explicit latest check-run pagination,
with strict route/query validation and the existing public-repository checks. - README rewritten as the 2.0 landing page: verify, catch mismatches and observe, a real verification run and a real
diagnostics run (assets/demo), one recommended start, a short statement of limits; badges for CI, Python and
license. Its detail moved word for word to docs/verification.md, docs/getting-started.md and docs/limitations.md;
tests/test_readme.pyruns the examples there and the diagnostics demo with the README's grants file. - The README's images and links point at the
v2.0.0tag, so the PyPI page (which resolves no relative path)
shows them;tests/test_readme.pymaps each pinned URL back to the file in the checkout. The GitHub Actions
that build and publish a release are pinned to full commit SHAs.
Release hardening (docs/release-hardening.md):
-
RH-1 (the intermittent Windows test failures): by experiment, the failure depends on the launcher. It reproduces
without buddie under the Python install manager's command shim (%LOCALAPPDATA%\Python\bin\pytest.exe), and not
under pip's launcher orpython -m pytest. What inside the shim invalidates the test process's standard input
handle is not proven (a late close of a handle it duplicated in is the working hypothesis; it reproduces the
signature, but was not observed). buddie's own child processes never inherit standard
input (pdftotextandcertutilnow get it explicitly, and a test keeps every call site so); the suite names a
recurrence (BUDDIE_RH1_STRICT=1fails the run). Run the suite withpython -m pytest. -
A test that the pattern worker ends with buddie's process mid-match (Windows, Linux; macOS recorded).
-
Version 2.0.0 in every manifest.
-
Adversarial verification suite (
tests/test_adversarial.py, docs/adversarial.md): attacks an agent can mount
with what it controls, run through the hook, the CLI, MCP and the collectors, in a threat matrix with the test
that holds each. Found and fixed:- A
ci:anchor whose ref is a branch or tag named like the SHA (ci:o/r@deadbee=successwith a branch
deadbee) held on another commit's checks. When GitHub's check runs or combined status name another commit,
the anchor is now UNCHECKABLE. ci:anchors go throughfreshness.ci_evidence: the SHA resolved to its full commit, the latest runs and
status fetched once for that id, each naming it, GitHub's count read in full; a run withouthead_sha, on
another commit, a missing page or disagreeing suites are UNCHECKABLE.- The pattern worker is bounded in every step, not only while it matches: its start (within the event's budget),
writing the request (a worker that stops reading cannot block on a full pipe), and a whole, well-formed answer;
past any of them it is killed and reaped, one worker at a time. Linux and Windows end it with buddie's process.
Texts over 64 K characters are not matched. buddie.toml[mandate]patterns run in a worker process within 1 s per match and 10 s per hook event; past
that the worker is stopped and the answer returned (PatternTimeout; the CLI exits 2).buddie.toml[mandate]patterns could backtrack exponentially on the queue's text ((a+)+$: hours in
Python'sre), holding the hook until the host let the answer out unchecked. Patterns with a backreference, a
repeat over alternatives or an unseparated repeat inside a repeat, or over 512 characters, andrefs[].doc
templates with anything but{name}fields, now make the file unusable: every answer is returned with the
reason.
- A
-
docs/release-hardening.md: the intermittent Windows full-suite failures, with the first captured signature
(WinError 6duplicating the test process's standard input handle); classified in RH-1 above. -
Evidence freshness (
buddie/freshness.py, docs/freshness.md): whether evidence is bound to the revision a claim
is about, apart from whether it is valid and how old it is.CURRENT,STALE,UNKNOWN(NOT_APPLICABLE
reserved), each with a reason; only full commit ids compare, the same SHA in two repositories is not one revision,
and evidence counts only when buddie observed its revision (by identity, not a field).buddie freshness ci --repo R (--pr N | --commit SHA) --evidence SHA [--check NAME]: a PR's head resolved now, the commit GitHub's
check runs and statuses are for (each must name it), the CI outcome reported beside the state (CURRENTis not
"passed").buddie freshness repo --commit SHA [--artifact PATH=SHA256] [--snapshot FILE]: the checkout now (a dirty
tree isUNKNOWN) and files' bytes. Exit 0 CURRENT, 1 STALE, 3 UNKNOWN, 2 unusable input. The protected policy's
network and API apply. Receipts, the hook andbuddie verifyare unchanged; not on MCP.
A binding's details are read-only all the way down and rendered as new objects;render()recomputes each CI
summary from its runs and statuses. Check runs are asked for withfilter=latest; a check name whose runs in
different check suites disagree isambiguous, not a success or failure, and names in several suites are listed.
The identity registry is a boundary for data, not a sandbox: code in the same interpreter can register a binding. -
Remote server: an answer given before the request body is read (401, 403, 404, 411, 413) reads and drops up to 64
KiB of the declared body and closes the connection. Before, Windows reset the socket over the unread bytes and the
client lost the answer (WinError 10053, about one call in forty: the flakytest_remotetests). -
Security (docs/security.md): every program buddie starts goes through
buddie/runner.py: a fixed argument list,
a timeout, output bounded whether kept or streamed, the whole process tree stopped (a process group on Linux and
macOS, a job object on Windows), and one 40-second budget for all of a hook event's git and free command. git gets
an environment of its own (PATH, git's own settings; no token, noGIT_DIR, noGIT_CONFIG_*, no proxy, no
protocol), reads no system or global configuration but the person'ssafe.directoryentries, and runs with
core.fsmonitor, signature display and, forgit status, every filter driver the repository's config names
switched off.- SEC-01 (high): the hook's
git statusfor the session'ssources/stores ran the repository's filter and
fsmonitor commands in the hook's environment, where the plugin's GitHub token is. They no longer run. When the
stores cannot all be listed safely, the hook says so and journalsstores_unavailable. - SEC-09 (high): the launch gate's free command (
BUDDIE_FREE, settable by a project, or the policy's
free_command) ran with the plugin's token in its environment. It now runs withoutCLAUDE_PLUGIN_OPTION_*,
BUDDIE_GITHUB_TOKENandBUDDIE_HTTP_TOKEN, and cannot hold the hook past its timeout on Windows. - SEC-08:
GIT_DIRand the like in the environment no longer choose the repository an anchor is checked in. - A git that does not answer is
UNCHECKABLE, neverBROKEN(path@commit, a queue at a commit). - Snapshots:
git ls-filesoutput is bounded when streamed;environment.problems()takes only plain JSON data. - Behaviour: system and global git configuration (but
safe.directory) no longer apply to buddie's git; git status
for the session's stores leaves out submodules and rename detection; one more git call per Stop in a repository.
- SEC-01 (high): the hook's
-
Environment snapshots (
buddie/environment.py, docs/environment.md):buddie snapshotand
environment.collect()record what buddie observes itself of the place a check ran in: the interpreter (Python,
OS, architecture), the git repository (the commit HEAD names; whether the tree is clean or dirty, and how many
entries git status lists; the origin remote without credentials) and named files under a root (sha256 and length,
read once with stat compared before, after and by path). Each fact names what it rests on (buddieor
agent_writable); one buddie cannot observe isunavailablewith a reason and no value; what the caller states
(--supply) is kept apart ascaller_suppliedand never checked. Paths that lead out of the root are refused and
not repeated; no environment variable, user, host or absolute path is recorded. git runs without a shell, with a
timeout, bounded output, an environment of its own and every command the repository's config can name switched
off (core.fsmonitor, filter drivers); an index with assume-unchanged or skip-worktree entries is not shown clean.
No network.--reportgives the digest a receipt names as its subject. Not signed, not exposed over MCP, read by
no check; receipt-v0, receipt-v1 and its schema are unchanged.environment.problems()checks a snapshot for
consistency, not authenticity. -
Security: the Claude Code plugin's MCP server receives the GitHub token setting as
CLAUDE_PLUGIN_OPTION_GITHUB_TOKEN(.mcp.json), as the hook does, so it goes only to api.github.com or the
protected policy'sgithub_api; underBUDDIE_GITHUB_TOKENit could go to an API a project's environment named. -
buddie verifyon a directory or a non-UTF-8 report exits 2 with the reason instead of a traceback with exit 1
(the code of a FAIL).buddie statusnames an active or invalid protected policy. MCP's instructions no longer say
PASS means every quote and anchor holds. docs/integrations.md: every shipped surface, the PR #32 audit, setup,
reading results, troubleshooting. -
receipt-v1 (
buddie/receipts.py, docs/receipts.md, docs/receipt-v1.schema.json), given only when asked for:
buddie verify --receipt v1, MCPverify_reportreceipt: "v1",receipts.render(verify.assessment(...), "v1"). It keeps apart the outcome of what ran (PASS, FAIL, GAPS, UNKNOWN, EMPTY, NOT_RUN), the scope (requested,
effective, executed, excluded with a reason and the claims of that kind in the text), the coverage (FULL, PARTIAL,
UNKNOWN, NONE) and the evidence's provenance. The version is the predicateType. One check, rendered as either
contract:verify.assessment()runs once, rendering never checks again. receipt-v0 stays the default everywhere
and is unchanged; the hook, the journal and the remote server stay on v0.buddie receipt-schema;
receipts.problems()checks a receipt-v1 for consistency (not authenticity), exclusion reasons
against the requested and effective selections included. -
Verification profiles (
buddie/profiles.py, docs/profiles.md):developer(github, execution),research
(sources),complete(everything) andcustom(listed modules and/or checks), resolved to an explicit,
deterministic set of checks run by the same core.buddie profiles;buddie verify --profile/--checks, MCP
verify_reportprofile/checks,verify.assess_selected(profile=, checks=);buddie.toml[verify]for the
hook, where a profile turns off the default level of each class none of its checks feed, below[gates],
BUDDIE_GATESand the protected policy's floors. What a profile leaves out is named in Coverage with the claims
of that kind the text holds, and printed as a note; an unknown name is an error (abuddie.tomlwith one is
unusable). Without a profile nothing changes. -
The final rule reads whether an answer carries an anchor from its text, not from the anchors that were checked
(the same thing without a profile). -
A profile whose effective selection is empty (every class it feeds turned off) runs no check: no fetch, no GitHub
call, an EMPTY receipt, a journal line with"checks": []and an explicit note inbuddie status. Only "no
profile" means every check. -
Verification modules (
buddie/modules.py, docs/architecture.md):sources(quotes, numbers),github(repo
anchors,pr:,ci:) andexecution(run:,choice:, work claims), each with a stable id and its checks.
buddie modules;buddie verify --modules, MCPverify_reportmodules,verify.assess_selected. An unknown
id is an error; a module left out shows in Coverage. With no selection everything runs as before; the hook always
runs every module. -
Security: the protected policy's
[evidence]table (docs/policy.md, "Evidence"):repos = "event"sets
BUDDIE_REPOSaside,stores = "observed"judges quotes and numbers only on pages the hook fetches in the check
(forged snapshots no longer count),journal = "fixed"keepsBUDDIE_LOG/BUDDIE_SHARED_LOGfrom moving or
turning off the journal,collector = "isolated"keeps proxies and CA overrides of the environment off the hook's
fetches,github_apifixes the GitHub API and where the token goes. Keys left out keep the legacy behaviour, so a
policy without[evidence]decides as before. -
Findings record their evidence's provenance more exactly (internal; receipt-v0 unchanged): a snapshot this check
fetched itself is observed, another is of unknown origin; apr:/ci:answer fromBUDDIE_GITHUB_APIor
through an environment proxy is caller supplied, not observed from GitHub. -
Security: the GitHub token goes only where it belongs. The plugin's token setting is no longer sent to an API
named byBUDDIE_GITHUB_API(the agent could name its own server), only toapi.github.comor the policy's
github_api; the token is an unredirected header, so a redirect never carries it to another host, and an answer
from another origin is not taken (the anchor stays unchecked). -
Provenance says what buddie observed: a snapshot is collector observed only when this check fetched the cited
https URL itself (not bytes added to the store, not plain http, not archive or browser copies), and apr:/ci:
answer only when buddie's own GitHub GET asked the default or the policy's API. "Own" is by identity
(effects.github_get, the remote server's wrapper of it;Store/UnionStoreand only what they fetched during
the check), never an attribute or a set a caller can fill. The network is judged before and
after a check, and the isolated collector nests and overlaps across threads without leaving its opener behind;
it no longer touchesos.environ. docs/policy.md, "Provenance" and "The collector's scope". -
Security: the Codex Stop hook runs
python3 -I/python -I, soPYTHONPATHfrom the environment loads nothing. -
Windows: a
[mandate]queue read at a commit (git show) is decoded as UTF-8, as the file in the tree is, not in
the locale's encoding (cp1251 misread a Russian queue's words). The same for the repo path git prints (a checkout
underC:\Users\Иванwas not found), a merge commit's subject (cp1251 cannot decode «И»; the launch gate failed
on it) and the snapshot store'sindex.json(written as UTF-8; an index an older version wrote in the locale's
encoding is still read). Test fixtures write and read UTF-8 explicitly, so the suite passes without UTF-8 mode. -
Security: a protected policy (
buddie/policy.py, docs/policy.md). A file only an administrator can write
(/etc/buddie/policy.toml;<ProgramData>\buddie\policy.tomlon Windows) sets floors for each gate class and
what buddie.toml and the hook's environment may still decide: the intro mode, the final mark, transcript reading,
conversation words in the journal, turning return tracking off, the launch free command, the network, and whether
abuddie:line may let a returned answer out. Lower sources may tighten, never weaken; each refusal is journaled.
With no policy nothing changes; a policy that is there but unprotected or invalid makes buddie run on its strictest
limits and return each answer with the reason.buddie policy show|check|template; buddie never writes the file. -
Security: on Windows the policy counts as protected only when the file and every directory above it are owned by
SYSTEM, Administrators or TrustedInstaller, no ACE lets a low-privilege principal or this user change or replace
them, and AccessCheck with the hook's token agrees (buddie/winacl.py, ctypes only). An applicable allow ACE the
check does not read (object, callback/conditional, compound) makes the policy invalid instead of being skipped. -
Security: the hook launcher runs Python isolated (
-I, also for its version probe), so PYTHONPATH and friends from
a project's settings load nothing into it; with no Python 3.11+ a Stop's answer goes back once with the reason
instead of passing (the re-entered Stop goes on with a systemMessage). docs/policy.md, "A trusted launcher". -
The hook reads the protected policy once per event (
policy.snapshot()). -
Security: a buddie.toml that cannot be used (not TOML, not UTF-8, unreadable) no longer turns the gate off. It
used to make the check raise and the hook let the answer out unchecked (exit 0). Now none of its settings apply,
buddie's full defaults do, and the gate returns the answer with the file and the reason until the file is fixed
or abuddie:line tells the reader.buddie statussays so too. -
Security: a
buddie:line the agent wrote before buddie returned the text no longer lets out an answer buddie
could not check (a broken buddie.toml, an error in the check, findings that do not line up): it counts only on
the attempt after that return. The Stop Claude Code re-enters after such a return is never held (no loop), and
buddie tells the person, as a systemMessage, that the answer went out unchecked. The journal marks these lines
status:internal_error, orunchecked_disclosedwithbyagent or buddie; a checked answer's line is as before. -
Security: an error inside the check of a text the gate guards (a final answer at Stop, a text tool's message) no
longer lets it out as checked: it goes back once with the error (exit 2). A re-entered Stop, abuddie:line and
every other event (SessionStart, PostToolUse, launches) are let through as before. -
The typed gate no longer falls back to the items' words when the findings do not line up with them: each item
then blocks whatever its level, and the journal line saystyped_mismatch. -
Internal: the Stop and PreToolUse gate takes each blocking item's class from the finding behind it
(verify.blocking_findings,config.CLASS_OF_CHECK) instead of from the item's words;config.classifystays
for compatibility and as the fallback. The hook resolves an event once (buddie/resolved.py,
ResolvedEventContext: repos, buddie.toml, settings with their sources): a Stop now runsgit rev-parseonce and
reads buddie.toml once, where it ran 6 to 8 git commands and read the file 4 to 6 times. The gate's output on 819
recorded scenarios is unchanged (tests/data/gate_golden.json). -
Internal: the journal writer (
buddie/logbook.py) and the event helpers (buddie/event.py: a tool's text, the
repos of a session) moved out ofhook.pyandpromises.py; the summary, decision cards, promises, context gate
and config no longer import the hook.confignames each setting's source (Source,resolve_levels,
resolve_transcript) and lists what a repo's buddie.toml weakens (influence); values are unchanged. -
Internal: a typed contract for what a check found (
buddie/core.py: Finding, Fact, Sufficiency, Decision, Policy,
Outcome, ReasonCode, EvidenceRef with Provenance, Coverage) and its adapter from the checkers' rows
(buddie/findings.py). verify's outcome now comes from the findings; receipt-v0, the CLI, MCP, the hooks and
exit codes are unchanged (the same receipts, byte for byte, on the comparison set). One edge: an anchor or work
claim status no checker returns used to fall through to PASS and is now a gap. -
Security: a
[launch] freecommand inbuddie.tomlis ignored. buddie.toml belongs to the repo under check, and
the launch gate ran that command with a shell. The free command now comes fromBUDDIE_FREEonly. -
Security: the files
buddie.tomlnames (queue,accepted,messages) are held to the repo by the same rule as
file anchors, and are not read past 16 MiB. -
Security: the remote server answers
pr:/ci:anchors only for public repositories. Its token may see private
ones, and a stranger's anchor would have learned their PR states, commits and check names. A GitHub anchor whose
owner or repo is.or..is not looked up. -
Limits: a file anchor is hashed in chunks and not past 256 MiB; a fetched page is not read past 32 MiB; a
compressed body is not inflated past 64 MiB; a report given toverify_reportis at most 16 MiB; a remote report
may make the server fetch at most 100 distinct links. -
Remote: each tool call runs under a budget of 60 connections, 64 MiB of bodies and 90 s, spent where sockets
are opened (so retries, redirects, alternative sources and GitHub calls all count) and where bodies are read;
past it a fetch fails (source unavailable) and the check's long loops stop with an error. brotli bodies are not
decompressed there, and pdftotext's text is capped byulimit -fon Linux and macOS. -
Remote:
pr:/ci:look-ups pass only the API paths buddie asks for, with ASCII names, and only when the repo
answersprivate: falseunder the very name asked for (a renamed repo is not followed) and a PR's base repo
says the same. -
Windows: a file anchor's file is accepted only when the path of the opened handle (GetFinalPathNameByHandleW) is
inside the repo, which closes the gap between the check and the open that #23 left there. -
Security: checking a report no longer runs code from the repository it names. A
fact=anchor used to import and
run that repo'stools/anchors.py; it is now alwaysUNCHECKABLE(audit R1). -
Security: a file anchor
path#sha256reads only a plain file inside the repo. An absolute path, a drive,..
(with/or\), a symlink whose target is outside the repo, or a hard link isUNCHECKABLEand is not read.
Before,../x#shaor/etc/x#shahashed the file outside the repo, and a wrong hash printed 12 hex characters of
the real one. On Linux and macOS each path part is opened without following symlinks, so a part swapped after
the check is refused (audit R2). -
A number whose source could not be read (
SOURCE_UNAVAILABLE) or whose value stood apart from the sentence's words
(NO_CONTEXT) made a receiptPASS("buddie PASS: numbers 0/1 found"). Both are now gaps and are listed under
gaps. A quote or number verdict that verify does not know, for example from a newer verbatim, is a gap too,
never a pass. Each verdict's meaning now sits in one table inbuddie/verify.py, and a test keeps that table equal
to the verdicts verbatim returns. Exit codes and blocking are unchanged: gaps never block.