Move the vault graph rebuild off SessionStart #1558

Open
opened 2026-11-05 01:01:44 +00:00 by jared · 0 comments
Owner

Problem

The os-vault SessionStart hook starts a detached vault graph rebuild when ~/.cache/graphify/vault-rebuild.stamp is older than stale_threshold_days. The GPU load and fan noise begin just as the user starts to work, with no warning. The user questioned this on 2026-11-04.

Observed

plugins/os-vault/hooks/session_start.py starts the rebuild. plugins/os-vault/config.yaml sets stale_threshold_days to 7. This is an os-vault choice, not a graphify default.

Extraction is incremental. The first run read 205 changed notes and skipped 128 unchanged notes. A later run costs less than the first run.

Reproduce

n/a: design change. Open a session when the stamp is older than 7 days, and the rebuild starts.

Approach

Run the rebuild from a systemd user timer at a fixed time, nightly or weekly. Remove the SessionStart rebuild. The user chooses the time.

Two tests pin the current hook behavior and must change with it: plugins/os-vault/tests/test_session_start_rebuild.py and plugins/os-vault/tests/test_session_start_lock.py.

Required work:

  1. Remove the detached rebuild start from the SessionStart hook — check: absent _REBUILD_SCRIPT in plugins/os-vault/hooks/session_start.py

Orchestrator work: the user picks the timer time. Install the systemd user timer and service unit.

Acceptance criteria

  1. Given a stamp older than stale_threshold_days, when a session starts, then no rebuild starts.
  2. Given the timer time arrives, when the systemd user timer fires, then the vault rebuild runs once.

Owner sketch

class Vault::RebuildTimer
  def install(time)
end

Origin

  • Trigger: the user questioned the SessionStart rebuild on 2026-11-04 while working on #1540.
  • Improvised this session: none
  • Chain: GPU load and fan noise at session start ← SessionStart hook starts the rebuild (plugins/os-vault/hooks/session_start.py) ← os-vault chose a stamp-age trigger with a 7 day threshold (plugins/os-vault/config.yaml). DESIGN.
  • Root candidate: none found; searched SessionStart, vault-rebuild, rebuild stamp, session_start.py, systemd, stale_threshold, timer
  • Where: plugins/os-vault/hooks/session_start.py
  • Session: 8a73b51f-d8a3-4dfc-9de7-e72ea77eacac
  • Transcript: /home/jared/.claude/projects/-home-jared-Documents-SecondBrain/8a73b51f-d8a3-4dfc-9de7-e72ea77eacac.jsonl

Found during #1540.

VERDICT: CREATE

## Problem The os-vault SessionStart hook starts a detached vault graph rebuild when `~/.cache/graphify/vault-rebuild.stamp` is older than `stale_threshold_days`. The GPU load and fan noise begin just as the user starts to work, with no warning. The user questioned this on 2026-11-04. ## Observed `plugins/os-vault/hooks/session_start.py` starts the rebuild. `plugins/os-vault/config.yaml` sets `stale_threshold_days` to 7. This is an os-vault choice, not a graphify default. Extraction is incremental. The first run read 205 changed notes and skipped 128 unchanged notes. A later run costs less than the first run. ## Reproduce n/a: design change. Open a session when the stamp is older than 7 days, and the rebuild starts. ## Approach Run the rebuild from a systemd user timer at a fixed time, nightly or weekly. Remove the SessionStart rebuild. The user chooses the time. Two tests pin the current hook behavior and must change with it: `plugins/os-vault/tests/test_session_start_rebuild.py` and `plugins/os-vault/tests/test_session_start_lock.py`. Required work: 1. Remove the detached rebuild start from the SessionStart hook — check: absent `_REBUILD_SCRIPT` in `plugins/os-vault/hooks/session_start.py` Orchestrator work: the user picks the timer time. Install the systemd user timer and service unit. ## Acceptance criteria 1. Given a stamp older than `stale_threshold_days`, when a session starts, then no rebuild starts. 2. Given the timer time arrives, when the systemd user timer fires, then the vault rebuild runs once. ## Owner sketch ```ruby class Vault::RebuildTimer def install(time) end ``` ## Origin - Trigger: the user questioned the SessionStart rebuild on 2026-11-04 while working on #1540. - Improvised this session: none - Chain: GPU load and fan noise at session start ← SessionStart hook starts the rebuild (`plugins/os-vault/hooks/session_start.py`) ← os-vault chose a stamp-age trigger with a 7 day threshold (`plugins/os-vault/config.yaml`). DESIGN. - Root candidate: none found; searched SessionStart, vault-rebuild, rebuild stamp, session_start.py, systemd, stale_threshold, timer - Where: plugins/os-vault/hooks/session_start.py - Session: 8a73b51f-d8a3-4dfc-9de7-e72ea77eacac - Transcript: /home/jared/.claude/projects/-home-jared-Documents-SecondBrain/8a73b51f-d8a3-4dfc-9de7-e72ea77eacac.jsonl Found during #1540. VERDICT: CREATE
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jared/cc-os#1558
No description provided.