Skip to content

fix(schedule): pin the job's state and log, and report failed runs - #81

Merged
volod-vana merged 1 commit into
mainfrom
volod/schedule-home-and-log
Oct 6, 2026
Merged

volod-vana merged 1 commit into
mainfrom
volod/schedule-home-and-log

Conversation

@volod-vana

Copy link
Copy Markdown
Member

A plist written from a shell with VANA_HOME set took its log path from that home but ran the job without it. The job collected into ~/.vana and logged into a /tmp home the OS wiped, so a week of nightly 401s on sync went unseen. With --quiet the run also printed nothing and exited 0.

Changes

  • schedule add pins the state: the plist gets EnvironmentVariables (VANA_HOME always, plus VANA_NETWORK / VANA_ENV / account and server URL vars when set, never tokens) and the log goes in that home's logs dir. The cron line carries the same env. Re-running add repairs an outdated job, keeps its interval when --every is omitted, says what was wrong, and does nothing when the job is already current. Windows Task Scheduler is unchanged.
  • schedule list shows the state and log the job uses, warns when the job is outdated, and notes when it serves a different state than the current shell.
  • collect --all exits 1 when any source failed to collect or sync, 5 when the only problem is that no Personal Server answered, and names each failed source on stderr even under --quiet.
  • The scheduled run (marked by VANA_SCHEDULED_RUN=1 in the job env) records its outcome in state. vana status shows Last scheduled collection: <time>, 6 of 6 failed to sync (see <log>), or just <time>, ok.

Repair for an existing outdated plist: run vana schedule add from a shell where VANA_HOME is unset (or set to the state you want), then check vana schedule list.

Tests: new test/cli/schedule.test.ts (temp plist path, fake launchctl/crontab, temp VANA_HOME) plus collect --all and status cases in test/cli/index.test.ts. pnpm validate green.

https://claude.ai/code/session_01Fcv6uEy4zcXaigzDNxeW3j

The launchd plist took its log path from the creating shell's VANA_HOME but
started the job without it, so a schedule made from a test state collected
into ~/.vana while logging into a /tmp home the OS wiped. With --quiet the
run printed nothing and exited 0 even when every sync failed.

- schedule add writes EnvironmentVariables (VANA_HOME always, plus network,
  account and server selection when set; never tokens) and puts the log in
  that home's logs dir; the cron line carries the same env. Re-running add
  repairs an outdated job, keeps its interval and says what was wrong.
- schedule list shows the state and log the job uses and warns when the job
  is outdated or serves a different state than the current shell.
- collect --all exits 1 when any source failed to collect or sync (5 when
  the only problem is that no Personal Server answered) and names each
  failed source on stderr, even under --quiet.
- A scheduled run records its outcome in state and vana status shows the
  last one, with the failure count and log path when it failed.

Claude-Session: https://claude.ai/code/session_01Fcv6uEy4zcXaigzDNxeW3j
@volod-vana
volod-vana merged commit e29269f into main Oct 6, 2026
6 checks passed
github-actions Bot pushed a commit that referenced this pull request Oct 6, 2026
## [0.38.6](v0.38.5...v0.38.6) (2026-10-06)

### Bug Fixes

* **schedule:** pin the job's state and log, and report failed runs ([#81](#81)) ([e29269f](e29269f))
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.38.6 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant