feat(kb): hierarchical org Phase 2 — maintainer/dream migrate old→new — 0.23.1#12
Merged
Merged
Conversation
… — 0.23.1
Teaches the editing skills to USE + MAINTAIN the 0.23.0 structure (the "fix old
into new" capability), and fixes a validate false-positive surfaced while verifying
on the live KB:
- knowledge-maintainer Phase 3 gains a project-structure reconciliation step:
read project-registry.jsonl, run kb-project-backfill.sh for part_of trees, and
for unlabeled pages get a reproducible suggestion from new kb-project-suggest.sh
(plurality of edge-neighbours' project: facets). Additive assign + log; re-parent
stages; closed vocabulary; never tags generated projects/themes pages.
- dream-runner + dream SKILL.md are surface-only: they know project MOCs exist +
are excluded from clustering input, and surface ungrouped-project suggestions for
the maintainer (never assign on the live path).
- knowledge-validate broken-link check splits [[target|alias]] before resolving
(was a false-positive on every valid aliased link — same alias rule as the 0.22.4
graph-migrate fix). MCP server -> 2.4.1.
New guards: kb-project-suggest test, kb-skill-awareness test, validate alias-split
test. Version 0.23.0 -> 0.23.1 lockstep + migration row. Full suite green (63 shell
+ 291 vitest).
Verified end-to-end on the LIVE KB: seeded registry (kiri-redesign->kiri), backfill
tagged the 14-member kiri tree, assigned cainish-bridge (3, no part_of), reindex
projected wiki/projects/{kiri,cainish-bridge}.md + the de-hubbed two-tier index;
drained 7 dangling/junk migration:v1 edges; validate now reports 0 issues.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR advances the KB hierarchical organization work by adding “Phase 2” maintainer/dream awareness + reconciliation tooling, plus a validation fix for aliased wiki links. It introduces a deterministic project: suggestion helper, updates maintainer/dream guidance to keep “dream” surface-only for live project: assignment, and bumps plugin/MCP versions.
Changes:
- Add
kb-project-suggest.sh(plurality vote over neighbors’project:facets) and new shell guards to lock in maintainer/dream awareness. - Fix
knowledge-validatebroken-link false positives by resolving[[target|alias]]totarget. - Bump plugin version to
0.23.1and MCP server version to2.4.1(plus rebuilt dist artifacts).
Reviewed changes
Copilot reviewed 13 out of 22 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test-kb-skill-awareness.sh | New guard ensuring maintainer/dream docs retain project/MOC awareness + dream “surface-only” prohibition. |
| tests/test-kb-project-suggest.sh | New integration test for deterministic plurality output (and empty output on no-signal). |
| skills/upgrade/SKILL.md | Adds the 0.23.1 migration registry entry documenting Phase 2 behavior. |
| skills/dream/SKILL.md | Documents project MOCs and explicitly forbids live project: assignment by dream. |
| scripts/kb-project-suggest.sh | New deterministic helper to suggest project: based on edge-neighbor plurality. |
| scripts/kb-project-backfill.sh | Updates knowledge-dir fallback to include KNOWLEDGE_DIR. |
| mcp/src/tools/knowledge-validate.ts | Splits rawRef on ` |
| mcp/src/tools/knowledge-validate.test.ts | Adds regression test for [[target|alias]] not being flagged broken. |
| mcp/src/server.ts | Bumps MCP server version string to 2.4.1. |
| mcp/dist/tools/knowledge-validate.test.js.map | Rebuilt dist sourcemap reflecting the new validate test. |
| mcp/dist/tools/knowledge-validate.test.js | Rebuilt dist test JS reflecting the new validate test. |
| mcp/dist/tools/knowledge-validate.js.map | Rebuilt dist sourcemap reflecting alias-split logic. |
| mcp/dist/tools/knowledge-validate.js | Rebuilt dist JS reflecting alias-split logic. |
| mcp/dist/tools/knowledge-validate.d.ts.map | Rebuilt dist d.ts sourcemap. |
| mcp/dist/tools/knowledge-validate.bundle.js | Rebuilt bundle reflecting alias-split logic. |
| mcp/dist/tools/knowledge-reindex.bundle.js | Rebuilt bundle (includes embedded validate logic). |
| mcp/dist/server.js | Rebuilt dist server JS version bump. |
| mcp/dist/server.bundle.js | Rebuilt dist server bundle version bump. |
| agents/knowledge-maintainer.md | Adds project reconciliation/backfill/suggest responsibilities + budget priority update. |
| agents/dream-runner.md | Adds project MOC awareness + explicit “surface-only” guidance for live project:. |
| .claude-plugin/plugin.json | Plugin version bump to 0.23.1. |
| .claude-plugin/marketplace.json | Marketplace version bump to 0.23.1. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+10
to
+16
| while [ $# -gt 0 ]; do | ||
| case "$1" in | ||
| --knowledge-dir) KDIR="${2:-}"; shift 2 ;; | ||
| --slug) SLUG="${2:-}"; shift 2 ;; | ||
| *) shift ;; | ||
| esac | ||
| done |
Comment on lines
+24
to
+26
| NBRS=$(jq -rn --arg s "$SLUG" 'reduce inputs as $r ({}; .[([$r.from,$r.type,$r.to]|tojson)]=$r) | [.[]] | ||
| | map(select(.valid_to==null and (.from==$s or .to==$s))) | ||
| | .[] | (if .from==$s then .to else .from end)' < "$EDGES" 2>/dev/null | sort -u) |
Comment on lines
+29
to
+32
| proj_of() { # <slug> → its project: facet (empty if none) | ||
| local f; f=$(find "$WIKI" -name "$1.md" -type f ! -name 'index.md' 2>/dev/null | sort | head -1) | ||
| [ -n "$f" ] || return 0 | ||
| awk -F': *' '/^project:/ { gsub(/["[:space:]]/,"",$2); print $2; exit }' "$f" |
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.
Why
Phase 1 (0.23.0) gave the projection machinery; this teaches the editing skills to use + maintain it — the "fix old→new" capability — and was verified end-to-end on the live KB.
What
project-registry.jsonl, runkb-project-backfill.shforpart_oftrees (deterministic), and for unlabeled pages get a reproducible suggestion from newkb-project-suggest.sh(plurality of edge-neighbours'project:facets). Additive assign + log; re-parent stages; closed vocabulary; never tags generatedprojects//themes/pages. Budget-priority guard updated to rank it below the conflict drain.project:on the live path (test-guarded).[[target|alias]]before resolving (was a false-positive on every valid aliased link — same alias rule as the 0.22.4 graph-migrate fix). MCP server → 2.4.1.Verified on the LIVE KB
Seeded registry (
kiri-redesign→kiri) → backfill tagged the 14-memberkiritree → assignedcainish-bridge(3, nopart_of) → reindex projectedwiki/projects/{kiri,cainish-bridge}.md+ the de-hubbed two-tier index → drained 7 dangling/junkmigration:v1edges → validate reports 0 issues.Release-gate review
Unit + history lenses, 0 false positives. Fixed: budget-guard (4 jobs, project ranks below conflict-drain),
KNOWLEDGE_DIRfallback in both helpers, surface-only test now asserts the real "does not assign on the live path" prohibition. New guards:test-kb-project-suggest.sh,test-kb-skill-awareness.sh, validate alias-split test.Verification
Full suite green (63 shell + 291 vitest, 0 fail); lockstep 0.23.1 / MCP 2.4.1; validate + migration-row gates; pre-push hook green.
🤖 Generated with Claude Code