Skip to content

docs(miner): add unattended scheduling & failure-alerting guidance - #5584

Closed
nickmopen wants to merge 1 commit into
JSONbored:mainfrom
nickmopen:feat/unattended-scheduling-docs
Closed

docs(miner): add unattended scheduling & failure-alerting guidance#5584
nickmopen wants to merge 1 commit into
JSONbored:mainfrom
nickmopen:feat/unattended-scheduling-docs

Conversation

@nickmopen

Copy link
Copy Markdown
Contributor

Summary

Adds operational guidance (#4840) for running the miner's two scheduled commands — manage poll and discover — unattended, and for alerting on failures.

Doc: packages/gittensory-miner/docs/unattended-scheduling.md. Covers:

  • The exit-code contract (0 success / 2 failure) that every scheduler keys on for alerting — verified against manage-poll.js and discover-cli.js.
  • The flags that matter for scheduled runs: --no-update-check / GITTENSORY_MINER_NO_UPDATE_CHECK=1 (skip the npm nudge) and --json (machine-parseable output).
  • Worked cron example (crontab env + MAILTO + a || logger fallback that captures the failing exit code).
  • Worked systemd oneshot service + timer, using OnFailure= as the alerting hook.
  • Three failure-alerting patterns: cron MAILTO/logger, systemd OnFailure= templated unit, and a scheduler-agnostic wrapper script.

Scope

  • The PR title follows type(scope): short summary Conventional Commit format.
  • This PR is focused (one new doc) and does not mix unrelated changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked a currently open issue this PR resolves — Closes #4840.

Validation

  • git diff --check
  • npm run docs:drift-check (passes — no mechanically-checkable claim goes stale)
  • Every command/flag/exit-code in the doc verified against the current source (manage-poll.js, discover-cli.js exit 0/2; update-check.js --no-update-check / GITTENSORY_MINER_NO_UPDATE_CHECK)

If any required check was skipped, explain why:

  • Docs-only change (one new .md, no code). No src/**/apps/**/package changes, so Codecov and the backend/UI/MCP CI jobs are path-skipped; there is no code to test.

Safety

  • No secrets, wallets, hotkeys, coldkeys, PATs, private keys, raw trust scores, private rankings, or maintainer evidence are exposed — the examples use placeholder repos/emails only.
  • Public GitHub text stays sanitized and low-noise.
  • No changelog edited.

Notes

  • Cross-links the existing operations-runbook.md and ../DEPLOYMENT.md rather than duplicating their scope.

Closes #4840

Operational guidance (JSONbored#4840) for running the miner's two scheduled commands (`manage poll`,
`discover`) unattended: the shared exit-code contract (0 success / 2 failure) that alerting keys
on, the `--no-update-check` / `--json` flags for scheduled runs, worked cron and systemd
service+timer examples, and three failure-alerting patterns (cron MAILTO/logger, systemd
OnFailure=, and a wrapper script).

Closes JSONbored#4840
@nickmopen
nickmopen requested a review from JSONbored as a code owner July 13, 2026 07:12
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@loopover-orb loopover-orb Bot added the gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. label Jul 13, 2026
@loopover-orb

loopover-orb Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Caution

🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥

🛑 Gittensory review result - reject/close recommended

Review updated: 2026-07-13 07:18:29 UTC

1 file · 2 AI reviewers · 1 blocker · readiness 100/100 · CI failing · unstable

🛑 Suggested Action - Reject/Close

Review summary
This is a docs-only addition documenting the exit-code contract, flags, and cron/systemd scheduling patterns for the miner's `manage poll` and `discover` commands, closing #4840. The content is internally consistent, the `$?` explanation for the `|| logger` pattern is technically correct, and the PR follows repo conventions (Conventional Commit title, docs-drift-check passing, no code changes). The only visible CI failure (Build UI preview artifact) is unrelated to a docs-only markdown addition.

Blockers

  • packages/gittensory-miner/docs/unattended-scheduling.md:30 claims cron mails `MAILTO` on any non-zero exit, but cron mails command output rather than exit status and the shown `|| logger` branch returns logger's status, so a silent command failure can be hidden from cron; change the comment/text to say MAILTO only sends emitted output and either rely on `logger` as the alert path or preserve failure with `|| { status=$?; logger -t gittensory-miner "manage poll failed (exit $status)"; exit "$status"; }`.
  • packages/gittensory-miner/docs/unattended-scheduling.md:88 says the wrapper keys on the `2` failure contract, but the sample exits `1` after alerting, so schedulers no longer see the command's documented failure code; capture and re-exit the original status with `status=$?; notify-failure "gittensory-miner $* exited $status"; exit "$status"`.
Nits — 6 non-blocking
  • The doc asserts exit code 2 covers 'invalid arguments, or the run hit an error (network / API / local state)' but doesn't note whether other non-zero codes are possible — worth a one-line caveat if `manage-poll.js`/`discover-cli.js` can ever exit with something other than 0 or 2.
  • The wrapper script example in the 'Alerting on failure' section exits 1 after a failure notification rather than propagating the original `$?`, which slightly undercuts the exit-code-contract emphasis elsewhere in the doc.
  • Consider linking directly to the relevant lines in `manage-poll.js`/`discover-cli.js` where the exit codes are set, so the claim stays auto-verifiable if the source changes.
  • Consider adding a one-line note on log rotation/retention for the `logger`/journalctl outputs referenced, since operators following this doc will be running these unattended for a long time.
  • nit: packages/gittensory-miner/docs/unattended-scheduling.md:56 only provides a systemd unit for `discover`, while the document opens by covering both scheduled commands; add the parallel `manage poll` unit or explicitly say the service shape is identical with the command substituted.
  • Diff looks like trivial or whitespace-only churn — Reduce whitespace-only or formatting-only churn and keep the diff focused on substantive changes.

Why this is blocked

  • packages/gittensory-miner/docs/unattended-scheduling.md:30 claims cron mails `MAILTO` on any non-zero exit, but cron mails command output rather than exit status and the shown `|| logger` branch returns logger's status, so a silent command failure can be hidden from cron; change the comment/text to say MAILTO only sends emitted output and either rely on `logger` as the alert path or preserve failure with `|| { status=$?; logger -t gittensory-miner "manage poll failed (exit $status)"; exit "$status"; }`.
📋 Copy for AI agents — paste into your coding agent
Fix the following blocker(s) from this PR review:

1. packages/gittensory-miner/docs/unattended-scheduling.md:30 claims cron mails \`MAILTO\` on any non-zero exit, but cron mails command output rather than exit status and the shown \`\|\| logger\` branch returns logger's status, so a silent command failure can be hidden from cron; change the comment/text to say MAILTO only sends emitted output and either rely on \`logger\` as the alert path or preserve failure with \`\|\| \{ status=$?; logger -t gittensory-miner "manage poll failed \(exit $status\)"; exit "$status"; \}\`.

CI checks failing

  • Build UI preview artifact
Signal Result Evidence
Code review ❌ 1 blocker 2 reviewers, synthesized
Linked issue ✅ Linked #4840
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 140 registered-repo PR(s), 88 merged, 12 issue(s).
Contributor context ✅ Confirmed Gittensor contributor nickmopen; Gittensor profile; 140 PR(s), 12 issue(s).
Gate result ❌ Blocking Repo-configured hard blocker found.
Improvement ⚠️ ℹ️ Insufficient signal risk: low · value: insufficient-signal — Nothing measurable for the structural-improvement analyzers on this PR (e.g. no code files changed). LLM value judgment: moderate — The doc closes a real open issue with concrete, verified operational guidance (exit codes, flags, cron/systemd examples) that unattended miner operators would otherwise have to reverse-engineer from source.
Linked issue satisfaction

Addressed
The PR adds a dedicated doc covering exit-code alerting, cron and systemd unit/timer examples, and multiple failure-alerting patterns for exactly the two commands (manage poll, discover) the issue names, matching the deliverable requested.

Review context
  • Author: nickmopen
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: TypeScript, Python
  • Official Gittensor activity: 140 PR(s), 12 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Keep the PR focused and include validation evidence before maintainer review.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
[BETA] Chat with Gittensory

Ask Gittensory a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @gittensory ask <question> answers contribution-quality Q&A with source citations and freshness.
  • @gittensory chat <question> answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @gittensory mention with a real question is routed to the closest matching read-only command automatically -- no exact syntax required.

Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

  • Re-run Gittensory review

@loopover-orb

loopover-orb Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Gittensory is closing this pull request on the maintainer's behalf (CI is failing (Build UI preview artifact); AI reviewers agree on a likely critical defect: packages/gittensory-miner/docs/unattended-scheduling.md:30 claims cron mails `MAILTO` on any non-zero exit, but cron mails command output rather than exit status and the shown `|| logger` branch returns logger's status, so a silent command failure can be hidden from cron; change the comment/text to say MAILTO only sends emitted output and either rely on `logger` as the alert path or preserve failure with `|| { status=$?; logger -t gittensory-miner "manage poll failed (exit $status)"; exit "$status"; }`.). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add cron/systemd/alerting guidance for unattended runs

1 participant