./v3 cron

Cycle: v3/cli_cron_command; Mode: one-shot; Record/index: this file, plans index

Debug mode: enabled (project marker .railspike_debug_on)

Effort study: railspike-effort, protocol P2, reference R1; host ledger. Standing P2 enrollment.

Extended estimates: disabled (one approach, no stages)

Cycle estimate: 0.05 (execution entry; intake missing, see Study history)

Status: done locally; PR open, awaiting maintainer merge. Not deployed; not replayed on vps22365.

Original request

Maintainer, 2026-12-04, pasting a terminal session on the production host:

$ ./v3 cron
Unknown command: cron
Run ./v3 with no arguments to see available commands.

"let's make a better outcome for this", then: "should probably alias task-queue cron unless you have a better idea".

Authorization

The request covers making ./v3 cron do something useful, with tests and docs, pushed as an open PR. It does not cover changing what either existing cron subcommand prints, installing crontab lines, or touching the server.

Outcome and work type

Application change (CLI only).

  1. ./v3 cron [--log=...] prints the task-queue cron reference, as the maintainer suggested (task-queue cron is the one every instance needs), followed by one line pointing at ./v3 high-traffic cron /path/to/access.log, the only other cron job v3 has. Both subcommands only print instructions; nothing is installed.

  2. The "better idea" part: an unknown top-level command that is a subcommand of a group gets "Did you mean:" with the matching usage lines (for example ./v3 run lists ./v3 task-queue run and ./v3 high-traffic ... run). Still exits 1. This turns the next miss of this kind into a pointer instead of a dead end.

Approach and risks

  • Alias in the case of the ./v3 dispatcher, delegating to scripts/task_queue.php cron "$@", so --log, --help and option errors behave exactly as ./v3 task-queue cron.

  • Suggestions come from the root usage text itself: the heredoc moves into a print_usage function and the unknown-command branch filters its lines. One source; no second list to drift.

  • Risk: the high-traffic pointer breaks a caller that pipes ./v3 cron into something expecting only the task-queue reference. Mitigation: the pointer goes to stderr, so stdout is byte-identical to ./v3 task-queue cron; it is skipped for --help and never printed when the task-queue command fails.

  • Risk: a short unknown word matches many lines. Matching is on whole subcommand words only (split on |), so cron matches two lines, not every line containing "cron".

Reuse decisions

  • scripts/task_queue.php cron: reused unchanged for the alias.

  • Root usage heredoc in ./v3: reused as the suggestion source (moved into a function, text unchanged except the new ./v3 cron line).

  • Tests: TaskQueueCommandTest::runCommand pattern through the dispatcher, as the CLI error-handling contract asks.

  • New: nothing beyond the case branch and a small awk filter.

Completion conditions

  • ./v3 cron exits 0, stdout matches ./v3 task-queue cron, stderr names ./v3 high-traffic cron.

  • ./v3 cron --log=/x bakes /x into the line; ./v3 cron --bogus exits nonzero with usage.

  • ./v3 run exits 1 with "Unknown command: run" and "Did you mean:" listing the task-queue and high-traffic run lines; ./v3 nonsense exits 1 without a "Did you mean" block.

  • Recovery: none needed; nothing changes state.

  • Release: PR open; the maintainer merges and deploys.

Concepts touched

None (CLI dispatch only; no concept entry exists for the dispatcher).

Verification and recovery plan

  • Regression tests in TaskQueueCommandTest through ./v3.

  • ./v3 test --smoke TaskQueueCommandTest. Full suite not run.

  • Replay of the reported failure: ./v3 cron in this clone. Not replayed on vps22365.

  • Not applicable: themes, nav icons, read-model schema, UI.

Starting revisions and branch

Branch cli/cron-command from origin/main at 04cf854.

Planning commit: 359c8be.

Dated execution history

  • 2026-12-04: record written. No matching item in docs/feedback/items/. Planning commit 359c8be.

  • 2026-12-04: maintainer, mid-cycle: "you can one-shot to pr". Confirms the mode and the PR as the end point; no scope change.

  • 2026-12-04: root usage heredoc moved into print_usage() (text unchanged plus one ./v3 cron line); usage_lines_for_subcommand() filters it with awk on whole |-separated subcommand words; cron) case added after task-queue); unknown-command branch prints "Did you mean:" when the filter finds lines. Two tests added to TaskQueueCommandTest; docs/reference/v3_cli.md gained the synopsis line, a sentence under cron, and a paragraph under the CLI error-handling contract.

  • 2026-12-04: discovery: ./v3 run matches five groups (task-queue, high-traffic, retraction-sweep, bake-timestamps, purge-history), each printed as its full usage line. Kept: those are the real answers, and long lines are the existing usage text, not new copy.

Study history

  • Intake: missing. The dispatcher and both cron subcommands were read before any estimate was written; not reconstructed.

  • 2026-12-04 execution entry 0.05, scope v1, R1, P2. Single exposed Claude rater. Not hours.

  • 2026-12-04 closeout, retrospective scope assessment 0.05: scope v1 unchanged. Maintainer fit judgment pending.

Enhancement requests

None.

Outcome

Delivered as planned. ./v3 cron prints the task-queue cron reference (same stdout as ./v3 task-queue cron, same options and errors) and one stderr line pointing at ./v3 high-traffic cron /path/to/access.log. Unknown commands that are a subcommand elsewhere get "Did you mean:" with the matching usage lines.

Limits and next actions:

  • Suggestions only match whole subcommand words; typos (./v3 crn) still get the plain message. A fuzzy match would be a separate cycle.

  • Next action: maintainer merges and deploys, then runs ./v3 cron on vps22365.

Verification

  • Passed: ./v3 test --smoke TaskQueueCommandTest (520 run, 520 passed), including the two new tests.

  • Passed: ./v3 test TaskQueueCommandTest (16 run, 16 passed), including the existing root-usage test that lists every task-queue line.

  • Replayed the reported command in this clone: ./v3 cron exits 0 with the reference; ./v3 cron --bogus exits 1 with the task-queue usage and no pointer; ./v3 cron --help exits 0; ./v3 nonsense exits 1 with no "Did you mean"; bare ./v3 still prints usage and exits 1.

  • Not replayed on vps22365 (no production access in this cycle).

  • Not applicable: themes, nav icons, read-model schema, UI.

  • Full suite not run.

Final review

Diff: v3 (function wrapper, one usage line, one case branch, suggestion block), two tests, three edits to docs/reference/v3_cli.md, this record, the index line, the ledger file and the debug log. No change to scripts/task_queue.php or scripts/high_traffic.php. git diff --check clean. todo.txt untouched.

Commit, merge and publication status

Completion commit: this commit. Pushed as cli/cron-command; PR open. Not merged, not deployed.

Storage changes: none.

— Claude · 2026-12-04 UTC · Model: claude-opus-5-5