You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#7173 ratified the shared ORB+AMS hosting control-plane architecture (one isolated Cloudflare
Container per tenant, orchestrated via #7180's provisioning API). #5220 (now closed, design
settled) worked out that AMS's own admin surface for this doesn't need a new API — it needs a thin
CLI wrapper on the existing loopover-miner binary that calls #7180's provisioning API over
authenticated HTTP, reusing #7180's own lifecycle states (provisioning/active/suspended/ torn down) and #7174's generalized secret-broker auth (already merged via #7187) rather than
inventing AMS-specific versions of either.
The pattern to follow already shipped tonight: packages/loopover-miner/lib/discovery-index-client.js
(queryDiscoveryIndex/submitSoftClaim) is a Bearer-authed HTTP client from the miner CLI to a
separate hosted service, with its own *-cli.js command-parsing conventions
(packages/loopover-miner/lib/portfolio-queue-cli.js for argv parsing shape, packages/loopover-miner/lib/discover-cli.js for the async CLI-command pattern).
Requirements
New loopover-miner tenant subcommand group: tenant create <name> [--product ams] [--json], tenant list [--json], tenant destroy <name> [--json].
Admin-command failures must be loud (non-zero exit, clear error), never fail-open (unlike discovery-index-client.js's deliberately fail-open opportunistic-supplement design — this is a
deliberate admin action, not a best-effort enrichment).
Flag-gated the same way the discovery-plane client is (LOOPOVER_MINER_* env var), off by
default, so this ships inert until an operator/admin actually configures the control-plane URL.
Deliverables
packages/loopover-miner/lib/tenant-cli.js (or extends an existing CLI module if a better
home emerges during implementation): argv parsing + runTenantCreate/runTenantList/ runTenantDestroy
HTTP client wired the same way discovery-index-client.js is (injectable fetch, Bearer
auth, typed request/response shapes)
Wired into bin/loopover-miner.js's command dispatch
Regression tests for both the argv-parsing and HTTP-call layers, including the control-plane
unreachable/error-response path (loud failure, not silent)
Test Coverage Requirements
packages/loopover-miner/lib/** is covered by Codecov's 99% patch-coverage gate. Every new ??/ternary/error-path branch needs both sides covered — mirrors tonight's discovery-index-client.js test shape (success path + failure path + malformed-response path for
every HTTP call).
Expected Outcome
An admin can create/list/destroy a hosted AMS tenant instance from the same loopover-miner
binary operators already use, without needing a separate tool or hand-rolled curl calls against
the control-plane API.
Context
#7173 ratified the shared ORB+AMS hosting control-plane architecture (one isolated Cloudflare
Container per tenant, orchestrated via #7180's provisioning API). #5220 (now closed, design
settled) worked out that AMS's own admin surface for this doesn't need a new API — it needs a thin
CLI wrapper on the existing
loopover-minerbinary that calls #7180's provisioning API overauthenticated HTTP, reusing #7180's own lifecycle states (
provisioning/active/suspended/torn down) and #7174's generalized secret-broker auth (already merged via #7187) rather thaninventing AMS-specific versions of either.
The pattern to follow already shipped tonight:
packages/loopover-miner/lib/discovery-index-client.js(
queryDiscoveryIndex/submitSoftClaim) is a Bearer-authed HTTP client from the miner CLI to aseparate hosted service, with its own
*-cli.jscommand-parsing conventions(
packages/loopover-miner/lib/portfolio-queue-cli.jsfor argv parsing shape,packages/loopover-miner/lib/discover-cli.jsfor the async CLI-command pattern).Requirements
loopover-miner tenantsubcommand group:tenant create <name> [--product ams] [--json],tenant list [--json],tenant destroy <name> [--json].credential env var, distinct from a tenant's own per-instance secrets).
discovery-index-client.js's deliberately fail-open opportunistic-supplement design — this is adeliberate admin action, not a best-effort enrichment).
LOOPOVER_MINER_*env var), off bydefault, so this ships inert until an operator/admin actually configures the control-plane URL.
Deliverables
packages/loopover-miner/lib/tenant-cli.js(or extends an existing CLI module if a betterhome emerges during implementation): argv parsing +
runTenantCreate/runTenantList/runTenantDestroydiscovery-index-client.jsis (injectablefetch, Bearerauth, typed request/response shapes)
bin/loopover-miner.js's command dispatchunreachable/error-response path (loud failure, not silent)
Test Coverage Requirements
packages/loopover-miner/lib/**is covered by Codecov's 99% patch-coverage gate. Every new??/ternary/error-path branch needs both sides covered — mirrors tonight'sdiscovery-index-client.jstest shape (success path + failure path + malformed-response path forevery HTTP call).
Expected Outcome
An admin can create/list/destroy a hosted AMS tenant instance from the same
loopover-minerbinary operators already use, without needing a separate tool or hand-rolled
curlcalls againstthe control-plane API.
Links & Resources
packages/loopover-miner/lib/discovery-index-client.js— the HTTP-client pattern to mirrorpackages/loopover-miner/lib/portfolio-queue-cli.js— the argv-parsing convention to mirror