Skip to content

Documentation Infrastructure

Sergey Gerasimov edited this page Oct 23, 2026 · 6 revisions

Documentation Infrastructure

DerivLab treats documentation as a product surface, not an afterthought.

Surface Purpose
README.md The story for a non-technical visitor
Wiki The technical and operational manual
docs/adr/ Durable architecture decisions
docs/VERSIONING.md SemVer and release checklist
docs/DOCUMENTATION.md How the documentation system is maintained
docs/social-preview.png Prepared 1280×640 GitHub social card

Link checking

The Docs workflow runs on every pull request and on main:

Docs · links + ADR
├── scripts/validate_docs.py       # local links, ADR structure, versioning, assets
└── lychee README.md docs          # external HTTP links

Local check:

python scripts/validate_docs.py

The local validator is standard-library only and checks:

  • every relative Markdown/HTML link resolves inside the repository;
  • every ADR has Status, Context, Decision, and Consequences;
  • every ADR is linked from the ADR index;
  • docs/VERSIONING.md and the current changelog entry exist;
  • the coverage badge and 1280×640 social preview exist.

Lychee tolerates public-host rate limits (403/429) and excludes the few interactive links that require a GitHub or Streamlit login.


Coverage

pytest -q --cov=derivlab --cov-report=term --cov-report=xml --cov-fail-under=80
coverage json -o coverage.json
python scripts/update_coverage_badge.py
python scripts/update_coverage_badge.py --check
  • CI fails below 80%.
  • The README badge is generated from coverage.json (currently 85%).
  • The badge is committed at docs/badges/coverage.svg; --check fails if it is stale.

ADRs

The decision log lives in docs/adr/:

  • 0001 — local-first, deterministic demo
  • 0002 — Backtrader + synthetic option chain
  • 0003 — optional LLM with deterministic fallback
  • 0004 — README story, Wiki manual, ADR log
  • 0005 — GHCR delivery and quality gates

Each ADR is append-only. A changed decision gets a new record that supersedes the old one.

See Architecture Decisions for the summary.


Versioning

See Versioning and docs/VERSIONING.md. Current release: 1.2.0.


Social preview

GitHub's repository social preview is set in Settings → Social preview and has no public REST/GraphQL mutation. The prepared asset is:

  • 1280×640 PNG;
  • dark terminal aesthetic;
  • AI Arena title, live model chips, model-stack screenshot;
  • github.com/SergeyGer/DerivLab and the educational disclaimer.

Upload it here: https://github.com/SergeyGer/DerivLab/settings/social-preview

Until it is uploaded, GitHub uses its generated OpenGraph card. The source image is kept in the repository so the card is reviewable and reproducible.


One-click delivery

docker run --rm -p 8501:8501 ghcr.io/sergeyger/derivlab:latest

The Publish image workflow builds a multi-arch image for linux/amd64 and linux/arm64, tags it latest, the release version, and sha-<short>, and pushes it to GHCR. View the package.

The Streamlit Community Cloud deploy button requires the owner to authorize the first deployment, but the app itself needs no keys: local models run the arena.


Branch governance

main is protected by the modern repository ruleset Protect Main:

  • pull request required before merge;
  • required checks: Python 3.11, Docker health, CodeQL, Docs;
  • branch must be up to date before merge;
  • force pushes and deletion blocked;
  • no bypass actors.

The classic branch-protection rule was removed after the ruleset was active.


Versioned and tested docs

  • Compatibility matrix: docs/COMPATIBILITY.md.
  • Immutable snapshots: docs/versions/.
  • Current version snapshot is required by the Docs check.
  • The validator checks local links, heading anchors, image alt text, Python snippets, ADRs, version snapshots, and governance assets.
  • The Wiki footer records the last verified version/date.

Owners and feedback

  • Owner: @SergeyGer.
  • Review policy: docs/OWNERS.md.
  • Feedback: documentation issue form.
  • GitHub Wiki does not expose page-level analytics; the issue form is the intentional feedback signal. Use GitHub repository traffic insights for aggregate, privacy-safe activity.

See LLM Quality & Safety for the model-output quality gates referenced from the AI documentation.

Clone this wiki locally