feat(jobs): add jobs.cleanup RPC + CLI for bulk-deleting codescaler jobs #14

Merged
mahmoud merged 2 commits from development_issue_10_jobs_cleanup into development 2026-04-27 16:34:09 +00:00
Owner

Adds an admin-gated mechanism for draining hero_proc state that
hero_codescalers has accumulated. Tagging was already in place via
build_tags(); this adds the operation that consumes the tags.

  • jobs::cleanup(state, pred) lists by codescaler tag (most-specific
    pushdown via JobFilter.tag), post-filters in Rust on
    kind/target/actor/older_than_ms, deletes matching jobs (force=true),
    then best-effort deletes unique action specs. Returns a structured
    summary: jobs_deleted, actions_deleted, job_ids, action_ids, errors,
    dry_run.
  • jobs.cleanup arm in dispatch, admin-gated like jobs.bulk / jobs.delete.
  • Method registered in openrpc.json; SDK regenerates at build time
    via openrpc_client! macro.
  • CLI subcommand: hero_codescalers jobs-cleanup [--kind] [--target]
    [--actor] [--older-than <Nms|s|m|h|d>] [--dry-run].
  • 7 unit tests: filter_tag priority, codescaler-tag guard,
    kind/target/actor narrowing, older_than_ms semantics, parse_duration_ms.

#10

Adds an admin-gated mechanism for draining hero_proc state that hero_codescalers has accumulated. Tagging was already in place via build_tags(); this adds the operation that consumes the tags. - jobs::cleanup(state, pred) lists by codescaler tag (most-specific pushdown via JobFilter.tag), post-filters in Rust on kind/target/actor/older_than_ms, deletes matching jobs (force=true), then best-effort deletes unique action specs. Returns a structured summary: jobs_deleted, actions_deleted, job_ids, action_ids, errors, dry_run. - jobs.cleanup arm in dispatch, admin-gated like jobs.bulk / jobs.delete. - Method registered in openrpc.json; SDK regenerates at build time via openrpc_client! macro. - CLI subcommand: hero_codescalers jobs-cleanup [--kind] [--target] [--actor] [--older-than <Nms|s|m|h|d>] [--dry-run]. - 7 unit tests: filter_tag priority, codescaler-tag guard, kind/target/actor narrowing, older_than_ms semantics, parse_duration_ms. https://forge.ourworld.tf/lhumina_code/hero_codescalers/issues/10
Adds an admin-gated mechanism for draining hero_proc state that
hero_codescalers has accumulated. Tagging was already in place via
build_tags(); this adds the operation that consumes the tags.

- jobs::cleanup(state, pred) lists by codescaler tag (most-specific
  pushdown via JobFilter.tag), post-filters in Rust on
  kind/target/actor/older_than_ms, deletes matching jobs (force=true),
  then best-effort deletes unique action specs. Returns a structured
  summary: jobs_deleted, actions_deleted, job_ids, action_ids, errors,
  dry_run.
- jobs.cleanup arm in dispatch, admin-gated like jobs.bulk / jobs.delete.
- Method registered in openrpc.json; SDK regenerates at build time
  via openrpc_client! macro.
- CLI subcommand: hero_codescalers jobs-cleanup [--kind] [--target]
  [--actor] [--older-than <Nms|s|m|h|d>] [--dry-run].
- 7 unit tests: filter_tag priority, codescaler-tag guard,
  kind/target/actor narrowing, older_than_ms semantics, parse_duration_ms.

#10
mahmoud merged commit ad787bdd8b into development 2026-04-27 16:34:09 +00:00
mahmoud deleted branch development_issue_10_jobs_cleanup 2026-04-27 16:34:12 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_codescalers!14
No description provided.