CI/CD Pipeline Diagram
Visual map and lane breakdown of the build, test, lint, security, and publish workflow stages that gate every code change and release.
The structural map of the build · validate · publish workflow that gates
every change to the Apothem ecosystem. This document installs the
visualization surface. The GitHub Actions workflow files it describes live in
.github/workflows/ (for example ci.yml and release.yml), and the release
tooling lives in scripts/release/.
Pipeline shape
%%{ init: { "theme": "neutral" } }%%
%% verified: 2026-04-27 %%
%% provenance: pyproject.toml + scripts/dev/validate_ecosystem.py + scripts/dev/validate_hooks.py %%
%% cross-reference: site/content/docs/developer-guide.mdx (contributor workflow) %%
flowchart LR
accTitle: CI/CD pipeline shape
accDescr: Left-to-right flowchart of the apothem CI CD pipeline showing build, test, lint, type-check, security scan, docs build, package, sign, and publish stages with branch protection gates between them.
subgraph Trigger["Trigger surface"]
PR["Pull request opened or updated"]
PUSH["Push to main"]
TAG["Tag release vX.Y.Z"]
end
subgraph Static["Static analysis lane"]
LINT["Ruff lint + format check"]
TYPE["Mypy strict"]
FRONT["Frontmatter validator"]
end
subgraph Test["Test lane"]
PYTEST["pytest tests/hooks"]
ECO["validate_ecosystem.py"]
CHAOS["chaos_pass.py (CI quality job)"]
BENCH["src/apothem/benchmarks/ (unit tests in CI, bench_hooks in metrics job)"]
end
subgraph Security["Security lane"]
SECRETS["Secret scan"]
SBOM["SBOM generation (tags only)"]
LICENSE["License audit"]
end
subgraph Publish["Publish lane (tags only)"]
SIGN["Signed-tag verification"]
ATTEST["Provenance attestation"]
RELEASE["Release notes from CHANGELOG.md"]
end
DOCS["Project website publish"]
PR --> Static
PR --> Test
PR --> Security
PUSH --> Static
PUSH --> Test
PUSH --> Security
PUSH --> DOCS
TAG --> Static
TAG --> Test
TAG --> Security
TAG --> Publish
Static --> GATE{All lanes green?}
Test --> GATE
Security --> GATE
GATE -->|yes| MERGE[Merge / publish]
GATE -->|no| BLOCK[Block · surface failures · request fix]
Publish --> MERGELane roles
- Static analysis lane — fast feedback. Ruff covers Python style and a curated rule set; mypy enforces type discipline at strict; the frontmatter validator gates artifact-schema compliance for rules, skills, delegated workers, and commands. markdownlint is not in this lane: the Markdown Lint workflow runs its pre-commit hook in CI on changed Markdown (see Markdown conventions).
- Test lane —
pytest tests/hooksexercises the hook runtime against the full event matrix;validate_ecosystem.pyis the primary structural gate for cross-artifact consistency;chaos_pass.pyruns in the CI quality job on pushes and pull requests tomain(path-filtered) to catch degradation under degraded inputs. The per-class benchmark drivers undersrc/apothem/benchmarks/run in CI through the pytest suite and through themetricsjob. Each full pytest run in CI collectstests/unit/test_benchmarks.py, which calls every driver exceptbench_install.py. Themetricsjob runsscripts/dev/collect_metrics.py, which runsbench_hooks.py --jsonand records the result ashook_e2e_ms.bench_tests.pyandbench_install.pytime real runs only undermake benchmarks. No workflow runsmake benchmarks. - Security lane — gitleaks in
ci.ymlcatches accidental committed credentials. The license audit (license-audit.yml) fails on a dependency license outside its allowlist. It runs weekly and when dependency or license files change. The REUSE gate (reuse.yml) runs on every change and fails when a file has no license line or an SPDX expression does not parse.release.ymlgenerates the SBOM for each tagged release. - Publish lane — the release workflows are triggered by tag pushes; the npm
and VS Code publishers can also be re-run by manual dispatch for an existing
tag. Signed-tag verification confirms release-branch provenance; release notes
derive from
CHANGELOG.mdKeep-A-Changelog format. The project website publishes fromsite/dist/to the GitHub Pages target on pushes tomainthat touch its build inputs, or on manual dispatch.
Concrete configuration
The actual workflow files (.github/workflows/ci.yml,
.github/workflows/release.yml, etc.) are in the repository. This diagram
defines the canonical shape every future configuration mirrors.
Authoritative cross-references
pyproject.toml— Ruff / mypy / pytest configuration source of truth.scripts/dev/validate_ecosystem.py— the primary cross-artifact gate.scripts/dev/validate_hooks.py— hook-specific structural validation.scripts/dev/chaos_pass.py— adversarial sweep of every configured hook.src/apothem/benchmarks/— per-class runtime budget verifiers.site/content/docs/developer-guide.mdx— the operator-facing contributor workflow.CHANGELOG.md— release-note source.
Repository-Scoped Conventions for Assistant Harnesses
How apothem materializes repository-scoped operating conventions — rules, skills, and delegated-worker definitions — into each harness's native instruction surface (AGENTS.md and its per-tool equivalents).
Reference
Navigable registry of artifact classes with paths and on-disk layouts for rules, commands, skills, delegated workers, hooks, MCP servers, settings, and output styles.