{"record":{"id":"666416ad988232b7","repo":"astrid-runtime/astrid","slug":"canonical-astrid-workspace-requires-the-kernel-wor","errorCode":null,"errorMessage":"canonical Astrid workspace requires the kernel workspace branch service","messagePattern":"canonical Astrid workspace requires the kernel workspace branch service","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-kernel/src/lib.rs","lineNumber":1947,"sourceCode":"            // Durable home VFS authority is threaded separately through the\n            // UID-bound principal store. Do not pass a native PrincipalHome\n            // path into the steady-state capsule context.\n            None,\n            kv,\n            Arc::clone(&self.event_bus),\n            capsule_listener,\n        )\n        .with_astrid_workspace()\n        .with_principal_storage(\n            self.principal_store.clone().ok_or_else(|| {\n                anyhow::anyhow!(\n                    \"native capsule runtime requires the authoritative principal store\"\n                )\n            })?,\n            self.principal_directory.clone(),\n        )\n        .with_workspace_branches(self.workspace_branches.clone().ok_or_else(|| {\n            anyhow::anyhow!(\n                \"canonical Astrid workspace requires the kernel workspace branch service\"\n            )\n        })?)\n        .with_process_storage_mount_broker(\n            self.process_storage_mount_broker\n                .get()\n                .cloned()\n                .ok_or_else(|| anyhow::anyhow!(\"native process storage mount broker unavailable\"))?,\n        )\n        .with_registry(Arc::clone(&self.capsules))\n        .with_session_token(Arc::clone(&self.session_token))\n        .with_allowance_store(Arc::clone(&self.allowance_store))\n        .with_identity_store(Arc::clone(&self.identity_store))\n        .with_profile_cache(Arc::clone(&self.profile_cache))\n        .with_overlay_registry(Arc::clone(&self.overlay_registry))\n        // Thread the live group config so capsule invocation checks observe\n        // runtime group mutations without requiring capsule reloads. Load-time\n        // run-loop decisions take their own explicit snapshot.","sourceCodeStart":1929,"sourceCodeEnd":1965,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-kernel/src/lib.rs#L1929-L1965","documentation":"Thrown when assembling the canonical Astrid workspace: the kernel's `workspace_branches` service is `None` at the point the builder calls `with_workspace_branches`. The workspace branch service manages per-workspace branch state, which the canonical workspace requires, so startup aborts instead of creating a workspace without branch tracking.","triggerScenarios":"Starting the native capsule runtime / canonical Astrid workspace while `self.workspace_branches` was never populated (lib.rs:1947, the `with_workspace_branches(...)` call in the builder chain).","commonSituations":"Kernel instances built without the workspace-branch initialization step; partial test fixtures that stub other services but omit workspace branches; upgrades where new required builder wiring (workspace branches) was not added to existing kernel construction code.","solutions":["Initialize and set the workspace branch service on the kernel before starting the canonical workspace","Update kernel construction to call the workspace-branches builder method (likely newly required after a version change)","Audit all kernel instantiation sites (including tests) so none skip workspace branch setup"],"exampleFix":"// before\nlet kernel = AstridKernel::builder()\n    .with_principal_store(store)\n    .build(); // workspace_branches left unset\n// after\nlet kernel = AstridKernel::builder()\n    .with_principal_store(store)\n    .with_workspace_branches(branch_service)\n    .build();","handlingStrategy":"validation","validationCode":"if kernel.workspace_branches().is_none() {\n    return Err(anyhow!(\"workspace branch service required for canonical workspace\"));\n}","typeGuard":"fn has_workspace_branches(kernel: &AstridKernel) -> bool {\n    kernel.workspace_branches().is_some()\n}","tryCatchPattern":null,"preventionTips":["Keep a single kernel-construction helper that sets every required service","After kernel upgrades, re-check builder requirements against the new version's docs","Cover kernel startup in an integration test that fails fast on missing wiring"],"tags":["rust","configuration","workspace","kernel-startup"],"backgroundTag":"missing-required-config-field","analyzedSha":"affd8760f44190dbdfbec23403f4c4b642c33112","analyzedAt":"2026-09-09T21:28:12.402Z","contentChangedAt":"2026-09-09T21:28:12.402Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}