Skip to main content

Module ops

Module ops 

Source
Expand description

Serve operations P1 per .spec/sot/serve-operations.sot.md:

  • O-6: Structured JSON access logs (ARKS_LOG_FORMAT=json), X-Request-Id, W3C traceparent.
  • O-7: Persistent atomic file-backed job queue (arks-forge/jobs/).
  • O-9: Typed TOML config (--config arks.toml), arks serve config check, *_FILE secret loader.

Structs§

JobRecord
RequestTrace
Request correlation context (O-6): X-Request-Id and W3C traceparent.
ServeConfig

Enums§

JobStatus

Functions§

complete_job
Mark a job completed and persist atomically.
due_jobs
Claim due pending jobs (next_run_at <= now) and return them.
enqueue_job
Atomically persist a new background job into <git_dir>/arks-forge/jobs/<id>.json.
fail_job_with_backoff
Record a failed attempt with capped exponential backoff (2^attempts * 5s, max 3600s), transitioning to DeadLetter once attempts >= max_attempts.
format_json_access_log
list_jobs
List all persisted jobs in <git_dir>/arks-forge/jobs/.
maybe_emit_json_access_log
Emit a single-line JSON access log record when ARKS_LOG_FORMAT=json (O-6).
resolve_secret_env
Resolve a secret from <VAR>_FILE (trimmed file contents) first, falling back to <VAR>.