#1949·astrid

Log migration byte limit aborts boot; orphaned capsule logs are never rotated or reclaimed

Author: jvsteinerCreated Sep 15, 2026Updated Sep 15, 2026

Summary

The principal log migration refuses to run when the legacy log tree exceeds 64 MiB, and offers the operator no way forward:

Error: Failed to boot Kernel: legacy log /Users/jamie/.astrid/home/default/.local/log: legacy log tree exceeds migration byte limit

My tree was 859 MB. 858 MB of that was a single capsule's logs — astrid-capsule-srouter, a capsule that is no longer installed. Nothing rotates these logs, nothing prunes logs belonging to removed capsules, and the error names neither the limit nor the directory responsible.

Mechanism

crates/astrid-kernel/src/principal_log_migration.rs:22:

rust
const MAX_BYTES: u64 = 64 * 1024 * 1024;

and the bail at principal_log_migration.rs:217:

rust
"legacy log tree exceeds migration byte limit",

A bound on how much a boot-time migration will copy is reasonable. The problems are around it:

  1. Nothing enforces the bound before boot. Capsule logs accumulate without rotation, so an install can quietly cross the threshold and only discover it when the daemon refuses to start.
  2. Logs outlive their capsule. astrid-capsule-srouter is not in the distro, has no entry in home/default/.local/capsules/, and has no authority receipt — but its log directory survived, and it alone was 13× the limit. Uninstall does not reclaim log space. (This is the same orphan that blocks the env/secret barrier in the companion issue.)
  3. The error is not actionable. It reports neither MAX_BYTES, nor the measured size, nor which subdirectory dominates. du -sh on each child is how I found it, which assumes the operator already suspects logs.

Measured breakdown:

858M  home/default/.local/log/astrid-capsule-srouter     <- capsule not installed
860K  home/default/.local/log/astrid-capsule-cli
 44K  home/default/.local/log/astrid-capsule-react
 40K  home/default/.local/log/astrid-capsule-context-engine
 40K  home/default/.local/log/a2a-capsule
 ...
859M  total

After moving the orphaned directory aside, the tree was 1.1 MB and the migration ran without complaint.

Reproduction Steps

  1. Run a capsule that logs heavily, long enough to exceed 64 MiB under home/<principal>/.local/log/<capsule>/. Uninstalling the capsule afterwards does not remove the logs and makes no difference.
  2. Upgrade to a build that runs the principal log migration.
  3. Run astrid start.
  4. Boot aborts with legacy log tree exceeds migration byte limit, naming only the parent directory.

Expected Behavior

  • Say what the limit is, what the tree measured, and which children are largest, so the operator can act on the message alone.
  • Do not fail the boot on log volume. Logs are not durable state worth blocking a daemon over — skip, truncate, or archive the oversized subtree and record that in the migration receipt.
  • Reclaim a capsule's log directory when the capsule is uninstalled, so orphaned logs cannot grow unbounded.
  • Rotate capsule logs. 858 MB from one capsule with no ceiling is the root cause; the migration limit is just where it surfaced.

Environment

  • OS: macOS 15.6 (Darwin 24.6.0), arm64
  • Astrid: 2026.9.2, installed via astrid update
  • Source: astrid-runtime/astrid @ 73661c9b (Cargo version 0.10.4)
  • home/default/.local/log = 859 MB, limit MAX_BYTES = 64 MiB
  • astrid-capsule-srouter: 858 MB of logs, capsule not installed

Logs / Backtrace

i Starting Astrid daemon (persistent mode)...
2026-09-15T06:34:52.537124Z  INFO astrid_config::loader: loaded user config path=/Users/jamie/.astrid/config.toml
✗ error: Daemon exited prematurely (exit status: 1). Check logs: /Users/jamie/.astrid/log

# ~/.astrid/log/daemon-boot.log
Error: Failed to boot Kernel: legacy log /Users/jamie/.astrid/home/default/.local/log: legacy log tree exceeds migration byte limit