Skip to main content

AI Build Guide

Objective: Document the Coherosphere AI build process — from prompt design to integration testing. Note: Covers AI-assisted generation, model governance, and validation routines for architectural artifacts. This guide ensures that AI participation in build workflows is transparent, reproducible, and auditable.e.


1. Build Philosophy

The Coherosphere build system aligns with three guiding principles:

PrincipleDescription
Declarative ArchitectureEvery service (C1–C4) defines its contract via OpenAPI + JSON Schemas.
Continuous ValidationEach commit triggers a full contract and codegen validation.
Self-Documenting SystemDocs, diagrams, and manifests are generated automatically at build time.

2. Build Flow Overview

A[Commit / PR] --> B[CI Trigger] B --> C[Run Validation Workflows] C --> D[Generate SDKs + Mock Servers] D --> E[Static Docs Build (Docusaurus)] E --> F[Publish Docs + Specs to GitHub Pages] F --> G[Sync Registry + SBOM]


3. C-ID Mapping

Each C-layer (C1–C4) component is explicitly mapped to its specification and container:

C-IDDescriptionSource PathOutput
C1Foundation Layer/assets/specs/core/Base schemas
C2Domain Layer/assets/specs/openapi/C2-*Domain APIs
C3Coordination Layer/assets/specs/events/Event Schemas
C4Interface Layer/assets/specs/interfaces/Gateway + SDKs

Mappings are verified in the workflow validate-codegen-harness.yml using a shared manifest file.


4. Parameter Governance Integration

Each build performs consistency checks against the parameter registry defined in /assets/specs/params/:

  • Validate JSON schema integrity (λ, α, θ, quorum, threshold).
  • Ensure registry signature is valid (Ed25519, M-of-N governance keys).
  • Check referenced Proposal-ID exists in Governance domain.

5. Dynamic Asset Generation

Build scripts generate static indexes to make architecture assets discoverable in Docs:

DirectoryContentGenerated Index
/assets/diagrams/C4 + System diagrams/diagrams/index.html
/assets/specs/openapi/OpenAPI specifications/specs/index.html
/assets/specs/events/JSON + CloudEvent Schemas/eventschemas/index.html

Generation handled by scripts/gen-asset-indexes.mjs.


6. CI Workflows Summary

WorkflowPurposeOutput
validate-openapi.ymlValidate all OpenAPI specs with Redocly.harness_out_contracts/
validate-codegen.ymlGenerate SDKs, run Prism harness, validate schema.harness_out/sdk_*
validate-mermaid.ymlLint and render all Mermaid diagramsbuild/diagrams/
validate-params.ymlVerify registry signatures + parameter schema/assets/specs/params/
build-docs.ymlBuild Docusaurus static site and deploy to GitHub Pagesdocs.coherosphere.io
nightly-manifest.ymlRegenerate architecture manifest and validation reports/assets/docs/

7. Deployment Process

  1. Build artifacts are created locally under /build/.
  2. Docs site built via Docusaurus v3.9 and deployed to docs.coherosphere.io.
  3. Generated assets synced under /static/assets in CI.
  4. Pages deployed using GitHub Actions → actions/deploy-pages@v4.

8. SBOM and Integrity Verification

  • SBOM (Software Bill of Materials) auto-generated at build time using cyclonedx-npm.
  • Integrity hashes (SHA256) verified for all critical assets under /assets/specs/.
  • Results stored in .sbom/ for transparency and reproducibility.

9. Version History

VersionDateHighlights
v4.02025-08Initial AI build pipeline integration
v4.12025-09Added SBOM and schema validation
v4.22025-10Codegen + test harness integration
v4.32025-11Added C-ID mapping, governance validation, and dynamic asset indexing

Prepared by: the coherosphere collective