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

Done

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. added
    user/escalated
    status/blocked
    queue/blocked
    work/assigned
    on Nov 18, 2026
  4. 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.

  5. removed their assignment
    on Nov 20, 2026
  6. 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.

  7. removed
    user/escalated
    on Nov 22, 2026
  8. added
    stray-work
    stray/needs-parent
    priority/normal
    and removed
    status/blocked
    on Nov 27, 2026
  9. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    Contributor

    Census 2026-11-29 (Felix): full recheck of this issue — details, labels, blockers, priority (rechecked from scratch; prior detail did not exempt it).

    STRENGTHS:

    • substantive body (1918 chars)
    • acceptance structure present (0 checklist items, 0 checked)
    • names concrete file/module pointers: memory/2026-11-16.md, tools/init.sh, tools/quota-recorder/install.sh
    • 4 prior comments of triage/work history on record

    GAPS FOUND:

    • no priority label
    • no kind label (kind not unambiguous from title/body — left for the picking-up lane to set)
    • carried a blocked status whose blockers have all closed

    FIXES I APPLIED:

    • added priority/normal (sound fix/feature with clear value (default band))
    • removed status/blocked — every named/edged blocker is closed; issue is unblocked

    REMAINS: nothing — ready for pickup

  10. added
    kind/bug
    status/blocked
    effort/m
    on Nov 29, 2026
  11. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    Contributor

    Issue census — 2026-11-29 (wave-2 residual fixes)

    A full census verdict for this issue was already posted today by another census lane (Felix / CEN-C11 / CEN-C12) — not duplicated here. This wave-2 pass re-verified state, body, labels and comments live immediately before editing and applied only the residual taxonomy fixes those notes left: added labels: kind/bug, status/blocked, effort/m. No priority change in this pass; no other changes.

  12. developing-today-fleet commented on Nov 30, 2026

    @developing-today-fleet
    Contributor

    Lane 0537-J claim — alpha DRIVE 2026-11-30 (fallback rank 182).

    This lane runs on the sandbox seat itself (root, Ubuntu 24.04) — the venue prior passes lacked. Firsthand: /etc/systemd/system/quota-recorder.{service,timer} present, timer active, ~/tools/quota-recorder/install.sh idempotent and network-free; the only restore trigger is the init/boot block in ~/tools/init.sh (the #6148 mechanism) — nothing heals a mid-boot loss.

    Slice (the body's own option c): add a watchdog timer in the same unit family that re-runs install.sh when quota-recorder.timer is missing/inactive; extend install.sh to carry the watchdog units so the boot restore path installs them too. Verify by simulating the wipe (units removed mid-boot) and confirming self-heal + a recorder tick with no manual reinstall.

  13. developing-today-fleet commented on Nov 30, 2026

    @developing-today-fleet
    Contributor

    Resolved — lane 0537-J (alpha DRIVE 2026-11-30), sandbox seat firsthand

    Fix (the body's option c — watchdog in the same unit family):

    • New ~/tools/quota-recorder/quota-recorder-watchdog.sh + quota-recorder-watchdog.service + quota-recorder-watchdog.timer (fires every 2 min; when quota-recorder.timer is missing/inactive it re-runs the idempotent install.sh).
    • install.sh now installs and verifies all four units (recorder + watchdog), so the init: quota-recorder units have no restore block — lost on every sandbox recycle #6148 boot restore carries the watchdog too.
    • ~/tools/init.sh restore condition widened: install runs when either timer is inactive (covers a watchdog-only wipe at boot).

    Acceptance verification (live, this seat, 2026-11-30):

    • 11:57:03Z — updated install.sh run: both timers active.
    • 11:57:09Z — wipe simulated exactly as the failure mode: quota-recorder.timer disabled/stopped, /etc/systemd/system/quota-recorder.{service,timer} deleted, daemon-reload. Timer inactive, units gone.
    • 11:59:15Z — watchdog fired on schedule, logged "quota-recorder.timer missing or inactive — re-running install.sh"; 11:59:16Z both timers active again. No manual reinstall.
    • 12:00:33Z — next recorder tick ran, exit 0/SUCCESS; spool-freshness.py: ok ages: record=19s unacked=none trailing_errors=0 — a tick landed within one timer interval of the heal.

    Note on venue wording: this sandbox is Ubuntu 24.04, not NixOS — the wipe mechanism the issue describes (imperative /etc copies lost mid-boot, ≥3× on 2026-11-16) is the same one simulated and healed above; prior lanes' blocker was venue access (laptop sessions cannot reach this seat's /etc), which this lane had. Closing as completed.

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

    effort/mkind/bugpriority/normalqueue/blockedstatus/blockedstray-workstray/needs-parentwork/assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions