Reliability Weekend Loop
SkillDev toolsWeekend reliability loop - daily delta-audit of everything merged since the last audited SHA (new findings appended to RELIABILITY_AUDIT.md), then red/green remediation of EVERY verified finding on the dated PR branch, then a deliver phase that publishes substantive changes only, gets their CI green and tells the operator what to merge. Runs unattended on the always-on runner via scripts/reliability_weekend.sh, one daily cycle at 00:00 local that runs audit, remediate, then deliver; invoke as /reliability-weekend audit, /reliability-weekend remediate or /reliability-weekend deliver.
Available today. Use it from your connected AI after setup.
No other account needed.
Connect ahel once, and every AI you use reads what you have installed.
Then ask your AI: use the Reliability Weekend Loop skill
What this skill tells your AI
The instructions your AI receives, as published by joemccann/radon in .codex/skills/reliability-weekend/SKILL.md and read by ahel’s review.
You are running as a NON-INTERACTIVE agent CLI. There is no human to ask: a question asked here is a night lost. The working directory is the Radon monorepo clone; you have full file, shell and network access, and you are expected to use them.
This manual covers three phases — audit, remediate and deliver. Run only the phase you were asked for.
The manual was written for Claude Code and names tools that do not exist in this CLI. The OVERRIDES section at the end says what to do instead, and it wins wherever it conflicts with the manual. The CONTRACT section at the end states the exact strings your run is judged on; the wrapper greps for them.
Reliability Weekend Loop
You are a site reliability engineer with decades of experience in trading
systems. This skill runs UNATTENDED — no human can answer questions. The
standard is the one set by the 2026-08-09 audit (RELIABILITY_AUDIT.md):
this system handles live orders and real money, so the question for every
component is not "does it work" but "what happens when it doesn't."
The mode is the first argument: audit, remediate or deliver. The
unattended job fires once a day at 00:00 local and runs audit, then
remediate, then deliver sequentially in this loop's own clone. The loop
never merges; the human merge is the deploy trigger.
Substantive publication gate (all phases)
Publish only a substantive net change against current origin/main: source,
tests, maintained product/operator documentation, configuration, or an actual
CI experiment. A real experiment remains eligible while VALIDATING or
INSUFFICIENT_SAMPLE; status words do not decide whether its diff has value.
Known nightly audit/log ledgers, tasks/, runner-only reports, checkpoint
dates and lessons alone are bookkeeping, not a reason for a commit, push or
PR. Maintained product reports, documentation and real generated-content
changes remain eligible; never exclude docs/ or reports/ wholesale. Never
manufacture a change to satisfy a completion check. Inspect the diff before
committing; keep report-only work in durable runner scratch and the existing
rolling issue. This rule governs every commit/push instruction and historical
lesson below.
After a substantive task is committed, run
python3.13 scripts/nightly_publish.py check --base origin/main --head HEAD.
Exit 0 means substantive; 3 means no-op; 1 means error and must stop publication.
The publisher rechecks current main before any push. All new PR creation goes
through python3.13 scripts/nightly_publish.py publish --base main --head <branch> --title <title> --body-file <body-file>.
It owns the push; do not push a new nightly branch first or bypass the guard.
Read JSON status: published (exit 0) includes pr_url and head_sha;
noop exits 3 without publication; error exits 1 and must stop. Never invent a URL. Existing
substantive PRs still resume through the deliver record and CI watch.
For report-only audits, post the completed audit range, findings/acceptance
criteria and audited-through: <verified-origin-main-sha> to the existing
rolling issue before declaring completion. That issue is the authoritative
checkpoint and remediation handoff when the disposable worktree is discarded;
a local ledger alone is not durable. Every successful checkpoint must carry
forward ALL still-open findings, their IDs, source evidence, acceptance criteria
and blocked/operator actions from the previous checkpoint, even on a zero-delta
night. Include resolved IDs with evidence so closure is explicit. Both audit
and remediation read this complete checkpoint before legacy ledgers; no open
finding may disappear when older issue comments are pruned. Do not advance the
checkpoint after an incomplete audit. A zero-finding/no-safe-change run reports its reason there, creates no
artificial commit or PR, and follows the no-op contract below.
Hard rails (both modes — violating any of these is a failed run)
- Never touch the IB Gateway. No restarts, no 2FA-push-risking calls,
no
radon restart, no docker commands against it. - Never place, modify, or cancel a live order. Fault injection is fakes/mocks only. Never set or clear the production trading halt.
- Never push to
main. Substantive changes land on a branchreliability/<YYYY-MM-DD>and a PR. The human merge is the deploy trigger. - Never run against the operator's working clone. Refuse (exit
nonzero, say why) unless BOTH
.radon-weekend-runnerand.radon-reliability-runnerexist in the repo root — together those markers mean this is the dedicated reliability runner clone. - Respect the frozen contracts.
RELIABILITY_AUDIT.mdfinding IDs (R-###) and backlog IDs (REL-###) continue their numbering; never renumber or rewrite prior entries.RELIABILITY_LOG.mdis append-only. - Bounded per session, complete overall. The wrapper enforces a
wall-clock cap per session and relaunches remediation as continuation
rounds until a session exits cleanly. Never leave work half-applied;
commit after every completed substantive task, never mid-task, and publish
through the shared guard so a killed round loses nothing. In remediate
mode,
DEFERREDis not an allowed outcome: do not stop early to log un-started work for a future date — keep working the backlog until it is empty (the only non-DONE end state isBLOCKEDwith a root-cause hypothesis after 3 genuine attempts). If the cap kills the session mid-backlog, the wrapper's next round resumes from the committed state.
Mode: audit (first phase of the daily cycle)
Goal: a DELTA audit — judge what changed, don't re-audit the world.
- Read the newest successful
audited-through:checkpoint from the existing rolling issue; fall back toRELIABILITY_AUDIT.md§Audit ledger only if absent. Compute the changed surface:git log --stat <last-sha>..HEAD. If the range is empty, complete the standing sweeps, persist the checkpoint on the rolling issue, and declare no-op (still a successful run). Widen it withtools/codemap/codemap.json: every file whoseedgesimport a changed file is in scope too (a changed contract breaks its callers, not itself). Confirm withrg; the map refreshes nightly. - Read
RELIABILITY_LOG.mdNEW_FINDINGS + REL-021b remainder — these are standing candidates every audit re-triages. - Fan out parallel read-only agents over the changed files/subsystems, one per A2 category that plausibly applies (connectivity, state/ persistence, resources, error handling, safety, observability). Every claim must cite file:line from actual code, never inferred from names. Scope agents to the diff plus its blast radius (callers/callees), not the whole tree.
- Additionally run the standing sweeps regardless of diff:
- grep-level checks that prior fixes still hold (halt chokepoints
present,
_NON_IDEMPOTENT_IB_SCRIPTSintact, order-limits wired, ack-poll present in exit_orders, hrana on daemon_state); - any new order-placing call site (
placeOrder|place_order) that bypassestrading_halt/order_limits; - any new
service_healthwriter missing from both watchdog catalogs.
- grep-level checks that prior fixes still hold (halt chokepoints
present,
- Dedupe against ALL existing R-### findings. Append genuinely-new
findings to
RELIABILITY_AUDIT.mdunder a dated## Delta audit <date>section (same table columns, continuing R-numbers) and add backlog rows (continuing REL-numbers) with fault-injection acceptance criteria. Update the §Audit ledger line:Audited through: <HEAD sha> on <date> — <n> new findings. - Post the complete audit checkpoint and remediation handoff to the existing rolling issue. Finding/ledger-only work is not a publishable change; declare audit no-op after the handoff is durable. Publish only if the branch already contains a substantive change under the shared gate.
Mode: remediate (second phase of the daily cycle)
Goal: work the ENTIRE un-DONE backlog to completion in severity order — P0, then P1, then P2 (this run's items first, then older stragglers) — exactly by the PART B contract. Deferring remaining items to a future run is not an outcome; every backlog item ends this run as DONE or BLOCKED-with-root-cause.
Remediate mandate. Implement every verified source-actionable finding
from this cycle's audit, not the first one and not one per night. Group fixes
by root cause into separate commits on one dated branch reliability/<YYYY-MM-DD> (one
branch per loop per day; the deliver phase publishes its substantive diff as one PR). Red/green
per fix; the full project gates before every commit. Independent fixes may
run in parallel as subagents in separate worktrees of this clone
(git worktree add ../wt-<id> -b reliability/<date>-<id> reliability/<date>), each
committing to its own branch; this phase merges them back onto the dated
branch, reruns the gates on the merged result, and removes the worktrees
(git worktree remove, git branch -d). Preserve substantive work with a local
commit before any long suite. Keep
report-only state in durable scratch and the rolling issue; it does not
require a commit. A finding is done only as DONE, BLOCKED (root-cause hypothesis
after three genuine attempts), or operator-only (an exact operator action
for the PR's Next section); verified findings with no implementation is a
failed remediate phase.
- Check out the nightly branch (create from
origin/mainif the audit phase produced nothing; then this run only re-verifies drills, step 4). If the branch already carriesREL-###commits from an earlier round of this run, this is a continuation: diff RELIABILITY_LOG.md against the backlog and resume from the first un-DONE item. - Per task, in severity order: (a) write the failing fault-injection
test FIRST and show it red; (b) implement surgically; (c) show green;
(d) run the full gates from the repo root (
python3.13 -m pytest,npx vitest run, andpytest cloud/testswhen units/cloud files changed); (e) append the RELIABILITY_LOG.md row with red/green counts; (f) commit with the REL-### id and publish through the shared guard. Forbidden moves: widening a catch block, adding a retry instead of understanding the failure, marking done on inspection, weakening an assertion, disabling a safety check. - If blocked after 3 attempts on a task, log
BLOCKEDwith a root-cause hypothesis and move on. - Always finish with the drill re-run: the permanent fault-injection
suites (
test_position_reconcile_spine,test_exit_orders_ack,test_exit_orders_guard_durability,test_trading_halt,test_order_limits,test_fill_monitor_degraded_session,test_daemon_bounded,test_snapshot_unavailable,order-idempotency-durability) plus three consecutive full-gate runs. Record the counts in the log. - If substantive work exists, publish via §Pull request output; otherwise
finish the report and declare no-op. DONE/BLOCKED
tables and gate counts ×3 go on the rolling issue. If
cloud/services/*changed,--nextis the rootbootstrap-control-plane.shinstall-copy before merge. CI on that PR is the deliver phase's job (§Mode: deliver).
Mode: deliver (third phase of the daily cycle)
Goal: every substantive net change the remediate phase landed on reliability/<YYYY-MM-DD> reaches the
operator as ONE pull request with CI green, in this same cycle, and the
operator is told exactly what is ready to merge. The loop never merges.
The wrapper caps this phase at 3h (RADON_WEEKEND_DELIVER_CAP_SECS,
default 10800).
- Resume first. Read this loop's deliver record
(
python3.13 scripts/nightly_deliver.py show --loop reliability; kept outside the clone under~/radon-weekend/.reliability-deliver/). If it isresumable(an earlier deliver ended INCOMPLETE), that branch and PR number are the run to finish: check the branch out, make its CI green (step 4), record the outcome, then continue with today's branch. Never open a second PR for a branch that already has one. - Classify the dated branch with
python3.13 scripts/nightly_publish.py check --base origin/main --head HEAD. Exit 3 means no substantive diff, even when ledger-only commits exist. If this phase has no substantive PR to resume or report, recordpython3.13 scripts/nightly_deliver.py record --loop reliability --branch "" --status greenwith no PR number or URL, then emit the step 6 verdict with no URLs:NIGHTLY DELIVER READY: loop=reliability prs=0. Do not push or create a PR. Keep any resumed substantive PR's record and URL in the final verdict even when today's branch is no-op; do not erase it with an empty record. Exit 1 is INCOMPLETE, never no-op. Exit 0 continues to guarded publication. - Publish ONE substantive PR through the guarded publisher in §Pull request output (
--loop reliability); update the existing PR when one is already open for the branch (gh api -X PATCH). Every operator-only finding from this cycle's audit (external state, credential rotation, host policy, aBLOCKEDitem) goes into the body's Next section as an exact operator action. Nothing is dropped silently. Record the PR:python3.13 scripts/nightly_deliver.py record --loop reliability --branch <branch> --pr <n> --url <url> --status pending. - Wait for CI, bounded:
python3.13 scripts/nightly_deliver.py watch --pr <n> --cap-secs <seconds left in the phase>pollsgh pr checksand exits 0 green / 1 red / 3 still pending at the cap. On red: read the failing job's log (gh run view <run-id> --log-failed), write the failing test first when the fix is in source, fix on the branch, run the focused gate, commit, push, watch again. Repeat until green or the cap. Never weaken a test or a gate to get green; never rebase or force-push over a commit you did not author. - Record the outcome (
record ... --status green, or--status incomplete --check <name>when a check is still red or pending at the cap) and post the three-section issue comment (§Dead-man reporting) naming the PR URL and, when INCOMPLETE, the failing check. - Print, as the LAST stdout line of the phase, the verdict line from
python3.13 scripts/nightly_deliver.py verdict --loop reliability --ready <url>...(or--incomplete <check> --pr-url <url>). The wrapper greps it:NIGHTLY DELIVER READY: loop=reliability prs=<n> <urls>becomes the operator notification "N PR(s) green, ready to merge: " (Pushover and the dead-man comment);NIGHTLY DELIVER INCOMPLETE: loop=reliability check=<name> pr=<url>becomes "INCOMPLETE: ", the phase exits 75, and the next fire resumes the same branch and PR from the record. An exit-0 deliver phase without the line is INCOMPLETE. Never emit the line anywhere else.
Declaring a no-op phase
Complete the audit/remediation work and persist the rolling-issue checkpoint and report first. Zero findings, no safe actionable change, or bookkeeping-only diffs are successful no-op outcomes, not a reason to commit or open a PR. Print the following as the LAST stdout line, at column 0, with this loop and the phase actually completed:
NIGHTLY PHASE NO-OP: loop=reliability phase=<audit|remediate> reason=<one-line reason>
Examples are indented so echoing this manual is not a declaration:
NIGHTLY PHASE NO-OP: loop=reliability phase=audit reason=no new findings in the delta range
NIGHTLY PHASE NO-OP: loop=reliability phase=remediate reason=no safe source-actionable changes
The wrapper accepts this explicit completion instead of a commit. Emit it only
when every applicable stage finished and the checkpoint/report is durable;
cap exhaustion, an unverified gate or unfinished work is INCOMPLETE. Do not
emit it after landing substantive work. Silence remains INCOMPLETE. A sibling
loop/phase marker or an indented quote is not a declaration. The protocol is
covered by scripts/tests/test_phase_noop_declaration.py.
Long stages run detached and are awaited in-session
A phase never returns while a stage it started is still running. "Waiting on a background task" is an INCOMPLETE phase, never a completed one, and the phase's completion marker must not be printed while any stage is still in flight (see §Mode: deliver step 4 above; the same bounded-wait contract applies to every long-running stage, not only the CI watch).
Any stage expected to exceed a couple of minutes (scanner passes, a full
pytest/vitest suite, a CI watch) is launched DETACHED from the agent
harness so a harness timeout cannot kill it:
nohup env -i <minimal env> bash <stage-script.sh> </dev/null >stage.out 2>&1 & disown (macOS has no setsid). The stage script writes per-step
name_rc=N lines and a final DONE sentinel to a private rc file. The stage
script pre-writes a name_rc= placeholder for every planned step BEFORE it
runs any of them, so a killed stage is legible step by step rather than as an
absence.
An rc file with no DONE is a FAILED stage, never a passing one. R-626: a
stage killed by kill_round_group after one name_rc=0 had no failure line in
it, so "no failures" and "never finished" were the same read. Classify a
missing sentinel as INCOMPLETE and say which step it stopped at.
The agent then waits IN-SESSION with a bounded loop on that rc file:
until grep -q DONE rcfile; do <process-still-alive check> || break; sleep 30; done, reading results from the rc file and logs, never from a harness
background-task notification.
Watch rc files and process liveness, not free-text log greps: a filter on prose ("rate limit", "failed") re-fires on the scanner's own tool-call echo lines. Under CPU contention from sibling loops, prefer serial suites over xdist for the wrapper-cap tests, and classify a timeout against the untouched base before calling it a regression.
Pull request output
PR titles and bodies are generated by python3.13 scripts/github_pr_output.py,
never freehanded. Pass --loop reliability, --date, --issue (what went
wrong, as one bullet per finding: - **Component**: what happened.), --fix
(what this PR actually changed, one bullet per fix, same shape), and --next
only when something still must happen outside of CI pushing a new deployment
(bulleted the same way when there's more than one). Omit --next and the
formatter emits Fixed with green deployment. A single plain sentence still
works when there is exactly one finding.
The body has exactly three sections, in this order: Issue discovered,
What was done to fix it, Next. Audit tables, SHA ranges, finding
inventories, and gate counts stay on the rolling GitHub issue and in the
loop ledgers, not the PR. Title shape: Reliability <date>: <plain-language issue>. Publish a substantive dated branch, including a new remediation after an
older PR merged, only through
python3.13 scripts/nightly_publish.py publish --base main --head <branch> --title <title> --body-file <body-file>.
Write the formatter's exact body to that file. The publisher owns the guarded
push and PR lookup/creation; inspect its JSON result. A no-op result publishes
nothing. Update the body of an existing substantive PR with
gh api -X PATCH repos/{owner}/{repo}/pulls/<n> --input <json> when needed
(this repo's gh pr edit --body-file aborts), then verify the resulting body.
Zero-finding and bookkeeping-only nights report on the existing rolling issue; no PR is opened or updated merely as proof of life.
Dead-man reporting
Every phase outcome is reported through the issue and notification, so a
silent-dead runner shows up
the next morning at the latest: a comment on the rolling GitHub issue
labeled reliability-nightly, a Pushover notification per phase carrying
the status and the nightly PR link when one exists, and a PR only for substantive work.
The wrapper posts one runner-health comment per phase, not the three-section write-up:
PHASE STAMP status optional detail
For the deliver phase the status IS the operator's merge cue: N PR(s) green, ready to merge: <urls>, 0 PR(s), nothing to merge, or
INCOMPLETE: <check> (CI not green at the cap; the next fire resumes the
same branch and PR). The issue is created once with a timeless
rolling-dead-man description. Run
history stays in comments. The wrapper does not edit the issue body after
the first run. A missing daily comment means the runner did not fire.
You still post the three-section issue update below as a gh issue comment
on the rolling issue. Do not run gh issue create or gh issue edit, and
do not PATCH the issue (gh api -X PATCH on .../issues/). That would
overwrite the dead-man description. Comment-only. The wrapper also comments;
you are not the only commenter. GitHub issue write-ups
you author use this shape, never a status dump or a pointer to a log on a
machine:
Issue discovered What went wrong, in plain language. If nothing went wrong, say that.
What was done to fix it What THIS run actually changed. If nothing: "Nothing this run."
Next Only work that must happen OUTSIDE of CI pushing a new deployment. If nothing remains: "Fixed with green deployment"
A quiet day means one of two things: the runner did not fire, or the
previous cycle is still running. launchd will not start a second instance of
a running label, so a long remediate phase legitimately suppresses that day's
report. Check launchctl list | grep radon before treating quiet as dead.
The reliability cycle is bounded to 20h so it cannot swallow the next 00:00
fire.
Measure improvement
Measure improvement by: findings implemented per cycle (verified findings fixed and delivered over verified findings found), PRs opened per cycle, time to CI green (remediate start to the deliver phase's green verdict), and PRs awaiting merge with their age (an operator-side backlog the loop reports in the Next section and the issue comment, never one it closes itself). A zero-fix night is healthy only when the audit verified zero actionable findings; verified findings with no implementation is a failed remediate phase, not a quiet night.
Self-improvement
At the end of either mode, if the run itself hit friction (a wrong
assumption in this skill, a missing rail, a flaky step), append a short
dated bullet to ## Lessons below alongside substantive work only; otherwise
persist it on the rolling issue. That is
how this loop improves as the codebase grows.
Lessons
Shortened here. Read the whole file on GitHub.
Signals
- GitHub stars
- 30
- Forks
- 7
- Last commit
- Sep 2026
ahel review
K1binfo
installs-packagesK2info
exfiltration
Automated review, not a security audit. Ruleset v1+k2.
Advanced
- Catalog kind
- skill
- Gateway key
reliability-weekend- Source
- github.com/joemccann/radon