diff --git a/nixos/home/meta-quota-export.nix b/nixos/home/meta-quota-export.nix deleted file mode 100644 index 1893018ff9..0000000000 --- a/nixos/home/meta-quota-export.nix +++ /dev/null @@ -1,50 +0,0 @@ -# meta-quota-export — the Meta (dev.meta.ai) quota exporter -# (developing-today/code#1301 Phase 1), run every 15 minutes. -# -# Home-manager module: imported by the amd host config -# (nixos/hosts/default.nix) with -# services.meta-quota-export.enable = true. -# -# Folded into the flake 2026-11-01 (developing-today/code#3720): -# until now the units were plain files in ~/.config/systemd/user. -# Semantics are replicated exactly; only provenance changes. The -# script itself stays at ~/atlas/meta-quota-export/, next to the -# data it exports, and runs under the system node. -{ - config, - lib, - ... -}: -let - cfg = config.services.meta-quota-export; -in -{ - options.services.meta-quota-export = { - enable = lib.mkEnableOption "the Meta quota exporter (code#1301)"; - }; - - config = lib.mkIf cfg.enable { - systemd.user.services.meta-quota-export = { - Unit = { - Description = "Meta (dev.meta.ai) quota exporter — code#1301 Phase 1"; - After = [ "network-online.target" ]; - }; - Service = { - Type = "oneshot"; - TimeoutStartSec = 120; - ExecStart = "/run/current-system/sw/bin/node %h/atlas/meta-quota-export/meta-quota-export.mjs --cdp-port 19222 --out-dir %h/atlas/meta-quota-export"; - }; - }; - - systemd.user.timers.meta-quota-export = { - Unit.Description = "Run the Meta quota exporter every 15 minutes — code#1301 Phase 1"; - Timer = { - OnCalendar = "*:0/15"; - RandomizedDelaySec = 20; - Persistent = true; - Unit = "meta-quota-export.service"; - }; - Install.WantedBy = [ "timers.target" ]; - }; - }; -} diff --git a/nixos/hosts/default.nix b/nixos/hosts/default.nix index f05c2b508e..8bb982846b 100644 --- a/nixos/hosts/default.nix +++ b/nixos/hosts/default.nix @@ -141,16 +141,16 @@ in }; } { - # Quota exporters (code#1048, code#1301): Cloudflare + Meta - # quota snapshots every 15 min for the quota gatherer. - # Folded into the flake 2026-11-01 (code#3720). + # Quota exporter (code#1048): Cloudflare quota snapshots + # every 15 min for the quota gatherer. Folded into the + # flake 2026-11-01 (code#3720). (The Meta exporter was + # retired 2026-11-03: quota is gathered by asking OpenCode, + # PR #5040.) home-manager.users.user = { imports = [ ../home/cloudflare-quota-export.nix - ../home/meta-quota-export.nix ]; services.cloudflare-quota-export.enable = true; - services.meta-quota-export.enable = true; }; } { diff --git a/pm-stack/aggregator/src/quota-gather-map.ts b/pm-stack/aggregator/src/quota-gather-map.ts index 26bc0b60f8..2d9de949ce 100644 --- a/pm-stack/aggregator/src/quota-gather-map.ts +++ b/pm-stack/aggregator/src/quota-gather-map.ts @@ -231,11 +231,15 @@ export interface FileExportDoc { const FILE_EXPORT_WINDOW_SECONDS: Record = { "5h": 18_000, weekly: 604_800 }; /** - * Map one file-export document onto a quota-current entry (v1 - * producer: Meta, service meta:high-usage, ~/atlas/meta-quota-export/ - * latest.json on the laptop). `doc` null = the file could not be - * read or parsed; `stale` = its mtime is past the staleness bound. - * Both are error entries — never zeros. + * Map one file-export document onto a quota-current entry. The v1 + * producer was Meta (service meta:high-usage, ~/atlas/meta-quota- + * export/latest.json on the laptop) — retired 2026-11-03 when the + * gatherer began asking the OpenCode quota module for Meta + * directly (PR #5040); the mapper stays as the #1301 convention's + * tested shape for the next producer the module cannot reach. + * `doc` null = the file could not be read or parsed; `stale` = its + * mtime is past the staleness bound. Both are error entries — never + * zeros. */ export function entryFromFileExport( doc: FileExportDoc | null, diff --git a/pm-stack/meta-exporter/README.md b/pm-stack/meta-exporter/README.md deleted file mode 100644 index 38b0de8dfb..0000000000 --- a/pm-stack/meta-exporter/README.md +++ /dev/null @@ -1,111 +0,0 @@ -# Meta quota exporter — Phase 1 (code#1301) - -Laptop-side exporter for the Meta "Muse Code High Usage" plan quota, -built on the #1167 investigation (report: usage-billing-hub goal, -`hidden_files/meta-console-investigation-2026-10-26.md`). Part of the -Stage-2 quota plane (epic #1149); the sandbox gatherer is #1151. - -## Why laptop-side - -The dev.meta.ai console is cookie-auth only; the session -(`llama_dev_sess`, expires 2027-10-27) lives in the laptop Helium -browser and Meta exposes a `sessionBindingId`, so Phase 1 replays the -console's own API calls **from the laptop session's own context**: -the exporter talks CDP (127.0.0.1:19222 on the laptop) and evaluates -`fetch()` inside the open dev.meta.ai page. Requests therefore carry -the session cookie and leave from the laptop's egress/device. The -cookie value never enters the exporter process, a file, or a log. - -Endpoints read per tick (both cookie-auth GETs, JSON): - -- `/api/portal/teams/{team_id}/subscription-quota` — both windows - (weighted used/limit + reset epochs; % = used/limit). -- `/api/portal/teams/{team_id}/billing-banner` — remaining free - credits (minor units). -- Best-effort: the PAYG "Current balance" is read from the billing - iframe's DOM text when a billing tab is open (the balance itself is - behind a GraphQL/embed flow). Absent tab → `paygBalanceUsd: null`, - never an invented 0. - -## Export format (the gatherer file-export convention) - -The gatherer (#1151) had no file-export ingest convention yet, so -this exporter defines it; #1151 should adopt it as-is: - -- Location (on the laptop): - `~/atlas/meta-quota-export/latest.json` (written atomically, - tmp + rename) plus an append-only `history.jsonl` of every run. - The sandbox side reads it over the existing multiplexed SSH channel - (`~/tools/laptop-ssh.sh 'cat ~/atlas/meta-quota-export/latest.json'`). -- Success document: - -```json -{ - "service": "meta", - "source": "file-export/meta-laptop", - "status": "ok", - "measuredAt": "", - "consoleAsOf": "", - "tier": "Muse Code High Usage", - "windows": [ - { "name": "5h", "usedPct": 1.02, "resetAt": "" }, - { "name": "weekly", "usedPct": 8.83, "resetAt": "" } - ], - "freeCreditsUsd": 148.57, - "paygBalanceUsd": 0 -} -``` - -A window with no usage in it has not started yet and has no reset: -the console returns its `*_resets_at` as null or omits the field, and -the exporter emits that window with `"resetAt": null` instead of -failing the whole export (#1301, the 2026-10-29 regression). A missing -reset on a window WITH recorded usage — and any malformed reset -value — still fails closed as `unparseable`. - -## Failure states (fail-closed) - -A failed tick writes a failure document to `latest.json` (and -`history.jsonl`) with `status`, `attemptedAt`, `detail`, and -`measuredAt: null` — and **no** windows or values, so nothing stale -can render as a current reading: - -| status | meaning | exit | -| ----------------- | ------------------------------------------------------------------------------- | ---- | -| `session-expired` | API answered 401/403 or bounced to auth — laptop session needs a human re-login | 3 | -| `cdp-unavailable` | browser debug port did not answer | 4 | -| `no-console-page` | browser up, no dev.meta.ai tab open | 5 | -| `unparseable` | endpoint answered an unrecognised shape | 6 | -| `fetch-failed` | network/other error inside the page | 7 | - -`laptop-unreachable` is a consumer-side derivation, by design: if the -laptop is down nothing runs, so the gatherer/hub treats a -`latest.json` older than 2 ticks (> 30 min) as laptop-unreachable. - -## Install / schedule (laptop) - -```sh -bash pm-stack/meta-exporter/install-laptop.sh # run ON the laptop -``` - -Installs the script to `~/atlas/meta-quota-export/`, renders -`meta-quota-export.service` (with the laptop's node path) + -`meta-quota-export.timer` into `~/.config/systemd/user/`, and enables -a user timer firing every 15 minutes (`OnCalendar=*:0/15`, -`Persistent=true`). Note: user timers run while the user has a -session; `loginctl enable-linger user` (needs sudo) would make them -fully boot-persistent — the laptop's graphical session is the normal -state, and staleness is visible via the age rule above either way. - -Manual run / debugging: - -```sh -node ~/atlas/meta-quota-export/meta-quota-export.mjs -journalctl --user -u meta-quota-export.service -``` - -## Tests - -```sh -node --test pm-stack/meta-exporter/meta-quota-export.test.mjs -``` diff --git a/pm-stack/meta-exporter/install-laptop.sh b/pm-stack/meta-exporter/install-laptop.sh deleted file mode 100644 index 80a6aaecb9..0000000000 --- a/pm-stack/meta-exporter/install-laptop.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env bash -# Install the Meta quota exporter on Drew's laptop (run ON the laptop). -# Copies the exporter next to its output directory, renders the systemd -# user units with the laptop's node path, enables the 15-minute timer, -# and starts one run immediately. Idempotent. -set -euo pipefail - -SRC_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -DEST_DIR="$HOME/atlas/meta-quota-export" -UNIT_DIR="$HOME/.config/systemd/user" -NODE_BIN="$(command -v node || true)" - -if [[ -z $NODE_BIN ]]; then - echo "install-laptop: node not found on PATH" >&2 - exit 1 -fi - -mkdir -p "$DEST_DIR" "$UNIT_DIR" -install -m 0755 "$SRC_DIR/meta-quota-export.mjs" "$DEST_DIR/meta-quota-export.mjs" -sed "s|@NODE@|$NODE_BIN|g" "$SRC_DIR/meta-quota-export.service" >"$UNIT_DIR/meta-quota-export.service" -install -m 0644 "$SRC_DIR/meta-quota-export.timer" "$UNIT_DIR/meta-quota-export.timer" - -systemctl --user daemon-reload -systemctl --user enable --now meta-quota-export.timer -systemctl --user start meta-quota-export.service || true - -echo "install-laptop: installed to $DEST_DIR; timer state:" -systemctl --user list-timers meta-quota-export.timer --no-pager || true -echo "install-laptop: latest export (if the first run succeeded):" -cat "$DEST_DIR/latest.json" 2>/dev/null || echo "(no latest.json yet — check: journalctl --user -u meta-quota-export.service)" diff --git a/pm-stack/meta-exporter/meta-quota-export.mjs b/pm-stack/meta-exporter/meta-quota-export.mjs deleted file mode 100644 index 95c883faf4..0000000000 --- a/pm-stack/meta-exporter/meta-quota-export.mjs +++ /dev/null @@ -1,537 +0,0 @@ -#!/usr/bin/env node -/** - * meta-quota-export — Meta (dev.meta.ai) quota exporter, Phase 1 of - * developing-today/code#1301 (epic #1149; investigation #1167). - * - * Runs ON Drew's laptop, inside the reach of the laptop Helium - * browser's live dev.meta.ai session (CDP debug port, default 19222). - * It evaluates fetch() calls in the console page's own context, so the - * requests carry the session cookie and leave from the laptop's own - * egress/device — no cookie value is ever read into this process, - * written to disk, or logged. - * - * Every run writes the export document atomically to - * /latest.json (default ~/atlas/meta-quota-export/) - * and appends the same document to /history.jsonl. - * - * Success document (the file-export format the #1151 quota gatherer - * ingests; source label fixed as "file-export/meta-laptop"): - * { service: "meta", source: "file-export/meta-laptop", - * status: "ok", measuredAt: , consoleAsOf: , - * tier: "Muse Code High Usage", - * windows: [ { name: "5h", usedPct: 1.02, resetAt: }, - * { name: "weekly", usedPct: 8.83, resetAt: } ], - * freeCreditsUsd: 148.57, paygBalanceUsd: 0 } - * - * Failure documents carry status + attemptedAt + detail and NO - * windows/values — a failed tick can never be mistaken for a reading: - * session-expired the console API answered 401/403 or bounced to - * an auth page; the laptop session needs a human - * re-login. Exit 3. - * cdp-unavailable the browser debug port did not answer. Exit 4. - * no-console-page browser is up but no dev.meta.ai tab is open. - * Exit 5. - * unparseable an endpoint answered something whose shape this - * parser does not recognise. Exit 6. - * fetch-failed network/other error inside the page. Exit 7. - * "laptop-unreachable" is deliberately NOT produced here: if the - * laptop is down nothing runs, so consumers derive it from the age of - * latest.json (> 2 ticks = > 30 min without a fresh document). - */ -import { appendFile, mkdir, rename, writeFile } from "node:fs/promises"; -import { homedir } from "node:os"; -import { join } from "node:path"; -import { pathToFileURL } from "node:url"; - -export const SOURCE = "file-export/meta-laptop"; -export const DEFAULT_TEAM_ID = "1073226932208501"; // "My Team" (#1167) - -export class ExportError extends Error { - constructor(status, exitCode, detail) { - super(detail); - this.status = status; - this.exitCode = exitCode; - } -} - -const round2 = (n) => Math.round(n * 100) / 100; -const MIN_EPOCH_SECONDS = 1_577_836_800; // 2020-01-01T00:00:00Z -const MAX_EPOCH_SECONDS = 4_102_444_800; // 2100-01-01T00:00:00Z - -/** Parse a subscription-quota payload into export windows. Throws on - * any shape drift — fail-closed, never partial zeros. The one tolerated - * absence is a not-yet-started window (used = 0) whose reset the - * console returns as null or omits: that window is emitted with - * resetAt: null instead of failing the whole export (#1301). */ -export function parseSubscriptionQuota(payload) { - const q = payload?.subscription_quota; - if (!q || typeof q !== "object") { - throw new ExportError("unparseable", 6, "subscription-quota: subscription_quota object missing"); - } - // Plain decimal spellings only (#2789). Number() also accepts "", - // whitespace-only, hex ("0x10" -> 16), and scientific ("1e2" -> 100) - // strings, which turned drifted fields into real measurements (a "" - // used value exported as a measured 0% window). Reject every - // non-decimal spelling here so drift fails closed at the parse; - // surrounding whitespace is drift too, not a spelling. - const DECIMAL = /^[0-9]+(\.[0-9]+)?$/; - const num = (v) => { - if (typeof v === "number") return v; - if (typeof v === "string" && DECIMAL.test(v)) return Number(v); - return NaN; - }; - const windowUsed = num(q.window_weighted_used); - const windowLimit = num(q.window_weighted_limit); - const weeklyUsed = num(q.weekly_weighted_used); - const weeklyLimit = num(q.weekly_weighted_limit); - const durationSecs = num(q.window_duration_secs); - const fields = { windowUsed, windowLimit, weeklyUsed, weeklyLimit }; - for (const [k, v] of Object.entries(fields)) { - if (!Number.isFinite(v) || v < 0) { - throw new ExportError("unparseable", 6, `subscription-quota: field ${k} not a finite number`); - } - } - const epochSecondsField = (v, label) => { - if (!Number.isFinite(v) || v < 0) { - throw new ExportError("unparseable", 6, `subscription-quota: field ${label} not a finite number`); - } - if (v < MIN_EPOCH_SECONDS || v > MAX_EPOCH_SECONDS) { - throw new ExportError( - "unparseable", - 6, - `subscription-quota: field ${label} outside the supported epoch-seconds range`, - ); - } - return v; - }; - // A window the console has not started yet (no usage recorded in it) - // has no reset: window_resets_at / weekly_resets_at comes back null - // or the field is omitted entirely (observed live 2026-10-29, #1301: - // after the 16:15Z short-window roll the absent reset poisoned every - // export, including the healthy weekly window and free credits). - // Tolerate exactly that shape — emit the window with resetAt: null. - // A missing reset on a window WITH recorded usage, and any malformed - // reset value, still fail closed. An empty/whitespace-only reset - // string is treated like an absent reset: it carries no reading, so - // on a zero-usage window it is tolerated, and on a window with usage - // it fails closed exactly like the absent case. - const resetField = (raw, used, label) => { - if (raw === null || raw === undefined || (typeof raw === "string" && raw.trim() === "")) { - if (used === 0) return null; - throw new ExportError( - "unparseable", - 6, - `subscription-quota: field ${label} absent but the window has recorded usage`, - ); - } - return epochSecondsField(num(raw), label); - }; - const windowReset = resetField(q.window_resets_at, windowUsed, "windowReset"); - const weeklyReset = resetField(q.weekly_resets_at, weeklyUsed, "weeklyReset"); - if (windowLimit === 0 || weeklyLimit === 0) { - throw new ExportError("unparseable", 6, "subscription-quota: zero limit"); - } - if (!Number.isFinite(durationSecs) || durationSecs <= 0) { - throw new ExportError("unparseable", 6, "subscription-quota: field window_duration_secs not a finite positive number"); - } - const shortName = durationSecs === 18_000 ? "5h" : durationSecs === 3_600 ? "1h" : `window-${durationSecs}s`; - const iso = (epochSecs) => new Date(epochSecs * 1000).toISOString(); - // as_of is console metadata, not a measurement: an absent or - // empty value means "the console didn't say when" and stays null, - // while any other non-decimal spelling fails closed — never the - // 1970 epoch that Number("") used to produce. - const asOfRaw = q.as_of; - let consoleAsOf = null; - if (!(asOfRaw === null || asOfRaw === undefined || (typeof asOfRaw === "string" && asOfRaw.trim() === ""))) { - consoleAsOf = iso(epochSecondsField(num(asOfRaw), "as_of")); - } - return { - tier: typeof q.tier === "string" ? q.tier : null, - consoleAsOf, - windows: [ - { name: shortName, usedPct: round2((windowUsed / windowLimit) * 100), resetAt: windowReset === null ? null : iso(windowReset) }, - { name: "weekly", usedPct: round2((weeklyUsed / weeklyLimit) * 100), resetAt: weeklyReset === null ? null : iso(weeklyReset) }, - ], - }; -} - -/** Parse a billing-banner payload into remaining free credits (USD). */ -export function parseBillingBanner(payload) { - const minor = payload?.remaining_minor_units; - // Minor units are a count of cents: only a nonnegative safe integer is a - // well-shaped value. A fractional value (1050.5) is shape drift, not - // a fractional dollar amount of credit — fail closed (#2510). No domain-specific maximum is - // imposed: there is no authoritative upstream bound, and - // Number.MAX_SAFE_INTEGER (via isSafeInteger) is a representation-safety - // limit, not a business cap. - if (typeof minor !== "number" || !Number.isSafeInteger(minor) || minor < 0) { - throw new ExportError("unparseable", 6, "billing-banner: remaining_minor_units missing/invalid"); - } - if (payload.currency !== "USD") { - throw new ExportError("unparseable", 6, `billing-banner: unexpected currency ${String(payload.currency)}`); - } - return minor / 100; -} - -/** Parse the PAYG current balance out of the billing iframe's text. - * Returns null (not 0) when the text does not contain the balance — - * an absent read must stay absent, never become a fake $0. */ -export function parsePaygBalance(iframeText) { - if (typeof iframeText !== "string") return null; - const m = iframeText.match(/Current balance\s*\n?\s*\$\s*([\d,]+(?:\.\d{2})?)(?![\d.,])/); - if (!m) return null; - const v = Number(m[1].replace(/,/g, "")); - return Number.isFinite(v) ? v : null; -} - -export function successDocument({ measuredAt, parsed, freeCreditsUsd, paygBalanceUsd }) { - return { - service: "meta", - source: SOURCE, - status: "ok", - measuredAt, - consoleAsOf: parsed.consoleAsOf, - tier: parsed.tier, - windows: parsed.windows, - freeCreditsUsd, - paygBalanceUsd, - }; -} - -export function failureDocument({ attemptedAt, status, detail }) { - return { - service: "meta", - source: SOURCE, - status, - measuredAt: null, - attemptedAt, - detail, - }; -} - -// ---------- CDP plumbing (only used by the main run) ---------- - -const DEFAULT_TIMEOUTS = Object.freeze({ - httpMs: 10_000, - websocketOpenMs: 10_000, - commandMs: 30_000, -}); - -async function httpJson(url, timeoutMs = DEFAULT_TIMEOUTS.httpMs) { - const controller = new AbortController(); - const timer = setTimeout(() => controller.abort(), timeoutMs); - try { - const res = await fetch(url, { signal: controller.signal }); - if (!res.ok) throw new Error(`HTTP ${res.status} for ${url}`); - return await res.json(); - } catch (error) { - if (controller.signal.aborted) { - throw new Error(`HTTP request timed out after ${timeoutMs}ms`); - } - throw error; - } finally { - clearTimeout(timer); - } -} - -export function connectWs( - wsUrl, - { - openTimeoutMs = DEFAULT_TIMEOUTS.websocketOpenMs, - commandTimeoutMs = DEFAULT_TIMEOUTS.commandMs, - WebSocketImpl = WebSocket, - } = {}, -) { - return new Promise((resolve, reject) => { - const ws = new WebSocketImpl(wsUrl); - const pending = new Map(); - let id = 0; - let state = "connecting"; - - const rejectPending = (error) => { - for (const [pendingId, call] of pending) { - clearTimeout(call.timer); - pending.delete(pendingId); - call.reject(error); - } - }; - const closeSocket = () => { - try { - ws.close(); - } catch { - // Closing a socket that is already closing is harmless. - } - }; - const fail = (error) => { - if (state === "connecting") { - state = "closed"; - clearTimeout(openTimer); - reject(error); - } else if (state === "open") { - state = "closed"; - rejectPending(error); - } - }; - const openTimer = setTimeout(() => { - fail(new Error(`websocket open timed out after ${openTimeoutMs}ms`)); - closeSocket(); - }, openTimeoutMs); - - ws.onmessage = (ev) => { - let message; - try { - message = JSON.parse(ev.data); - } catch (error) { - fail(new Error(`invalid websocket response: ${error.message}`)); - closeSocket(); - return; - } - if (message.id != null && pending.has(message.id)) { - const call = pending.get(message.id); - pending.delete(message.id); - clearTimeout(call.timer); - if (message.error) call.reject(new Error(JSON.stringify(message.error))); - else call.resolve(message.result); - } - }; - ws.onopen = () => { - if (state !== "connecting") return; - state = "open"; - clearTimeout(openTimer); - resolve({ - send: (method, params = {}) => - new Promise((res, rej) => { - if (state !== "open") { - rej(new Error("websocket is not open")); - return; - } - const requestId = ++id; - const timer = setTimeout(() => { - pending.delete(requestId); - rej(new Error(`websocket ${method} timed out after ${commandTimeoutMs}ms`)); - }, commandTimeoutMs); - pending.set(requestId, { resolve: res, reject: rej, timer }); - try { - ws.send(JSON.stringify({ id: requestId, method, params })); - } catch (error) { - pending.delete(requestId); - clearTimeout(timer); - rej(error); - } - }), - close: () => { - if (state === "open") { - state = "closed"; - rejectPending(new Error("websocket closed by client")); - } - closeSocket(); - }, - }); - }; - ws.onerror = (event) => { - fail(new Error(`websocket error: ${event.message ?? "unknown"}`)); - closeSocket(); - }; - ws.onclose = () => { - fail(new Error("websocket closed before response")); - }; - }); -} - -async function evaluate(client, expression) { - const r = await client.send("Runtime.evaluate", { - expression, - returnByValue: true, - awaitPromise: true, - }); - if (r.exceptionDetails) { - throw new Error(`page eval exception: ${JSON.stringify(r.exceptionDetails).slice(0, 300)}`); - } - return r.result.value; -} - -/** Fetch both quota endpoints inside the console page's context. - * Returns { quota, banner } parsed JSON bodies; throws ExportError - * with the right failure state otherwise. */ -async function fetchQuotaPayloads(client, teamId) { - const expression = `(async () => { - const team = ${JSON.stringify(teamId)}; - const get = async (path) => { - const r = await fetch(path, { headers: { Accept: "application/json" }, credentials: "same-origin" }); - return { status: r.status, url: r.url, text: await r.text() }; - }; - const quota = await get("/api/portal/teams/" + team + "/subscription-quota"); - const banner = await get("/api/portal/teams/" + team + "/billing-banner"); - return JSON.stringify({ quota, banner }); - })()`; - let raw; - try { - raw = await evaluate(client, expression); - } catch (e) { - throw new ExportError("fetch-failed", 7, `in-page fetch failed: ${e.message}`); - } - let outer; - try { - outer = JSON.parse(raw); - } catch { - throw new ExportError("fetch-failed", 7, "in-page fetch returned a non-JSON envelope"); - } - const bodies = {}; - for (const key of ["quota", "banner"]) { - const r = outer[key]; - if (!r || typeof r.status !== "number") { - throw new ExportError("fetch-failed", 7, `${key}: no response captured`); - } - if (r.status === 401 || r.status === 403 || (typeof r.url === "string" && r.url.includes("auth"))) { - throw new ExportError( - "session-expired", - 3, - `${key}: HTTP ${r.status}${r.url ? ` (landed on ${new URL(r.url).pathname})` : ""} — laptop dev.meta.ai session needs re-login`, - ); - } - if (r.status !== 200) { - throw new ExportError("fetch-failed", 7, `${key}: HTTP ${r.status}`); - } - try { - bodies[key] = JSON.parse(r.text); - } catch { - throw new ExportError("unparseable", 6, `${key}: HTTP 200 but body is not JSON`); - } - } - return bodies; -} - -/** Best-effort PAYG balance from the billing iframe's DOM text. - * Absence is reported as null, never invented. */ -async function fetchPaygBalance(cdpBase, { timeouts, WebSocketImpl } = {}) { - try { - const targets = await httpJson(`${cdpBase}/json/list`, timeouts.httpMs); - const frame = targets.find( - (t) => t.type === "iframe" && typeof t.url === "string" && t.url.includes("billing.dev.meta.ai"), - ); - if (!frame?.webSocketDebuggerUrl) return null; - const client = await connectWs(frame.webSocketDebuggerUrl, { - openTimeoutMs: timeouts.websocketOpenMs, - commandTimeoutMs: timeouts.commandMs, - WebSocketImpl, - }); - try { - const text = await evaluate(client, "document.body ? document.body.innerText : ''"); - return parsePaygBalance(text); - } finally { - client.close(); - } - } catch { - return null; - } -} - -async function writeOutputs(outDir, doc) { - await mkdir(outDir, { recursive: true }); - const latest = join(outDir, "latest.json"); - const tmp = join(outDir, `.latest.json.tmp-${process.pid}`); - await writeFile(tmp, `${JSON.stringify(doc, null, 2)}\n`, "utf8"); - await rename(tmp, latest); - await appendFile(join(outDir, "history.jsonl"), `${JSON.stringify(doc)}\n`, "utf8"); -} - -/** Run one export and always write either its success or failure document. */ -export async function exportAndWrite({ outDir, ...runOptions } = {}) { - try { - const doc = await run(runOptions); - await writeOutputs(outDir, doc); - return { doc, exitCode: 0, error: null, outputError: null }; - } catch (error) { - const err = - error instanceof ExportError - ? error - : new ExportError("fetch-failed", 7, `unexpected: ${error.message ?? String(error)}`); - const doc = failureDocument({ - attemptedAt: new Date().toISOString(), - status: err.status, - detail: err.message, - }); - let outputError = null; - try { - await writeOutputs(outDir, doc); - } catch (writeError) { - outputError = writeError; - } - return { doc, exitCode: err.exitCode, error: err, outputError }; - } -} - -export async function run({ - cdpPort = 19222, - outDir, - teamId = DEFAULT_TEAM_ID, - timeouts = {}, - WebSocketImpl = WebSocket, -} = {}) { - const deadlines = { ...DEFAULT_TIMEOUTS, ...timeouts }; - const attemptedAt = new Date().toISOString(); - const cdpBase = `http://127.0.0.1:${cdpPort}`; - let targets; - try { - targets = await httpJson(`${cdpBase}/json/list`, deadlines.httpMs); - } catch (e) { - throw new ExportError("cdp-unavailable", 4, `CDP ${cdpBase}/json/list unreachable: ${e.message}`); - } - const page = targets.find( - (t) => t.type === "page" && typeof t.url === "string" && t.url.startsWith("https://dev.meta.ai"), - ); - if (!page?.webSocketDebuggerUrl) { - throw new ExportError("no-console-page", 5, "browser is up but no dev.meta.ai tab is open"); - } - const effectiveTeam = - new URL(page.url).searchParams.get("team_id") ?? teamId; - const client = await connectWs(page.webSocketDebuggerUrl, { - openTimeoutMs: deadlines.websocketOpenMs, - commandTimeoutMs: deadlines.commandMs, - WebSocketImpl, - }); - let bodies; - try { - bodies = await fetchQuotaPayloads(client, effectiveTeam); - } finally { - client.close(); - } - const parsed = parseSubscriptionQuota(bodies.quota); - const freeCreditsUsd = parseBillingBanner(bodies.banner); - const paygBalanceUsd = await fetchPaygBalance(cdpBase, { - timeouts: deadlines, - WebSocketImpl, - }); - return successDocument({ - measuredAt: new Date().toISOString(), - parsed, - freeCreditsUsd, - paygBalanceUsd, - }); -} - -async function main() { - const args = process.argv.slice(2); - const opt = (name, fallback) => { - const i = args.indexOf(name); - return i >= 0 && args[i + 1] ? args[i + 1] : fallback; - }; - const outDir = opt("--out-dir", join(homedir(), "atlas", "meta-quota-export")); - const cdpPort = Number(opt("--cdp-port", "19222")); - const teamId = opt("--team-id", process.env.META_TEAM_ID ?? DEFAULT_TEAM_ID); - const outcome = await exportAndWrite({ cdpPort, outDir, teamId }); - if (outcome.exitCode === 0) { - const { doc } = outcome; - console.log(JSON.stringify({ status: doc.status, measuredAt: doc.measuredAt, outDir })); - return; - } - if (outcome.outputError) { - console.error(`meta-quota-export: could not write outputs: ${outcome.outputError.message}`); - } - console.error(`meta-quota-export: ${outcome.error.status}: ${outcome.error.message}`); - process.exit(outcome.exitCode); -} - -if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) { - await main(); -} diff --git a/pm-stack/meta-exporter/meta-quota-export.service b/pm-stack/meta-exporter/meta-quota-export.service deleted file mode 100644 index e88a9ae53e..0000000000 --- a/pm-stack/meta-exporter/meta-quota-export.service +++ /dev/null @@ -1,8 +0,0 @@ -[Unit] -Description=Meta (dev.meta.ai) quota exporter — code#1301 Phase 1 -After=network-online.target - -[Service] -Type=oneshot -TimeoutStartSec=120 -ExecStart=@NODE@ %h/atlas/meta-quota-export/meta-quota-export.mjs --cdp-port 19222 --out-dir %h/atlas/meta-quota-export diff --git a/pm-stack/meta-exporter/meta-quota-export.test.mjs b/pm-stack/meta-exporter/meta-quota-export.test.mjs deleted file mode 100644 index 3320264373..0000000000 --- a/pm-stack/meta-exporter/meta-quota-export.test.mjs +++ /dev/null @@ -1,419 +0,0 @@ -// Tests for the parser and bounded transport paths of meta-quota-export.mjs. -// Run: node --test pm-stack/meta-exporter/ -import assert from "node:assert/strict"; -import { mkdtemp, readFile, rm } from "node:fs/promises"; -import { createServer } from "node:http"; -import { once } from "node:events"; -import { tmpdir } from "node:os"; -import { join } from "node:path"; -import { test } from "node:test"; -import { - connectWs, - ExportError, - exportAndWrite, - failureDocument, - parseBillingBanner, - parsePaygBalance, - parseSubscriptionQuota, - successDocument, -} from "./meta-quota-export.mjs"; - -// The live payload captured 2026-10-27 (#1167): 1.02% / 8.83%. -const QUOTA = { - subscription_quota: { - tier_id: "27681527378179523", - tier: "Muse Code High Usage", - as_of: 1793077399, - window_weighted_limit: "100000000000", - window_duration_secs: 18000, - window_weighted_used: "1023570000", - window_resets_at: 1793090405, - weekly_weighted_limit: "300000000000", - weekly_weighted_used: "26484231500", - weekly_resets_at: 1793577600, - }, -}; - -test("parseSubscriptionQuota: percentages and resets match the console", () => { - const parsed = parseSubscriptionQuota(QUOTA); - assert.equal(parsed.tier, "Muse Code High Usage"); - assert.deepEqual(parsed.windows, [ - { name: "5h", usedPct: 1.02, resetAt: "2026-10-27T08:40:05.000Z" }, - { name: "weekly", usedPct: 8.83, resetAt: "2026-11-02T00:00:00.000Z" }, - ]); - assert.equal(parsed.consoleAsOf, "2026-10-27T05:03:19.000Z"); // 00:03:19 CDT -}); - -test("parseSubscriptionQuota: shape drift fails closed", () => { - assert.throws(() => parseSubscriptionQuota({}), /unparseable|missing/); - assert.throws(() => parseSubscriptionQuota({ subscription_quota: { window_weighted_used: "1" } })); - const zeroLimit = structuredClone(QUOTA); - zeroLimit.subscription_quota.window_weighted_limit = "0"; - assert.throws(() => parseSubscriptionQuota(zeroLimit), /zero limit/); - // window_duration_secs is validated like every other numeric field: - // missing, non-numeric, zero, or negative durations fail closed - // instead of exporting a "window-NaNs" window as a successful reading. - for (const bad of [undefined, "abc", 0, -3600]) { - const drifted = structuredClone(QUOTA); - if (bad === undefined) delete drifted.subscription_quota.window_duration_secs; - else drifted.subscription_quota.window_duration_secs = bad; - assert.throws(() => parseSubscriptionQuota(drifted), /window_duration_secs/); - } -}); - -test("parseSubscriptionQuota: window naming for valid durations is unchanged", () => { - const oneHour = structuredClone(QUOTA); - oneHour.subscription_quota.window_duration_secs = 3600; - assert.equal(parseSubscriptionQuota(oneHour).windows[0].name, "1h"); - const twoHours = structuredClone(QUOTA); - twoHours.subscription_quota.window_duration_secs = 7200; - assert.equal(parseSubscriptionQuota(twoHours).windows[0].name, "window-7200s"); -}); - -test("parseBillingBanner: minor units to USD, currency checked", () => { - assert.equal(parseBillingBanner({ kind: "free_partial", remaining_minor_units: 14857, currency: "USD" }), 148.57); - assert.throws(() => parseBillingBanner({ remaining_minor_units: 100, currency: "EUR" }), /currency/); - assert.throws(() => parseBillingBanner({})); - // Fractional minor units are shape drift: fail closed, never export a fractional dollar amount (#2510). - assert.throws(() => parseBillingBanner({ remaining_minor_units: 1050.5, currency: "USD" }), /missing\/invalid/); - assert.throws(() => parseBillingBanner({ remaining_minor_units: 0.1, currency: "USD" }), /missing\/invalid/); - assert.equal(parseBillingBanner({ remaining_minor_units: 0, currency: "USD" }), 0); - // Unsafe integers and negatives reject; MAX_SAFE_INTEGER itself is the - // representation limit, not a business cap. - assert.throws(() => parseBillingBanner({ remaining_minor_units: Number.MAX_SAFE_INTEGER + 1, currency: "USD" }), /missing\/invalid/); - assert.throws(() => parseBillingBanner({ remaining_minor_units: -100, currency: "USD" }), /missing\/invalid/); -}); - -test("parsePaygBalance: reads the iframe text, absence stays null", () => { - assert.equal(parsePaygBalance("Pay as you go\nCurrent balance\n$0.00\nYour balance won't increase"), 0); - assert.equal(parsePaygBalance("Current balance\n$1,234.56"), 1234.56); - assert.equal(parsePaygBalance("Current balance\n$1,234.5"), null); - assert.equal(parsePaygBalance("Current balance\n$1,234.567"), null); - assert.equal(parsePaygBalance("Current balance\n$1,234.560"), null); - assert.equal(parsePaygBalance("Current balance\n$1,234.56 USD"), 1234.56); - assert.equal(parsePaygBalance("Current balance\n$5"), 5); - assert.equal(parsePaygBalance("Current balance\n$1,234"), 1234); - assert.equal(parsePaygBalance("Current balance\n$1,234.56\nYour balance won't increase"), 1234.56); - assert.equal(parsePaygBalance("nothing relevant here"), null); - assert.equal(parsePaygBalance(undefined), null); -}); - -test("documents: success carries the spec fields; failure carries none", () => { - const ok = successDocument({ - measuredAt: "2026-10-27T05:00:00.000Z", - parsed: parseSubscriptionQuota(QUOTA), - freeCreditsUsd: 148.57, - paygBalanceUsd: 0, - }); - assert.equal(ok.service, "meta"); - assert.equal(ok.source, "file-export/meta-laptop"); - assert.equal(ok.status, "ok"); - assert.equal(ok.windows.length, 2); - - const bad = failureDocument({ attemptedAt: "2026-10-27T05:00:00.000Z", status: "session-expired", detail: "HTTP 401" }); - assert.equal(bad.measuredAt, null); - assert.equal("windows" in bad, false); - assert.equal("freeCreditsUsd" in bad, false); -}); - -// The live payload captured 2026-10-29 (#1301): after the short window -// rolled at 16:22Z it went inactive — window_weighted_used "0" and NO -// window_resets_at key at all — while the weekly window stayed live at -// 23.62%. Every export tick failed on this shape (16:15Z onward) until -// the parser learned to tolerate a missing reset on a not-yet-started -// (zero-usage) window. -const QUOTA_INACTIVE_SHORT = { - subscription_quota: { - tier_id: "27681527378179523", - tier: "Muse Code High Usage", - as_of: 1793328541, - window_weighted_limit: "100000000000", - window_duration_secs: 18000, - weekly_weighted_limit: "300000000000", - weekly_resets_at: 1793577600, - window_weighted_used: "0", - weekly_weighted_used: "70873201100", - }, -}; - -test("parseSubscriptionQuota: inactive zero-usage window with absent reset is tolerated", () => { - const parsed = parseSubscriptionQuota(QUOTA_INACTIVE_SHORT); - assert.deepEqual(parsed.windows, [ - { name: "5h", usedPct: 0, resetAt: null }, - { name: "weekly", usedPct: 23.62, resetAt: "2026-11-02T00:00:00.000Z" }, - ]); -}); - -test("parseSubscriptionQuota: inactive zero-usage window with explicit null reset is tolerated", () => { - const payload = structuredClone(QUOTA_INACTIVE_SHORT); - payload.subscription_quota.window_resets_at = null; - const parsed = parseSubscriptionQuota(payload); - assert.equal(parsed.windows[0].resetAt, null); - assert.equal(parsed.windows[1].usedPct, 23.62); - // The same tolerance applies to the weekly window when it has not - // started either. - const weeklyInactive = structuredClone(QUOTA); - weeklyInactive.subscription_quota.weekly_weighted_used = "0"; - weeklyInactive.subscription_quota.weekly_resets_at = null; - assert.equal(parseSubscriptionQuota(weeklyInactive).windows[1].resetAt, null); -}); - -test("parseSubscriptionQuota: null reset on an active window still fails closed", () => { - // Active = the window has started, i.e. it carries recorded usage - // (the 2026-10-27 capture above); a reset must exist for it. The - // inactive-window tolerance must not become blanket null tolerance. - const shortActive = structuredClone(QUOTA); - shortActive.subscription_quota.window_resets_at = null; - assert.throws(() => parseSubscriptionQuota(shortActive), /windowReset/); - const weeklyActive = structuredClone(QUOTA); - delete weeklyActive.subscription_quota.weekly_resets_at; - assert.throws(() => parseSubscriptionQuota(weeklyActive), /weeklyReset/); -}); - -test("parseSubscriptionQuota: absent reset with usage above zero still fails closed", () => { - const payload = structuredClone(QUOTA_INACTIVE_SHORT); - payload.subscription_quota.window_weighted_used = "1"; // any usage at all - assert.throws(() => parseSubscriptionQuota(payload), /windowReset/); -}); - -test("parseSubscriptionQuota: malformed reset fails closed even at zero usage", () => { - for (const bad of ["soon", -5, true, {}]) { - const payload = structuredClone(QUOTA_INACTIVE_SHORT); - payload.subscription_quota.window_resets_at = bad; - assert.throws(() => parseSubscriptionQuota(payload), /windowReset not a finite number/); - } -}); - -// #2789: num() used to be a bare Number() coercion, so drifted -// spellings became real measurements ("" -> 0% window, "0x10" -> 16, -// "1e2" -> 100). Only plain decimal spellings are accepted now. -test("parseSubscriptionQuota: non-decimal numeric spellings fail closed", () => { - for (const bad of ["", " ", "0x10", "0b101", "0o17", "1e2", "1E2", "abc", "12,000", " 123", "123 ", "1023570000n"]) { - for (const field of ["window_weighted_used", "window_weighted_limit", "window_duration_secs"]) { - const payload = structuredClone(QUOTA); - payload.subscription_quota[field] = bad; - assert.throws(() => parseSubscriptionQuota(payload), /not a finite|window_duration_secs/); - } - } - // The same spellings are rejected on the weekly fields too. - for (const bad of ["", "0x10", "1e2"]) { - const payload = structuredClone(QUOTA); - payload.subscription_quota.weekly_weighted_used = bad; - assert.throws(() => parseSubscriptionQuota(payload), /weeklyUsed/); - } -}); - -test("parseSubscriptionQuota: empty-string reset on a used window fails closed", () => { - for (const bad of ["", " "]) { - const shortUsed = structuredClone(QUOTA); - shortUsed.subscription_quota.window_resets_at = bad; - assert.throws(() => parseSubscriptionQuota(shortUsed), /windowReset/); - const weeklyUsed = structuredClone(QUOTA); - weeklyUsed.subscription_quota.weekly_resets_at = bad; - assert.throws(() => parseSubscriptionQuota(weeklyUsed), /weeklyReset/); - } -}); - -test("parseSubscriptionQuota: empty-string reset on a zero-usage window is tolerated like absent", () => { - const payload = structuredClone(QUOTA_INACTIVE_SHORT); - payload.subscription_quota.window_resets_at = ""; - assert.equal(parseSubscriptionQuota(payload).windows[0].resetAt, null); -}); - -test("parseSubscriptionQuota: decimal spellings still parse, including fractions", () => { - const frac = structuredClone(QUOTA); - frac.subscription_quota.window_weighted_used = "1023570000.5"; - assert.equal(parseSubscriptionQuota(frac).windows[0].usedPct, 1.02); -}); - -test("parseSubscriptionQuota: empty as_of stays null; non-decimal as_of fails closed", () => { - const empty = structuredClone(QUOTA); - empty.subscription_quota.as_of = ""; - assert.equal(parseSubscriptionQuota(empty).consoleAsOf, null); - const blank = structuredClone(QUOTA); - delete blank.subscription_quota.as_of; - assert.equal(parseSubscriptionQuota(blank).consoleAsOf, null); - for (const bad of ["0x10", "1e2", "soon"]) { - const payload = structuredClone(QUOTA); - payload.subscription_quota.as_of = bad; - assert.throws(() => parseSubscriptionQuota(payload), /unparseable|finite/); - } -}); - -test("parseSubscriptionQuota: epoch fields reject values outside the pinned seconds window", () => { - const firstAllowed = 1_577_836_800; // 2020-01-01T00:00:00Z - const lastAllowed = 4_102_444_800; // 2100-01-01T00:00:00Z - const cases = [ - ["window_resets_at", [firstAllowed - 1, lastAllowed + 1, 0, 1_793_090_405_000, 1e300]], - ["weekly_resets_at", [firstAllowed - 1, lastAllowed + 1, 0, 1_793_090_405_000, 1e300]], - ["as_of", [firstAllowed - 1, lastAllowed + 1, 0, 1_793_000_000_000, 1e300]], - ]; - for (const [field, values] of cases) { - for (const value of values) { - const payload = structuredClone(QUOTA); - payload.subscription_quota[field] = value; - assert.throws( - () => parseSubscriptionQuota(payload), - (error) => { - assert.ok(error instanceof ExportError); - assert.equal(error.status, "unparseable"); - assert.equal(error.exitCode, 6); - return true; - }, - `${field}=${value} should fail as unparseable`, - ); - } - } -}); - -test("parseSubscriptionQuota: epoch window endpoints are inclusive", () => { - const endpoints = [ - [1_577_836_800, "2020-01-01T00:00:00.000Z"], - [4_102_444_800, "2100-01-01T00:00:00.000Z"], - ]; - for (const [epoch, expected] of endpoints) { - for (const field of ["window_resets_at", "weekly_resets_at"]) { - const payload = structuredClone(QUOTA); - payload.subscription_quota[field] = epoch; - const parsed = parseSubscriptionQuota(payload); - assert.equal(parsed.windows[field === "window_resets_at" ? 0 : 1].resetAt, expected); - } - const payload = structuredClone(QUOTA); - payload.subscription_quota.as_of = epoch; - assert.equal(parseSubscriptionQuota(payload).consoleAsOf, expected); - } -}); - -async function listen(server) { - server.listen(0, "127.0.0.1"); - await once(server, "listening"); - return server.address().port; -} - -async function closeServer(server) { - server.closeAllConnections(); - await new Promise((resolve, reject) => { - server.close((error) => (error ? reject(error) : resolve())); - }); -} - -test("a non-answering CDP HTTP endpoint writes bounded failure documents", async () => { - const server = createServer(() => {}); - const port = await listen(server); - const outDir = await mkdtemp(join(tmpdir(), "meta-exporter-http-timeout-")); - try { - const result = await exportAndWrite({ - cdpPort: port, - outDir, - timeouts: { httpMs: 30 }, - }); - - assert.equal(result.exitCode, 4); - assert.equal(result.doc.status, "cdp-unavailable"); - assert.match(result.doc.detail, /timed out/i); - assert.equal("windows" in result.doc, false); - - const latest = JSON.parse(await readFile(join(outDir, "latest.json"), "utf8")); - const history = (await readFile(join(outDir, "history.jsonl"), "utf8")).trim().split("\n"); - assert.deepEqual(latest, result.doc); - assert.equal(history.length, 1); - assert.deepEqual(JSON.parse(history[0]), result.doc); - } finally { - await closeServer(server); - await rm(outDir, { recursive: true, force: true }); - } -}); - -test("a non-answering CDP command writes fetch-failed output within its deadline", async () => { - const server = createServer((_req, res) => { - res.writeHead(200, { "content-type": "application/json" }); - res.end(JSON.stringify([ - { - type: "page", - url: "https://dev.meta.ai/", - webSocketDebuggerUrl: "ws://fake-cdp/", - }, - ])); - }); - const port = await listen(server); - const outDir = await mkdtemp(join(tmpdir(), "meta-exporter-ws-timeout-")); - class SilentWebSocket { - constructor() { - queueMicrotask(() => this.onopen?.({})); - } - send() {} - close() { - this.onclose?.({}); - } - } - - try { - const result = await exportAndWrite({ - cdpPort: port, - outDir, - WebSocketImpl: SilentWebSocket, - timeouts: { httpMs: 100, websocketOpenMs: 100, commandMs: 30 }, - }); - - assert.equal(result.exitCode, 7); - assert.equal(result.doc.status, "fetch-failed"); - assert.match(result.doc.detail, /timed out/i); - assert.deepEqual( - JSON.parse(await readFile(join(outDir, "latest.json"), "utf8")), - result.doc, - ); - const history = (await readFile(join(outDir, "history.jsonl"), "utf8")).trim().split("\n"); - assert.equal(history.length, 1); - assert.deepEqual(JSON.parse(history[0]), result.doc); - } finally { - await closeServer(server); - await rm(outDir, { recursive: true, force: true }); - } -}); - -test("connectWs bounds open and rejects every pending command on close or error", async () => { - let unopenedSocket; - class NeverOpenWebSocket { - constructor() { - unopenedSocket = this; - } - close() { - this.closed = true; - } - } - - await assert.rejects( - connectWs("ws://fake-cdp/", { - WebSocketImpl: NeverOpenWebSocket, - openTimeoutMs: 10, - commandTimeoutMs: 20, - }), - /timed out/i, - ); - assert.equal(unopenedSocket.closed, true); - - for (const [event, emit] of [ - ["close", (socket) => socket.onclose?.({})], - ["error", (socket) => socket.onerror?.({ message: "test socket failure" })], - ]) { - class DisruptedWebSocket { - constructor() { - queueMicrotask(() => this.onopen?.({})); - } - send() { - queueMicrotask(() => emit(this)); - } - close() {} - } - const client = await connectWs("ws://fake-cdp/", { - WebSocketImpl: DisruptedWebSocket, - openTimeoutMs: 100, - commandTimeoutMs: 100, - }); - const pending = [client.send("one"), client.send("two")]; - const results = await Promise.allSettled(pending); - assert.equal(results.length, 2, `${event} should settle both requests`); - assert.ok(results.every((result) => result.status === "rejected")); - assert.ok(results.every((result) => /(closed|failure)/i.test(result.reason.message))); - } -}); diff --git a/pm-stack/meta-exporter/meta-quota-export.timer b/pm-stack/meta-exporter/meta-quota-export.timer deleted file mode 100644 index a639cf4290..0000000000 --- a/pm-stack/meta-exporter/meta-quota-export.timer +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=Run the Meta quota exporter every 15 minutes — code#1301 Phase 1 - -[Timer] -OnCalendar=*:0/15 -RandomizedDelaySec=20 -Persistent=true -Unit=meta-quota-export.service - -[Install] -WantedBy=timers.target