Skip to content

Commit 4c18a21

Browse files
committed
Prepare librarian schema migration release
1 parent abe2f87 commit 4c18a21

18 files changed

Lines changed: 400 additions & 22 deletions

File tree

.claude-plugin/marketplace.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://anthropic.com/claude-code/marketplace.schema.json",
33
"name": "llm-wiki",
4-
"version": "0.10.2",
4+
"version": "0.13.0",
55
"description": "LLM-compiled knowledge base plugin. Natural language routing, collector catalogs, topic archive lifecycle, inventory tracking, dataset manifests, collection ingestion for external wikis/spec repos, truth-seeking audits, session resume, concurrent-safe indexes, topic-isolated wikis, parallel multi-agent research, thesis mode (--mode thesis), repo assessment, Obsidian dual-linking, lint-as-migration, retardmax mode, and --min-time sustained research.",
66
"owner": {
77
"name": "nvk"
@@ -10,7 +10,7 @@
1010
{
1111
"name": "wiki",
1212
"description": "LLM-compiled knowledge base. Commands: /wiki (natural language router + init/status), /wiki:ingest, /wiki:ingest-collection, /wiki:collect, /wiki:inventory, /wiki:dataset, /wiki:archive, /wiki:compile, /wiki:query (quick/standard/deep/--resume), /wiki:research (5-10 parallel agents, --new-topic, --min-time, --mode thesis), /wiki:audit, /wiki:librarian, /wiki:assess, /wiki:plan, /wiki:lint, /wiki:output, /wiki:retract, /wiki:project.",
13-
"version": "0.10.2",
13+
"version": "0.13.0",
1414
"author": {
1515
"name": "nvk"
1616
},

.claude/release-checklist.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Standard process for testing and shipping a new version of the llm-wiki plugin.
1919
```
2020

2121
1. **Bump `plugin.json`** — both files must match:
22+
- `.claude-plugin/marketplace.json`
2223
- `claude-plugin/.claude-plugin/plugin.json`
2324
- `plugins/llm-wiki/.codex-plugin/plugin.json`
2425

@@ -29,6 +30,7 @@ Standard process for testing and shipping a new version of the llm-wiki plugin.
2930
./scripts/sync-codex-plugin.sh
3031
./scripts/sync-opencode-plugin.sh
3132
./tests/test-plugin-validate.sh
33+
./tests/test-docs-consistency.sh
3234
./tests/test-structure.sh
3335
./tests/test-local-cli-lint.sh
3436
./tests/test-codex-sync.sh

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# Codex local/project-local state
66
.codex/
77
.tmp/
8+
__pycache__/
89

910
# macOS
1011
.DS_Store

AGENTS.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,11 @@ All content lives here. One topic per wiki. Isolated indexes, focused queries.
5454
```
5555
~/wiki/topics/<name>/
5656
├── .obsidian/ # Obsidian vault config (optional)
57-
├── .librarian/ # Optional: wiki-only maintenance reports
57+
├── .librarian/ # Optional: maintenance reports + derived caches
5858
├── .audit/ # Optional: umbrella audit reports
5959
├── _index.md # Master index: stats, navigation, recent changes
6060
├── config.md # Title, scope, conventions
61+
├── schema.md # Optional: topic-local vocabulary/conventions
6162
├── log.md # Activity log for this topic
6263
├── inbox/ # Drop zone — user dumps files here
6364
│ └── .processed/
@@ -735,18 +736,28 @@ content.
735736

736737
### Librarian
737738

738-
Content-level wiki maintenance: staleness detection, quality scoring, factual verification, semantic coherence, deduplication. Produces scored reports — never modifies content without confirmation. Archived topics are skipped by default.
739+
Content-level wiki maintenance: staleness detection, quality scoring, factual
740+
verification, semantic coherence, deduplication, and proposal-only topic schema
741+
advice. Produces scored reports — never modifies content without confirmation.
742+
Archived topics are skipped by default.
739743

740744
**Subcommands**:
741-
- **scan**: Score all wiki articles for staleness and quality. Two-tier: quick metadata scan first, deep content read only for articles below threshold or with `volatility: hot`. Checkpoints after each article for crash recovery. Results to `.librarian/scan-results.json` and `.librarian/REPORT.md`.
745+
- **scan**: Score all wiki articles for staleness and quality. Two-tier: quick metadata scan first, deep content read only for articles below threshold or with `volatility: hot`. Checkpoints after each article for crash recovery. Results to `.librarian/scan-results.json` and `.librarian/REPORT.md`. Optional `--passes schema` may write `output/schema-proposal-<topic>-YYYY-MM-DD.md`; it must not create/update `schema.md` without explicit acceptance.
742746
- **report**: Display the latest scan report.
743747
- **fix <id>**: Apply a proposed fix from the report (Phase 3 — not yet implemented).
744748

745749
**Staleness scoring** (0-100): four dimensions at 25 points each — source freshness, verification recency, compilation recency, source chain integrity. Decay curves scaled by article `volatility` tier (hot/warm/cold).
746750

747751
**Quality scoring** (0-100): four dimensions at 25 points each — source diversity, content depth, cross-reference density, summary quality. Articles scoring below 40 on either dimension are flagged.
748752

749-
Flags: `--article <path>` (single article), `--resume` (from checkpoint), `--passes <list>` (staleness, quality — future: verification, coherence, dedup).
753+
Flags: `--article <path>` (single article), `--resume` (from checkpoint),
754+
`--passes <list>` (staleness, quality, optional schema — future:
755+
verification, coherence, dedup).
756+
757+
Schema migration for existing wikis is lazy and proposal-first. Existing wikis
758+
without `schema.md` remain valid and silent. Status/resume may show a one-line
759+
optional nudge for active wikis with roughly 10+ compiled articles and no
760+
recent schema proposal/report. Applying a schema proposal is explicit.
750761

751762
### Plan
752763

CLAUDE.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ git -C ~/.claude/plugins/marketplaces/llm-wiki remote set-url origin https://git
3535

3636
```bash
3737
./tests/test-plugin-validate.sh # plugin manifest + command frontmatter
38+
./tests/test-docs-consistency.sh # README command table + manifest/version drift
3839
./tests/test-structure.sh # wiki fixture validation (84 assertions)
3940
./tests/test-local-cli-lint.sh # local scripts/llm-wiki lint helper
4041
./tests/test-session-capture.sh # deterministic session capture helper
@@ -71,6 +72,7 @@ Requires `ANTHROPIC_API_KEY`. Costs ~$2-5 per run.
7172
- **Added a new lint rule**: add a defect fixture in `generate-defect-fixtures.sh` and a negative test case in `test-structure.sh`.
7273
- **Changed frontmatter schema** (new required field, renamed enum): update the golden wiki fixture files to match, update `test-structure.sh` field/enum lists, regenerate defect fixtures.
7374
- **Added a new command**: add a frontmatter check to `test-plugin-validate.sh` if it's not picked up by the wildcard. Add a behavioral eval in `promptfooconfig.yaml` for routing.
75+
- **Changed user-facing command docs or versions**: update README command rows and all plugin/marketplace manifest versions together, then run `test-docs-consistency.sh`.
7476
- **Changed the fuzzy router**: add or update test cases in `promptfooconfig.yaml` covering the new routing behavior plus negative controls.
7577
- **Added a new reference file**: `test-plugin-validate.sh` has three `for ref in ...` loops (Claude-side existence, Codex-side copied-reference validation, OpenCode-side symlink reachability) — add the new filename to all three.
7678
- **Changed directory structure** (new `raw/` or `wiki/` subdirectory): update `test-structure.sh` C1 directory list and C11 placement checks. Update the golden wiki fixture if needed.

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ LLM-compiled knowledge bases for any AI agent. Parallel multi-agent research, co
1919

2020
## Changelog
2121

22+
**v0.13.0****Librarian schema migration groundwork.**
23+
- Adds deterministic docs/version consistency checks so command tables, manifests, generated mirrors, and reference lists do not drift silently.
24+
- Stabilizes local lint fixtures with a deterministic test date override.
25+
- Documents the next-run librarian schema migration nudge for existing wikis: report/proposal first, explicit `schema.md` apply later.
26+
- Clarifies the optional index/server layer as a read-only, rebuildable acceleration cache rather than source-of-truth state.
27+
2228
**v0.12.0****Feedback curator.**
2329
- Captures high-signal user corrections, preferences, approvals, and plan acceptance as redacted candidates under `HUB/.sessions/feedback/`.
2430
- Ignores generic acknowledgements like `ok`, `thanks`, and `cool`.
@@ -466,9 +472,14 @@ folder move plus `wikis.json`, hub index, and log updates.
466472
| `/wiki:audit report` | Display the latest umbrella audit report |
467473
| `/wiki:librarian` | Focused wiki maintenance: staleness and quality scan for the `wiki/` layer |
468474
| `/wiki:librarian --article <path>` | Scan a single article |
475+
| `/wiki:librarian scan --passes staleness,quality,schema` | Optionally generate a schema proposal for established wikis without changing articles |
469476
| `/wiki:librarian report` | Display the latest librarian scan report |
477+
| `/wiki:refresh [<article-path>|--due]` | Re-check article sources for changed facts and offer human-gated updates |
470478
| `/wiki:output <type>` | Generate: summary, report, study-guide, slides, timeline, glossary, comparison |
471479
| `/wiki:output <type> --retardmax` | Ship it now — rough but comprehensive, iterate later |
480+
| `/wiki:project new <slug> "goal"` | Group related outputs under `output/projects/<slug>/` with a plain `WHY.md` rationale |
481+
| `/wiki:project list\|show\|add\|archive` | Manage output project folders without duplicating project state into frontmatter |
482+
| `/wiki:retract <source-path> --reason "why"` | Remove a bad source, map blast radius, and flag downstream claims for review |
472483
| `/wiki:ll` | Extract lessons learned from the current session into the wiki |
473484
| `/wiki:ll --dry-run` | Preview extracted lessons without writing |
474485
| `/wiki:ll --rules` | Also suggest CLAUDE.md / AGENTS.md rule additions |

claude-plugin/.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "wiki",
33
"description": "LLM-compiled knowledge base. Natural language routing, collector catalogs, topic archive lifecycle, inventory tracking, dataset manifests, collection ingestion for external wikis/spec repos, truth-seeking audits, session resume, automated session capture, feedback curation, context rehydration, concurrent-safe derived indexes, topic-isolated wikis, parallel multi-agent research, thesis-driven investigation, repo assessment, Obsidian dual-linking, retardmax mode, and --min-time sustained research.",
4-
"version": "0.12.0",
4+
"version": "0.13.0",
55
"author": {
66
"name": "nvk"
77
},

claude-plugin/commands/librarian.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ Flags (apply to `scan`):
3535

3636
- **--article <path>**: Scan only this article instead of the full wiki. Path relative to wiki root (e.g., `wiki/concepts/librarian-agent.md`).
3737
- **--resume**: Explicitly resume from checkpoint. Also happens automatically if `checkpoint.json` exists.
38-
- **--passes <list>**: Comma-separated list of passes to run. Default: `staleness,quality`. Future: `verification,coherence,dedup`.
38+
- **--passes <list>**: Comma-separated list of passes to run. Default:
39+
`staleness,quality`. Optional: `schema` for a proposal-only topic schema
40+
migration pass. Future: `verification,coherence,dedup`.
3941
- **--wiki <name|all>**: Target a specific topic wiki, or every registered topic wiki sequentially.
4042
- **--local**: Use project-local `.wiki/`.
4143
- **--include-archived**: Explicitly include archived topic wikis. Archived
@@ -125,6 +127,31 @@ After all articles are scored:
125127
5. For articles the user selects to refresh: invoke the refresh protocol from `commands/refresh.md` for that article.
126128
6. For articles the user selects to verify: update `verified:` to today in the article's frontmatter.
127129

130+
#### 3b. Optional Schema Advisory Pass
131+
132+
Run only when `schema` is included in `--passes`.
133+
134+
1. Check whether `<wiki-root>/schema.md` exists. If it exists, treat the schema
135+
as advisory unless it explicitly declares a stricter mode.
136+
2. Derive observed topic vocabulary from existing markdown:
137+
- article titles, aliases, tags, and categories;
138+
- See Also links and markdown link neighborhoods;
139+
- raw source types, collection manifests, and source tags;
140+
- inventory kinds/entities/corpora and dataset manifests when present;
141+
- recurring output/project names and prefixes.
142+
3. If no schema exists and the wiki is small (roughly fewer than 10 compiled
143+
articles) with no obvious repeated category/link/source confusion, report
144+
`schema skipped: wiki too small` and do not write a proposal.
145+
4. If a schema would help, write
146+
`output/schema-proposal-<topic>-YYYY-MM-DD.md`. The proposal may recommend
147+
entity types, relationship verbs, article subtypes, source conventions, and
148+
inventory/dataset boundaries.
149+
5. Do **not** create or update `schema.md` during the scan. Applying a proposal
150+
is a separate explicit user decision.
151+
6. Add schema findings to `scan-results.json` and `REPORT.md` under a
152+
`Schema Advice` section, including whether the state is `absent`,
153+
`proposed`, `advisory`, or `strict`.
154+
128155
#### 4. Generate Reports
129156

130157
1. Compile all results from checkpoint into `scan-results.json` (format per `references/librarian.md`).

claude-plugin/commands/wiki.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,14 @@ Show wiki status. Before reading any `_index.md`, stale-check it: count `.md` fi
206206
- Read `config.md` for title and description
207207
- Count actual files for accuracy
208208
- Show: title, location, source/article/inventory/dataset/output counts, inbox pending, last compiled/lint dates, last 5 recent changes
209+
- If the topic is active, has roughly 10+ compiled articles, has no root
210+
`schema.md`, has no recent `output/schema-proposal-*.md`, and has no
211+
recent `.librarian/REPORT.md` already covering schema advice, show one
212+
optional next-run migration nudge:
213+
`Optional upgrade: this wiki is large enough to benefit from a librarian schema pass. It will only write a report/proposal, not change articles. Run: /wiki:librarian scan --passes staleness,quality,schema`
214+
- Do not block normal status/query/compile/ingest on this nudge. Do not
215+
auto-create `schema.md`, proposal outputs, or dismissal files from status.
216+
Suppress the nudge when a schema or recent schema proposal already exists.
209217
210218
3. List available subcommands
211219

claude-plugin/skills/wiki-manager/SKILL.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,16 @@ Flow: Read `_index.md` → identify relevant articles by summary/tag → read ar
179179
See [references/linting.md](references/linting.md).
180180
Flow: Check structure → indexes → links → content → coverage → report → optionally auto-fix. Default lint keeps active material healthy and reports archived topics as skipped. Use `--include-archived` or `--archived-only` for explicit archived structural maintenance.
181181

182+
### Librarian
183+
See [references/librarian.md](references/librarian.md).
184+
Flow: Scan the active topic's compiled `wiki/` layer → score staleness, quality,
185+
source-chain integrity, and link health → write `.librarian/scan-results.json`
186+
and `.librarian/REPORT.md` → recommend ranked next actions. Optional
187+
`--passes schema` may write a proposal output for a topic-local `schema.md`,
188+
but it must not create or modify `schema.md` without explicit user acceptance.
189+
Librarian is the article-health advisor; it does not replace lint's structural
190+
checks or audit's broader trust review.
191+
182192
### Audit
183193
See [references/audit.md](references/audit.md).
184194
Flow: Run or reuse the librarian pass → inspect artifact dependency chains across `output/`, `wiki/`, and `raw/` → escalate with fresh source checks and targeted research until trust verdicts converge → write `.audit/REPORT.md`.

0 commit comments

Comments
 (0)