feat: wiki/candidates/ approval workflow#230
Merged
Merged
Conversation
New llmwiki/candidates.py with full promote/merge/discard workflow for LLM-generated entity + concept pages. Problem: /wiki-ingest can hallucinate entities. Before this PR they landed in wiki/entities/ directly and were only caught by later lint. Solution: new pages land in wiki/candidates/<kind>/<slug>.md with status: candidate. Human reviews via /wiki-review (or CLI 'llmwiki candidates list|promote|merge|discard'). Public API: list_candidates(wiki_dir) -> list[Candidate] promote(slug, wiki_dir, kind?) -> Path merge(slug, wiki_dir, into_slug=..., kind?) -> Path discard(slug, wiki_dir, reason='', kind?) -> Path stale_candidates(wiki_dir, threshold_days=30) -> list[Candidate] is_candidate(path) -> bool Promote rewrites frontmatter 'status: candidate' → 'status: reviewed'. Merge appends candidate body under ## Candidate merge — <date> in the target page, then archives the candidate. Discard moves to wiki/archive/candidates/<timestamp>/ with a .reason.txt audit-trail file. New lint rule 'stale_candidates' (12th overall) reports candidates sitting > 30 days as info severity. New slash command: .claude/commands/wiki-review.md walks the workflow. 34 tests cover: list (empty/missing-dir/skip-context/preview/age), all 3 action paths + error cases, status rewrite (replace/add), staleness computation, CLI + slash-command + lint-rule registration. Closes #51
Pratiyush
added a commit
that referenced
this pull request
Apr 17, 2026
Two regressions from the candidates workflow (PR #230) surfaced on CI after merge: 1. StaleCandidates lint rule referenced `Path` without importing it, so the rule raised NameError against any real page — the seeded wiki lint job crashed on every push. 2. tests/test_candidates.py used a nested f-string with a backslash inside the expression, which Python 3.9 rejects at parse time (only 3.12+ allows backslashes in f-string parts). Both are narrowly scoped: - Add `from pathlib import Path` inside StaleCandidates.run() (matches existing lazy-import style). - Extract the default body into a local variable in _write_candidate(). Regression test added in tests/test_lint_rules.py that exercises the rule end-to-end — the same failure path CI hit.
12 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #51
Summary
Quality gate for LLM-generated wiki pages: new entities/concepts land in
wiki/candidates/and require human review before promotion. Discard is non-destructive (archive with reason).PR Checklist
/wiki-reviewslash command shippedllmwiki candidates list|promote|merge|discardworks