platform-factory

module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 17, 2026 License: MIT

README

Platform Factory

Quality OCI validation Security analysis Reproducibility Runtime integration MicroVM boot CodeQL analysis Fuzz validation Release evidence Benchmark OCI compatibility Supply-chain E2E

Platform Factory turns a compiled executable into a deterministic OCI image, attaches native supply-chain evidence, and runs the result as a hardened container or a KVM/HVF microVM — one Go binary, no Docker daemon and no external SBOM/signing/scanning tools required for the core path.

Scope: Platform Factory is the build, supply-chain and execution layer that plugs into your existing stack. It does not replace Kubernetes, a CI orchestrator (GitHub Actions, GitLab CI, Jenkins), or a general-purpose container registry — it produces the image, the evidence, and the running workload that those systems schedule, trigger and store.

Who it's for

  • Platform engineers who want one static Go binary instead of wiring together Docker, BuildKit, cosign, syft and skopeo for a build-to-deploy pipeline.
  • Security-conscious teams who need byte-for-byte reproducible builds and independently verifiable SBOM/provenance/signature evidence, without trusting a remote build service with source or credentials.
  • Teams running legacy or non-containerizable binaries — dynamically linked, or requiring stronger-than-namespace isolation — who want microVM execution without operating Firecracker or Cloud Hypervisor.

Capabilities

Build — a deterministic OCI image builder with no Docker daemon, BuildKit, or CGO dependency; a project lifecycle (detect, freeze, build, run, diff, migrate); and a language-neutral pipeline engine that runs each stage in a fresh, sandboxed namespace and extends via out-of-process, signature-verified plugins.

Supply chain — native SBOM generation, SLSA-style provenance, Ed25519/ECDSA signing, and policy evaluation, all in-process; hermetic rebuild verification proves a build is byte-identical before it's trusted.

Distribution — a native Registry client with resumable uploads, publish with pre-flight verification, and deploy/rollback against a restricted Kubernetes Deployment contract.

Execution — the same run verb launches a hardened container (Docker or Podman) or a native KVM/HVF microVM; containerd and a Kubernetes RuntimeClass can select the microVM path per workload without changing the node's default runtime.

What makes this different

Every stage validates its own output rather than trusting the one before it — the OCI layout, SBOM, provenance and signature all come from the same native Go implementation instead of five external tools with five different trust boundaries. The tradeoff is a stricter build contract than a general Dockerfile: inputs must be locked and pre-built, and automatic dependency resolution stays out of scope on purpose, in exchange for output whose determinism and evidence chain the tool itself can verify end to end.

Quick start

CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -ldflags='-s -w' -o service ./cmd/your-service
go run ./cmd/oci-builder -binary ./service -output ./oci-image -arch amd64
go run ./cmd/platform-factory verify ./oci-image
go run ./cmd/platform-factory run --runtime podman ./oci-image

Install the full CLI (platform-factory, alias pf) locally:

./install.sh
pf version

Documentation

Production documentation lives in the project wiki: start with the production adoption guide, then review the architecture decisions, threat model, GHCR/Cosign/Kubernetes demonstration, benchmarks, and OCI compatibility matrix.

Directories

Path Synopsis
api
microvm/v1
Package v1 defines stable microVM configuration and port-forwarding types.
Package v1 defines stable microVM configuration and port-forwarding types.
migration/v1
Package v1 defines stable migration resources, graphs, plans, bundles, and validation rules.
Package v1 defines stable migration resources, graphs, plans, bundles, and validation rules.
oci/v1
Package v1 defines the stable OCI image build contract.
Package v1 defines the stable OCI image build contract.
pipeline/v1
Package v1 validates stable pipeline documents.
Package v1 validates stable pipeline documents.
pipeline/v1alpha1
Package v1alpha1 defines the first language-neutral pipeline wire format.
Package v1alpha1 defines the first language-neutral pipeline wire format.
pipeline/v1beta1
Package v1beta1 defines the frozen beta pipeline wire format.
Package v1beta1 defines the frozen beta pipeline wire format.
plugin/v1
Package v1 defines stable plugin manifests, capabilities, and RPC messages.
Package v1 defines stable plugin manifests, capabilities, and RPC messages.
vmm/v1
Package v1 defines stable backend-neutral VMM lifecycle types.
Package v1 defines stable backend-neutral VMM lifecycle types.
cmd
example-service command
example-service is a tiny stdlib-only HTTP API used as a fixture by the local Podman and microVM tooling under scripts/.
example-service is a tiny stdlib-only HTTP API used as a fixture by the local Podman and microVM tooling under scripts/.
microvm-init command
microvm-init is a tiny PID 1 for the scripts/microvm boot path.
microvm-init is a tiny PID 1 for the scripts/microvm boot path.
microvm-initramfs command
microvm-initramfs assembles a Linux kernel initramfs natively from a verified local OCI image layout: it converts the layout's rootfs with internal/rootfs.Convert, installs the project's PID 1 (built separately from cmd/microvm-init) and an optional fixed entrypoint, then packs the result into a deterministic gzip-compressed cpio archive with internal/rootfs.WriteInitramfs.
microvm-initramfs assembles a Linux kernel initramfs natively from a verified local OCI image layout: it converts the layout's rootfs with internal/rootfs.Convert, installs the project's PID 1 (built separately from cmd/microvm-init) and an optional fixed entrypoint, then packs the result into a deterministic gzip-compressed cpio archive with internal/rootfs.WriteInitramfs.
oci-builder command
oci-builder creates a secure OCI Image Layout from a compiled Go binary.
oci-builder creates a secure OCI Image Layout from a compiled Go binary.
platform-factory command
Helpers shared by every native microVM backend's own runNativeKVM implementation (microvm_native_linux_amd64.go's KVM backend, microvm_native_darwin.go's HVF backend) - pure Go, no platform-specific syscalls, so this file carries no build tag at all.
Helpers shared by every native microVM backend's own runNativeKVM implementation (microvm_native_linux_amd64.go's KVM backend, microvm_native_darwin.go's HVF backend) - pure Go, no platform-specific syscalls, so this file carries no build tag at all.
platform-factory-conformance command
platform-factory-conformance runs the public conformance suite.
platform-factory-conformance runs the public conformance suite.
platform-factory-control-plane command
platform-factory-control-plane exposes internal/control's coordination logic over an authenticated HTTP API.
platform-factory-control-plane exposes internal/control's coordination logic over an authenticated HTTP API.
platform-factory-packager command
platform-factory-packager creates deterministic, relocatable release archives from an environment produced by scripts/local/bootstrap.sh.
platform-factory-packager creates deterministic, relocatable release archives from an environment produced by scripts/local/bootstrap.sh.
platform-factory-plugin-demo command
platform-factory-plugin-demo is the minimal reference language extension.
platform-factory-plugin-demo is the minimal reference language extension.
platform-factory-plugin-languages command
platform-factory-plugin-languages is the official language adapter plugin.
platform-factory-plugin-languages is the official language adapter plugin.
platform-factory-worker command
platform-factory-worker registers with a platform-factory-control-plane over mutual TLS, polls for leases, and reports completion.
platform-factory-worker registers with a platform-factory-control-plane over mutual TLS, polls for leases, and reports completion.
Package conformance is the public conformance suite for the secure-oci stable v1 pipeline API (including its v1alpha1/v1beta1 compatibility inputs) and the v1 plugin protocol.
Package conformance is the public conformance suite for the secure-oci stable v1 pipeline API (including its v1alpha1/v1beta1 compatibility inputs) and the v1 plugin protocol.
demo
hello-world command
examples
sdk/microvm command
sdk/oci command
Command oci-sdk-example builds a secure OCI image by consuming sdk/oci directly, then shows both ways the resulting image can run: as an ordinary container (no platform-factory code involved at all) or, opt-in, under the platform-factory MicroVM runtime (sdk/microvm).
Command oci-sdk-example builds a secure OCI image by consuming sdk/oci directly, then shows both ways the resulting image can run: as an ordinary container (no platform-factory code involved at all) or, opt-in, under the platform-factory MicroVM runtime (sdk/microvm).
sdk/pipeline command
sdk/plugin-go command
internal
app/doctor
Package doctor is the application-layer service behind `pf doctor` - devenir une façade").
Package doctor is the application-layer service behind `pf doctor` - devenir une façade").
app/migration
Package migration contains application orchestration for migrations.
Package migration contains application orchestration for migrations.
app/projectinit
Package projectinit owns the application use-case for scaffolding a local Platform Factory project.
Package projectinit owns the application use-case for scaffolding a local Platform Factory project.
app/sbom
Package sbom is the application-layer service behind `pf sbom` - extraction internal/app/doctor already did for `pf doctor`.
Package sbom is the application-layer service behind `pf sbom` - extraction internal/app/doctor already did for `pf doctor`.
app/verify
Package verify is the application-layer service behind internal/app/doctor and internal/app/sbom already did for `pf doctor` and `pf sbom`.
Package verify is the application-layer service behind internal/app/doctor and internal/app/sbom already did for `pf doctor` and `pf sbom`.
archtest
Package archtest provides executable checks for repository dependency boundaries.
Package archtest provides executable checks for repository dependency boundaries.
assemble
Package assemble bridges a pipeline's declared, cached stage outputs to a real OCI image layout.
Package assemble bridges a pipeline's declared, cached stage outputs to a real OCI image layout.
atomicfile
Package atomicfile publishes complete files without exposing partial writes.
Package atomicfile publishes complete files without exposing partial writes.
attestation
Package attestation creates and verifies project-owned DSSE envelopes.
Package attestation creates and verifies project-owned DSSE envelopes.
budget
Package budget provides resource budget tracking and enforcement for pipeline execution and other long-running operations.
Package budget provides resource budget tracking and enforcement for pipeline execution and other long-running operations.
cache
Package cache provides the concrete implementation of core.CacheStore interface.
Package cache provides the concrete implementation of core.CacheStore interface.
control
Package control coordinates workers and leases independently of transport.
Package control coordinates workers and leases independently of transport.
core
Package core defines the abstract interfaces for Platform Factory's domain.
Package core defines the abstract interfaces for Platform Factory's domain.
detect
Package detect classifies application inputs without executing them.
Package detect classifies application inputs without executing them.
errors
Package errors provides a common typed error model for all platform-factory components.
Package errors provides a common typed error model for all platform-factory components.
executor
Package executor runs a single validated pipeline stage as a local OS process.
Package executor runs a single validated pipeline stage as a local OS process.
guesttransport
Package guesttransport implements the small authenticated control protocol shared by native VMM backends and the in-guest agent.
Package guesttransport implements the small authenticated control protocol shared by native VMM backends and the in-guest agent.
hypervisor/hvf
Package vmm's darwin backend drives Apple's Virtualization.framework directly (vz_bridge_darwin.{h,m}) - no QEMU, no other third-party VMM.
Package vmm's darwin backend drives Apple's Virtualization.framework directly (vz_bridge_darwin.{h,m}) - no QEMU, no other third-party VMM.
hypervisor/sandbox
Package sandbox provides VMM sandboxing and isolation mechanisms.
Package sandbox provides VMM sandboxing and isolation mechanisms.
hypervisor/virtio
Package virtio provides virtio block device.
Package virtio provides virtio block device.
hypervisor/whpx
Package vmm's windows backend drives the Windows Hypervisor Platform (WHP, WinHvPlatform.dll) directly via syscall - no cgo, no external module, matching this repository's minimal-dependency convention.
Package vmm's windows backend drives the Windows Hypervisor Platform (WHP, WinHvPlatform.dll) directly via syscall - no cgo, no external module, matching this repository's minimal-dependency convention.
idempotency
Package idempotency persists crash-safe operation outcomes.
Package idempotency persists crash-safe operation outcomes.
layout
Package layout inspects and strictly verifies OCI image layouts.
Package layout inspects and strictly verifies OCI image layouts.
marketplace
Package marketplace implements a Go-modules-inspired plugin marketplace: plugins are never hosted directly, only discovered.
Package marketplace implements a Go-modules-inspired plugin marketplace: plugins are never hosted directly, only discovered.
mcp
Package mcp implements a native Model Context Protocol server for platform-factory: a stdio JSON-RPC transport (protocol.go, server.go), a tool/resource registry (tools.go, resources.go), and typed error mapping (errors.go), with the actual platform-factory-specific tools implemented in the project/, plugins/, core/, git/, and agent/ subpackages.
Package mcp implements a native Model Context Protocol server for platform-factory: a stdio JSON-RPC transport (protocol.go, server.go), a tool/resource registry (tools.go, resources.go), and typed error mapping (errors.go), with the actual platform-factory-specific tools implemented in the project/, plugins/, core/, git/, and agent/ subpackages.
mcp/agent
Package agent implements the MCP server's opt-in, server-embedded LLM orchestration: pf_plugin_modify, the free-text mode of pf_core_patch, and pf_implement.
Package agent implements the MCP server's opt-in, server-embedded LLM orchestration: pf_plugin_modify, the free-text mode of pf_core_patch, and pf_implement.
mcp/core
Package core implements the pf_core_inspect/pf_core_validate/ pf_core_patch tools and the pf://core, pf://core/packages resources: a read-only map of this repository's internal/ domain packages plus bounded, scoped write primitives for proposing a core change.
Package core implements the pf_core_inspect/pf_core_validate/ pf_core_patch tools and the pf://core, pf://core/packages resources: a read-only map of this repository's internal/ domain packages plus bounded, scoped write primitives for proposing a core change.
mcp/docutil
Package docutil reads a Go package's doc comment straight off disk - the first line of the comment block immediately preceding "package NAME" in one of its non-test source files - without a full go/doc parse.
Package docutil reads a Go package's doc comment straight off disk - the first line of the comment block immediately preceding "package NAME" in one of its non-test source files - without a full go/doc parse.
mcp/git
Package git provides the MCP server's only path to git/gh: typed, argument-array operations (status, branch, commit, push, PR) confined to one repository directory, mirroring internal/marketplace/sync.go's existing gitEnv/runGit hardening.
Package git provides the MCP server's only path to git/gh: typed, argument-array operations (status, branch, commit, push, PR) confined to one repository directory, mirroring internal/marketplace/sync.go's existing gitEnv/runGit hardening.
mcp/plugins
Package plugins implements the pf_plugin_* tools and the pf://plugins, pf://plugins/schema, pf://marketplace resources: a read-only and creation interface onto this repository's own plugins/ directory.
Package plugins implements the pf_plugin_* tools and the pf://plugins, pf://plugins/schema, pf://marketplace resources: a read-only and creation interface onto this repository's own plugins/ directory.
mcp/product
Package product exposes platform-factory's own end-user product commands (init, build, publish, deploy, status, doctor, detect, verify/inspect) as MCP tools - the CLI capability an MCP client uses this server for beyond just inspecting/modifying platform-factory's own source, letting it drive the same "build and ship a project" workflow a human would from a terminal.
Package product exposes platform-factory's own end-user product commands (init, build, publish, deploy, status, doctor, detect, verify/inspect) as MCP tools - the CLI capability an MCP client uses this server for beyond just inspecting/modifying platform-factory's own source, letting it drive the same "build and ship a project" workflow a human would from a terminal.
mcp/project
Package project implements the pf_project_inspect tool and the pf://project / pf://architecture resources: a read-only summary of this repository's identity (module, version, git state) and its major components.
Package project implements the pf_project_inspect tool and the pf://project / pf://architecture resources: a read-only summary of this repository's identity (module, version, git state) and its major components.
microvm
Package microvm owns the contracts used by the in-process microVM domain.
Package microvm owns the contracts used by the in-process microVM domain.
microvm/forward
Package forward is a minimal host-port -> guest-port TCP relay: it accepts connections on a host listener and splices each one to a freshly dialed connection on the guest side.
Package forward is a minimal host-port -> guest-port TCP relay: it accepts connections on a host listener and splices each one to a freshly dialed connection on the guest side.
migration
Package migration owns the private migration domain model and invariants.
Package migration owns the private migration domain model and invariants.
mtls
Package mtls creates conservative TLS configurations for service clients and servers.
Package mtls creates conservative TLS configurations for service clients and servers.
networking
Package networking validates runtime network configuration without executing a container engine, QEMU, or a Kubernetes client.
Package networking validates runtime network configuration without executing a container engine, QEMU, or a Kubernetes client.
observability
Package observability provides structured logging, metrics, and tracing.
Package observability provides structured logging, metrics, and tracing.
oci
Package oci writes small, deterministic OCI image layouts without a daemon.
Package oci writes small, deterministic OCI image layouts without a daemon.
ociruntime
Package ociruntime implements the persistent OCI lifecycle used by container engines to run MicroVM workloads.
Package ociruntime implements the persistent OCI lifecycle used by container engines to run MicroVM workloads.
pipeline
Package pipeline provides checkpoint and resume functionality for pipeline execution.
Package pipeline provides checkpoint and resume functionality for pipeline execution.
placement
Package placement selects pending leases by platform, capability, cache locality, and priority.
Package placement selects pending leases by platform, capability, cache locality, and priority.
plugin
Package plugin is the host side of the out-of-process plugin boundary: it launches plugin subprocesses, performs the handshake, verifies signed digest-pinned manifests and discovers installed plugins.
Package plugin is the host side of the out-of-process plugin boundary: it launches plugin subprocesses, performs the handshake, verifies signed digest-pinned manifests and discovers installed plugins.
policy
Package policy evaluates the minimal, versioned native publication policy.
Package policy evaluates the minimal, versioned native publication policy.
project
Package project loads and validates declarative, language-neutral project image configuration.
Package project loads and validates declarative, language-neutral project image configuration.
provenance
Package provenance builds native build provenance records: the complete pipeline DAG, its declared inputs, resolved output digests, and caller-supplied build metadata.
Package provenance builds native build provenance records: the complete pipeline DAG, its declared inputs, resolved output digests, and caller-supplied build metadata.
publicationtarget
Package publicationtarget defines deterministic, side-effect-free target contracts shared by the CLI and the public conformance suite.
Package publicationtarget defines deterministic, side-effect-free target contracts shared by the CLI and the public conformance suite.
quota
Package quota provides tenant-level resource quotas, priorities, and fairness for the pipeline scheduler and distributed execution system.
Package quota provides tenant-level resource quotas, priorities, and fairness for the pipeline scheduler and distributed execution system.
registry
Package registry implements the project-owned OCI Distribution client.
Package registry implements the project-owned OCI Distribution client.
rootfs
Package rootfs converts a verified local OCI image layout into a safe, deterministic filesystem tree without invoking external tools.
Package rootfs converts a verified local OCI image layout into a safe, deterministic filesystem tree without invoking external tools.
sbom
Package sbom generates a native software bill of materials: an inventory of local files correlated with their detected kind and ELF dependencies via internal/detect.
Package sbom generates a native software bill of materials: an inventory of local files correlated with their detected kind and ELF dependencies via internal/detect.
scheduler
Package scheduler provides pipeline graph validation and analysis.
Package scheduler provides pipeline graph validation and analysis.
signing
Package signing signs build artifacts with Ed25519 and verifies those signatures, using Go's native crypto/ed25519 rather than an external signing CLI.
Package signing signs build artifacts with Ed25519 and verifies those signatures, using Go's native crypto/ed25519 rather than an external signing CLI.
strictjson
Package strictjson decodes one JSON value and rejects schema drift.
Package strictjson decodes one JSON value and rejects schema drift.
vmdisk
Package vmdisk identifies legacy virtual-machine disk image formats by header inspection only.
Package vmdisk identifies legacy virtual-machine disk image formats by header inspection only.
workloadstate
Package workloadstate is the durable counterpart to internal/core.RuntimeState/TransitionTo: the state machine itself is a pure, in-memory transition validator with no persistence opinion (see statemachine.go's own package doc), which is correct for a library but leaves nothing for a CLI command - whose process exits between every invocation - to read a workload's last known Phase back from before calling TransitionTo again.
Package workloadstate is the durable counterpart to internal/core.RuntimeState/TransitionTo: the state machine itself is a pure, in-memory transition validator with no persistence opinion (see statemachine.go's own package doc), which is correct for a library but leaves nothing for a CLI command - whose process exits between every invocation - to read a workload's last known Phase back from before calling TransitionTo again.
sdk
langplugin
Package langplugin implements the supported protocol and utilities for platform-factory-lang-* plugins.
Package langplugin implements the supported protocol and utilities for platform-factory-lang-* plugins.
microvm
Package microvm defines portable microVM configuration and VMM lifecycle contracts.
Package microvm defines portable microVM configuration and VMM lifecycle contracts.
migration
Package migration constructs, seals, and verifies versioned migration plans.
Package migration constructs, seals, and verifies versioned migration plans.
oci
Package oci builds deterministic OCI image layouts without a container daemon.
Package oci builds deterministic OCI image layouts without a container daemon.
pipeline
Package pipeline loads and validates pipeline definitions.
Package pipeline loads and validates pipeline definitions.
plugin
Package plugin implements the framed v1 protocol for out-of-process plugins.
Package plugin implements the framed v1 protocol for out-of-process plugins.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL