Product content (changelog / docs)

Mainark views and (later) edits product documentation that lives in each product's git repository. Git remains the source of truth. There is no docs CMS or snapshot ingest pipe.

Fulreach contract: product repo docs/ops/mainark-docs-contract.md.

Design

ConcernChoice
Read/writeGitHub Contents + Git Data API (GITHUB_PAT on orchestrator only)
AuthEvery /api/content/* route requires bearer MAINARK_API_TOKEN; web uses session cookie → Next proxy
Configsrc/content/productContentConfig.ts — paths + branches per productId; repo URL from existing Mainark config
IsolationNever uses agent worktrees or REPO_PATH

Phases

  • P0 — Changelog timeline (GET /api/content/:product/changelog, UI /changelog)
  • P1 — Docs browser (/content): Fumadocs-like meta.json nav, safe non-executing MDX preview, search corpus cached by commit SHA
  • P2 — MDX source editor (/content/edit?path=) → feature branch from the tip commit whose file blobSha matched → PR into prTargetBranch (no auto-merge)

SHAs

API responses distinguish:

  • blobSha — Contents API file object sha (optimistic concurrency for edits)
  • commitSha / baseCommitSha — git commit the file was read at / branch base