# cypt71/platform-factory architecture

> Architecture diagram of the GitHub repository cypt71/platform-factory, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/cypt71/platform-factory
- Repository: https://github.com/cypt71/platform-factory

## Overview

Platform Factory packages existing executables into deterministic OCI images, adds verifiable supply-chain evidence, and runs or distributes the result. The primary workflow is CLI-driven: build/package, verify, then publish or execute as a hardened container or microVM. Separate capabilities include project lifecycle and pipeline execution, plugins and marketplace, and a remote worker/control-plane path. README statements support the broad capability relationships; sampled excerpts clarify pipeline orchestration, OCI building, worker execution, and runtime behavior. Other source implementations were not sampled, so their internal links are limited to documented relationships.

Main entry points: [`cmd/platform-factory/main.go`](https://github.com/cypt71/platform-factory/blob/main/cmd/platform-factory/main.go) (Platform Factory CLI), [`cmd/platform-factory-runtime/main.go`](https://github.com/cypt71/platform-factory/blob/main/cmd/platform-factory-runtime/main.go) (OCI runtime facade), [`internal/app/pipeline/pipeline.go`](https://github.com/cypt71/platform-factory/blob/main/internal/app/pipeline/pipeline.go) (Pipeline service), [`cmd/platform-factory/pipeline.go`](https://github.com/cypt71/platform-factory/blob/main/cmd/platform-factory/pipeline.go) (Pipeline commands)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_build["Build and projects"]
  node_cli["Platform Factory CLI<br/>[main.go]"]
  node_project["Project lifecycle"]
  node_oci["OCI image builder<br/>[builder.go]"]
  node_pipeline_cli["Pipeline commands<br/>[pipeline.go]"]
  node_pipeline_service["Pipeline service<br/>[pipeline.go]"]
  node_installer["Binary installer<br/>[main.go]"]
end

subgraph group_evidence["Supply-chain evidence"]
  node_verify["Image and release verification<br/>[verify.go]"]
  node_sbom["SBOM generation<br/>[sbom.go]"]
  node_provenance["Provenance and signing<br/>[provenance.go]"]
  node_policy["Policy evaluation<br/>[policy.go]"]
end

subgraph group_execution["Workload execution"]
  node_container["Hardened container runtime<br/>[runtime.go]"]
  node_microvm["Native microVM<br/>[kvm_linux.go]"]
  node_runtime_cmd["OCI runtime facade<br/>[main.go]"]
end

subgraph group_distribution["Distribution and extensions"]
  node_registry["OCI registry client<br/>[client.go]"]
  node_deploy["Deployment and rollback<br/>[deploy.go]"]
  node_marketplace["Plugin marketplace<br/>[manager.go]"]
  node_plugin["Verified plugin runtime<br/>[client.go]"]
end

subgraph group_remote["Remote coordination"]
  node_control_plane["Control-plane API<br/>[server.go]"]
  node_worker["Pipeline worker<br/>[workerpipeline.go]"]
end

node_engineer(("Platform engineer"))
node_marketplace_user(("Plugin consumer"))
node_cluster["Kubernetes or containerd"]

node_engineer -->|"invokes"| node_cli
node_cli -->|"builds image"| node_oci
node_cli -->|"manages project"| node_project
node_cli -->|"verifies image"| node_verify
node_cli -->|"generates SBOM"| node_sbom
node_cli -->|"creates evidence"| node_provenance
node_cli -->|"evaluates policy"| node_policy
node_cli -->|"runs pipelines"| node_pipeline_cli
node_pipeline_cli -->|"calls service"| node_pipeline_service
node_pipeline_service -.->|"validates inputs"| node_verify
node_cli -->|"publishes image"| node_registry
node_cli -->|"deploys workload"| node_deploy
node_cli -->|"launches workload"| node_runtime_cmd
node_runtime_cmd -->|"manages state"| node_container
node_runtime_cmd -.->|"launches guest"| node_microvm
node_cluster -.->|"selects runtime"| node_runtime_cmd
node_cli -->|"manages plugins"| node_marketplace
node_marketplace_user -->|"installs plugins"| node_marketplace
node_cli -->|"activates plugins"| node_plugin
node_cli -.->|"installs binaries"| node_installer
node_control_plane -.->|"leases pipelines"| node_worker
node_worker -.->|"runs stages"| node_pipeline_service

click node_cli "https://github.com/cypt71/platform-factory/blob/main/cmd/platform-factory/main.go"
click node_project "https://github.com/cypt71/platform-factory/tree/main/internal/app/project"
click node_oci "https://github.com/cypt71/platform-factory/blob/main/oci/builder.go"
click node_pipeline_cli "https://github.com/cypt71/platform-factory/blob/main/cmd/platform-factory/pipeline.go"
click node_pipeline_service "https://github.com/cypt71/platform-factory/blob/main/internal/app/pipeline/pipeline.go"
click node_installer "https://github.com/cypt71/platform-factory/blob/main/cmd/platform-factory-installer/main.go"
click node_verify "https://github.com/cypt71/platform-factory/blob/main/internal/app/verify/verify.go"
click node_sbom "https://github.com/cypt71/platform-factory/blob/main/internal/app/sbom/sbom.go"
click node_provenance "https://github.com/cypt71/platform-factory/blob/main/internal/provenance/provenance.go"
click node_policy "https://github.com/cypt71/platform-factory/blob/main/internal/policy/policy.go"
click node_registry "https://github.com/cypt71/platform-factory/blob/main/internal/registry/client.go"
click node_deploy "https://github.com/cypt71/platform-factory/blob/main/internal/app/deploy/deploy.go"
click node_marketplace "https://github.com/cypt71/platform-factory/blob/main/internal/marketplace/manager.go"
click node_plugin "https://github.com/cypt71/platform-factory/blob/main/internal/plugin/client.go"
click node_container "https://github.com/cypt71/platform-factory/blob/main/internal/ociruntime/runtime.go"
click node_microvm "https://github.com/cypt71/platform-factory/blob/main/internal/hypervisor/kvm/kvm_linux.go"
click node_runtime_cmd "https://github.com/cypt71/platform-factory/blob/main/cmd/platform-factory-runtime/main.go"
click node_control_plane "https://github.com/cypt71/platform-factory/blob/main/cmd/platform-factory-control-plane/server.go"
click node_worker "https://github.com/cypt71/platform-factory/blob/main/internal/app/workerpipeline/workerpipeline.go"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_project,node_oci,node_pipeline_cli,node_pipeline_service,node_installer toneBlue
class node_verify,node_sbom,node_provenance,node_policy toneAmber
class node_container,node_microvm,node_runtime_cmd toneMint
class node_registry,node_deploy,node_marketplace,node_plugin toneRose
class node_control_plane,node_worker,node_engineer,node_marketplace_user,node_cluster toneIndigo
```

## Components

### Build and projects

- [Platform Factory CLI](https://github.com/cypt71/platform-factory/blob/main/cmd/platform-factory/main.go): `cmd/platform-factory/main.go`
- [Project lifecycle](https://github.com/cypt71/platform-factory/tree/main/internal/app/project): `internal/app/project`
- [OCI image builder](https://github.com/cypt71/platform-factory/blob/main/oci/builder.go): `oci/builder.go`
- [Pipeline commands](https://github.com/cypt71/platform-factory/blob/main/cmd/platform-factory/pipeline.go): `cmd/platform-factory/pipeline.go`
- [Pipeline service](https://github.com/cypt71/platform-factory/blob/main/internal/app/pipeline/pipeline.go): `internal/app/pipeline/pipeline.go`
- [Binary installer](https://github.com/cypt71/platform-factory/blob/main/cmd/platform-factory-installer/main.go): `cmd/platform-factory-installer/main.go`

### Supply-chain evidence

- [Image and release verification](https://github.com/cypt71/platform-factory/blob/main/internal/app/verify/verify.go): `internal/app/verify/verify.go`
- [SBOM generation](https://github.com/cypt71/platform-factory/blob/main/internal/app/sbom/sbom.go): `internal/app/sbom/sbom.go`
- [Provenance and signing](https://github.com/cypt71/platform-factory/blob/main/internal/provenance/provenance.go): `internal/provenance/provenance.go`
- [Policy evaluation](https://github.com/cypt71/platform-factory/blob/main/internal/policy/policy.go): `internal/policy/policy.go`

### Workload execution

- [Hardened container runtime](https://github.com/cypt71/platform-factory/blob/main/internal/ociruntime/runtime.go): `internal/ociruntime/runtime.go`
- [Native microVM](https://github.com/cypt71/platform-factory/blob/main/internal/hypervisor/kvm/kvm_linux.go): `internal/hypervisor/kvm/kvm_linux.go`
- [OCI runtime facade](https://github.com/cypt71/platform-factory/blob/main/cmd/platform-factory-runtime/main.go): `cmd/platform-factory-runtime/main.go`

### Distribution and extensions

- [OCI registry client](https://github.com/cypt71/platform-factory/blob/main/internal/registry/client.go): `internal/registry/client.go`
- [Deployment and rollback](https://github.com/cypt71/platform-factory/blob/main/internal/app/deploy/deploy.go): `internal/app/deploy/deploy.go`
- [Plugin marketplace](https://github.com/cypt71/platform-factory/blob/main/internal/marketplace/manager.go): `internal/marketplace/manager.go`
- [Verified plugin runtime](https://github.com/cypt71/platform-factory/blob/main/internal/plugin/client.go): `internal/plugin/client.go`

### Remote coordination

- [Control-plane API](https://github.com/cypt71/platform-factory/blob/main/cmd/platform-factory-control-plane/server.go): `cmd/platform-factory-control-plane/server.go`
- [Pipeline worker](https://github.com/cypt71/platform-factory/blob/main/internal/app/workerpipeline/workerpipeline.go): `internal/app/workerpipeline/workerpipeline.go`

### Other components

- **Platform engineer**
- **Plugin consumer**
- **Kubernetes or containerd**

## Connections

- Platform engineer → Platform Factory CLI: invokes (evidence: `README.md`)
- Platform Factory CLI → OCI image builder: builds image (evidence: `README.md`)
- Platform Factory CLI → Project lifecycle: manages project (evidence: `README.md`)
- Platform Factory CLI → Image and release verification: verifies image (evidence: `README.md`)
- Platform Factory CLI → SBOM generation: generates SBOM (evidence: `README.md`)
- Platform Factory CLI → Provenance and signing: creates evidence (evidence: `README.md`)
- Platform Factory CLI → Policy evaluation: evaluates policy (evidence: `README.md`)
- Platform Factory CLI → Pipeline commands: runs pipelines (evidence: `README.md`)
- Pipeline commands → Pipeline service: calls service (evidence: `cmd/platform-factory/pipeline.go`)
- Pipeline service → Image and release verification: validates inputs
- Platform Factory CLI → OCI registry client: publishes image (evidence: `README.md`)
- Platform Factory CLI → Deployment and rollback: deploys workload (evidence: `README.md`)
- Platform Factory CLI → OCI runtime facade: launches workload (evidence: `README.md`)
- OCI runtime facade → Hardened container runtime: manages state (evidence: `cmd/platform-factory-runtime/main.go`)
- OCI runtime facade → Native microVM: launches guest
- Kubernetes or containerd → OCI runtime facade: selects runtime (evidence: `README.md`)
- Platform Factory CLI → Plugin marketplace: manages plugins (evidence: `README.md`)
- Plugin consumer → Plugin marketplace: installs plugins (evidence: `README.md`)
- Platform Factory CLI → Verified plugin runtime: activates plugins (evidence: `README.md`)
- Platform Factory CLI → Binary installer: installs binaries
- Control-plane API → Pipeline worker: leases pipelines
- Pipeline worker → Pipeline service: runs stages
