Repository navigation
Description
What
pm-stack/meta-exporter/meta-quota-export.mjs:624 (landed today in #6333, the re-home of the retired Meta exporter) guards main() with the pre-#2083 raw-path entry-point check:
if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
await main();
}Invoked through any symlink (a symlinked file, or a path through a symlinked directory), the raw process.argv[1] string never equals import.meta.url, main() is skipped, and Node exits 0 with no output and no files written — a silent no-op that looks like a successful export.
This is the exact bug #2350 reported, fixed, and closed for this same file before the exporter was retired in 1d0944333f ("retire the Meta console-scrape exporter"). The re-homed copy in #6333 (commit b4cf60a2db) carries the old guard again. The sibling exporters kept the fix: pm-stack/supabase-export/supabase-quota-export.mjs:403 and pm-stack/cloudflare-export/cloudflare-quota-export.mjs:649 both use the established guarded form fs.realpathSync(process.argv[1]) === fs.realpathSync(fileURLToPath(import.meta.url)) (pattern also at bin/proxy-supervise.mjs:892). Meta is now the only exporter with the raw-path form.
Verified this run (laptop primary @560febee0d, HEAD == origin/main)
Probe: ~/git/fleet/probe-meta-entry/ on the laptop, real exporter, --cdp-port 1 (loopback-refused, so a run must produce the cdp-unavailable failure document):
| Invocation | Result |
|---|---|
node pm-stack/meta-exporter/meta-quota-export.mjs --cdp-port 1 --out-dir <scratch>/out-direct |
exit 4, stderr meta-quota-export: cdp-unavailable: CDP http://127.0.0.1:1/json/list unreachable, wrote latest.json + history.jsonl |
node <symlink-to-the-same-file> --cdp-port 1 --out-dir <scratch>/out-symlink |
exit 0, no output, output directory empty — main() never ran |
The direct run proves the exporter works; the symlinked run proves the guard silently swallows it. (The installed systemd path is not affected today — install-laptop.sh copies the file to ~/atlas/meta-quota-export/ and the unit runs that real path — but any symlinked invocation, e.g. a ~/bin link or a checkout reached through a symlinked directory, silently produces no export and no failure document, which for a quota exporter means the gatherer reads stale data with no error anywhere.)
Why it matters
A quota exporter that exits 0 while doing nothing is the worst failure shape for this subsystem: no failure document, no log line, and downstream consumers (pm-dashboard backup requires meta-quota-export/latest.json + history.jsonl, nixos/home/pm-dashboard-backup.sh:341-342) see only staleness. #2350 already established both the bug and the house fix; the re-home regressed it.
Acceptance criteria
-
meta-quota-export.mjsuses the guardedrealpathSyncentry-point comparison (same shape as supabase-export:403 / cloudflare-export:649), or an equivalent that resolves symlinks on both sides. - Regression coverage: invoking the exporter through a symlinked path with an unreachable CDP port exits non-zero and writes the failure document, matching direct invocation (the suite added in feat(meta-exporter): re-home exporter + helium-cdp wedge readiness probe (#5487) #6333,
meta-quota-export.test.mjs, is the natural home — note it is currently run by no workflow; see the companion CI filing). - Direct invocation behavior unchanged (exit codes, documents, console output).
- The other
opt()argv-helper instance in this file is not in scope here — it is already tracked by pm-stack(quota-exporters): opt() in all three exporters takes a flag token as a value — '--out-dir --cdp-port 19222' writes the export into a directory named '--cdp-port', the flag token is consumed twice, and a non-numeric --cdp-port becomes a NaN CDP outage #3469, which names this file.
Dedup
- meta-exporter: meta-quota-export still uses the pre-#2083 raw-path entry-point check — invoked via any symlink it silently no-ops with exit 0 #2350 (CLOSED) fixed this exact check for this file pre-retirement; the re-home in feat(meta-exporter): re-home exporter + helium-cdp wedge readiness probe (#5487) #6333 re-introduced it — this filing is the regression report, not a duplicate.
- bin+pm-stack: four entry points still use the pre-#2083 raw-path entry-point check — codedb-bridge, supabase/cloudflare exporters and the claimant installer silently no-op via any symlink #4325 (CLOSED) and open opencode-usage-export: the fifth raw-path entry-point check — symlinked invocation silently no-ops with exit 0 (survived #4325 due to its four-file scope) #5099 cover the same check class in other files (opencode-usage-export is opencode-usage-export: the fifth raw-path entry-point check — symlinked invocation silently no-ops with exit 0 (survived #4325 due to its four-file scope) #5099's file); neither covers meta-exporter.
- pm-stack(quota-exporters): opt() in all three exporters takes a flag token as a value — '--out-dir --cdp-port 19222' writes the export into a directory named '--cdp-port', the flag token is consumed twice, and a non-numeric --cdp-port becomes a NaN CDP outage #3469 (OPEN) covers this file's
opt()helper only, not the entry-point guard.
Activity
developing-today commentedon Nov 5, 2026
CODE-1881
dezren39 commentedon Nov 5, 2026
🤖 Agent note · filed
dezren39 commentedon Nov 5, 2026
🤖 Agent note · picked up
16 remaining items
Merge pull request #6346 from developing-today/queue/10698-6343-meta-…
dezren39 commentedon Nov 5, 2026
🤖 Agent note · done