treg
superdesigndev
OpenRouter for agent tools. Join community here: https://discord.gg/6mQYYfFMAn
jingchangzhao-gif/error-knowledge-base
Error knowledge base for LLM tools: record a failure once, keep the fix, and hand it back before the model re-diagnoses. Windows CLI and daemon, DSH/Codex/Claude connectors, MCP server, PostgreSQL store.
PROJECT TOPICS
PROJECT README
Diagnose an error once, record the fix, and reuse it the next time the same failure appears — locally, without calling a model.
Error Knowledge Base (errkb) is a local error-reuse and prevention platform for command-line workflows and AI coding tools. It captures observable failures, stores redacted and deduplicated knowledge in PostgreSQL, returns known fixes with evidence and trust, and tracks repository-backed prevention artifacts.
| Version | What it contains |
|---|---|
| Released v0.1.3 | Error capture, retrieval, versioned fixes, outcomes and trust; CLI, daemon, Web toolbox and connectors; migrations 0001–0008; 9 MCP tools |
Current main |
Everything above, plus the prevention loop, recurrence metrics, migration 0009 and 12 MCP tools; tested but not yet released |
Download the portable toolbox from GitHub Releases. Source-only capabilities are marked Unreleased below so the download is not confused with the development branch.
| Goal | Capability |
|---|---|
| Capture failures | Wrap CLI commands, observe supported host hooks, follow logs or submit an ErrorEvent v1 payload |
| Protect local data | Redact secrets before persistence; use a local Named Pipe by default with no telemetry or outbound model calls |
| Identify repeats | Classify, normalize, fingerprint and deduplicate failures by project; repeated events append occurrences idempotently |
| Find known fixes | Search exact identifiers first, then at most three explicitly labelled approximate candidates |
| Reuse with context | Return the stored fix, source, match reason, environment warning and measured trust |
| Learn from results | Keep solution versions and record success, failure or unknown outcomes for a specific version |
| Prevent recurrence (Unreleased) | Version regression tests, deterministic checks, agent instructions and intents; verify, activate and measure real recurrence |
| Operate locally | Use the Web toolbox, MCP, diagnostics, migrations, backup/restore, retention, audited deletion and portable PostgreSQL management |
The exact implementation and verification boundary for each feature is in docs/features-and-implementation.md.
CLI / host hook / log / manual event
│
▼
redact → classify → normalize → fingerprint
│
▼
local daemon → PostgreSQL
│
▼
exact match → bounded approximate candidates → fix + reason + trust
Unpack errkb-toolbox.zip into a writable directory, then run:
.\errkb.exe pg install
.\start-errkb.cmd
The first command creates the local cluster, applies migrations and writes credentials. The second opens the loopback-only Web toolbox and starts the daemon when needed. For an existing PostgreSQL server, use errkb db migrate --dsn <your-dsn> instead.
See docs/install.md for custom ports, upgrades, logon recovery and uninstallation.
Run a real project command through errkb:
.\errkb.exe run --connector cli --session local --project my-repo -- npm test
If it fails, open the issue in the Web toolbox and record the verified fix, or use MCP err_record_solution. Run the same command again to retrieve that fix when the failure repeats.
Record whether the specific solution version worked:
.\errkb.exe feedback <issue-id> <solution-version-id> --outcome success
.\errkb.exe search "module not found"
.\errkb.exe show <issue-id>
.\errkb.exe stats
The generic CLI returns a known fix after observing the failure. Supported DSH and Claude hooks can additionally provide standing hints or notices before a new diagnosis.
| Host | Supported integration |
|---|---|
| Generic CLI | errkb run -- <command> failure capture and known-fix lookup |
| DSH | Plugin hooks, standing hints and post-execution notices |
| Codex CLI | CLI wrapper and MCP tools; no pre-failure hook is claimed |
| Claude Code | PostToolUseFailure hook, CLI wrapper, session hints and MCP tools |
Register MCP with a supported host:
.\errkb.exe mcp install --host codex
.\errkb.exe mcp install --host claude
.\errkb.exe mcp install --host dsh
.\errkb.exe mcp selftest
Current main exposes 12 MCP tools; released v0.1.3 exposes 9. MCP lets a model or user actively query and update allowed knowledge; installing it does not passively watch the host. Measured versions and unsupported paths are recorded in docs/connector-matrix.md.
mainTurn a resolved issue into a reviewed, versioned prevention artifact:
HEAD.errkb prevention add --issue <resolved-issue-id> --kind regression_test --title "Rename regression" --repo . --path tests/rename_test.go
errkb prevention verify <artifact-version-id> --repo . -- go test ./...
# Review and commit the artifact yourself before activation.
errkb prevention activate <artifact-version-id> --repo .
errkb prevention stats --issue <resolved-issue-id>
The four artifact kinds are regression_test, deterministic_check, agent_instruction and intent. MCP can register metadata and read preventions, but only the human-invoked CLI can verify or activate them. Web prevention statistics are read-only.
Activation records evidence; it does not install a CI job or host hook, edit a file or perform Git writes. See docs/prevention.md for lifecycle rules, metrics, privacy and troubleshooting.
| Command | Purpose |
|---|---|
errkb run -- <command> |
Run a command, preserve its behavior and record failures |
errkb search <query> / show <id> |
Find and inspect known issues and fixes |
errkb record --event <file> |
Submit a complete event from a file or stdin |
errkb list / stats |
List issues or solutions and read aggregate metrics |
errkb feedback <issue> <version> |
Record a solution outcome |
errkb prevention add\|verify\|activate\|list\|show\|stats |
Manage and observe prevention artifacts (Unreleased) |
errkb tail --file <path> |
Capture failures from a growing log |
errkb ui --web |
Open the local Web toolbox |
errkb mcp / mcp install / mcp selftest |
Serve, register and verify MCP |
errkb db migrate\|status |
Apply or inspect schema migrations |
errkb pg install\|start\|stop\|status\|uninstall |
Manage the local PostgreSQL cluster |
errkb doctor |
Run read-only environment, connector and MCP diagnostics |
errkb markdown import\|export |
Exchange the legacy ERRORS.md format |
Most read and write commands support --json with a versioned contract payload.
Read docs/privacy.md before storing sensitive project data.
SHA256SUMS.| Document | Purpose |
|---|---|
docs/project-status.md / 中文 |
Release, source and verification status |
docs/install.md / 中文 |
Install, upgrade, recovery and uninstall |
docs/features-and-implementation.md / 中文 |
Feature-to-source implementation map |
docs/prevention.md / 中文 |
Prevention workflow and metrics |
docs/connector-matrix.md / 中文 |
Measured host capabilities and gaps |
docs/privacy.md / 中文 |
Data storage, redaction, retention and deletion |
docs/benchmarks.md / 中文 |
Performance evidence and test environment |
CHANGELOG.md |
Release history and Unreleased changes |
Historical design plans and acceptance records remain under docs/; they are evidence rather than current user entry points.
pnpm install
pnpm typecheck
pnpm lint
pnpm format:check
pnpm test
pnpm build
go build ./...
go vet ./...
gofmt -l .
cue vet ./spec/...
Database integration tests require PostgreSQL and ERRKB_TEST_DATABASE_URL; without it they skip. Windows packaging scripts live in packaging/windows/.
Contributions should preserve the bilingual documentation and the existing contract, privacy and verification gates. See docs/implementation-plan.md for repository conventions.
MIT © jingchangzhao-gif
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: devtools。