Analyze a job-queue CSV and generate a numerically sorted release list of safely releasable held jobs using hold-reason and resource-limit filters. Use when triaging held batch/HTCondor-style jobs from structured queue exports.
Use this skill when a task requires creating a release_list.txt (or equivalent) from a queue CSV by applying all of the following:
held)This pattern was validated across three independent successful runs with identical test expectations.
Read queue data with schema-aware parsing.
Use csv.DictReader and parse fields explicitly (job_id, status, hold_reason, resource columns).
Define release policy as constants.
Keep allowlisted hold reasons and max resource limits in named constants/sets.
Filter in a strict gate sequence. Keep only rows that satisfy all conditions:
held<= configured limitsParse IDs numerically and sort numerically.
Convert job_id to int, collect, then sort().
Write output as plain ID lines.
Write exactly one job ID per line, no headers, no commentary.
Always create output file.
Open output in write mode even if no jobs qualify so an empty file exists.
Execute script and inspect output immediately.
Run script, then cat the output to confirm expected IDs and format.
Including non-held jobs (e.g., running rows).
Tests explicitly reject this class of mistake.
Including non-resource hold reasons (e.g., missing input/network issues).
Only allowlisted resource reasons should pass.
Ignoring resource caps after reason filter.
Resource-related reason alone is not enough; jobs exceeding limits must remain held.
Sorting IDs lexicographically instead of numerically.
Treat IDs as integers before sorting to avoid ordering bugs.
Writing wrong file format.
Avoid headers, commas, JSON, or extra text. Output must be ID-only, one per line.
Failing to create output when result set is empty.
The empty-file case is usually asserted.
Perform verification in two layers:
Functional spot-check
Format and ordering checks (mapped to observed grader behavior)
If a pytest harness is provided, run it after manual checks; in the observed runs, passing conditions aligned with assertions for: