Skip to content

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

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
nickmopen:feat/unattended-scheduling-docs
Jul 13, 2026
Merged

docs(miner): add unattended scheduling & failure-alerting guidance#5592
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
nickmopen:feat/unattended-scheduling-docs

Conversation

@nickmopen

Copy link
Copy Markdown
Contributor

Summary

(Resubmit of #5584, closed by the orb: the AI reviewer correctly caught that the cron guidance overstated MAILTO (cron mails output, not exit status) and that a bare || logger masks the failure. Both are fixed here — the examples now capture and re-raise the exit code (status=$?; …; exit "$status"), and the text explains cron's actual output-vs-exit behavior.)

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:40
@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

Tip

🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩

✅ Gittensory review result - approve/merge recommended

Review updated: 2026-07-13 07:45:10 UTC

1 file · 2 AI reviewers · no blockers · readiness 100/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This adds a new operational doc for scheduling `manage poll` / `discover` unattended via cron or systemd, with failure-alerting patterns. It correctly addresses the two prior review findings from #5584: cron's `MAILTO` only mails output (not exit status), and it fixes the `|| logger` masking issue by capturing and re-raising the exit code via `status=$?; ...; exit "$status"`. The doc is internally consistent, well-scoped, and cites #4840 as the linked issue.

Nits — 6 non-blocking
  • The doc asserts the exit-code contract (`0`/`2`) and flag names are 'verified against manage-poll.js and discover-cli.js', but those source files aren't in the diff or provided context, so this claim can't be independently confirmed here — worth a maintainer spot-check.
  • In the systemd example (packages/gittensory-miner/docs/unattended-scheduling.md), the service file doesn't set `User=`/`WorkingDirectory=`, which could matter if the miner relies on a specific local-state directory — minor omission for an operational guide.
  • The wrapper script example uses `$*` for logging args, which could produce confusing quoting for arguments containing spaces; `$@​`-based formatting or `printf '%s '` would be marginally more robust.
  • Consider a one-line cross-reference to whatever config docs define where miner local state lives, so operators know what `OnFailure=` alert handlers might need to inspect.
  • Consider adding a note that `Persistent=true` in the timer means missed hourly runs fire once on next boot, which could surprise operators expecting strict hourly cadence.
  • Diff looks like trivial or whitespace-only churn — Reduce whitespace-only or formatting-only churn and keep the diff focused on substantive changes.
Signal Result Evidence
Code review ✅ No blockers 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 ✅ Passing No configured 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 — This is a focused, correctness-conscious documentation addition that closes a real open issue (#4840) and demonstrably fixes the two concrete defects (MAILTO misconception, exit-code masking) flagged in the prior closed attempt.
Linked issue satisfaction

Addressed
The PR adds a documentation page covering exactly the deliverables requested: an example cron entry, an example systemd timer/service, and concrete guidance on alerting off the non-zero exit code for both `manage poll` and `discover`.

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: not available
  • 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 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gittensory approves — the gate is satisfied and CI is green.

@loopover-orb
loopover-orb Bot merged commit eb2880d into JSONbored:main Jul 13, 2026
9 checks passed
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