feat(miner): add a hosted-container entry point for AMS cron-wake cycles - #8070
Conversation
…les (#7182) Adds packages/loopover-miner/bin/loopover-miner-hosted.ts (+ lib/hosted-entry.ts, the real logic) as an ADDITIONAL entry point alongside the existing loopover-miner CLI -- self-host is completely unaffected. Starts #7177's already-built-but-previously-unwired AMS health server (a state-dir readiness probe), dispatches to exactly one existing one-shot unattended command (discover/manage-poll/attempt, reused in-process, unmodified), stops the health server, and returns that command's own 0=success/2=failure exit code unchanged. This is the miner-side half of #7182 (control-plane's cron-triggered wake/poll-exit-code logic is a separate, follow-up PR) -- landing it first since the cron side calls into this entry point via a Cloudflare Container entrypoint override.
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Warning ⏸️ LoopOver review result - manual review recommendedReview updated: 2026-07-22 18:52:56 UTC
Review summary Nits — 5 non-blocking
Concerns raised — review before merging
📋 Copy for AI agents — paste into your coding agentDecision drivers
Context & advisory signals — never blocks the verdict
Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 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 LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (94.44%) is below the target coverage (99.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #8070 +/- ##
==========================================
+ Coverage 91.82% 93.06% +1.23%
==========================================
Files 734 653 -81
Lines 75036 54391 -20645
Branches 23050 19406 -3644
==========================================
- Hits 68902 50617 -18285
+ Misses 5034 2852 -2182
+ Partials 1100 922 -178
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Summary
Part of #7182 (miner-side half — control-plane's cron-triggered wake/poll-exit-code logic is a separate follow-up PR, since it calls into this entry point via a Cloudflare Container entrypoint override).
packages/loopover-miner/bin/loopover-miner-hosted.ts(+lib/hosted-entry.ts, the real logic) as an additional entry point alongside the existingloopover-minerCLI — self-host is completely unaffected.ams-health-server.ts) with a state-dir readiness probe, for the brief window a cron-woken container is up.discover,manage-poll, orattempt(docs/unattended-scheduling.md's own documented pattern) — reused in-process via the same exported functionsbin/loopover-miner.tsalready calls, unmodified.0=success/2=failure exit code unchanged — no new exit-code vocabulary introduced.loop(the continuous self-scheduling mode, semantically incompatible with "wake, run one cycle, sleep") and any strictly-local command (status/doctor/etc).Scope
type(scope): short summaryConventional Commit format.bin/loopover-miner.ts, the CLI dispatch table, or any existing command's behavior; self-host mode is unaffected.Validation
git diff --checknpm run typecheck(root)npm run build:minerpackages/loopover-minertest suite: 176/176 files, 2757/2757 tests passing (including the newtest/unit/miner-hosted-entry.test.ts, 100% line/branch/function coverage).npm run test:miner-pack— new bin/lib files correctly allowlisted, no forbidden content.npm run test:miner-deployment-docs-audit— passes unchanged.Safety
Notes
Landed first (of the two-PR set) since control-plane's cron/wake logic depends on this entry point existing in the AMS image.