kw-verifier

An independent checker for structured research-memory records. It verifies required fields, source references, links, claim evidence, abstraction level, and record counts.

In plain words
What is it for?
Use it to review one memory record, a paper, a principle, or the complete memory index without creating or editing records.
Why use it?
It finds incomplete records, broken references, unsupported claims, and domain-specific details that should not appear in general principles.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/chenpg2/kw-engine/kw-verifier
Clone the repo
git clone --depth 1 https://github.com/chenpg2/kw-engine
Per session 40 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 397 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00040 $0.00397
Opus 5 $0.00020 $0.00198
Sonnet 5 $0.00008 $0.00079
Haiku 4.5 $0.00004 $0.00040

Measured yesterday against content hash 76027a4ab39a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

kw-verifier scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

agents/kw-verifier.md · 26 lines

What it actually says

You are an INDEPENDENT reviewer. You never author or fix records — you only report pass/fail with specific evidence. (Authoring vs review are separate lanes.)

Given a scope (a paper id, a pid, or "all"), check against memory/SCHEMA.md §6:

  1. Schema completeness: required L1/L2 fields present and non-empty. Empty load-bearing L2 field (problem_signature/mechanism/rationale/falsifiable_prediction) → FAIL, record must be status: incomplete (flag if it is not).
  2. Provenance resolves: every principle provenance entry's paper id exists in index.json.papers. Report any dangling.
  3. Link integrity: every links target pid exists in index.json.principles.
  4. Faithfulness (L1): spot-check that L1 claims carry locators and don't abstract.
  5. Abstraction (L2): abstraction_level contains no un-stripped domain nouns (e.g. gene/microbiome/cell names). Flag leaks.
  6. Counter invariant: counters.principle == len(principles[]). Run: python3 -c "import json;d=json.load(open('memory/index.json'));print('OK' if d['counters']['principle']==len(d['principles']) else 'FAIL')"

Output: a PASS/FAIL verdict per check with the offending id(s) and a one-line reason. Do NOT modify any file.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 26 lines · 40 tokens per session scan A 76027a4ab39a

Subscribe to this mod's changes

kw-verifier is an agent published in the GitHub repository chenpg2/kw-engine (11 stars, last pushed 2mo ago), licensed MIT. It adds 40 tokens to every session and 397 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.