clawft

Kernel Phases (K0-K6)

The kernel build order K0 to K6, what each phase delivered by 0.8.4, and where later work is tracked.

WeftOS was built in incremental phases (K0 through K6). Each phase added a layer of OS capability to the kernel, and the module headers in crates/clawft-kernel/src/ still carry the phase labels (for example lib.rs: wasm-sandbox is "Phase K3", containers is "Phase K4", ecc is "Phase K3c"). The phases are the original build order. Work since 0.8.0 is organized by ADR and card instead, so this page maps the phases to what is in the 0.8.4 code and points at where newer work is described.

Earlier versions of this page carried per-phase test counts (373+, 479, 560+). Those figures were not recomputed and are removed; run scripts/build.sh test clawft-kernel for current counts.

Phase summary

PhaseNameState at 0.8.4Where it lives
K0FoundationIn the code, in useboot.rs, console.rs, config.rs, error.rs. See Boot Sequence
K1Process and supervisionIn the code, in useprocess.rs, supervisor.rs, capability.rs. See Process Table, Capabilities. Restart strategies need the off-by-default os-patterns feature (Self-Healing)
K2IPC and communicationIn the code, in useipc.rs, a2a.rs, topic.rs, agent_loop.rs, cron.rs, health.rs, service.rs. See IPC
K2bHardeningIn the codeChain-logged IPC events, SIGTERM and SIGHUP handling in the daemon, governance gate wired into the router
ExoChainCryptographic auditIn the code, default featurechain.rs, tree_manager.rs, gate.rs. See ExoChain
K2.1Symposium changesSpawnBackend exists and only Native spawns; ServiceEntry and MessageTarget::Service existsupervisor.rs, ipc.rs
K3WASM sandboxRunner and 36-spec catalog exist; wasmtime is behind the off-by-default wasm-sandbox featurewasm_runner/. See WASM Sandbox
K3cECC cognitive substrateIn the code, default feature ecccausal.rs, cognitive_tick.rs, hnsw_service.rs and others. See ECC
K4ContainersTypes and registry only; the manager has no engine and refuses to start containers outside simulation. Container workloads run through workload_runtimecontainer.rs. See Containers
K5App frameworkIn the codeapp.rs, weaver app. See App Framework
K6Mesh networkingWell past the original Phase 1: TCP, WebSocket and QUIC transports, Noise sessions, admission, discovery (mDNS, Kademlia), liveness, artifact transfer, leaf devicesmesh*.rs (54 non-test modules). See Mesh Networking

What is not covered by the K-phases

These were added after the phase plan and are tracked by ADR:

  • Governed workload placement and the cog workload kind (ADR-099, ADR-100), the Seed licence proxy (ADR-106), mesh resources and exposures (ADR-120), the AI org (ADR-121) and the cog data plane broker cogbus (ADR-122): see the platform pages under Platform.
  • Weave project topology and per-project kernels (ADR-103).
  • Spatial and BVH indexing (ADR-056).

K2.1 symposium decisions

The K2 Symposium (22 decisions, 10 approved changes) produced these breaking changes and quick wins, still visible in the code:

DecisionChangeEvidence
D3SpawnBackend enum on SpawnRequestsupervisor.rs: only None and Native spawn
D11Ed25519 plus ML-DSA-65 dual signingchain.rs: ML-DSA key is optional
D14SpawnBackend::Tee variantsupervisor.rs: returns BackendNotAvailable
D1ServiceEntry as a registry conceptservice.rs
D19MessageTarget::Service(name) routingipc.rs

Phase dependency graph

K0 Foundation
 -> K1 Process + supervision
 -> K2 IPC + communication  -> ExoChain (chain, tree, gate)
 -> K2b Hardening
 -> K3 WASM sandbox + K3c ECC
 -> K4 Containers
 -> K5 App framework + clustering
 -> K6 Mesh networking + replication

Integration checklist

Every new module should satisfy the checklist in the Kernel Developer Guide. This page used to show it with every box ticked; that was a status claim nobody re-verified per phase, so it is not repeated here.

Implementation priority (K2 Symposium D21)

Ordering was K3, then K4, K5, K6, with iteration; the phases were a development cycle, not a strict waterfall. The effort estimates that used to be listed here (25, 20, 35 and 40 hours) were planning figures from 2026-03 and are dropped.

On this page