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
| Concern | Choice |
|---|---|
| Read/write | GitHub Contents + Git Data API (GITHUB_PAT on orchestrator only) |
| Auth | Every /api/content/* route requires bearer MAINARK_API_TOKEN; web uses session cookie → Next proxy |
| Config | src/content/productContentConfig.ts — paths + branches per productId; repo URL from existing Mainark config |
| Isolation | Never uses agent worktrees or REPO_PATH |
Phases
- P0 — Changelog timeline (
GET /api/content/:product/changelog, UI/changelog) - P1 — Docs browser (
/content): Fumadocs-likemeta.jsonnav, 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 fileblobShamatched → PR intoprTargetBranch(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