/check
Scans the full wiki to detect structural, link, field, and graph health issues, and generates a tiered fix-recommendation report.
Covers all 9 entity types, including claims confidence plausibility, idea failure-reason completeness,
experiment-claim link validity, and graph edge consistency.
Inputs
- Full wiki directory (default
wiki/)
- Optional:
--json flag (output JSON format via tools/lint.py)
- Optional:
--fix flag (auto-fix deterministic issues)
- Optional:
--fix --dry-run (preview fixes without applying them)
- Optional:
--suggest flag (show recommendations for issues that cannot be auto-fixed)
Outputs
- Lint report (reported directly to the user)
- Optional file write:
wiki/outputs/lint-report-{date}.md
Wiki Interaction
Reads
wiki/papers/*.md — paper page fields and links
wiki/concepts/*.md — concept page fields and links
wiki/topics/*.md — topic page fields and links
wiki/people/*.md — people page fields and links
wiki/ideas/*.md — idea status, failure_reason, origin_gaps
wiki/experiments/*.md — experiment status, target_claim, outcome
wiki/claims/*.md — claim confidence, status, evidence, source_papers
wiki/Summary/*.md — survey page fields
wiki/graph/edges.jsonl — semantic graph edge consistency check
wiki/graph/citations.jsonl — bibliographic citation consistency check
wiki/index.md — cross-check page completeness
Writes
- Does not directly modify wiki content (reports only, no fixes)
wiki/log.md — records lint result summary via tools/research_wiki.py log
Workflow
Pre-conditions: confirm the working directory is the wiki project root (directory containing wiki/, raw/, tools/).
Set WIKI_ROOT=wiki/.
Step 1: Run the Automated Lint Tool
Default mode (report only):
python3 tools/lint.py --wiki-dir wiki/ --json
Auto-fix mode (when user specifies --fix):
python3 tools/lint.py --wiki-dir wiki/ --fix --json
Auto-fixes deterministic issues (xref reverse-link completion, missing fields filled with default values) and outputs a fix report.
Preview mode (when user specifies --fix --dry-run):
python3 tools/lint.py --wiki-dir wiki/ --fix --dry-run --json
Previews what would be fixed without applying any changes.
Parse the JSON output to obtain all automatically detected issues (and fix results).
Step 2: Structural Completeness (automated coverage)
The automated tool checks:
- Broken wikilinks:
[[slug]] target file does not exist
- Orphan pages: pages with no incoming links
- Missing required fields (all 9 entity types):
- papers: title, slug, tags, importance
- concepts: title, tags, maturity, key_papers
- topics: title, tags
- people: name, tags
- Summary: title, scope, key_topics
- ideas: title, slug, status, origin, tags, priority
- experiments: title, slug, status, target_claim, hypothesis, tags
- claims: title, slug, status, confidence, tags, source_papers, evidence
Step 3: Field Value Validation (automated coverage)
- Enum value checks:
- papers.importance ∈ {1,2,3,4,5}
- concepts.maturity ∈ {stable, active, emerging, deprecated}
- ideas.status ∈ {proposed, in_progress, tested, validated, failed}
- ideas.priority ∈ {1,2,3,4,5}
- experiments.status ∈ {planned, running, completed, abandoned}
- experiments.outcome ∈ {succeeded, failed, inconclusive}
- claims.status ∈ {proposed, weakly_supported, supported, challenged, deprecated}
- Claim confidence ∈ [0.0, 1.0]
- Idea failure_reason: must be non-empty when status=failed (anti-repetition memory)
- Experiment target_claim: the referenced claim must exist
Step 4: Cross Reference Symmetry (automated coverage)
Check all bidirectional link rules defined in CLAUDE.md:
| Forward link |
Reverse link checked |
| concepts.key_papers → papers |
papers.Related contains concept link |
| papers → people (wikilink) |
people.Key papers contains paper |
| claims.source_papers → papers |
papers.Related contains claim link |
| ideas.origin_gaps → claims |
claims.Linked ideas contains idea |
| experiments.target_claim → claims |
claims.evidence contains experiment |
Step 5: Graph Edge Consistency (automated coverage)
- JSON format validity: every line is valid JSON
- Required fields: each edge has from, to, type
- Edge type validity: semantic edges use the current endpoint-aware type sets; legacy paper-paper / paper-concept types produce migration warnings
- Edge confidence:
/ingest paper-paper and paper-concept semantic edges use confidence: high|medium|low
- Citation layer:
graph/citations.jsonl rows use type: cites, valid source/date, paper endpoints, and no confidence field
- Dangling nodes: wiki pages referenced by from/to must exist
Step 6: Content Quality (LLM-assisted)
Items detectable by the automated tool:
- Papers with importance=5 have no concept page referencing them
- Concepts with maturity=stable have only 1 key_paper
- Topics have empty Open problems sections
Additional LLM judgments (requires reading content):
- Concept near-duplicate detection: scan all concept page titles + aliases and assess whether any pairs are semantically identical or highly similar (e.g. "attention mechanism" and "self-attention"). Output merge recommendations for suspected duplicates.
- Contradictory statement detection (inconsistent descriptions of the same fact across different pages)
- SOTA records not updated in over 6 months
- people Recent work not updated in over 6 months
- Claim confidence inconsistent with evidence quantity/strength
- High-priority idea stuck in proposed status for a long time
Step 7: Generate Report
Output sorted by priority:
## Lint Report — YYYY-MM-DD
**Summary**: N 🔴, M 🟡, K 🔵
### 🔴 Fix Immediately
1. [file] — {issue description}
### 🟡 Recommended Fixes
1. [file] — {issue description}
### 🔵 Optional Improvements
1. [file] — {issue description}
Classification:
- 🔴 Fix Immediately: broken links, missing required fields, invalid enum values, failed idea without failure_reason, invalid JSON in edges, confidence out of range
- 🟡 Recommended Fixes: xref asymmetry, dangling graph edges, broken claim references, unknown edge types
- 🔵 Optional Improvements: orphan pages, quality suggestions, empty sections
Append log:
python3 tools/research_wiki.py log wiki/ "check | report: N 🔴, M 🟡, K 🔵"
Constraints
- Report-only by default: without
--fix, only reports, no modifications
--fix only repairs deterministic issues: xref reverse-link completion, missing fields filled with safe default values. Non-deterministic issues output recommendations (--suggest) for user approval
- raw/ is read-only: do not modify files under
raw/
- graph/ is read-only: lint does not modify graph files, checks consistency only
- LLM judgments labeled by source: automated checks and LLM judgments are clearly distinguished in the report
- Idempotent: running multiple times produces the same result (unless wiki content changes)
Error Handling
- wiki/ does not exist: report error and suggest running
/init
- graph files do not exist: skip the missing graph-file checks, note in report
- Partial directory missing: skip checks for missing directories, list missing directories in report
Dependencies
Tools(via Bash)
python3 tools/lint.py --wiki-dir wiki/ [--json] [--fix] [--dry-run] [--suggest] — automated structural check + fix (core dependency)
python3 tools/research_wiki.py log wiki/ "<message>" — append log
python3 tools/research_wiki.py stats wiki/ — get statistics (optional, for the report)
1---2name: check3description: Scan the full wiki to detect health issues and produce a tiered fix-recommendation report (covers all 9 entity types + graph consistency)4---56# /check78> Scans the full wiki to detect structural, link, field, and graph health issues, and generates a tiered fix-recommendation report.9> Covers all 9 entity types, including claims confidence plausibility, idea failure-reason completeness,10> experiment-claim link validity, and graph edge consistency.1112## Inputs1314- Full wiki directory (default `wiki/`)15- Optional: `--json` flag (output JSON format via tools/lint.py)16- Optional: `--fix` flag (auto-fix deterministic issues)17- Optional: `--fix --dry-run` (preview fixes without applying them)18- Optional: `--suggest` flag (show recommendations for issues that cannot be auto-fixed)1920## Outputs2122- Lint report (reported directly to the user)23- Optional file write: `wiki/outputs/lint-report-{date}.md`2425## Wiki Interaction2627### Reads28- `wiki/papers/*.md` — paper page fields and links29- `wiki/concepts/*.md` — concept page fields and links30- `wiki/topics/*.md` — topic page fields and links31- `wiki/people/*.md` — people page fields and links32- `wiki/ideas/*.md` — idea status, failure_reason, origin_gaps33- `wiki/experiments/*.md` — experiment status, target_claim, outcome34- `wiki/claims/*.md` — claim confidence, status, evidence, source_papers35- `wiki/Summary/*.md` — survey page fields36- `wiki/graph/edges.jsonl` — semantic graph edge consistency check37- `wiki/graph/citations.jsonl` — bibliographic citation consistency check38- `wiki/index.md` — cross-check page completeness3940### Writes41- Does not directly modify wiki content (reports only, no fixes)42- `wiki/log.md` — records lint result summary via `tools/research_wiki.py log`4344## Workflow4546**Pre-conditions**: confirm the working directory is the wiki project root (directory containing `wiki/`, `raw/`, `tools/`).47Set `WIKI_ROOT=wiki/`.4849### Step 1: Run the Automated Lint Tool5051**Default mode (report only)**:52```bash53python3 tools/lint.py --wiki-dir wiki/ --json54```5556**Auto-fix mode** (when user specifies `--fix`):57```bash58python3 tools/lint.py --wiki-dir wiki/ --fix --json59```60Auto-fixes deterministic issues (xref reverse-link completion, missing fields filled with default values) and outputs a fix report.6162**Preview mode** (when user specifies `--fix --dry-run`):63```bash64python3 tools/lint.py --wiki-dir wiki/ --fix --dry-run --json65```66Previews what would be fixed without applying any changes.6768Parse the JSON output to obtain all automatically detected issues (and fix results).6970### Step 2: Structural Completeness (automated coverage)7172The automated tool checks:73741. **Broken wikilinks**: `[[slug]]` target file does not exist752. **Orphan pages**: pages with no incoming links763. **Missing required fields** (all 9 entity types):77 - papers: title, slug, tags, importance78 - concepts: title, tags, maturity, key_papers79 - topics: title, tags80 - people: name, tags81 - Summary: title, scope, key_topics82 - ideas: title, slug, status, origin, tags, priority83 - experiments: title, slug, status, target_claim, hypothesis, tags84 - claims: title, slug, status, confidence, tags, source_papers, evidence8586### Step 3: Field Value Validation (automated coverage)87881. **Enum value checks**:89 - papers.importance ∈ {1,2,3,4,5}90 - concepts.maturity ∈ {stable, active, emerging, deprecated}91 - ideas.status ∈ {proposed, in_progress, tested, validated, failed}92 - ideas.priority ∈ {1,2,3,4,5}93 - experiments.status ∈ {planned, running, completed, abandoned}94 - experiments.outcome ∈ {succeeded, failed, inconclusive}95 - claims.status ∈ {proposed, weakly_supported, supported, challenged, deprecated}962. **Claim confidence** ∈ [0.0, 1.0]973. **Idea failure_reason**: must be non-empty when status=failed (anti-repetition memory)984. **Experiment target_claim**: the referenced claim must exist99100### Step 4: Cross Reference Symmetry (automated coverage)101102Check all bidirectional link rules defined in CLAUDE.md:103104| Forward link | Reverse link checked |105|----------|---------------|106| concepts.key_papers → papers | papers.Related contains concept link |107| papers → people (wikilink) | people.Key papers contains paper |108| claims.source_papers → papers | papers.Related contains claim link |109| ideas.origin_gaps → claims | claims.Linked ideas contains idea |110| experiments.target_claim → claims | claims.evidence contains experiment |111112### Step 5: Graph Edge Consistency (automated coverage)1131141. **JSON format validity**: every line is valid JSON1152. **Required fields**: each edge has from, to, type1163. **Edge type validity**: semantic edges use the current endpoint-aware type sets; legacy paper-paper / paper-concept types produce migration warnings1174. **Edge confidence**: `/ingest` paper-paper and paper-concept semantic edges use `confidence: high|medium|low`1185. **Citation layer**: `graph/citations.jsonl` rows use `type: cites`, valid source/date, paper endpoints, and no confidence field1196. **Dangling nodes**: wiki pages referenced by from/to must exist120121### Step 6: Content Quality (LLM-assisted)122123Items detectable by the automated tool:1241. Papers with importance=5 have no concept page referencing them1252. Concepts with maturity=stable have only 1 key_paper1263. Topics have empty Open problems sections127128Additional LLM judgments (requires reading content):1291. **Concept near-duplicate detection**: scan all concept page titles + aliases and assess whether any pairs are semantically identical or highly similar (e.g. "attention mechanism" and "self-attention"). Output merge recommendations for suspected duplicates.1302. Contradictory statement detection (inconsistent descriptions of the same fact across different pages)1313. SOTA records not updated in over 6 months1324. people Recent work not updated in over 6 months1335. Claim confidence inconsistent with evidence quantity/strength1346. High-priority idea stuck in proposed status for a long time135136### Step 7: Generate Report137138Output sorted by priority:139140```141## Lint Report — YYYY-MM-DD142143**Summary**: N 🔴, M 🟡, K 🔵144145### 🔴 Fix Immediately1461. [file] — {issue description}147148### 🟡 Recommended Fixes1491. [file] — {issue description}150151### 🔵 Optional Improvements1521. [file] — {issue description}153```154155Classification:156- **🔴 Fix Immediately**: broken links, missing required fields, invalid enum values, failed idea without failure_reason, invalid JSON in edges, confidence out of range157- **🟡 Recommended Fixes**: xref asymmetry, dangling graph edges, broken claim references, unknown edge types158- **🔵 Optional Improvements**: orphan pages, quality suggestions, empty sections159160Append log:161```bash162python3 tools/research_wiki.py log wiki/ "check | report: N 🔴, M 🟡, K 🔵"163```164165## Constraints166167- **Report-only by default**: without `--fix`, only reports, no modifications168- **`--fix` only repairs deterministic issues**: xref reverse-link completion, missing fields filled with safe default values. Non-deterministic issues output recommendations (`--suggest`) for user approval169- **raw/ is read-only**: do not modify files under `raw/`170- **graph/ is read-only**: lint does not modify graph files, checks consistency only171- **LLM judgments labeled by source**: automated checks and LLM judgments are clearly distinguished in the report172- **Idempotent**: running multiple times produces the same result (unless wiki content changes)173174## Error Handling175176- **wiki/ does not exist**: report error and suggest running `/init`177- **graph files do not exist**: skip the missing graph-file checks, note in report178- **Partial directory missing**: skip checks for missing directories, list missing directories in report179180## Dependencies181182### Tools(via Bash)183- `python3 tools/lint.py --wiki-dir wiki/ [--json] [--fix] [--dry-run] [--suggest]` — automated structural check + fix (core dependency)184- `python3 tools/research_wiki.py log wiki/ "<message>"` — append log185- `python3 tools/research_wiki.py stats wiki/` — get statistics (optional, for the report)