Repository navigation
A task record names its agent under config.agent, not config.project #2531
Description
What is observed
A scheduled task's record in ~/.emrg/tasks.yml names the agent it runs as through a config key called project:
- name: journal-editor
type: journal
config:
project: silicon-science-cs
interval: 1800
enabled: trueEveryone who touches that key spells it as a string literal, in six places that must agree:
| Site | Role |
|---|---|
emrg/server/scheduler.py DEFAULT_TASK_RECORD |
the record seeded when the table does not exist |
TaskHandler._apply |
resolves the target directory from the key |
TaskScheduler._idle_status |
reports the key's value for a task with no handler |
TaskScheduler.task_create / task_update |
write the key |
emrg/server/daemon.py task_create / task_update |
the wire field a client sends |
emrg/gui/renderer/src/lib/workspaceView.ts, TaskFormDialog.tsx |
the payload the GUI form posts, and the evolve badge derived from it |
Each is a hand-written literal, so a rename is only as complete as its least visible site — and nothing in the suite fails when one of them keeps the old spelling while the others move. The task simply resolves to no directory and stops scheduling, silently.
What is expected
The key that names a task's agent is agent, spelled that way in the seeded record, in resolution, in the wire field a client sends, in the form the GUI posts, and in the file on disk.
What the fix must satisfy
- One spelling, no compat read. Resolution reads
config.agent. A record carryingconfig.projectis migrated in place at daemon startup rather than read through a fallback: a tree that answers both spellings keeps the ambiguity alive, which is the thing being removed. - The migration runs once, from the daemon, and the reader never writes.
projects.yml→agents.ymlalready sets this pattern (emrg/config.pymigrate_legacy_registry): called from daemon startup, never from a path the test suite runs, so no suite run can rewrite a host's live table under a daemon still reading the old key. The same separation is required here. - Nothing else moves. Every other field, its order and its value copies across unchanged. A record already carrying
config.agentis left alone, andconfig.projectis dropped onceagentis present so the old word does not survive as a residue. - The nine live tasks still resolve. A table in the host's current shape, passed through the migration and then through resolution, must answer the same directory for every task at the same interval — measured read-only, against a copy.
- Seed, wire and form agree. The scheduler's seed record, the daemon's wire field and the GUI form payload carry the same key, and a task created from the GUI is resolvable by the scheduler.
- A guard names the requirement. A test asserts the read path performs no write to the table, so "the reader never migrates" is pinned rather than assumed.
Scope boundary
The task's config key only. TaskHandler.status()'s derived project / project_path values, projects_list, and the project picker keep their names here and move in a later rename.
Activity
argszero commentedon Oct 23, 2026
Handled by #2532