Jump to content

MindAttic.Docs/architecture

From MindAttic Docs

Architecture

How the hub is put together: two scripts, one workflow, and the wiki that reads the result.

The pieces

Piece Where Job
tools/docs-signatures.ps1 this repo One GitHub GraphQL query (one request per 50 repos) that returns every wip-tagged repo's name, visibility and signature: <README.md blob id>:<docs tree id>. It is the roster and the change detector in one.
tools/build-hub.ps1 this repo Stages every public wip repo into a folder of this repo, writes the homepage, the top nav and docfx.json.
build-docs-site.ps1 MindAttic.Agency shared/docs-site/ The one staging engine every repo's docs site uses. The hub calls it as a library per repo, so link rewriting, image copying and per-repo toc.yml are defined once.
tools/hub-template/public/hub.css this repo The hub's own styles (hero, stat strip, card grid), appended to Agency's shared main.css on every build.
tools/sources.json this repo, generated The signature each repo was last staged from.
tools/PORTFOLIO.snapshot.md this repo, generated A copy of the private workspace's docs/PORTFOLIO.md; its category tables group the homepage cards and the nav.
.github/workflows/docs.yml this repo Runs build-hub.ps1 in GitHub Actions, commits the result, then builds the DocFX site through Agency's shared docs-pages.yml.
engine/sync-docs-wiki.ps1, engine/md2wiki.py MindAttic.Docs.Wiki Turns this repo's main into wiki pages at https://mindattic.com/wiki/docs/.

One build, step by step

  1. Roster. docs-signatures.ps1 lists every wip repo. Private repos are counted and named as excluded; nothing of theirs is read.
  2. What to restage. A full build restages every repo. An incremental build restages only repos whose signature differs from tools/sources.json, or whose folder is missing; the rest keep their committed folders.
  3. Source. Each repo is read from a sibling checkout in the workspace when one exists, else from a shallow, sparse clone of its README.md and docs/. A source repo is only read, never changed. The hub itself is a section too, read from its own checkout.
  4. Front page. A repo whose README.md is the standard pointer (<!-- mindattic:readme-pointer) gets its docs/overview.md as its front page; any other README is the front page. The hub always uses its own docs/overview.md, because its README is generated.
  5. Staging. build-docs-site.ps1 stages the repo into a scratch folder; the hub copies the result into <repo>/, and every .md/.yml file passes the secret scan on the way in.
  6. Secret scan. Provider-shaped tokens, private key blocks, credential assignments and connection-string passwords are replaced with a visible <REDACTED...> marker. Placeholders (<your key>, example) are left alone. Every finding is printed.
  7. Stale sections. A folder that is no longer a published repo is removed. .git, .github, tools, docs, .agent, .mindattic-toolkit and _site are reserved and never touched.
  8. Homepage, nav, README. index.md (hero, stat strip, one card per repo in its portfolio group), toc.yml and README.md are written from the roster and the portfolio snapshot.
  9. Site config. docfx.json, the logo and favicon, and the merged main.css are written for the DocFX build.

The wiki

The wiki is the published product. MindAttic.Docs.Wiki's sync job reads this repo's origin/main every few minutes: every top-level folder with an index.md is one repo; <repo>/index.md becomes the page <repo>, and <repo>/docs/<path>.md becomes <repo>/<path>. The hub's index.md becomes the wiki's Main Page. The finished wikitext is secret-scanned a second time before it is pushed.

Boundaries

  • The hub never writes into another repo, and never holds hand-written content for one (SPEC.md 2.2).
  • A private repo is never staged, and the build never needs a credential to read one.
  • The DocFX site and the wiki are two renderings of the same committed tree.
From MindAttic.Docs/docs/architecture.md via MindAttic.Docs; synced automatically, so edit the repo, not this page.