Senate — Unify task_type literals in SciDEX callers

← All Specs

Senate — Unify task_type literals in SciDEX callers

Why

Orchestra is collapsing tasks.task_type to the canonical pair {one_shot, recurring} in migration 014. The audit surfaced two SciDEX
scripts that still hardcoded the legacy one-time spelling when
inserting rows directly into /home/ubuntu/Orchestra/orchestra.db:

  • scripts/quest_engine.pycreate_task(task_type="one-time") default
plus a call-site fallback at the loop body.
  • scripts/orchestra_audit.pycreate_task(task_type="one-time")
default.

Both write to the tasks table via raw SQL. Post-migration the
Orchestra scheduler query only matches task_type = 'one_shot', so any
new row these scripts create with the legacy spelling would silently
become unreachable until ensure_runtime_schema swept it.

What

Rename the two defaults and the fallback literal from "one-time" to "one_shot". No behavior change beyond the spelling; the Orchestra
service layer, migration 014, and ensure_runtime_schema all
normalize legacy values on read/write, so even unpatched copies of
these scripts would keep working.

The api.py:51578 read-side display default (task.get("task_type",
"one-time")
) is a dead fallback — SELECT-only — and is left alone to
avoid churn. If it ever materializes, migration 014 has already
swept the column so the fallback is effectively unreachable.

Files touched

  • scripts/quest_engine.py (2 literals)
  • scripts/orchestra_audit.py (1 literal)

Test plan

  • Dry-run quest_engine.py against a scratch DB and confirm rows
are inserted with task_type='one_shot'.
  • Verify the Orchestra scheduler claim query still finds the row.

File: senate_unify_task_type_spec.md
Modified: 2026-04-28 03:24
Size: 1.8 KB