Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ identity does not inherit old authority merely because continuity was demonstrat
|---|---:|---|
| **Shell / MCP** | active | operator interface, workflows, resources, prompts, capability surfaces |
| **Spine** | **v0.24** | authority-aware observation, verification, evidence, and receipts |
| **App Platform** | **v0.50** | governed intake, build, install, launch, update, rollback, cleanup, and release lineage |
| **App Platform** | **v0.51** | governed intake, toolchain matching, build, install, launch, update, rollback, cleanup, and release lineage |
| **PhiReflex** | **v0.10** | provider-neutral fast advisory layer with authenticated bounded routing influence |
| **Governed Memory** | active | canonical local memory, derived semantic index, read admissibility, temporal horizon |
| **Reality Ledger** | active | append-only evidence plus bounded read-only analytics |
Expand Down Expand Up @@ -172,10 +172,10 @@ unless the broader claim is separately observed and verified.
Current contract:
[Spine v0.24 numeric-transition verification](docs/PHIOS_SPINE_V0.24_NUMERIC_TRANSITION_CONTRACT.md).

### App Platform v0.50
### App Platform v0.51

The App Platform provides a governed lifecycle from public source intake through
exact-commit acquisition, reviewed build planning, Linux sandboxing, dependency staging,
exact-commit acquisition, reviewed build planning, digest-bound toolchain capsule matching, Linux sandboxing, dependency staging,
offline build, artifact installation, visible/persistent launch, app cataloging,
side-by-side update, separately authorized rollback, cleanup recovery, release discovery,
human review, execution lineage, package lineage, and release-install proposal gating.
Expand All @@ -194,7 +194,9 @@ update != rollback authority
```

Current contract:
[App Platform v0.50 release-install proposal gate](docs/PHIOS_APP_PLATFORM_V0.50_RELEASE_INSTALL_PROPOSAL_GATE.md).
[App Platform v0.51 toolchain capsules](docs/PHIOS_APP_PLATFORM_V0.51_TOOLCHAIN_CAPSULES.md).

v0.51 is additive: capsule compatibility is review evidence only and does not grant execution, network, install, or host-write authority.

### PhiReflex v0.10

Expand Down
210 changes: 210 additions & 0 deletions docs/PHIOS_APP_PLATFORM_V0.51_TOOLCHAIN_CAPSULES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
# PhiOS App Platform v0.51 — Toolchain Capsule Contract

## Status

Alpha contract.

New schemas:

- `phios.toolchain_requirement.v0.1`
- `phios.toolchain_capsule.v0.1`
- `phios.toolchain_binding.v0.1`

## Purpose

v0.28 can already identify several build families and the tools they require. v0.29 can probe and execute host tools. That is useful, but it leaves a gap between:

```text
this build needs Python / Node / Rust / Go
```

and:

```text
these exact toolchain bytes are the environment reviewed for this build
```

v0.51 introduces a declarative, digest-bound toolchain-capsule contract.

The central rule is:

> A toolchain can be compatible with a build without having authority to execute it.

## Supported v0.51 families

The first contract recognizes exactly four Linux x86_64 families:

| Family | Required tools |
| --- | --- |
| `node_npm` | `node`, `npm` |
| `python_pep517` | `python`, `python-build` |
| `rust_cargo` | `cargo`, `rustc` |
| `go_module` | `go` |

Current pnpm, Yarn and Bun build plans remain valid v0.28 observations, but v0.51 classifies them as `unsupported_toolchain`. Future adapters must get their own explicit contract rather than silently borrowing Node/npm semantics.

Static-web source that requires no build produces `no_capsule_required`.

## Requirement derivation

`derive_toolchain_requirement()` consumes an exact v0.28 `BuildPlan` and binds:

- app identity;
- exact commit;
- canonical build-plan SHA-256;
- strategy;
- required tools;
- one supported family when deterministically recognized;
- status.

Possible statuses are:

- `capsule_required`
- `no_capsule_required`
- `unsupported_toolchain`

Every requirement fixes:

```text
execution_authority = false
```

A requirement is evidence about what a build needs. It is not permission to obtain or run a toolchain.

## Capsule contract

A v0.51 capsule declares:

- bounded capsule ID;
- toolchain family;
- platform = `linux_x86_64`;
- artifact kind = `oci_image`;
- immutable artifact SHA-256;
- artifact reference;
- exact tool names and version strings;
- canonical capsule SHA-256.

The family fixes the exact tool-name set. A Node/npm capsule cannot omit npm, add pnpm, or masquerade as a Rust capsule.

The artifact reference is descriptive. The artifact SHA-256 is the immutable identity field.

v0.51 does not download, inspect, start or trust the referenced OCI artifact. Artifact acquisition and verification are separate future boundaries.

## Fixed zero-authority fields

Every capsule and every successful binding fixes:

```text
execution_authority = false
network_authority = false
install_authority = false
host_write_authority = false
```

These fields are validated, hashed, and fail closed if changed.

Therefore:

```text
capsule exists
!= capsule acquired

capsule acquired
!= capsule verified

capsule verified
!= build may execute

capsule matches requirement
!= build may execute

build may execute
!= network authority

build succeeds
!= install authority
```

## Binding

`bind_toolchain_capsule()` accepts only:

- a `capsule_required` requirement;
- an exact matching family;
- an exact matching tool set.

A successful binding records:

- app/commit/build-plan identity;
- requirement SHA-256;
- capsule SHA-256;
- family;
- status = `compatible_for_review`;
- fixed zero-authority fields.

The binding is review evidence only.

## Fail-closed behavior

v0.51 rejects:

- unknown schema fields;
- malformed digests;
- duplicate tools;
- missing or extra family tools;
- unsupported platform or artifact kind;
- non-false authority fields;
- digest tampering;
- capsule binding for a no-build or unsupported requirement;
- family mismatch;
- tool-set mismatch.

## Explicit non-capabilities

v0.51 does not:

- pull OCI images;
- invoke Docker, Podman, Bubblewrap or another container runtime;
- execute Node, npm, Python, Cargo, Rust or Go;
- install a compiler into the base PhiOS image;
- grant network access;
- grant host filesystem writes;
- replace v0.30 sandbox approval;
- replace dependency-broker approval;
- install or launch an application;
- infer trust from a version string;
- make a release-ready claim.

## Why capsules instead of a giant ISO

The base operating system should not need every compiler and package manager merely because a public repository might use one.

The intended future flow is:

```text
GitHub intake
-> exact source acquisition
-> build plan
-> toolchain requirement
-> reviewed capsule binding
-> verified capsule acquisition
-> dependency broker
-> network-denied sandbox execution
-> artifact verification
-> governed install
```

This keeps the base image smaller and preserves the PhiOS rule that capability and authority are separate.

## Next boundary

v0.52 should introduce governed capsule acquisition and verification.

That rung should prove that the locally available capsule bytes match the exact reviewed v0.51 artifact identity before any build executor can consume them.

It must still preserve:

```text
verified capsule
!= execution authority
```
26 changes: 26 additions & 0 deletions phios/apps/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,20 @@
plan_static_web_adapter,
review_static_web_adapter,
)
from .toolchain_capsule import (
TOOLCHAIN_BINDING_SCHEMA_VERSION,
TOOLCHAIN_CAPSULE_SCHEMA_VERSION,
TOOLCHAIN_REQUIREMENT_SCHEMA_VERSION,
ToolchainBinding,
ToolchainCapsule,
ToolchainFamily,
ToolchainPlatform,
ToolchainRequirement,
ToolchainRequirementStatus,
ToolchainTool,
bind_toolchain_capsule,
derive_toolchain_requirement,
)
from .visible_browser import (
VISIBLE_BROWSER_PLAN_SCHEMA_VERSION,
VISIBLE_BROWSER_RECEIPT_SCHEMA_VERSION,
Expand Down Expand Up @@ -360,6 +374,9 @@
"STATIC_WEB_ADAPTER_PLAN_SCHEMA_VERSION",
"STATIC_WEB_ADAPTER_REVIEW_SCHEMA_VERSION",
"STATIC_WEB_SERVE_RECEIPT_SCHEMA_VERSION",
"TOOLCHAIN_BINDING_SCHEMA_VERSION",
"TOOLCHAIN_CAPSULE_SCHEMA_VERSION",
"TOOLCHAIN_REQUIREMENT_SCHEMA_VERSION",
"VISIBLE_BROWSER_PLAN_SCHEMA_VERSION",
"VISIBLE_BROWSER_RECEIPT_SCHEMA_VERSION",
"VISIBLE_BROWSER_REVIEW_SCHEMA_VERSION",
Expand Down Expand Up @@ -505,6 +522,13 @@
"StaticWebServeRequest",
"StaticWebServeResult",
"SuccessfulBuildBinding",
"ToolchainBinding",
"ToolchainCapsule",
"ToolchainFamily",
"ToolchainPlatform",
"ToolchainRequirement",
"ToolchainRequirementStatus",
"ToolchainTool",
"StreamCapture",
"SubprocessBuildRunner",
"SubprocessNpmCommandRunner",
Expand All @@ -519,7 +543,9 @@
"WaylandBubblewrapRuntimeRunner",
"WaylandDisplayEvidence",
"WaylandSocketIdentity",
"bind_toolchain_capsule",
"default_phios_control_plane_surfaces",
"derive_toolchain_requirement",
"evaluate_control_plane_isolation",
"derive_npm_offline_build_plan",
"inspect_public_github_app",
Expand Down
Loading
Loading