feat(tasks): implement dispatch_task/get_task_status used by product cf-orch integrations #67
Labels
No labels
architecture
backlog
enhancement
module:documents
module:hardware
module:manage
module:pipeline
module:voice
priority:backlog
priority:high
priority:medium
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Circuit-Forge/circuitforge-core#67
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
While working on
pagepiper(PR Circuit-Forge/pagepiper#12), found thatapp/api/library.pyimports and calls:Neither function exists anywhere in
circuitforge_core— grepped the main source tree and every worktree, zero matches. The only thing that exists incircuitforge_core.taskstoday is the VRAM-awareTaskScheduler(get_scheduler().submit(task_type, payload, vram_gb)/.result(task_id)), which is a different API shape (task_type/payload/vram_gb, not caller/args).Impact
Pagepiper's cf-orch dispatch path (
_dispatch_shelveinapp/api/library.py) always hits theImportErrorfallback and silently runs shelving via localBackgroundTasksinstead of routing through cf-orch. This is currently invisible — it just works via the fallback — but it means:caller=/args=interface (copied from pagepiper's pattern, e.g. if Turnstone or a future product assumes it exists) will hit the same silent fallbackScope
Implement in
circuitforge_core/tasks/:dispatch_task(caller: str, args: dict) -> str— submits a task identified by a"product/task_name"string (e.g."pagepiper/shelve_pdf") with a plain kwargs dict, routes through the existing coordinator/agent scheduling infra, returns a task_idget_task_status(task_id: str) -> dict— polls status, shape compatible with whatapp/api/ingest.py(pagepiper) /app/api/shelve.pyalready expect:{"status": ..., "progress": ..., "error": ...}Open question: should this be a new thin wrapper over the existing
TaskScheduler/get_scheduler()API (translatingcaller/argsintotask_type/payload), or a genuinely new lower-level primitive? Whoever picks this up should check how_dispatch_shelve's fallback-on-ImportErrorpattern is used across products before deciding, since other products may have copied the same assumed interface.Testing
Unit tests for
dispatch_task/get_task_status, plus (once implemented) an integration check that pagepiper's_dispatch_shelveactually routes through cf-orch instead of falling back, to close the silent-fallback gap this ticket describes.