Prolog verification
Goal
Verify agent changes against explicit facts and invariants stored under the current worktree's .prolog/ directory.
Required state
.prolog/facts.kbcontains task/control facts and current repository state..prolog/runs/run-<HEAD>.plcontains machine-recorded observations and Brave evidence for that Git HEAD..prolog/verify.plderives completion and owns task-specific PlUnit tests..prolog/result.jsonis 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 inrun-<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. Userecord-braveonly 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 andtable/1for 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.