Back to feed

sledtools/pika branch #143

pika-delete-legacy-runtime-residue

Fix pikaci rebase after frontend split

Target branch: master

Merge Commit: cd9677e171a183ee300e84ecb8a23ea920153a8c

branch: merged tutorial: ready ci: success
Open CI Details

Continuous Integration

CI: success

Compact status on the review page, with full logs on the CI page.

Open CI Details

Latest run #179 success

9 passed

head 942dd096acfe12b6a6ded265d059f8a7bd3de5d9 · queued 2026-03-27 01:43:54 · 9 lane(s)

queued 6s · ran 1m 44s

check-pika-rust · success check-pika-followup · success check-notifications · success check-agent-contracts · success check-pikachat · success check-pikachat-typescript · success check-apple-host-sanity · success check-pikachat-openclaw-e2e · success check-fixture · success

Summary

This branch removes legacy 'microvm' and 'control-plane' terminology from the pika codebase, replacing it with current product names ('pika-cloud', 'Incus', 'staged guest'). The changes span CI lane definitions, test fixtures, contract validation payloads, admin template assertions, documentation, and a user-facing status message. Two obsolete docs are deleted entirely. The net effect is that the codebase no longer references the retired vm-spawner / microVM runtime identity, aligning all surface area with the surviving Incus/OpenClaw provider contract.

Tutorial Steps

Rename CI lane enum variant from ControlPlane to PikaCloud

Intent: Replace the legacy 'AgentContractsControlPlaneUnit' enum variant with 'AgentContractsPikaCloudUnit' across all CI lane definitions and their consumers, reflecting the fact that the old control-plane package was renamed to pika-cloud.

Affected files: crates/jerichoci/src/model.rs, crates/jerichoci/src/run.rs, crates/pikaci/src/catalog.rs

Evidence
@@ -484,7 +484,7 @@ mod tests {
-        AgentContractsControlPlaneUnit,
+        AgentContractsPikaCloudUnit,
@@ -668,9 +668,7 @@ mod tests {
-                Self::AgentContractsControlPlaneUnit => {
-                    StagedLinuxRustTarget::PreMergeAgentContracts
-                }
+                Self::AgentContractsPikaCloudUnit => StagedLinuxRustTarget::PreMergeAgentContracts,
@@ -4478,7 +4478,7 @@ mod tests {
-        AgentContractsControlPlaneUnit,
+        AgentContractsPikaCloudUnit,
@@ -59,7 +59,7 @@ pub(crate) enum PikaStagedLinuxLane {
-    AgentContractsControlPlaneUnit,
+    AgentContractsPikaCloudUnit,

The AgentContractsControlPlaneUnit variant is renamed to AgentContractsPikaCloudUnit in three crates that define or mirror the staged Linux Rust lane enum:

  • crates/jerichoci/src/model.rs — the canonical CI model layer
  • crates/jerichoci/src/run.rs — the run-plan test doubles
  • crates/pikaci/src/catalog.rs — the pikaci lane catalog

Every match arm, constructor call, and assertion that referenced the old variant is updated in lockstep. The variant's command_config() output was already pointing at run-pika-cloud-unit-tests, so only the Rust symbol and job-ID strings needed to change. The arm in staged_linux_target() was also simplified from a block expression to a single-line return, removing unnecessary braces.

Rename job IDs and descriptions from 'agent-control-plane' to 'pika-cloud'

Intent: Update all job specification IDs and human-readable descriptions so CI logs, run plans, and target selectors consistently say 'pika-cloud' instead of the defunct 'agent-control-plane' name.

Affected files: crates/jerichoci/src/model.rs, crates/jerichoci/src/run.rs, crates/pikaci/src/targets.rs, crates/pikaci/src/main.rs

Evidence
@@ -805,7 +805,7 @@ mod tests {
-            id: "agent-control-plane-unit",
+            id: "pika-cloud-unit",
@@ -5784,8 +5784,8 @@ mod tests {
-            target_id: Some("agent-control-plane-unit".to_string()),
-            target_description: Some("Run all pika-agent-control-plane unit tests".to_string()),
+            target_id: Some("pika-cloud-unit".to_string()),
+            target_description: Some("Run all pika-cloud unit tests".to_string()),
@@ -130,8 +130,8 @@ pub(crate) fn target_spec(name: &str) -> anyhow::Result<TargetSpec> {
-        "agent-control-plane-unit" => single_job_target_spec(
-            "agent-control-plane-unit",
+        "pika-cloud-unit" => single_job_target_spec(
+            "pika-cloud-unit",
@@ -5793,16 +5793,14 @@ mod tests {
-                id: "execute-agent-control-plane-unit".to_string(),
-                description: "Run all pika-agent-control-plane unit tests in a remote Linux VM"
+                id: "execute-pika-cloud-unit".to_string(),
+                description: "Run all pika-cloud unit tests in a remote Linux VM".to_string(),

String-level references to the old job identity appear in:

  1. crates/pikaci/src/targets.rs — the target_spec match arm key and the agent_contract_jobs() factory both used "agent-control-plane-unit" as the job ID. Now "pika-cloud-unit".
  2. crates/jerichoci/src/model.rs and crates/jerichoci/src/run.rs — test fixtures that construct JobSpec and RunPlanRecord values carried the old ID and descriptions like "Run all pika-agent-control-plane unit tests". These are updated to "pika-cloud-unit" / "Run all pika-cloud unit tests".
  3. crates/pikaci/src/main.rs — the standalone_agent_contract_target_uses_staged_remote_linux_lane test and the rerun_falls_back_to_single_job_id test both passed "agent-control-plane-unit" to target_spec() and sample_job_record(). Updated accordingly.

The cargo test -p pika-cloud --lib command string in the run-plan execute node is also corrected from cargo test -p pika-agent-control-plane.

Update legacy-field rejection tests to use 'legacy_backend' payload

Intent: Ensure deserialization guard tests reject a realistic stale field name rather than a field that might still parse, keeping the 'fail closed' contract accurate after the microvm field was removed.

Affected files: crates/pika-managed-agent-contract/src/lib.rs, crates/pika-server/src/managed_runtime_contract.rs

Evidence
@@ -91,9 +91,10 @@ mod tests {
-            serde_json::from_str::<AgentProvisionRequest>(r#"{"microvm":{"kind":"openclaw"}}"#)
+        let err = serde_json::from_str::<AgentProvisionRequest>(
+            r#"{"legacy_backend":{"kind":"openclaw"}}"#,
+        )
@@ -128,9 +128,10 @@ mod tests {
-            serde_json::from_str::<AgentProvisionRequest>(r#"{"microvm":{"kind":"openclaw"}}"#)
+        let err = serde_json::from_str::<AgentProvisionRequest>(
+            r#"{"legacy_backend":{"kind":"openclaw"}}"#,
+        )

Two identical tests — one in pika-managed-agent-contract and one in pika-server — verify that AgentProvisionRequest strict deserialization rejects unknown fields. The payload was {"microvm":{"kind":"openclaw"}}, but since the microvm concept has been fully retired, the test payload is changed to {"legacy_backend":{"kind":"openclaw"}}. The assertion logic (expect_err + contains("unknown field")) is unchanged, so the contract guarantee is preserved while the fixture no longer accidentally references a real former field name.

Remove microvm path assertions from admin template tests

Intent: The admin dashboard and restore-confirm templates no longer render any microvm-specific paths, so the negative assertions checking for their absence are now dead code that could cause confusion.

Affected files: crates/pika-server/src/admin.rs

Evidence
@@ -85,7 +85,6 @@ mod tests {
-        assert!(!rendered.contains("/var/lib/microvms"));
@@ -111,7 +110,6 @@ mod tests {
-        assert!(!rendered.contains("/var/lib/microvms"));

Both admin_dashboard_renders_expected_sections and restore_confirm_dialog_renders_expected_sections contained a negative assertion assert!(!rendered.contains("/var/lib/microvms")). With the microvm runtime fully removed, the template source can never contain this path, making the assertion tautological. Removing it keeps the tests focused on positive contract verification (contains("Restore From Recovery Point"), etc.).

Update user-facing provisioning status message

Intent: Replace the last user-visible 'microVM' string with the current runtime name so end users see accurate status text during agent provisioning.

Affected files: rust/src/core/mod.rs

Evidence
@@ -10206,7 +10206,7 @@ mod tests {
-                    status_message: "Provisioning microVM...".into(),
+                    status_message: "Provisioning Incus environment...".into(),

In the core state module's test fixture for AgentProvisioningPhase::ProvisioningVm, the status message shown to users was "Provisioning microVM...". This is updated to "Provisioning Incus environment..." to match the actual runtime backend. The field name ProvisioningVm is left unchanged here (enum variant renaming is out of scope for this branch), but the user-visible string is now truthful.

Update guardrails assertion message to remove microVM reference

Intent: The guardrails integration test contains an assertion message that explained why pikahut clippy must be validated before remote execution. The explanation referenced 'the microVM lane', which no longer exists.

Affected files: crates/pikahut/tests/guardrails.rs

Evidence
@@ -1144,7 +1144,7 @@ fn pre_merge_fixture_filter_tracks_checked_in_lane_surface() -> Result<()> {
-        "staged fixture workspace build must validate pikahut clippy before remote execute so the microVM lane stays offline"
+        "staged fixture workspace build must validate pikahut clippy before remote execute so the staged guest lane stays offline"

The assertion failure message in pre_merge_fixture_filter_tracks_checked_in_lane_surface now says "staged guest lane" instead of "microVM lane". This is a message-only change — the assertion condition (linux_rust.contains("cargo clippy ... -p pikahut ...")) is identical. The updated phrasing accurately describes the lane's current identity as a generic staged guest environment.

Remove trailing blank line from migration SQL

Intent: Minor whitespace cleanup in the migration file to keep it consistent with project style.

Affected files: crates/pika-server/migrations/2026-03-16-180000_agent_instance_provider_identity/up.sql

Evidence
@@ -1,4 +1,3 @@
 ALTER TABLE agent_instances
     ADD COLUMN provider TEXT NOT NULL DEFAULT 'microvm',
-    ADD COLUMN provider_config TEXT;
-
+    ADD COLUMN provider_config TEXT;

A single trailing newline is removed from the up.sql migration. The migration content (adding provider and provider_config columns) is unchanged. Note that the DEFAULT 'microvm' value is retained — this is the database-level default for existing rows and changing it would require a separate data migration.

Update documentation terminology from 'vm-spawner' to 'pre-Incus'

Intent: Replace legacy runtime-era terminology in prose documentation so readers understand the historical context without referencing internal codenames that no longer exist.

Affected files: docs/agent-ci.md, docs/testing/integration-matrix.md

Evidence
@@ -16,7 +16,7 @@ These lanes are defined canonically in `ci/forge-lanes.toml` and orchestrated by
-  - Intentionally does not cover the old host-side `pikahut` deterministic HTTP / CLI selectors anymore. Those selectors still encode legacy vm-spawner-era assumptions,
+  - Intentionally does not cover the old host-side `pikahut` deterministic HTTP / CLI selectors anymore. Those selectors still encode legacy pre-Incus assumptions,
@@ -63,7 +63,7 @@ Current policy note:
-| `just pre-merge-agent-contracts` | ... The old host-side deterministic HTTP / CLI selectors were intentionally removed because they still encode legacy vm-spawner assumptions;
+| `just pre-merge-agent-contracts` | ... The old host-side deterministic HTTP / CLI selectors were intentionally removed because they still encode legacy pre-Incus assumptions;

Two documentation files contained the phrase "legacy vm-spawner-era assumptions" (or similar). This is replaced with "legacy pre-Incus assumptions" in both:

  • docs/agent-ci.md — the check-agent-contracts lane description
  • docs/testing/integration-matrix.md — the pre-merge-agent-contracts row description

The new phrasing is more informative to readers who never encountered the vm-spawner internal name.

Delete obsolete microvm-era contract documentation

Intent: Remove two markdown documents that described frozen contracts and baselines for the retired microVM runtime. These documents are no longer actionable and could mislead contributors.

Affected files: docs/agent-provider-contract-baseline.md, docs/microvm-v1-api-contract.md

Evidence
@@ -1,33 +0,0 @@
----
-summary: Baseline scope lock for the unified agent provider workstream (microvm)
-...
-- Providers in scope: `microvm`
-...
@@ -1,40 +0,0 @@
----
-summary: Frozen v1 app-facing MicroVM API contract (paths, lifecycle states, and error codes).
-...
-## Endpoints
-- `POST /v1/agents/ensure`
-...

Two documents are fully deleted:

  1. docs/agent-provider-contract-baseline.md — locked scope for the "unified agent provider workstream (microvm)", including baseline constants for the microvm provider and relay domain defaults. The referenced source-of-truth file cli/src/provider_contract_baseline.rs is presumably already removed.

  2. docs/microvm-v1-api-contract.md — froze the v1 app-facing MicroVM API contract (endpoints, lifecycle states, error codes). The canonical constants file crates/pika-server/src/agent_api_v1_contract.rs that it pointed to has been superseded.

Both documents carried read_when front-matter that would have directed contributors to consult them when changing provider contracts. Deleting them prevents stale guidance from influencing future work.

Diff