feat: dependency DAG and YAML-defined compute jobs #92
Reference in New Issue
Block a user
Delete Branch "feat-dag-workers"
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?
Summary
Implements the server-side dependency DAG and worker/runner system for YAML-defined compute jobs, as specified in MULTI_USER_EDITS.md.
What's Included
Design Documentation
docs/DAG.md-- Dependency DAG specification (two-tier model, validation states, graph queries, interference detection)docs/WORKERS.md-- Worker system specification (YAML job definitions, job lifecycle, runner architecture, claim semantics)docs/DAG_CLIENT_INTEGRATION.md-- Client/silo-mod integration contract (DAG sync payload, Python entry points, headless invocation)Database
migrations/014_dag_nodes_edges.sql--dag_nodes,dag_edges,dag_cross_edgestablesmigrations/015_jobs_runners.sql--runners,job_definitions,jobs,job_logtables withjob_statusenumCore Libraries
internal/jobdef/-- YAML job definition parser (Load, LoadAll, Validate) with 11 unit testsinternal/db/dag.go-- DAG repository: recursive CTE queries (forward/backward cone, dirty propagation), SyncFeatureTree, cycle detectioninternal/db/jobs.go-- Job + runner repository:SELECT FOR UPDATE SKIP LOCKEDatomic claim, lifecycle methods, timeout enforcementServer Wiring
JobsConfigin config with defaults (runner timeout, sweep interval, priority)Authentication
internal/auth/runner.go-- RunnerIdentity context helpersRequireRunnerAuthmiddleware -- validatessilo_runner_tokens via SHA-256 hash lookupAPI Endpoints (~25 new routes)
DAG (nested under
/api/items/{partNumber}):GET /dag,GET /dag/forward-cone/{nodeKey},GET /dag/dirtyPUT /dag(sync),POST /dag/mark-dirty/{nodeKey}Jobs:
GET/POST /api/jobs,GET /api/jobs/{id},GET /api/jobs/{id}/logs,POST /api/jobs/{id}/cancelJob Definitions:
GET /api/job-definitions,GET /api/job-definitions/{name},POST /api/job-definitions/reloadRunners (admin):
GET/POST /api/runners,DELETE /api/runners/{id}Runner-facing (runner token auth):
POST /api/runner/heartbeat,POST /api/runner/claimPOST /api/runner/jobs/{id}/start,PUT /api/runner/jobs/{id}/progressPOST /api/runner/jobs/{id}/complete,POST /api/runner/jobs/{id}/failPOST /api/runner/jobs/{id}/log,PUT /api/runner/jobs/{id}/dagAuto-Triggers
HandleCreateRevisiontriggersrevision_createdjobsHandleMergeBOMtriggersbom_changedjobsRunner Binary
cmd/silorunner/main.go-- separate binary with config, heartbeat, poll loop, job execution scaffoldcreate-validate,create-export,create-dag-extract,create-thumbnailTests
Verification