{
  "title": "Wiki Sync",
  "story": [
    {
      "type": "markdown",
      "id": "c17471dc13b8d017",
      "text": "# Wiki Sync\n\n**Version** 1.0\n\nSync the agentprivacy canon into the federated guide wiki — guide.agentprivacy.ai plus sibling subdomain sites (skill / tomes / research / atlas), served locally as ~/.wiki farm hosts. Use when projecting a canon directory into forkable wiki pages, adding a new area to the federation, re-syncing a site after a repo change, wiring cross-site links, or auditing coverage and leaks. Encodes the distribution gates G0–G7, the manifest-first G1 discipline, the per-source builders, the verification recipes, and the full registry of every area to sync (done + gaps)."
    },
    {
      "type": "markdown",
      "id": "e0de83c5db7f3546",
      "text": "Project the agentprivacy canon (many git repos) into a **federated, forkable wiki**: a guide hub\n(`guide.agentprivacy.ai`) that rosters one sibling subdomain wiki per canon source. Built local-first as\n`~/.wiki/<host>/` farm hosts; going public is just forking the host up (or DNS-mapping the farm) —\n`localhost` → the agentprivacy domain, no structural change.\n\n**Golden rule:** the git repo is always the source of truth. The wiki is a *projection that carries lineage*.\n*The Librarian forks; the Archivist never copies.*\n\n## The model\n\n```\nguide.guide.agentprivacy.ai  ← the hub (build-guide-host.js): index · federation-map · distribution-gates · contribute\n   ├─ skill.guide.agentprivacy.ai     ← agentprivacy-skills-v5\n   ├─ tomes.guide.agentprivacy.ai     ← cityofmages/tomes\n   ├─ research.guide.agentprivacy.ai  ← agentprivacy-docs\n   ├─ atlas.guide.agentprivacy.ai     ← spellweb/src/data  (the graph — the hyperlink backbone)\n   └─ library.guide.agentprivacy.ai   ← agentprivacy_master/public  (the 5 narrative spellbooks)\n```\nServe all hosts: `\"$HOME/AppData/Roaming/npm/wiki\" --data ~/.wiki --port 3030 --farm`\n(use the ABSOLUTE wiki path — a bare `wiki` exits 127). Log: `~/.wiki/_farm.log`.\nEach host = `pages/<slug>` + `assets/<slug>/<file>` + `status/owner.json` (`{name:\"<owner>\",friend:{secret:\"<friend-secret — never commit the live value>\"}}`).\n\n## The area registry — everything to sync (NAME ALL AREAS HERE)\n\nStatus: ✅ done · ◻️ gap (public canon not yet federated) · 🔒 sealed (never federate) · ♻️ dup (never double-federate).\n\n| Area | Source path | → Site | Builder | Status |\n|---|---|---|---|---|\n| Skills | `agentprivacy-skills-v5/{persona,role,privacy-layer,meta,wikis}` | skill | `build-all.js` | ✅ 163 |\n| Tome acts + cast + specs + bestiary + invitations | `cityofmages/tomes/` | tomes | `build-tomes.js` | ✅ 121 |\n| Conjecture register + v6 papers | `agentprivacy-docs/research/CONJECTURE_REGISTER_V6.md` + `papers/v6/*` | research | `build-research.js` | ✅ 94 |\n| Knowledge graph (nodes+edges) | `spellweb/src/data/{nodes,edges}.ts` | atlas | `build-atlas.js` | ✅ ~660 |\n| The hub (index/map/gates/contribute) | — | guide | `build-guide-host.js` | ✅ |\n| Ceremonies | `agentprivacy-docs/ceremonies/` | research | `build-research.js` (buildDocs) | ✅ 14 |\n| Compendium | `agentprivacy-docs/compendium/_assembled/` | research | `build-research.js` (buildDocs) | ✅ 2 (PLAN.md sealed) |\n| Reference | `agentprivacy-docs/reference/` | research | `build-research.js` (buildDocs) | ✅ 10 |\n| Lineage + whitepaper papers | `agentprivacy-docs/papers/{lineage,v4,v5,whitepapers}` | research | `build-research.js` (buildDocs) | ✅ 11 |\n| Grimoire prose | `agentprivacy-docs/grimoires/` | research | `build-research.js` (buildDocs) | ✅ 4 |\n| City blog + letters + lore | `cityofmages/{blog,mageletters}` + top-level public `.md` | tomes | `build-tomes.js` (buildDocsFrom CITY) | ✅ blog 13 · letters 6 · lore 7 |\n| Blockchain canon + blade prose | `spellweb/dist/canon/` + root `*-blade.md` | atlas | `build-atlas.js` (buildCanon) | ✅ canon 25 · blades 5 |\n| Architecture guides | `agentprivacy_master/docs/guides/` | guide | `build-guide-host.js` | ✅ 9 (chronicles/plans/dupes sealed) |\n| Docs deep pass — poems · specs · story-frame · research notes · about | `agentprivacy-docs/{poems,specs,story,research/*.md,*.md}` | research | `build-research.js` (buildDocs) | ✅ poems 3 · specs 7 · story 2 · notes 18 · about 3 (story/acts ♻️=ceremonies, drafts/eml/letters/chronicle sealed) |\n| Blog | `agentprivacy-docs/blog/` | research | `build-research.js` (forward-link summary) | ✅ 1 summary page — **forward-links to live `sync.soulbis.com`, NOT reproduced** |\n| **Narrative spellbooks** — Story · Parallel Society · Plurality · Zero (Privacymage Grimoire) · Canon | `agentprivacy_master/public/{story,society,plurality,zero,canon}` | **library** (NEW 6th site) | `build-library.js` | ✅ 146 (story 34 · society 22 · plurality 38 · zero 33 · canon 14 + 5 hubs + index; Planning_Document sealed) |\n| **Dual-agent harness** — core (loop·trusts·ground rules·contract) + 7 seats + specialisation + 15 harness paths (the origin fleet) + workflows/runtimes + field-guide spar | `~/dual-agent-harness` | **harness** (NEW site) | `build-harness.js` | ✅ (chronicles/ · universe/ · runs/ · instance ledgers 🔒 — numbers cited from frontier.json, never paged) |\n| **DTG research KB** — decision baseline (§-split) + explorations (now incl. X10 + X11 field-guide deployment) + lab NOTES + 2 chronicles | `~/dtgwg-cred-spec-main_mage` via its own `tools/build-kb.mjs` (manifest-first + secrets gate; emits `kb/fedwiki/`) | **dtg** (NEW site) | `node tools/build-kb.mjs` then **`wire-dtg-kb.js`** (wires slug = slugify(title); retires manifest-slug basename copies to recycle — 15 differ, incl. x11) | ✅ 92 = 78 kb + 13 trust-tasks + welcome (vendored spec 58 files NEVER projected; 2 chronicle slugs = manifested circulating, leak-scan false positives) |\n| **MyTerms bundle** — alliance application (exec brief + application + A/C/D/E letter docs) + IEEE 7012 integration plan v2 + universe card + standards presentation brief + The Two Familiars (extensions at low altitude) | `~/myterms` (docs directly; `/swordsman` `/mage` `/swordsman-blade` `/mages-spell` = EXPERIMENTS, reference-only) | **myterms** (site: \"The Agreement Layer\" 📜 #86a9c9) | `build-myterms.js` (+ `myterms-crosslinks.json` outbound refs, `link-myterms.js` inbound post-pass — re-run after any host rebuild) | ✅ 11 (SEALED: IEEE 7012-2025 PDF — copyright + no-AI-ingest; chronicles; `harness/` ♻️ = harness site; superseded v1 plan; stale Feb PDF renders) |\n| **Field Guide trust overlay** — 22 pages (counter-spec rulings · question map · acceptance · proverbs · 2 dated chronicles = manifested circulating) + assets lane (whole workbench + runnable bundle) | `~/field_guide_privacymage/wiki/{pages,assets-staging}` — WORKING DIR by ruling (git-less; durable substance folded to `agentprivacy-docs/research/fieldguide/` — docs+maps+runtimes; built on the Mac farm as `privacy.fieldguide.guide.agentprivacy.ai`; also served from embassy Pis as `mitch.private.fish` / `fieldguide.pi4.private.fish`) | **fieldguide** (site: \"The Field Guide\" 🧭 #4a8c5f) | pages byte-copied (fork lineage kept) + local `welcome-visitors`; see `~/field_guide_privacymage/wiki/push-to-pi.mjs` for the Pi lane | ✅ 23 (2026-08-17 convergence merge) |\n| Chronicles / plans / drafts / audits / version-history / `.bak` / `node_modules` / `dist/` artifacts | (everywhere) | — | — | 🔒 |\n| Tome mirrors | `agentprivacy-docs/tomes/` (80) · `agentprivacy_master/docs/tomes/` (164) | — | — | ♻️ = cityofmages/tomes |\n\nWhen adding an area: append a row here first, then build it. **Naming a thing in this table is step zero of syncing it.**\n\n## The distribution gates (G0–G7)\n\nOut (git → wiki): **G0** source-of-truth (git upstream) · **G1** classify circulating vs sealed · **G2** coherence\n(numbers/tiers/versions match register+grimoire) · **G3** attribution (`upstream`/author/license; vendored credited)\n· **G4** projection altitude (link down to source, don't dump) · **G5** hyperlink coherence (links resolve; from the\ngraph edges) · **G6** distribution topology (right site, canonical slugs, no collisions).\nBack (wiki → git): **G7** fork-back — coherence + attribution + First-Person sign-off (OPEN→SIGNED); propose a diff,\nnever auto-commit.\n\n## The process (per area — the 8-step loop)\n\n1. **Manifest (G1) — NON-OPTIONAL.** Enumerate the source dir; mark every file `circulating` or `sealed`. The\n   leak and the gaps both came from skipping this. Default-seal chronicles/plans/drafts/audits/version-history.\n2. **Map.** Slug + title per file; resolve cross-links (intra-site `[[ ]]`, cross-site `reference` items).\n3. **⊥check map.** Adversarially verify classification + coherence against the repo + grimoire/register.\n4. **Generate.** Run the converter → page JSONs + staged `assets/<slug>/<sourcefile>`.\n5. **Hyperlink.** Inject nav footer + hub rosters + cross-links.\n6. **⊥check build.** Slug-collision + link-integrity + orphan sweep (script below) BEFORE serving.\n7. **Serve.** Write into `~/.wiki/<host>/`; the farm rebuilds the sitemap on next request.\n8. **⊥check live.** Read the live wiki; confirm sitemap count, assets `200 text/markdown`, links resolve, and\n   **no sealed slug leaked** (leak-scan below). For structured data (register, graph) a deterministic re-parse\n   beats an agent; for prose/lore use an Explore agent to map live↔repo. SIGN (chronicle) only when clean.\n\n## Conventions (do these every time)\n\n- **slug = `slugify(title)`** (`t.replace(/\\s/g,'-').replace(/[^A-Za-z0-9-]/g,'').replace(/-+/g,'-').toLowerCase()`),\n  and choose **unique, readable, self-namespacing titles** so roster/footer `[[title]]` links always resolve.\n- **THE BIJECTION RULE (2026-08-03 ruling, after a fedwiki.club bug report)**: the page's stored slug MUST equal\n  FedWiki's own `asSlug(title)` = `t.replace(/\\s/g,'-').replace(/[^A-Za-z0-9-]/g,'').toLowerCase()` — downstream\n  code (share links, `<slug>.html` static export, forks) assumes title↔slug map to each other. Consequences:\n  **titles must be ASCII-clean** (no emoji — `\"Archer 🗡️🎯\"` slugs to `archer-` with a trailing dash; put emoji in\n  the story-card heading instead), no title-vs-filename divergence (`agentprivacy-guild-efficiency` file with\n  title \"Guild Efficiency\" broke fedwiki.club link-gen). `build-all.js` now has a **bijection lint** that fails\n  the build on any violation — never push pages that fail it. Rename map for the 2026-08-03 mass fix:\n  `~/.wiki/skill-fedwiki/rename-map.json`; club repair script: `club-fix.js`.\n- **Cross-site links** = a FedWiki `reference` item `{type:'reference', site:'<host>', slug, title, text}` — NOT a\n  bare `[[ ]]` (those resolve same-site only). Add a cross-site ref ONLY if the target page already exists.\n- **Neutralise source-body `[[ ]]`** before converting — canon prose (RPP gates etc.) uses `[[ ]]` as content; it\n  collides with wikilinks. Strip to plain text, then add your own links.\n- **Assets** keep the original source filename (`assets/<slug>/01-the-single-button.md`), not `<slug>.md`.\n- Attach each page's source file as a `# Assets` heading + `{type:'assets', text:slug}` item.\n\n## Tooling (`~/.wiki/skill-fedwiki/`)\n\n- `skill-to-fedwiki.js` — `buildPage({srcPath,slug,title,navText,assetsSlug})` module + frontmatter/section split.\n- `build-all.js` (skills) · `build-tomes.js` · `build-research.js` · `build-atlas.js` — per-source orchestrators.\n- `build-local-host.js <host>` — materialize staged pages+assets into a farm host.\n- `build-guide-host.js` — the hub; flip a site's `SITES[].status` to `LIVE` + re-run to roster it (and emit its\n  cross-site `tileglyph` tile + `reference`).\n- `link-tomes-research.js` — idempotent post-pass wiring act↔conjecture cross-site links (re-run after a rebuild).\n- `add-family.js` — idempotent post-pass binding all hosts into a **family**: injects a `roster` item (categories\n  Hub=guide · Sister sites=the four) into every welcome-visitors, so each site rosters its sisters and can pull\n  the whole family into the neighbourhood. Re-run after a rebuild (welcome-visitors is regenerated).\n- `log.js <op> <detail>` — append a greppable entry to `log.md` (`## [date] op | detail`; the LLM-Wiki log).\n- `file-answer.js \"<title>\" [content.md]` — **file a good answer back** into the wiki as a synthesis note\n  (`notes/<slug>.md` + a `log.js note` entry) so explorations compound (the LLM-Wiki \"answers filed back\" op).\n- `build-guide-extras.js` — idempotent post-pass: publish `log.md` → **Federation Log**, `notes/*.md` → **The\n  Notes**, and `AUDIT.md` → **Federation Audit** on the guide, + a Log & Notes section on welcome-visitors.\n- `audit.js` — the **lint** op: reads every host → page counts · broken links · leak-scan · orphans · cross-site\n  refs → writes `AUDIT.md` + a `lint` log entry + a PASS/WARN table. Reads only. (Non-zero broken/leaks are\n  usually benign in-content `[[ ]]` examples or false-positive candidates — the report says so; confirm before acting.)\n- **`resync.js [area...]`** — **one-command auto-sync for a research turn.** Runs forkback (report contributions\n  first) → the chosen area builders (default: all) → `link-tomes-research` → `add-family` → `audit` →\n  `build-guide-extras`. A research turn that touched only research = `node resync.js research`. Full re-sync = `node resync.js`.\n  **This is the run order; resync.js encodes it.**\n- `make-favicon.js` — per-host colour-identity favicon flag.\n- `forkback.js <host>` — the **G7 gate**: detect external contributions (current story diverges from the `create`\n  journal snapshot, or post-create journal actions exist) and print each as an `[OPEN]` proposal for First-Person\n  sign-off. **Reads only — never writes to git or the wiki.** Run before re-building a host (a rebuild overwrites\n  contributions); fold signed changes into the source repo by hand (page→repo is a lossy projection).\n- `push.js` / `push-assets.js` — public push (action API / WebDAV) — **parked**; user pushes to the domain manually.\n\n### Verify recipes\n```bash\n# sitemap count for a host\ncurl -s -H \"Host: <host>.localhost\" http://localhost/system/sitemap.json | grep -o '\"slug\"' | wc -l\n# link integrity (run in ~/.wiki/<host>): 0 broken expected (in-content example [[ ]] are benign)\nnode -e 'const fs=require(\"fs\");const S=t=>t.replace(/\\s/g,\"-\").replace(/[^A-Za-z0-9-]/g,\"\").replace(/-+/g,\"-\").replace(/^-|-$/g,\"\").toLowerCase();const F=fs.readdirSync(\"pages\"),X=new Set(F);let b=0;for(const f of F){const p=JSON.parse(fs.readFileSync(\"pages/\"+f));for(const it of p.story){if(it.type===\"reference\")continue;for(const m of (it.text||\"\").matchAll(/\\[\\[([^\\]]+)\\]\\]/g))if(!X.has(S(m[1])))b++;}}console.log(\"broken:\",b)'\n# leak scan — sealed content that slipped in (verify hits are false positives like a Chronicler persona)\ncurl -s -H \"Host: <host>.localhost\" http://localhost/system/sitemap.json | grep -oE '\"slug\":\"[^\"]+\"' | grep -iE \"chronicle|draft|plan|audit|candidate|presync|\\.bak\"\n```\n\n## Gotchas (learned the hard way)\n\n- **Manifest-first or it bites you**: firehosing a whole repo/graph leaks internal nodes (3 chronicle nodes rode\n  the spellweb graph into atlas — now sealed by `type:chronicle`/`label:/^Chronicle/`). Spine-only passes\n  under-federate (research got 6 of ~100 docs).\n- `dist/spellweb/nodes.json` is a **stale 16-node artifact** — parse `src/data/*.ts`.\n- Cast `sigil` may carry a parenthetical note — take the glyph only, or slugs break.\n- Leak-scan false positives: `chronicler` (the persona), `spec-vertex-naming-audit` (canonical spec), \"plan\"\n  inside \"plane\". Always confirm a hit is real before sealing.\n- Browser extension is offline here — **tileglyph tiles / favicon flags can't be visually verified**; check the\n  item JSON, not the render.\n\n**Verify:** [agentprivacy.ai](https://agentprivacy.ai) · plan `~/.claude/plans/moonlit-stirring-lagoon.md` ·\ncoverage audit `agentprivacy_master/docs/chronicles/2026-06-27_federation_coverage_audit.md`"
    },
    {
      "type": "markdown",
      "id": "d95be638d5176bbc",
      "text": "## Provenance\nForkable skill page migrated from the agentprivacy skills repo (`persona/agentprivacy-wiki-sync`, v1.0).\nSource of truth: `agentprivacy-skills-v5`. Fork this page to materialize a local `SKILL.md` via `fedwiki-to-skill`.\n\n*origin: 0xagentprivacy · author: Mitchell Travers*"
    },
    {
      "type": "markdown",
      "id": "dc7f634ae6c84790",
      "text": "# Assets"
    },
    {
      "type": "assets",
      "id": "864dd393c57e0c7a",
      "text": "wiki-sync"
    },
    {
      "type": "markdown",
      "id": "2fcac3c4c22095fb",
      "text": "## Navigation\n\n← [[Welcome Visitors]] · [[The Wikis]]"
    }
  ],
  "journal": [
    {
      "type": "create",
      "item": {
        "title": "Wiki Sync",
        "story": [
          {
            "type": "markdown",
            "id": "c17471dc13b8d017",
            "text": "# Wiki Sync\n\n**Version** 1.0\n\nSync the agentprivacy canon into the federated guide wiki — guide.agentprivacy.ai plus sibling subdomain sites (skill / tomes / research / atlas), served locally as ~/.wiki farm hosts. Use when projecting a canon directory into forkable wiki pages, adding a new area to the federation, re-syncing a site after a repo change, wiring cross-site links, or auditing coverage and leaks. Encodes the distribution gates G0–G7, the manifest-first G1 discipline, the per-source builders, the verification recipes, and the full registry of every area to sync (done + gaps)."
          },
          {
            "type": "markdown",
            "id": "e0de83c5db7f3546",
            "text": "Project the agentprivacy canon (many git repos) into a **federated, forkable wiki**: a guide hub\n(`guide.agentprivacy.ai`) that rosters one sibling subdomain wiki per canon source. Built local-first as\n`~/.wiki/<host>/` farm hosts; going public is just forking the host up (or DNS-mapping the farm) —\n`localhost` → the agentprivacy domain, no structural change.\n\n**Golden rule:** the git repo is always the source of truth. The wiki is a *projection that carries lineage*.\n*The Librarian forks; the Archivist never copies.*\n\n## The model\n\n```\nguide.guide.agentprivacy.ai  ← the hub (build-guide-host.js): index · federation-map · distribution-gates · contribute\n   ├─ skill.guide.agentprivacy.ai     ← agentprivacy-skills-v5\n   ├─ tomes.guide.agentprivacy.ai     ← cityofmages/tomes\n   ├─ research.guide.agentprivacy.ai  ← agentprivacy-docs\n   ├─ atlas.guide.agentprivacy.ai     ← spellweb/src/data  (the graph — the hyperlink backbone)\n   └─ library.guide.agentprivacy.ai   ← agentprivacy_master/public  (the 5 narrative spellbooks)\n```\nServe all hosts: `\"$HOME/AppData/Roaming/npm/wiki\" --data ~/.wiki --port 3030 --farm`\n(use the ABSOLUTE wiki path — a bare `wiki` exits 127). Log: `~/.wiki/_farm.log`.\nEach host = `pages/<slug>` + `assets/<slug>/<file>` + `status/owner.json` (`{name:\"<owner>\",friend:{secret:\"<friend-secret — never commit the live value>\"}}`).\n\n## The area registry — everything to sync (NAME ALL AREAS HERE)\n\nStatus: ✅ done · ◻️ gap (public canon not yet federated) · 🔒 sealed (never federate) · ♻️ dup (never double-federate).\n\n| Area | Source path | → Site | Builder | Status |\n|---|---|---|---|---|\n| Skills | `agentprivacy-skills-v5/{persona,role,privacy-layer,meta,wikis}` | skill | `build-all.js` | ✅ 163 |\n| Tome acts + cast + specs + bestiary + invitations | `cityofmages/tomes/` | tomes | `build-tomes.js` | ✅ 121 |\n| Conjecture register + v6 papers | `agentprivacy-docs/research/CONJECTURE_REGISTER_V6.md` + `papers/v6/*` | research | `build-research.js` | ✅ 94 |\n| Knowledge graph (nodes+edges) | `spellweb/src/data/{nodes,edges}.ts` | atlas | `build-atlas.js` | ✅ ~660 |\n| The hub (index/map/gates/contribute) | — | guide | `build-guide-host.js` | ✅ |\n| Ceremonies | `agentprivacy-docs/ceremonies/` | research | `build-research.js` (buildDocs) | ✅ 14 |\n| Compendium | `agentprivacy-docs/compendium/_assembled/` | research | `build-research.js` (buildDocs) | ✅ 2 (PLAN.md sealed) |\n| Reference | `agentprivacy-docs/reference/` | research | `build-research.js` (buildDocs) | ✅ 10 |\n| Lineage + whitepaper papers | `agentprivacy-docs/papers/{lineage,v4,v5,whitepapers}` | research | `build-research.js` (buildDocs) | ✅ 11 |\n| Grimoire prose | `agentprivacy-docs/grimoires/` | research | `build-research.js` (buildDocs) | ✅ 4 |\n| City blog + letters + lore | `cityofmages/{blog,mageletters}` + top-level public `.md` | tomes | `build-tomes.js` (buildDocsFrom CITY) | ✅ blog 13 · letters 6 · lore 7 |\n| Blockchain canon + blade prose | `spellweb/dist/canon/` + root `*-blade.md` | atlas | `build-atlas.js` (buildCanon) | ✅ canon 25 · blades 5 |\n| Architecture guides | `agentprivacy_master/docs/guides/` | guide | `build-guide-host.js` | ✅ 9 (chronicles/plans/dupes sealed) |\n| Docs deep pass — poems · specs · story-frame · research notes · about | `agentprivacy-docs/{poems,specs,story,research/*.md,*.md}` | research | `build-research.js` (buildDocs) | ✅ poems 3 · specs 7 · story 2 · notes 18 · about 3 (story/acts ♻️=ceremonies, drafts/eml/letters/chronicle sealed) |\n| Blog | `agentprivacy-docs/blog/` | research | `build-research.js` (forward-link summary) | ✅ 1 summary page — **forward-links to live `sync.soulbis.com`, NOT reproduced** |\n| **Narrative spellbooks** — Story · Parallel Society · Plurality · Zero (Privacymage Grimoire) · Canon | `agentprivacy_master/public/{story,society,plurality,zero,canon}` | **library** (NEW 6th site) | `build-library.js` | ✅ 146 (story 34 · society 22 · plurality 38 · zero 33 · canon 14 + 5 hubs + index; Planning_Document sealed) |\n| **Dual-agent harness** — core (loop·trusts·ground rules·contract) + 7 seats + specialisation + 15 harness paths (the origin fleet) + workflows/runtimes + field-guide spar | `~/dual-agent-harness` | **harness** (NEW site) | `build-harness.js` | ✅ (chronicles/ · universe/ · runs/ · instance ledgers 🔒 — numbers cited from frontier.json, never paged) |\n| **DTG research KB** — decision baseline (§-split) + explorations (now incl. X10 + X11 field-guide deployment) + lab NOTES + 2 chronicles | `~/dtgwg-cred-spec-main_mage` via its own `tools/build-kb.mjs` (manifest-first + secrets gate; emits `kb/fedwiki/`) | **dtg** (NEW site) | `node tools/build-kb.mjs` then **`wire-dtg-kb.js`** (wires slug = slugify(title); retires manifest-slug basename copies to recycle — 15 differ, incl. x11) | ✅ 92 = 78 kb + 13 trust-tasks + welcome (vendored spec 58 files NEVER projected; 2 chronicle slugs = manifested circulating, leak-scan false positives) |\n| **MyTerms bundle** — alliance application (exec brief + application + A/C/D/E letter docs) + IEEE 7012 integration plan v2 + universe card + standards presentation brief + The Two Familiars (extensions at low altitude) | `~/myterms` (docs directly; `/swordsman` `/mage` `/swordsman-blade` `/mages-spell` = EXPERIMENTS, reference-only) | **myterms** (site: \"The Agreement Layer\" 📜 #86a9c9) | `build-myterms.js` (+ `myterms-crosslinks.json` outbound refs, `link-myterms.js` inbound post-pass — re-run after any host rebuild) | ✅ 11 (SEALED: IEEE 7012-2025 PDF — copyright + no-AI-ingest; chronicles; `harness/` ♻️ = harness site; superseded v1 plan; stale Feb PDF renders) |\n| **Field Guide trust overlay** — 22 pages (counter-spec rulings · question map · acceptance · proverbs · 2 dated chronicles = manifested circulating) + assets lane (whole workbench + runnable bundle) | `~/field_guide_privacymage/wiki/{pages,assets-staging}` — WORKING DIR by ruling (git-less; durable substance folded to `agentprivacy-docs/research/fieldguide/` — docs+maps+runtimes; built on the Mac farm as `privacy.fieldguide.guide.agentprivacy.ai`; also served from embassy Pis as `mitch.private.fish` / `fieldguide.pi4.private.fish`) | **fieldguide** (site: \"The Field Guide\" 🧭 #4a8c5f) | pages byte-copied (fork lineage kept) + local `welcome-visitors`; see `~/field_guide_privacymage/wiki/push-to-pi.mjs` for the Pi lane | ✅ 23 (2026-08-17 convergence merge) |\n| Chronicles / plans / drafts / audits / version-history / `.bak` / `node_modules` / `dist/` artifacts | (everywhere) | — | — | 🔒 |\n| Tome mirrors | `agentprivacy-docs/tomes/` (80) · `agentprivacy_master/docs/tomes/` (164) | — | — | ♻️ = cityofmages/tomes |\n\nWhen adding an area: append a row here first, then build it. **Naming a thing in this table is step zero of syncing it.**\n\n## The distribution gates (G0–G7)\n\nOut (git → wiki): **G0** source-of-truth (git upstream) · **G1** classify circulating vs sealed · **G2** coherence\n(numbers/tiers/versions match register+grimoire) · **G3** attribution (`upstream`/author/license; vendored credited)\n· **G4** projection altitude (link down to source, don't dump) · **G5** hyperlink coherence (links resolve; from the\ngraph edges) · **G6** distribution topology (right site, canonical slugs, no collisions).\nBack (wiki → git): **G7** fork-back — coherence + attribution + First-Person sign-off (OPEN→SIGNED); propose a diff,\nnever auto-commit.\n\n## The process (per area — the 8-step loop)\n\n1. **Manifest (G1) — NON-OPTIONAL.** Enumerate the source dir; mark every file `circulating` or `sealed`. The\n   leak and the gaps both came from skipping this. Default-seal chronicles/plans/drafts/audits/version-history.\n2. **Map.** Slug + title per file; resolve cross-links (intra-site `[[ ]]`, cross-site `reference` items).\n3. **⊥check map.** Adversarially verify classification + coherence against the repo + grimoire/register.\n4. **Generate.** Run the converter → page JSONs + staged `assets/<slug>/<sourcefile>`.\n5. **Hyperlink.** Inject nav footer + hub rosters + cross-links.\n6. **⊥check build.** Slug-collision + link-integrity + orphan sweep (script below) BEFORE serving.\n7. **Serve.** Write into `~/.wiki/<host>/`; the farm rebuilds the sitemap on next request.\n8. **⊥check live.** Read the live wiki; confirm sitemap count, assets `200 text/markdown`, links resolve, and\n   **no sealed slug leaked** (leak-scan below). For structured data (register, graph) a deterministic re-parse\n   beats an agent; for prose/lore use an Explore agent to map live↔repo. SIGN (chronicle) only when clean.\n\n## Conventions (do these every time)\n\n- **slug = `slugify(title)`** (`t.replace(/\\s/g,'-').replace(/[^A-Za-z0-9-]/g,'').replace(/-+/g,'-').toLowerCase()`),\n  and choose **unique, readable, self-namespacing titles** so roster/footer `[[title]]` links always resolve.\n- **THE BIJECTION RULE (2026-08-03 ruling, after a fedwiki.club bug report)**: the page's stored slug MUST equal\n  FedWiki's own `asSlug(title)` = `t.replace(/\\s/g,'-').replace(/[^A-Za-z0-9-]/g,'').toLowerCase()` — downstream\n  code (share links, `<slug>.html` static export, forks) assumes title↔slug map to each other. Consequences:\n  **titles must be ASCII-clean** (no emoji — `\"Archer 🗡️🎯\"` slugs to `archer-` with a trailing dash; put emoji in\n  the story-card heading instead), no title-vs-filename divergence (`agentprivacy-guild-efficiency` file with\n  title \"Guild Efficiency\" broke fedwiki.club link-gen). `build-all.js` now has a **bijection lint** that fails\n  the build on any violation — never push pages that fail it. Rename map for the 2026-08-03 mass fix:\n  `~/.wiki/skill-fedwiki/rename-map.json`; club repair script: `club-fix.js`.\n- **Cross-site links** = a FedWiki `reference` item `{type:'reference', site:'<host>', slug, title, text}` — NOT a\n  bare `[[ ]]` (those resolve same-site only). Add a cross-site ref ONLY if the target page already exists.\n- **Neutralise source-body `[[ ]]`** before converting — canon prose (RPP gates etc.) uses `[[ ]]` as content; it\n  collides with wikilinks. Strip to plain text, then add your own links.\n- **Assets** keep the original source filename (`assets/<slug>/01-the-single-button.md`), not `<slug>.md`.\n- Attach each page's source file as a `# Assets` heading + `{type:'assets', text:slug}` item.\n\n## Tooling (`~/.wiki/skill-fedwiki/`)\n\n- `skill-to-fedwiki.js` — `buildPage({srcPath,slug,title,navText,assetsSlug})` module + frontmatter/section split.\n- `build-all.js` (skills) · `build-tomes.js` · `build-research.js` · `build-atlas.js` — per-source orchestrators.\n- `build-local-host.js <host>` — materialize staged pages+assets into a farm host.\n- `build-guide-host.js` — the hub; flip a site's `SITES[].status` to `LIVE` + re-run to roster it (and emit its\n  cross-site `tileglyph` tile + `reference`).\n- `link-tomes-research.js` — idempotent post-pass wiring act↔conjecture cross-site links (re-run after a rebuild).\n- `add-family.js` — idempotent post-pass binding all hosts into a **family**: injects a `roster` item (categories\n  Hub=guide · Sister sites=the four) into every welcome-visitors, so each site rosters its sisters and can pull\n  the whole family into the neighbourhood. Re-run after a rebuild (welcome-visitors is regenerated).\n- `log.js <op> <detail>` — append a greppable entry to `log.md` (`## [date] op | detail`; the LLM-Wiki log).\n- `file-answer.js \"<title>\" [content.md]` — **file a good answer back** into the wiki as a synthesis note\n  (`notes/<slug>.md` + a `log.js note` entry) so explorations compound (the LLM-Wiki \"answers filed back\" op).\n- `build-guide-extras.js` — idempotent post-pass: publish `log.md` → **Federation Log**, `notes/*.md` → **The\n  Notes**, and `AUDIT.md` → **Federation Audit** on the guide, + a Log & Notes section on welcome-visitors.\n- `audit.js` — the **lint** op: reads every host → page counts · broken links · leak-scan · orphans · cross-site\n  refs → writes `AUDIT.md` + a `lint` log entry + a PASS/WARN table. Reads only. (Non-zero broken/leaks are\n  usually benign in-content `[[ ]]` examples or false-positive candidates — the report says so; confirm before acting.)\n- **`resync.js [area...]`** — **one-command auto-sync for a research turn.** Runs forkback (report contributions\n  first) → the chosen area builders (default: all) → `link-tomes-research` → `add-family` → `audit` →\n  `build-guide-extras`. A research turn that touched only research = `node resync.js research`. Full re-sync = `node resync.js`.\n  **This is the run order; resync.js encodes it.**\n- `make-favicon.js` — per-host colour-identity favicon flag.\n- `forkback.js <host>` — the **G7 gate**: detect external contributions (current story diverges from the `create`\n  journal snapshot, or post-create journal actions exist) and print each as an `[OPEN]` proposal for First-Person\n  sign-off. **Reads only — never writes to git or the wiki.** Run before re-building a host (a rebuild overwrites\n  contributions); fold signed changes into the source repo by hand (page→repo is a lossy projection).\n- `push.js` / `push-assets.js` — public push (action API / WebDAV) — **parked**; user pushes to the domain manually.\n\n### Verify recipes\n```bash\n# sitemap count for a host\ncurl -s -H \"Host: <host>.localhost\" http://localhost/system/sitemap.json | grep -o '\"slug\"' | wc -l\n# link integrity (run in ~/.wiki/<host>): 0 broken expected (in-content example [[ ]] are benign)\nnode -e 'const fs=require(\"fs\");const S=t=>t.replace(/\\s/g,\"-\").replace(/[^A-Za-z0-9-]/g,\"\").replace(/-+/g,\"-\").replace(/^-|-$/g,\"\").toLowerCase();const F=fs.readdirSync(\"pages\"),X=new Set(F);let b=0;for(const f of F){const p=JSON.parse(fs.readFileSync(\"pages/\"+f));for(const it of p.story){if(it.type===\"reference\")continue;for(const m of (it.text||\"\").matchAll(/\\[\\[([^\\]]+)\\]\\]/g))if(!X.has(S(m[1])))b++;}}console.log(\"broken:\",b)'\n# leak scan — sealed content that slipped in (verify hits are false positives like a Chronicler persona)\ncurl -s -H \"Host: <host>.localhost\" http://localhost/system/sitemap.json | grep -oE '\"slug\":\"[^\"]+\"' | grep -iE \"chronicle|draft|plan|audit|candidate|presync|\\.bak\"\n```\n\n## Gotchas (learned the hard way)\n\n- **Manifest-first or it bites you**: firehosing a whole repo/graph leaks internal nodes (3 chronicle nodes rode\n  the spellweb graph into atlas — now sealed by `type:chronicle`/`label:/^Chronicle/`). Spine-only passes\n  under-federate (research got 6 of ~100 docs).\n- `dist/spellweb/nodes.json` is a **stale 16-node artifact** — parse `src/data/*.ts`.\n- Cast `sigil` may carry a parenthetical note — take the glyph only, or slugs break.\n- Leak-scan false positives: `chronicler` (the persona), `spec-vertex-naming-audit` (canonical spec), \"plan\"\n  inside \"plane\". Always confirm a hit is real before sealing.\n- Browser extension is offline here — **tileglyph tiles / favicon flags can't be visually verified**; check the\n  item JSON, not the render.\n\n**Verify:** [agentprivacy.ai](https://agentprivacy.ai) · plan `~/.claude/plans/moonlit-stirring-lagoon.md` ·\ncoverage audit `agentprivacy_master/docs/chronicles/2026-06-27_federation_coverage_audit.md`"
          },
          {
            "type": "markdown",
            "id": "d95be638d5176bbc",
            "text": "## Provenance\nForkable skill page migrated from the agentprivacy skills repo (`persona/agentprivacy-wiki-sync`, v1.0).\nSource of truth: `agentprivacy-skills-v5`. Fork this page to materialize a local `SKILL.md` via `fedwiki-to-skill`.\n\n*origin: 0xagentprivacy · author: Mitchell Travers*"
          },
          {
            "type": "markdown",
            "id": "dc7f634ae6c84790",
            "text": "# Assets"
          },
          {
            "type": "assets",
            "id": "864dd393c57e0c7a",
            "text": "wiki-sync"
          },
          {
            "type": "markdown",
            "id": "2fcac3c4c22095fb",
            "text": "## Navigation\n\n← [[Welcome Visitors]] · [[The Wikis]]"
          }
        ]
      },
      "date": 1787093608191
    }
  ]
}