Repository navigation
v0.2.2-alpha
h2ck.me v1 audit-cycle round — closes six findings surfaced in
h2ck.me/projects/CronManager-on-Rust/v1/NEXT-TASKS.md (2026-09-17).
Every fix / feature landed as its own one-issue-one-branch-one-PR
per the project's ops policy: PRs #20, #22, #24, #26, #28, #30.
239 tests pass (was 223 on 0.2.1-alpha; added +6 lock-order pin,
+3 405 pins, +1 axum shutdown wiring, +1 SIGTERM handler unit,
+3 offline-mode dispatch/env, +7 doctor findings + render); cargo fmt --check + cargo clippy --all-targets -- -D warnings +
cargo audit --deny warnings + cargo deny check all + mdbook build all clean.
Patch version bump. CronManager ships as a binary, not a library
— there are no external Rust API consumers — so the two additive
items with in-crate shape implications (new ExecutionStatus::Offline
variant, new ExecutorBundle.offline_mode: bool field) don't
warrant a minor bump on their own. Config / DSL / HTTP / CLI
surface stays fully backward-compatible with 0.2.1-alpha; every
new lever defaults to the pre-existing behaviour
(CRONMANAGER_OFFLINE unset = 100% behavioural parity).
Ships on dev only. main remains at 0.1.4-alpha.
Added
cronmanager doctorCLI subcommand — synchronous offline
config audit. Loads the same config the boot path would, runs
every checkmain.rsruns (env-safety, refuse-to-start, DSL
path existence, database env, weak posture flags) and prints
severity-prefixed findings (FATAL/BREAK/WEAK/INFO).
Exits1on any FATAL. Never binds a listener, never touches
the DB. Wire into containerHEALTHCHECKor pre-deploy CI.
Adopts FLEET-STRONGHOLDS §8.2 (XTR-pattern). (h2ck.me v1 T-19,
PR #30.)CRONMANAGER_OFFLINE=trueenv-var lever — short-circuits
every HTTP + shell dispatch. One history row per fire records
status=OFFLINE, no network call, no child process. Boot
emits a WARN and doctor surfaces an INFO. Truthy values:
true/1/yes/on(case-insensitive). New
ExecutionStatus::Offlinevariant with labelOFFLINE— the
job_execution_history.statuscolumn isVARCHAR(50)so no
migration is required. New publicExecutorBundle.offline_mode: boolfield. Adopts FLEET-STRONGHOLDS §9.1. (h2ck.me v1 U15,
PR #28.)- Graceful shutdown on SIGTERM (unix) + SIGINT / Ctrl+C —
axum::serve(..).with_graceful_shutdown(shutdown_signal())
drains in-flight requests when the container orchestrator
sends SIGTERM (docker stop, k8s pod eviction). Before this
change, in-flight requests were aborted mid-flight and their
history rows lost. Newsrc/signal.rsmodule holds the
future. Windows: only Ctrl+C is available; tokio's ctrl_c
handler covers both platforms. Newlibcdev-dependency
(SIGTERM-to-self regression pin). (h2ck.me v1 T-18 /
FLEET §34.4, PR #26.)
Changed
tower_http::RequestBodyLimitLayer413 body is now
structured JSON matching every other failure path in the
codebase:{"error":"request_too_large","message":"...","limit":N}.
Previously the layer emitted a bare-text body that JSON clients
couldn't parse. Newstructured_error_body_middlewarein
src/router.rs, wired outside the body-limit layer via
from_fn_with_state. Handler-generated 413s (e.g.
TooManyQueryParams) that already carryapplication/json
pass through untouched. (h2ck.me v1 T-15 /
FLEET-STRONGHOLDS §U10, PR #22.)
Fixed
Scheduler::describe_runninglock-order inversion risk —
the method used to acquirerunningthenjobsand hold both
simultaneously, while every other acquisition site
(stop,trigger_now,reload_from) takes at most one at a
time. Any future caller goingjobs→runningcould have
deadlocked.describe_runningnow snapshotsrunningunder
its own lock (cloning JobKey + started_at_ms + schedule),
releases it, then takesjobsfor the per-keylast_result
lookup. No method insrc/scheduler.rsholds both
simultaneously anymore. Regression pin
(describe_running_and_reload_do_not_deadlock) hammers
describe_running+reload_from+stopconcurrently for
500 ms with a 10 s timeout guard. (h2ck.me v1 T-5 /
2026-09-17 concurrency mini-audit R-4, PR #20.)- mdbook-linkcheck failure on CHANGELOG version headings —
the linkcheck flagged## [0.2.1-alpha]/## [0.2.0-alpha]
as "potential incomplete link" (pre-existing failure on
dev). Add explicit link definitions at the bottom of
CHANGELOG.md — the Keep-a-Changelog idiom — so linkcheck
resolves them.
Tests
- 405 Method Not Allowed regression pins — axum's
MethodRouteralready emits 405 with the correctAllow:
header when the path matches but the method doesn't, but no
regression tests locked the behaviour. New
wrong_method_on_health_returns_405_with_allow_header,
wrong_method_on_execute_returns_405, and
unknown_path_still_returns_404guard against a future
Router::fallbackrefactor silently downgrading to 404 or
vice versa. (h2ck.me v1 T-17 / RFC 7231 §7.4.1, PR #24.)