Prolog verification
Goal
Verify agent changes against explicit facts and invariants stored under the current worktree's .prolog/ directory.
Required state
.prolog/facts.kb contains task/control facts and current repository state.
.prolog/runs/run-<HEAD>.pl contains machine-recorded observations and Brave evidence for that Git HEAD.
.prolog/verify.pl derives completion and owns task-specific PlUnit tests.
.prolog/result.json is overwritten by the gate with the checked repository state and result.
Use the installed prolog-verify command when available. Otherwise run this skill's scripts/prolog-verify.py with Python 3.
Workflow
- Run
prolog-verify init --task <short-task-id> in the worktree before recording evidence.
- Add task-specific requirements and derived invariants to the canonical verification files. Never assert
verified(true) or equivalent self-certifying facts.
- Run real tests through
prolog-verify observe -- <command> [args...]. The helper records the command, exit status, output digest, Git HEAD, and worktree digest in run-<HEAD>.pl.
- When external discovery is required, run
prolog-verify brave --query <query> so the fixed Brave CLI call and its result are recorded in the same run file. Use record-brave only when a compatible Brave tool already wrote its successful result to a file. Do not mark local-only work as research.
- Run
prolog-verify check. Treat a missing, stale, timed-out, exceptional, or non-zero result as failure.
Rules
- Facts tied to an old HEAD or worktree digest are historical evidence, not current proof.
- Keep claimed requirements, machine observations, and derived conclusions distinct.
.prolog/runs/, sessions, verifier control files, and result output are runtime state and are excluded from the worktree digest.
- Durable
.prolog/kb/** project knowledge is not runtime state: changes there must affect the digest and require fresh verification evidence.
- Missing evidence is unknown, not proof of falsehood.
- Use
library(clpfd) for integer constraints and table/1 for recursive relations over cyclic graphs when needed.
- Keep verification pure. Filesystem, shell, and network effects belong in the helper, which projects their results into ground Prolog facts.
- Do not weaken or delete an invariant merely to make the gate pass.
For the fact schema and extension rules, read references/schema.md.
1---2name: prolog-verification3description: prolog, verification, evidence, invariants, worktrees, brave, hooks4---56# Prolog verification78## Goal910Verify agent changes against explicit facts and invariants stored under the current worktree's `.prolog/` directory.1112## Required state1314- `.prolog/facts.kb` contains task/control facts and current repository state.15- `.prolog/runs/run-<HEAD>.pl` contains machine-recorded observations and Brave evidence for that Git HEAD.16- `.prolog/verify.pl` derives completion and owns task-specific PlUnit tests.17- `.prolog/result.json` is overwritten by the gate with the checked repository state and result.1819Use the installed `prolog-verify` command when available. Otherwise run this skill's `scripts/prolog-verify.py` with Python 3.2021## Workflow22231. Run `prolog-verify init --task <short-task-id>` in the worktree before recording evidence.242. Add task-specific requirements and derived invariants to the canonical verification files. Never assert `verified(true)` or equivalent self-certifying facts.253. Run real tests through `prolog-verify observe -- <command> [args...]`. The helper records the command, exit status, output digest, Git HEAD, and worktree digest in `run-<HEAD>.pl`.264. When external discovery is required, run `prolog-verify brave --query <query>` so the fixed Brave CLI call and its result are recorded in the same run file. Use `record-brave` only when a compatible Brave tool already wrote its successful result to a file. Do not mark local-only work as research.275. Run `prolog-verify check`. Treat a missing, stale, timed-out, exceptional, or non-zero result as failure.2829## Rules3031- Facts tied to an old HEAD or worktree digest are historical evidence, not current proof.32- Keep claimed requirements, machine observations, and derived conclusions distinct.33- `.prolog/runs/`, sessions, verifier control files, and result output are runtime state and are excluded from the worktree digest.34- Durable `.prolog/kb/**` project knowledge is not runtime state: changes there must affect the digest and require fresh verification evidence.35- Missing evidence is unknown, not proof of falsehood.36- Use `library(clpfd)` for integer constraints and `table/1` for recursive relations over cyclic graphs when needed.37- Keep verification pure. Filesystem, shell, and network effects belong in the helper, which projects their results into ground Prolog facts.38- Do not weaken or delete an invariant merely to make the gate pass.3940For the fact schema and extension rules, read [references/schema.md](references/schema.md).