Skip to content

Move cron config into workspace/config/cron (with legacy fallback) (4/13) - #207

Open
alex-clickhouse wants to merge 1 commit into
config-refactor/03-config-subdirfrom
config-refactor/04-cron-move
Open

Move cron config into workspace/config/cron (with legacy fallback) (4/13)#207
alex-clickhouse wants to merge 1 commit into
config-refactor/03-config-subdirfrom
config-refactor/04-cron-move

Conversation

@alex-clickhouse

@alex-clickhouse alex-clickhouse commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

What

Cron jobs, system jobs and gate plugins move from ~/.nerve/cron/ into <workspace>/config/cron/. An install with only the legacy directory still loads its jobs, so nothing breaks before migration runs.

Includes a docs guard that fails when any document sends a reader to the pre-move location without marking it as the old one. It has already caught one such reference.

Why

Cron is where most of the interesting configuration lives — schedules, prompts, gates — and it was the one part that could not travel with the workspace. Leaving it under ~/.nerve meant a synced workspace repo carried skills and identity files but not the jobs that use them, so a second machine reproduced the agent without reproducing its behaviour.

Paths resolve through paths.cron_dir() rather than a literal ~/.nerve. A hardcoded home ignores NERVE_HOME, which sends a relocated instance looking in the default state directory while the daemon reads from the relocated one.

The legacy fallback is a read path only, and a blank jobs.yaml in the new location must not shadow a populated legacy one — otherwise upgrading looks successful and silently drops every custom job.

🤖 Generated with Claude Code

@alex-clickhouse alex-clickhouse changed the title Move cron config into workspace/config/cron (with legacy fallback) Move cron config into workspace/config/cron (with legacy fallback) (4/13) Jul 28, 2026
@alex-clickhouse
alex-clickhouse requested a review from Copilot July 28, 2026 10:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Moves cron configuration (jobs/system/gates) into the git-syncable workspace subtree at <workspace>/config/cron/, while preserving backward compatibility by falling back to the legacy ~/.nerve/cron/ when the workspace location has no job files. Adds guards to prevent docs/prompt text from drifting back to the legacy path without clearly marking it as legacy.

Changes:

  • Implement workspace-aware cron dir resolution (workspace/config/cron preferred; legacy fallback when only legacy has job files).
  • Update bootstrap/init to write cron config into the workspace subtree and migrate legacy jobs.yaml forward on re-init.
  • Add tests + doc/prompt guards to prevent unqualified legacy-path references and validate the new resolver behavior end-to-end.

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
nerve/config.py Adds cron-dir resolution logic and threads resolved workspace into CronConfig.from_dict.
nerve/bootstrap.py Writes cron config under <workspace>/config/cron, creates gates/, and migrates legacy jobs.yaml on init.
nerve/cron/gate_plugins.py Updates gate plugin docs to reflect new default location with legacy fallback mention.
nerve/agent/engine.py Updates worker onboarding text to point at <workspace>/config/cron/jobs.yaml with legacy note.
tests/test_cron_paths.py New unit/integration tests for cron dir resolution and init migration behavior.
tests/test_docs_cron_paths.py New guard tests scanning docs/package text for unqualified legacy cron path references.
tests/test_bootstrap.py Updates bootstrap expectations and Docker tools-section assertions to the new cron location.
README.md Updates config layering summary to include tracked <workspace>/config/settings.yaml.
docs/cron.md Updates cron docs to new location, explains migration/fallback, and adjusts examples.
docs/config.md Updates cron config defaults (including cron.gate_plugins_dir) to workspace location with fallback notes.
docs/migration.md Updates migration instructions to create/use $NERVE_WS/config/cron and documents fallback behavior.
docs/setup.md Updates init overwrite/preserve lists for new cron and settings locations.
docs/worker-guide.md Updates onboarding steps and nerve doctor example output related to cron/config.
docs/workflow-runs.md Updates cron jobs.yaml example path.
docs/plans.md Updates task-planner cron reference path.
docs/sources.md Updates config edit instructions to <workspace>/config/settings.yaml.
docs/memory.md Updates referenced config file path and memory model key names in examples.
docs/codex-sync.md Updates config example file path to <workspace>/config/settings.yaml.
config.example.yaml Removes pinned cron paths (now auto-resolved) and updates memory key naming in the example.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread nerve/config.py Outdated
Comment thread nerve/bootstrap.py Outdated
Comment on lines 1707 to 1709
click.echo(" Setting up ~/.nerve/...", nl=False)
nerve_dir = paths.nerve_home()
nerve_dir.mkdir(parents=True, exist_ok=True)
@alex-clickhouse
alex-clickhouse force-pushed the config-refactor/04-cron-move branch from 214fa51 to 0d097e3 Compare July 28, 2026 12:11
@alex-clickhouse
alex-clickhouse force-pushed the config-refactor/04-cron-move branch from 0d097e3 to a23022e Compare July 28, 2026 12:36
@alex-clickhouse
alex-clickhouse force-pushed the config-refactor/04-cron-move branch from a23022e to 2585c99 Compare July 28, 2026 13:14
@alex-clickhouse
alex-clickhouse force-pushed the config-refactor/04-cron-move branch from 2585c99 to c7150a4 Compare July 28, 2026 14:23
@alex-clickhouse
alex-clickhouse force-pushed the config-refactor/04-cron-move branch from c7150a4 to 15c24fb Compare July 28, 2026 14:54
@alex-clickhouse
alex-clickhouse force-pushed the config-refactor/04-cron-move branch from 15c24fb to 0dfbb03 Compare July 28, 2026 15:33
@alex-clickhouse
alex-clickhouse marked this pull request as ready for review July 28, 2026 15:37
@alex-clickhouse
alex-clickhouse force-pushed the config-refactor/04-cron-move branch from 0dfbb03 to eb302fd Compare July 29, 2026 10:31
@alex-clickhouse
alex-clickhouse force-pushed the config-refactor/04-cron-move branch from eb302fd to d691988 Compare July 30, 2026 08:01
Cron jobs, system jobs and gate plugins resolve under <workspace>/config/cron/
so they can be reviewed and synced with the rest of the shared config. An
install with only the legacy ~/.nerve/cron keeps working: resolution is
file-aware and falls back when the workspace location holds no jobs, so a
partially migrated tree does not lose its schedule.

Re-running init preserves existing legacy jobs rather than regenerating over
them, and cron is written where the loader will look even when the workspace
path is itself an ${ENV_VAR}.

Co-Authored-By: Claude <noreply@anthropic.com>
@alex-clickhouse
alex-clickhouse force-pushed the config-refactor/04-cron-move branch from d691988 to 4be7284 Compare July 30, 2026 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants