OctoEvidence.Cli 0.0.4

There is a newer version of this package available.
See the version list below for details.
dotnet tool install --global OctoEvidence.Cli --version 0.0.4
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local OctoEvidence.Cli --version 0.0.4
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=OctoEvidence.Cli&version=0.0.4
                    
nuke :add-package OctoEvidence.Cli --version 0.0.4
                    

OctoEvidence

Give coding agents a reliable, validated map of your project — in three roles.

You mark which folders are components and connect your agent once. The agent (Claude Code, Codex, or any MCP client) writes and maintains the knowledge — OKF v0.2 Markdown inside each component's okf/ folder — on its own during normal coding sessions. A human reviews it in the pull request like any other code. OctoEvidence is the referee in between: it validates, verifies citations against real source lines, routes future tasks, and keeps everything in step with Git.

It works with any programming language because it never parses source code and never calls a model. The format is the Open Knowledge Format v0.2.

You declare and review. The agent authors. OctoEvidence enforces. Git stays the source of truth.

Requirements: .NET 10 SDK or runtime, and Git on PATH.


Role 1 — You: set it up (four commands, once per repo)

1. Install the CLI (once per machine; only the executable is global — all state stays in each project):

dotnet tool install --global OctoEvidence.Cli --version 0.0.4

2. Declare your components. Pick the folders that mean something on their own — a service, a job, an infra module. init creates an empty okf/ folder in each, records the shared sync branch in octoevidence.json, and writes the agent operating rules into AGENTS.md (or CLAUDE.md if you already have one) — both Codex and Claude Code read that file automatically, so you write no prompt rules yourself:

octoevidence init --declare services/identity --declare services/payments --sync-branch origin/main

init also detects your agent. If Claude Code or Codex is present (a .claude/, CLAUDE.md, or .codex/ marker in the project or your home directory), it generates the octoevidence workflow skill for each — the SKILL.md standard both read — so the authoring choreography loads exactly when a fill, reconcile, or repair task starts instead of sitting in every session's context. For Claude Code it additionally wires a Stop hook into .claude/settings.json: a session that leaves OKF validation errors is blocked from handing off, with the errors fed back to the agent. Everything is regenerated by re-running init and merged without touching your own settings; hooks stay Claude-only while Codex's hook engine remains experimental.

Only an exact lowercase okf/ folder counts as a declaration; Okf/ and OKF/ are ordinary directories. After declaration the agent owns every file inside okf/, including index.md — OctoEvidence never generates, merges, or deletes bundle documents.

3. Connect your agent:

# Claude Code
claude mcp add --transport stdio --scope project octoevidence -- octoevidence mcp

# Codex
codex mcp add octoevidence -- octoevidence mcp

4. Tell the agent to fill it — one plain prompt in your next session:

Fill every reserved okf folder in this project.

When it finishes, commit okf/ and octoevidence.json like any other code and open a PR. That's the whole developer job: declare folders, connect the agent, prompt once, review PRs.

One rule to remember: nothing sensitive or executable ever goes inside okf/ — no source code, SQL, DDL, credentials, data rows, or raw logs. Validation fails the bundle if it happens.


Role 2 — The agent: uses it automatically

The instruction block init installed drives all of this; you don't trigger these steps.

  • At session start the agent calls check_component_updates. If the sync branch changed the knowledge, the user decides — pull the branch's version or continue locally. When the MCP client supports elicitation the question is put to the user directly (and a "pull" answer is applied at once); otherwise the agent is instructed to ask. One answer is remembered per branch revision.
  • On a normal coding task it calls find_components with the request, gets the relevant components ranked with the files to open first, then read_component to load just the few documents that matter — index and card first, exact paths on demand.
  • When writing knowledge it calls prepare_okf_fill, reads okf_authoring_guide, authors the Markdown, backs each factual claim with a source-line digest from cite_lines (it cannot invent one), and runs validate_okf until clean.
  • After changing your code it updates the affected concepts, claims, and log.md, re-resolves moved citations, and validates again — so knowledge never lags the code.

MCP tools

Tool Purpose
check_component_updates Three-way sync state against the branch; asks the user pull-or-continue when the branch has updates.
pull_okf_updates Materialize immutable branch bundles for remote-only/remote-ahead components. Never merges.
find_components Deterministic ranked routing for ordinary coding work.
read_component Progressive, bounded reads from local or immutable branch state.
list_okf_components Complete uncapped inventory for fill-all work.
prepare_okf_fill Targets, gaps, sync state, and the exact authoring procedure.
okf_authoring_guide The self-contained OKF v0.2 authoring contract.
cite_lines Strict line-range digests; invalid ranges are rejected, never clamped.
validate_okf OKF v0.2 conformance plus the stricter no-code profile.

The server speaks current MCP: every tool declares an output schema and returns structured content, tools carry accurate read-only/destructive/idempotent annotations, and the pull-or-continue decision uses MCP elicitation when the client supports it.


Role 3 — The human: reviews it

OKF is plain Markdown committed to Git, so it shows up in the pull request next to the code it describes. Review it there — no separate tool.

OctoEvidence already machine-checks the mechanical parts (format, frontmatter, citation digests against actual source lines, the no-code rule). Your job is the part a machine can't judge:

  • Is the prose true? Does the card describe what the component actually does and owns?
  • Are claims interpreted correctly? The cited lines are guaranteed to exist and match — you confirm they mean what the claim says: octoevidence component cite services/identity src/routes.ts --lines 18-18
  • Did anything business-sensitive slip through?

When a document is correct, approve it by adding a verification event to its frontmatter:

verified:
  - by: human:ahmed
    at: 2026-08-02T10:00:00Z

Trust is derived, never authored: absent verified is unverified, non-human verifiers are machine-confirmed, and a valid human:<id> event is human-reviewed. Claims marked pending were written by a model and nobody has confirmed them — useful, not settled. Documents past their stale_after date stay readable but are flagged stale until regenerated or re-verified.


Staying in sync with your team

check_component_updates compares complete bundle contents across the working tree, the merge base, and the configured branch:

State Meaning Blocks citation authoring?
in-sync Local and branch bundles match. No
local-only The branch has no bundle; local is authoritative. No
local-ahead Only the working tree changed. No
remote-only The branch introduced a component not present locally. Yes
remote-ahead Only the branch changed. Yes
diverged Both sides changed; the agent must merge deliberately. Yes

A missing branch or failed fetch fails closed. Pulling is deterministic transport of agent-authored content, never a merge: diverged components are refused, and local-only or local-ahead bundles are never touched.

CI and hooks

Both commands exit non-zero on failure, so they drop into any pipeline or pre-commit hook without JSON parsing:

octoevidence component check --fail-on-drift
octoevidence component validate --fail-on-error

Configuration — octoevidence.json

Committed at the repository root so the whole team shares one answer:

Field Meaning
syncBranch Branch every agent compares against — remote-tracking (origin/main) or local (main, release/2.0). Repositories without a remote work out of the box.
fetchEverySeconds Seconds between fetches. 0 fetches every check; -1 never fetches. Default 300.
includeDirectories Directory names discovery would normally skip (packages, build, …) that this project keeps components in.

CLI reference

Every command answers in JSON and accepts --directory <repository>.

Command Purpose
octoevidence init [--declare <dir>]... [--sync-branch <branch>] Declare components, record the sync branch, install the agent instruction block.
octoevidence doctor Status report: declarations, claims, validation warnings, sync state.
octoevidence component list Declared components and what each one knows.
octoevidence component find "<query>" [--limit N] Rank components for a request.
octoevidence component check [--fail-on-drift] Three-way sync state; non-zero exit for hooks and CI.
octoevidence component pull [component] Materialize branch bundles after the user chose to pull.
octoevidence component prepare [all\|<component>] [--prompt "<goal>"] Everything an agent needs to fill bundles.
octoevidence component validate [--fail-on-error] OKF v0.2 plus no-code profile validation.
octoevidence component cite <component> <file> [--lines 42-60] Digest for a line range, plus the covered lines for review.
octoevidence okf guide [section] The complete authoring contract, or one section.
octoevidence hook stop Session-close referee for agent Stop hooks: exit 2 with feedback while validation fails, 1 on unreconciled drift.
octoevidence mcp Run the stdio MCP server.

What's new in 0.0.4

  • Derived-data cache: routing cards, claim verification, and validation reports are cached process-wide, keyed by fingerprints of every file each computation consulted — bundle documents, cited sources, and link targets. Repeated MCP calls re-stat instead of re-reading and re-hashing, and one verification pass reads each cited source file once however many claims cite it. Git stays the only source of truth: the cache holds nothing that cannot be recomputed, and one-shot CLI runs always compute fresh.
  • Leaner reads: read_component returns document bodies by default — claims arrive structurally, now including broken citations flagged citationBroken instead of hidden. A verbatim read returns exact file text for editing and merges. The response budget is 64 KiB, and a single oversized document is truncated and flagged instead of failing.
  • Less duplication: prepare_okf_fill points at okf_authoring_guide instead of inlining three of its sections into every fill session.
  • Agent integration: init generates the octoevidence workflow skill (the SKILL.md standard) for detected Claude Code and Codex installs, and wires a Claude Code Stop hook — the new octoevidence hook stop blocks session handoff with actionable feedback while OKF validation fails, and warns without blocking on unreconciled drift.

Development

dotnet restore OctoEvidence.slnx
dotnet test OctoEvidence.slnx
dotnet pack src/OctoEvidence.Cli/OctoEvidence.Cli.csproj --configuration Release

The tests exercise real temporary Git repositories and run on Windows and Linux in CI.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
0.0.18 171 8/27/2026
0.0.17 120 8/27/2026
0.0.16 131 8/26/2026
0.0.15 135 8/26/2026
0.0.14 130 8/25/2026
0.0.13 139 8/23/2026
0.0.12 124 8/21/2026
0.0.11 135 8/21/2026
0.0.10 137 8/21/2026
0.0.9 137 8/20/2026
0.0.8 133 8/19/2026
0.0.7 139 8/18/2026
0.0.6 148 8/17/2026
0.0.5 156 8/16/2026
0.0.4 125 8/7/2026
0.0.3 151 8/2/2026
0.0.2 155 8/2/2026
0.0.1 158 7/23/2026

- Derived-data cache: routing cards, claim verification, and validation reports are cached process-wide, keyed by (path, size, mtime) fingerprints of every file each computation consulted — bundle documents, cited sources, and link targets. Repeated MCP calls re-stat instead of re-reading and re-hashing, and one verification pass reads each cited source file once however many claims cite it.
- Leaner reads: read_component returns document bodies by default; claims arrive structurally, now including claims whose citation no longer verifies, flagged citationBroken instead of hidden. A verbatim read returns exact file text for editing and merges. The response budget is 64 KiB, and a single oversized document is truncated and flagged instead of failing the read.
- prepare_okf_fill points at okf_authoring_guide instead of inlining three of its sections into every fill.
- Agent integration: init generates the octoevidence workflow skill (SKILL.md standard) for detected Claude Code and Codex installs, and wires a Claude Code Stop hook. The new `octoevidence hook stop` blocks session handoff with actionable feedback while OKF validation fails, and warns without blocking on unreconciled drift.