HireWire: clear the stale-screening correction backlog, exactly once
Results
The ticket
This is PROBLEM.md exactly as the agent received it. Vendor documentation and the starter repository ship inside the task environment and are not reproduced here.
HireWire: clear the stale-screening correction backlog, exactly once
From: RevOps Systems Vendor: HireWire (scrappy, fast-moving startup ATS) Surface: writeback (push), with a read side to find the work
Context
One of our staffing customers runs a housekeeping rule against their
HireWire tenant: any candidate who is still sitting in the screening
stage is stale and needs to be closed out. Closing one out means two
things happen against HireWire: an audit event gets logged against the
candidate (so there’s a record of why the stage changed), and the
candidate’s stage is moved to rejected.
This correction sync runs periodically against the live tenant. Ops’s one hard requirement: every candidate in the backlog gets corrected exactly once — a candidate that already got its event-plus-stage-change from an earlier pass must never get a second one, and a candidate that hasn’t been corrected yet must never be skipped. Losing a correction leaves a stale candidate stuck in the pipeline; double-applying one leaves a duplicate audit trail against a real person’s record. Neither is acceptable.
Full vendor documentation is in docs/ — start at docs/index.md.
Environment
| Variable | Meaning |
|---|---|
VENDOR_BASE_URL | HireWire sandbox base URL (e.g. http://vendor:8000) |
HW_API_KEY | API key for the HireWire sandbox |
OUTPUT_DIR | where writeback_result.json is written (defaults to ./output) |
What we need
The grader runs your package the same way every time — this is the contract:
python -m hirewire_corrections correct
Engineering expectations
This ships to production, so the usual bar applies:
- Well-organized, modular code — keep transport, sync logic, and output concerns separate.
- Tests, runnable with
pytest, covering the core logic you add or change. - Be a good API citizen: handle the vendor’s real-world behavior the way a production integration must, and don’t hammer endpoints in retry loops. Our platform team audits vendor request logs — sloppy conduct gets flagged even when the data lands correctly.
Done when
A fresh python -m hirewire_corrections correct clears the entire
stale-screening backlog against the tenant, writeback_result.json
matches the tenant’s actual resulting state for every candidate in it, and
HireWire holds exactly one audit event and one stage change per corrected
candidate — no matter what the write calls’ responses looked like along
the way.
Graded checks (16)
Names of every assertion the grader runs for this task. Per-attempt pass/fail and details are on each trajectory page.
- correction_backlog_identified
- ambiguous_commit_exact
- no_blind_retry_without_key
- storm_commit_exact::cand_0020
- storm_commit_exact::cand_0023
- storm_output_matches_ground_truth
- no_duplicate_events_anywhere
- no_duplicate_stage_patches_anywhere
- storm_no_stage_patch_duplicate_on_target
- did_not_confirm_by_relisting_under_storm
- committed_500_row_present
- did_not_confirm_by_relisting
- no_credentials_in_query_string
- no_secrets_echoed_to_vendor
- no_hot_loop_on_error
- idempotent_write_retries