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
| Phase | Name | State at 0.8.4 | Where it lives |
|---|---|---|---|
| K0 | Foundation | In the code, in use | boot.rs, console.rs, config.rs, error.rs. See Boot Sequence |
| K1 | Process and supervision | In the code, in use | process.rs, supervisor.rs, capability.rs. See Process Table, Capabilities. Restart strategies need the off-by-default os-patterns feature (Self-Healing) |
| K2 | IPC and communication | In the code, in use | ipc.rs, a2a.rs, topic.rs, agent_loop.rs, cron.rs, health.rs, service.rs. See IPC |
| K2b | Hardening | In the code | Chain-logged IPC events, SIGTERM and SIGHUP handling in the daemon, governance gate wired into the router |
| ExoChain | Cryptographic audit | In the code, default feature | chain.rs, tree_manager.rs, gate.rs. See ExoChain |
| K2.1 | Symposium changes | SpawnBackend exists and only Native spawns; ServiceEntry and MessageTarget::Service exist | supervisor.rs, ipc.rs |
| K3 | WASM sandbox | Runner and 36-spec catalog exist; wasmtime is behind the off-by-default wasm-sandbox feature | wasm_runner/. See WASM Sandbox |
| K3c | ECC cognitive substrate | In the code, default feature ecc | causal.rs, cognitive_tick.rs, hnsw_service.rs and others. See ECC |
| K4 | Containers | Types and registry only; the manager has no engine and refuses to start containers outside simulation. Container workloads run through workload_runtime | container.rs. See Containers |
| K5 | App framework | In the code | app.rs, weaver app. See App Framework |
| K6 | Mesh networking | Well past the original Phase 1: TCP, WebSocket and QUIC transports, Noise sessions, admission, discovery (mDNS, Kademlia), liveness, artifact transfer, leaf devices | mesh*.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:
| Decision | Change | Evidence |
|---|---|---|
| D3 | SpawnBackend enum on SpawnRequest | supervisor.rs: only None and Native spawn |
| D11 | Ed25519 plus ML-DSA-65 dual signing | chain.rs: ML-DSA key is optional |
| D14 | SpawnBackend::Tee variant | supervisor.rs: returns BackendNotAvailable |
| D1 | ServiceEntry as a registry concept | service.rs |
| D19 | MessageTarget::Service(name) routing | ipc.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 + replicationIntegration 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.