Skip to content

quota-recorder: units still vanish mid-boot — #6148 restore block only heals at init, switch activations wipe the /etc copies with no mid-boot restore #11020

Open

Description

@dezren39

Symptom

The quota-recorder systemd units (quota-recorder.service / quota-recorder.timer, installed as imperative copies in /etc/systemd/system) still vanish mid-boot and stay gone until a person or a sweep notices and hand-reinstalls them. Recording silently stops in the gap.

Evidence

  • init: quota-recorder units have no restore block — lost on every sandbox recycle #6148 (closed 2026-11-05 as COMPLETED) fixed the filed defect: a restore block in ~/tools/init.sh plus ~/tools/quota-recorder/install.sh (dezren39/hatch 3efce1255). Verified 2026-11-17 audit: init.sh contains the restore block and the timer is currently active.
  • But the restore only runs at init/boot. On 2026-11-16 the units were lost at least 3 times in ~14 hours (fleet run reports, ~/memory/2026-11-16.md), including one sweep recording verbatim: "quota-recorder units had vanished from /etc again — reinstalled via ~/tools/quota-recorder/install.sh; timer active, tick landed". Each loss was healed by a manual reinstall, not by the init: quota-recorder units have no restore block — lost on every sandbox recycle #6148 mechanism.
  • Working pattern: imperative /etc unit copies are wiped by NixOS switch activations mid-boot; nothing re-runs the installer until the next boot or a human notice.

Scope

Give the quota-recorder units a restore path that fires mid-boot — e.g. declare the units in the Nix configuration so switch activations carry them, or add a switch/post-activation hook (or a watchdog timer in a durable unit family) that re-runs ~/tools/quota-recorder/install.sh when the timer is missing. Sandbox side (the recorder runs on the sandbox); do not change the recorder itself.

Acceptance check

After a NixOS switch activation on the sandbox, systemctl is-active quota-recorder.timer is active with no manual reinstall, and a recorder tick lands (file-first + Turso ack) within one timer interval of the activation.

Refs

Activity

  1. developing-today commented on Nov 17, 2026

    @developing-today
    Contributor
  2. dezren39 commented on Nov 17, 2026

    @dezren39
    MemberAuthor

    Sweep run 2026-11-17: investigated, not closed. Blocked on the sandbox NixOS config, which is not in any repo this session can reach. No fix PR is open.

    Re-check first: #11020 is OPEN. Only the Kaneo sync comment exists. No merged PR covers a mid-boot or switch-activation restore. The only merged PR found for this search is code#5764 (a doc PR, not a fix). #6148 is CLOSED but covers the boot-only restore.

    Why switch activations wipe the /etc copies (root cause):

    • The restore (~/tools/quota-recorder/install.sh, called from ~/tools/init.sh) does cp into /etc/systemd/system/ and then systemctl enable --now. Writes there are not owned by any NixOS config.
    • On NixOS, /etc/systemd/system is a symlink into /etc/static, which is a symlink into an immutable /nix/store/...-etc tree. The units under it are generated by the active system generation (verified on this host: /etc/systemd/system -> /etc/static/systemd/system -> /nix/store/dasm2s…-system-units, dr-xr-xr-x). A switch builds a new generation and replaces that tree, so any imperative unit file in it is dropped. Boot-only restore cannot cover this, because a switch does not re-run init.sh.
    • This host (NixOS 26.11) shows the store-backed layout: test -w /etc/systemd/system/ fails. The sandbox's layout may differ, since its restore copies succeed. The switch-wipe itself was observed on the sandbox (2026-11-16), not reproduced here.

    Why I cannot land the fix here: the durable fix is to declare quota-recorder.service and quota-recorder.timer in the sandbox NixOS configuration (systemd.services / systemd.timers, ExecStart pointing at /home/hatch/tools/quota-recorder.py), so every switch carries them. No nixosConfigurations, /etc/nixos, or sandbox flake exists in the local repos (~/git/nix and ~/git/darwin-nix are darwin configs), and /home/hatch is not on this host. I cannot write or test that config, and I cannot run a switch on the sandbox to produce the required proof.

    Question (default chosen, recorded for the owner): where is the sandbox NixOS config that owns /etc/systemd/system for hatch? Default until answered: I will not change the boot-only restore, and the fix will go in that config as above, verified by a sandbox switch that leaves quota-recorder.timer active with a tick landing and no manual reinstall. Once the config location is known, this is the PR and the proof.

    Also flagged: hatch tools/quota-recorder/quota-recorder.timer has OnCalendar=*:0/5 (5-minute), while the hatch-personal notes describe a 1-minute cadence. One of them is stale, and the fix should pick the correct value.

    Leaving this OPEN. It needs the sandbox config location, or a sandbox switch for proof, before it can close.

  3. dezren39 commented on Nov 18, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    state: escalated
    task: 20736
    lane: oc-code-04 (OpenChamber scheduled lane, worker repo-worker-code)
    stage: claimed -> verified -> escalated-to-user

    Claimed and revalidated #11020. It is OPEN, assigned to dezren39, and has no fix PR; the prior comment from dezren39 on 2026-11-17 states the durable fix must go in the sandbox NixOS configuration that owns hatch /etc, which this laptop session cannot access, and that a sandbox switch is required to prove the units survive. The named prior fix session is not present in the OpenChamber session listing. No code or PR work was started.

    Escalating because the missing config location/access and permission to run a sandbox switch are Drew-owned decisions/access. Resume when Drew identifies the owning config/repo and provides the required switch-activation verification path (or supplies equivalent proof). Until then, keep this issue OPEN and do not change the boot-only restore or claim acceptance. Labels synced to user/escalated, status/blocked, queue/blocked, work/assigned.

  4. removed their assignment
    on Nov 20, 2026
  5. dezren39 commented on Nov 22, 2026

    @dezren39
    MemberAuthor

    Decided: Do not change the boot-only restore from this host; the durable fix belongs in the sandbox-owned NixOS configuration, and this task cannot be implemented or acceptance-tested without access to that target.
    Why: #11020 requires a switch-activation test on the sandbox. /home/hatch and its NixOS configuration are absent here; fleet init reports no host manifest, HTTPS_PROXY is unset and laptop-agent cannot reach its transport, and the reachable repository documents no trusted sandbox route. The prior SSH attempt rejected an unknown host key, which will not be bypassed.
    Undo: Resume by editing the sandbox-owned configuration once it is reachable through a trusted route, then perform the required switch/tick acceptance check.
    By: oc-code-04

    This is a technical access/configuration blocker, not a request for an owner decision. No code, PR, or acceptance claim was made. #11020 remains open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    queue/blockedQueue or user escalation statestatus/blockedQueue or user escalation statework/assignedQueue worker lifecycle state

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions