Commit 93df30c
spec(docs): polish-fact-check umbrella spec — 4 phases to reduce hallucinations (#27)
Adds docs/specs/polish-fact-check/ — an umbrella spec for a
four-phase intervention ladder that shifts polish-pass
verification work from human editorial review to automated checks.
Motivated by a regression fixture from attune-ai PR #351
(Smart-AI-Memory/attune-ai#351), where the ops-dashboard regen
produced six factual errors in a single feature's docs:
- 1 hallucinated CLI flag (--allow-run, real flag is --read-only)
- 2 hallucinated private module paths (attune.ops._readers)
- 4 hallucinated cross-references
- 1 hallucinated count (498 templates vs real 259)
- 2 wrong route paths
- 1 insecure example (0.0.0.0 without auth callout)
Three of the six (CLI flag, private imports, wrong routes) would
actively break readers who follow the docs literally.
Four phases, each shipping as its own PR:
Phase 1: AST-based post-generation fact-check (Python refs,
CLI flags, Markdown links, numeric claims) — catches
5 of 6 fixture errors. Cheapest, no LLM cost.
Phase 2: Ground-truth context injection into polish prompt
(CLI --help output, __all__, dataclass fields).
Phase 3: Adapt attune-rag faithfulness judge as a polish
post-step. Catches the 6th fixture error
(missing-security-callout).
Phase 4: Static analysis of tutorial code samples (mypy +
ast.parse). Execution tiers explicitly deferred to
Phase 4.2 for security reasons.
Files:
- requirements.md — problem statement, scope, acceptance
- design.md — architecture, per-phase API shapes,
open design questions
- tasks.md — numbered tasks per phase, exit checklists
- decisions.md — pre-committed decision matrix
(introduces a spec-file convention)
Status: draft. Awaiting review/approval before Phase 1
implementation begins.
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>1 parent d9b9f09 commit 93df30c
4 files changed
Lines changed: 763 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
0 commit comments