Ownership and upgrades
What belongs to the package, the project, or the generator; why there is no update command; and how to refresh the scaffold by hand.
Who owns what
| Path | Owner | Edit by hand? |
|---|---|---|
doc/ | Project | Yes |
circuit/, circuit/, circuit/templates/ | Project | Yes |
. | Project | Yes, following the evidence contract |
. | Project | Yes |
. | Project | Yes |
circuit/, circuit/ | Project | Yes, as a reviewed diff — see Publication |
circuit/cad-receipts/ | Project | Yes, created when the first asset is acquired |
circuit.config.ts | Project | Yes |
doc/ | Project | Yes — headerNav, headerRightItems, footer, claudeResources, etc. See Adding an authored section below before adding a nav entry |
doc/, doc/, and the rest of doc/src/** outside content/ | Project | Yes |
doc/public/**, excluding the generator-owned doc/ below | Project | Yes, subject to the publication assets allowlist for anything that shouldn't be public |
Root package.json scripts | Project | Yes — a custom pre-build step, a deploy hook, or any other project-specific command goes here; see Workflows → Migrating an existing project for why this is the seam for things that can't be ported directly |
doc/ | Generator | Never |
circuit/ | Generator | Never |
doc/ | Generator | Never |
node_modules/@takazudo/zudo-circuit-doc/ | Package | Never |
Generated MDX is never hand-edited: change the evidence or the selection, then regenerate. A hand-edited generated file is reported as drift by pnpm check; one with its generated-page marker removed entirely is reported as an ownership conflict — the emitter refuses to overwrite a marker-less target, and never partially writes on any conflict.
Create-only: there is no update command
create-zudo-circuit-doc scaffolds a project once. There is deliberately no zudo-circuit-doc
update or create-zudo-circuit-doc upgrade command — a generated project's authored content (brief, architecture, decisions, evidence) is yours from the moment it's created, and an automatic in-place rewrite of project files is exactly the kind of silent mutation this project's evidence model is built to avoid elsewhere. Two things do get newer over time without an update command:
The runtime package (
@takazudo/zudo-circuit-doc) — an ordinarypnpm updatebumps it like any other dependency, because the CLI, validator and MDX renderer are code your project depends on, not files copied into your project.The scaffold (the zudo-doc host glue under
doc/,package.json,pnpm-workspace.yaml) — these files are copied at creation time, and upgrading them is a manual, reviewable scaffold-refresh, described next.
The scaffold-refresh procedure
The initializer's doc/ host glue is synced from a pinned create-zudo-doc release, with a few project-specific lines layered on top (the chrome-bindings import, the islands seed import, the package's styles.css import). ZUDO_DEPS_PINS.md, generated into every new project, records exactly which files came from where, at which pinned commit, and which lines were added on top of the vendored scaffold:
## create-zudo-doc
- pinned: <commit> (v10.0.3)
- files: doc/pages/docs/[[...slug]].tsx, doc/pages/index.tsx, doc/tsconfig.json,
doc/src/styles/global.css, doc/scripts/check-links.js
- notes: doc/pages/docs/[[...slug]].tsx carries one added import beyond the upstream stub;
doc/src/styles/global.css has one added @import line. Re-apply both after any re-copy.To refresh a project's scaffold by hand after a new create-zudo-doc release:
Run the pinned (or newer)
create-zudo-docinto a scratch directory and diff its project output against the filesZUDO_DEPS_PINS.mdlists.Apply the upstream diff to your project's copies.
Re-apply the project-specific lines
ZUDO_DEPS_PINS.md's notes call out (they are not part of the upstream scaffold, and a plain re-copy would silently drop them).Update
ZUDO_DEPS_PINS.md'spinned:/updated:fields.
Migrating the 0.3 runtime family to 0.4
Runtime 0.4 moves to zudo-doc/history-server/create-zudo-doc 10.0.3 and ZFB/runtime/md-wasm 6.0.1. Its peer floors are @takazudo/ and @takazudo/, so a host still on zudo-doc 9 does not satisfy them. A caret on runtime ^0.3.0 does not opt into 0.4. Keep runtime 0.3 with the 9.1.x / 5.2.2 family until you migrate the host deliberately.
In
doc/, update the exact pins for zudo-doc, history-server and all three ZFB packages together, then raise the runtime range in both the root andpackage. json doc/. History-server 10 is required: zudo-doc 10 peers onpackage. json ^10.0.0.In zudo-doc 10,
themePack: "default"is an alias of Graphite, and Classic's slug is nowclassic. A project generated by initializer 0.2.0 that still hasthemePack: "default"switches to Graphite. To keep Classic, change boththemePackand anythemePacksentry to"classic". AthemePackslist that names both"default"and"graphite"fails the build.ZFB 6 bundles with Rolldown. Leave any removed bundler selector unset in
zfb.config.ts. KeepallowBuilds: esbuild: trueinpnpm-workspace.yaml, as create-zudo-doc 10 still generates it.create-zudo-doc 10 generates
typescript ^7.0.2anddiff ^8.0.4 || ^9.0.0for the doc host. Follow those pins when you refresh the scaffold against the reference project. TypeScript 7 rejects command-line files beside atsconfig.jsonunless you pass--ignoreConfig. Project-mode checking (pnpm --dir doc exec tsc --noEmit) is unaffected.ZFB 6 renders transcluded (
:::include) files with the project's GFM, math, CJK and hard-break settings. If you transclude content, review it after the upgrade.Run the verification in step 7 of the 0.2 → 0.3 recipe below.
Migrating the 0.2 runtime family to 0.3
Runtime 0.3.0 and initializer 0.2.1 are published on npm. The selected published upstream family is zudo-doc/history-server/create-zudo-doc 9.1.4 and ZFB/runtime/md-wasm 5.2.2. It passes the direct strict packed MDX registration and unchanged LED publication scan that blocked the 6.0.0 attempt (TS2322 and 117 hits). The sidebar fix minimizes hydration payloads while preserving authored server content. A successful bundle alone does not establish type compatibility; run the full verification below after migrating.
The old pairing is runtime ^0.2.0, zudo-doc/history-server 5.27.0 and the aligned ZFB 2.21.0 family. A caret on runtime ^0.2.0 does not opt into 0.3. Keep that pairing until you deliberately migrate the entire host. The new pairing is runtime ^0.3.0, initializer 0.2.1, zudo-doc/history-server/create-zudo-doc 9.1.4 and ZFB/runtime/md-wasm 5.2.2. Runtime peer floors are ^9.1.3 and ^5.2.2, matching this verified family. Projects generated by initializer 0.2.0 keep zudo-doc's Classic look (themePack: "default"). To use Graphite, zudo-doc 9's default look that initializer 0.2.1 generates, set themePack: "graphite" and themePacks: ["graphite"] in doc/. Independently released packages need not share a patch version.
To migrate, apply this recipe on a project branch:
Back up authored content, evidence, configuration and CAD receipts. Update the runtime range in both root and
doc/; update the exact zudo-doc/history-server and all three ZFB pins in the doc host together. Remove retired direct Preact and preact-render-to-string dependencies unless independently used by another explicitly owned renderer. Keep the existing pnpm and Python floors; use Node 24 LTS (package. json >=24 <25) for zudo-doc 7. Reinstall and retain the generated lockfile.Generate a separate reference project from the recorded
create-zudo-docversion. Never run an initializer over your existing app, and never addcreate-zudo-docto app dependencies. Compare the docs route, root route, tsconfig, global CSS and link checker listed above.Extend
@takazudo/. Remove React-to-Preact paths and JSX pragmas, removezudo- doc/ tsconfig. base. json baseUrl, preserve genuine aliases with explicitly relative targets such as"@/*": ["./src/*"], and inherit the base's top-levelfiles. Keep TypeScript 5.9. Custom TSX importsChild/Descriptionand the published intrinsic types from zudo-react. Interactive components use setup-owned signals/computed values,Show, nativeon:*handlers and scope activation/cleanup. A one-time.valueread is not a reactive binding.Replace Tailwind directives, removed
safelist.cssandtheme-no-reset.csswith@layer zw-reset, zd-flow;, followed by the publictheme.css,content.css,page-loading.cssandfeatures.cssimports. Move token values to ordinary:root. Import@takazudo/immediately after feature CSS.zudo- circuit- doc/ styles. css zudoDoc()registers its Wind manifest; do not scan package sources to recover old utilities.Use
DocHistoryBoundary as DocHistoryfrom@takazudo/in chrome bindings. Keep the directzudo- doc/ doc- history- area mdxExtras: { ...circuitDocMdxExtras }registration with its required props. Retain the docs route'simport "../lib/_circuit-doc-islands";and that seed file's package import. NamedIslandtargets transport only strings and hydrate when visible. Custom dialog code usesmodalDialog(scope, options)from the retained use-modal-dialog subpath; conditional model surfaces own abort and disposal, including pending initialization.Preserve
base: "/",/paths, categories/locales, assets,docs/ strictContentBridge, history exclusions, agent-resource links, wide/TOC andllmsTxtchoices. Keepcircuit.config.tsseparate. Header dropdowns group links; they do not define document ancestry. Check the actual sidebar's broader tree, focus/restore and filter behavior without duplicating parent rows.Run circuit checks, host TypeScript checking (
pnpm --dir doc exec tsc --noEmit), builds, and the strict built-HTML link/anchor scanner. Source-only checking cannot see EvidenceAnchor output. Runpnpm --dir doc exec zfb wind audit --project-root . --fail-on errorand inspect computed dialog stacking, focus, tables and themes. Exercise search, mobile drawer, history, footprint/model enlargement, Escape/backdrop, no-JS/error states, SPA/reload and delayed-load cleanup with shell/search browser assertions enabled. Update dependency provenance only after reviewing the generated diffs; never change evidence to hide a renderer regression.
The monorepo verifies local runtime and initializer tarballs in empty/minimal/LED consumers, including strict direct registration and host types. Publication is separate: publish the runtime first, pass verify:pack --fixture empty --published-runtime, then publish the initializer.
Adding an authored section
A new top-level section (a sibling of project/, architecture/, research/, decisions/, verification/) needs three things, all in doc/, which is project-owned:
A content directory.
doc/with its ownsrc/ content/ docs/ <section>/ index.mdx.A
headerNaventry whosecategoryMatchmatches that directory name exactly.categoryMatchis how zudo-doc decides which sidebar to render for a given page — a section with no matchingcategoryMatchgets an empty sidebar, silently, with no build error. Copy an existing entry's shape rather than writing one from scratch:{ label: "My Section", path: "/docs/my-section", categoryMatch: "my-section" }A slot in the scaffold's six-item header navigation. The scaffold's default
headerNavalready uses 6 items (Project, Architecture, Research, Decisions, Verification, Components) — the same number the generated site's own What you get page counts. Adding a 7th top-level entry means either removing one, or nesting the new section as achildrenentry under an existing one (seeheaderNav[].children— the scaffold's own Components entry nests "Catalog & Records" and "Raw agent resources" this way):{ label: "Components", path: "/docs/components", categoryMatch: "components", children: [ { label: "Catalog & Records", path: "/docs/components", categoryMatch: "components" }, { label: "My Section", path: "/docs/my-section", categoryMatch: "my-section" }, ], }
The project/ entry is required by the shared workflow entry: every workflow starts by reading the brief and next actions there, so removing or renaming it breaks the workflow text's own instructions, not just navigation. The other four scaffold sections (architecture, research, decisions, verification) are conventional, not load-bearing — rename or drop them if your project structures its authored docs differently, as long as project/ stays.