| name | wiki-rebuild |
| description | Regenerate Deep Wiki derived catalogs from page frontmatter with one token-owned journaled transaction and a rebuild lifecycle record. Use for /wiki-rebuild, stale catalog repair, or wiki reindexing. |
| user-invocable | true |
| runtime_hosts | ["claude","codex"] |
wiki-rebuild
Pages and provenance are authoritative; catalogs are derived. Rebuild all
derived artifacts with one transaction so no caller can expose a new catalog
without its matching lifecycle record.
Procedure
Acquire one owner token.
{"executable":"node","argv":["<plugin_root>/scripts/wiki-runtime.js","lock","acquire","--wiki-root","ABSOLUTE_WIKI_ROOT","--operation","rebuild","--json"]}
Create one manifest with a stable operation_id. The state engine scans page
frontmatter, refreshes both human and machine derived artifacts, versions any
replaced content, and records one wiki-wide action in the same journal.
{"operation":"rebuild","operation_id":"01JZ7P9Q6MD7S5PB8H4Y40HJ84","pages":[],"sources":[],"events":[{"event_id":"01JZ7P9Q6MD7S5PB8H4Y40HJ85","ts":"2026-07-11T00:00:00Z","action":"rebuild","source":null,"pages_created":[],"pages_updated":[]}],"refresh_index":true,"promote_pending_scan":null}
Submit that manifest exactly once.
{"executable":"node","argv":["<plugin_root>/scripts/wiki-runtime.js","commit","--wiki-root","ABSOLUTE_WIKI_ROOT","--lock-token","LOCK_TOKEN","--manifest-file","ABSOLUTE_MANIFEST_FILE","--json"]}
On interruption, inspect the owner and recover the same journaled operation;
never manufacture a second operation identifier.
{"executable":"node","argv":["<plugin_root>/scripts/wiki-runtime.js","lock","status","--wiki-root","ABSOLUTE_WIKI_ROOT","--json"]}
{"executable":"node","argv":["<plugin_root>/scripts/wiki-runtime.js","transaction","recover","--wiki-root","ABSOLUTE_WIKI_ROOT","--lock-token","LOCK_TOKEN","--operation-id","01JZ7P9Q6MD7S5PB8H4Y40HJ84","--json"]}
After terminal success, run read-only diagnostics. Any repair remains a
separate explicit /wiki-lint --fix request.
{"executable":"node","argv":["<plugin_root>/scripts/wiki-runtime.js","lint","inspect","--wiki-root","ABSOLUTE_WIKI_ROOT","--json"]}
Release in a guaranteed final step with the matching token.
{"executable":"node","argv":["<plugin_root>/scripts/wiki-runtime.js","lock","release","--wiki-root","ABSOLUTE_WIKI_ROOT","--token","LOCK_TOKEN","--json"]}