Repository navigation
Description
Summary
Four entry points still use the pre-#2083 raw-path entry-point check — the exact bug class fixed today for bin/record.mjs and bin/provider-catalog-sync.mjs in #4123 (closing #2235):
if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
await main();
}process.argv[1] is the path exactly as invoked; import.meta.url is the module's resolved URL. Invoked through any symlink — a symlinked file, or a path through a symlinked directory such as the ~/code -> ~/git/code checkout alias that caused #2083 — the two never match, main() never runs, and the process exits 0 with no output and no files written: a silent no-op.
Remaining instances on main c08b27f2:
bin/codedb-bridge.mjs:317— the MCP stdio bridge added in codedb shared daemon + MCP bridge: one codedb serve per project root, lift the #2220 park in the new shape (#2225) #4120, after bin: provider-catalog-sync and record still use the pre-#2083 raw-path entry-point check — invoked via any symlink they silently no-op with exit 0 #2235 was filed; bin: provider-catalog-sync and record still use the pre-#2083 raw-path entry-point check — invoked via any symlink they silently no-op with exit 0 #2235's "no remaining raw-path instances inbin/" acceptance criterion is unmet inbin/itself because of this file.pm-stack/supabase-export/supabase-quota-export.mjs:399pm-stack/cloudflare-export/cloudflare-quota-export.mjs:491pm-stack/opencode-claimant/install.mjs:97-98(same check, stored in anisMainconst)
Not in scope: pm-stack/meta-exporter/meta-quota-export.mjs:535 has the same check but is already tracked by #2350 — fix it there, not here. This issue is the four instances no open issue names.
Evidence (main c08b27f2, laptop probe ~/git/fleet/probe-2026-11-02-laneA-entryguard/, all four files md5-matched between the sandbox clone and the laptop clone)
codedb-bridge (ping request on stdin):
- Direct:
node bin/codedb-bridge.mjs→{"jsonrpc":"2.0","id":3,"result":{}}, exit 0 — main ran. - Via a file symlink and via a symlinked directory: no response at all, exit 0 — main never ran; an MCP client sees a bridge that starts "successfully" and never answers.
supabase-quota-export (no token available, BWS_BIN=/bin/false, scratch --out-dir):
- Direct: exit 3, stderr
supabase-quota-export: no-token: …, and the failure document is written (latest.json+history.jsonl). - Via a file symlink and via a symlinked directory: exit 0, no output, out-dir empty.
cloudflare-quota-export (no token in env, scratch --out-dir):
- Direct: exit 2, stderr
cloudflare-quota-export: no-token: …, failure document written. - Via a file symlink and via a symlinked directory: exit 0, no output, out-dir empty.
opencode-claimant install (--store <scratch> --dry-run):
- Direct: prints the summary JSON (
action: "inserted", task id, …), exit 0. - Via a file symlink and via a symlinked directory: exit 0, no output — the claimant task is silently never installed/refreshed.
Why it matters
All four tools are designed to be quiet on success, and the two exporters' whole failure-visibility design is the failure document: a tick that cannot read its source still writes a no-token document so consumers can tell "source down" from a reading. The symlink no-op defeats exactly that — no document, a green exit 0, and the only signal is latest.json quietly going stale. The codedb bridge is worse: it is spawned by MCP clients as a subprocess, so a symlinked invocation path (wrapper, symlink farm, checkout alias — the fleet's own ~/code -> ~/git/code layout) yields a server that accepts the spawn and never speaks. This pattern has already burned the fleet three times (#2083, #2235, #2350); each fix repaired the named files and left the siblings behind.
Acceptance criteria
- All four files above run their
main()when invoked via a symlinked file path and via a symlinked directory path (use thefs.realpathSync-on-both-sides comparison proven inbin/proxy-supervise.mjsand applied in fix(bin): run main when provider-catalog-sync and record are invoked via symlink (#2235) #4123 tobin/record.mjs/bin/provider-catalog-sync.mjs, or an equivalent). - Importing any of the four modules as a library (their test suites do this) still does not run
main(). - A regression test covers the symlinked invocation for at least the codedb bridge (its test suite already spawns the bridge as a subprocess) and at least one exporter, so the check cannot silently regress again.
- A repo-wide grep for entry-point comparisons (
process.argv[1]vsimport.meta.url) shows no remaining raw-path instances exceptpm-stack/meta-exporter/meta-quota-export.mjs, which is tracked separately by 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.
Related: #2083 (closed — original instance + proven fix pattern), #2235 (closed by #4123 — the bin/ pair fixed today), #2350 (open — the meta-exporter instance, explicitly out of scope here), #4120 (added the codedb bridge with the old check).
Found by new-issue-creator-code-a (lane A) this run.
Activity
dezren39 commentedon Nov 2, 2026
agent-note:v1
state: filed
Found via: filed this run (new-issue-creator-code-a, Lane A) — residual set of the #2083/#2235 raw-path entry-point bug class, fixed today for record/provider-catalog-sync in #4123. A repo-wide grep on main c08b27f found four instances no open issue names: bin/codedb-bridge.mjs:317 (added in #4120, after #2235), pm-stack/supabase-export/supabase-quota-export.mjs:399, pm-stack/cloudflare-export/cloudflare-quota-export.mjs:491, pm-stack/opencode-claimant/install.mjs:97-98. Verified on the laptop (all four files md5-matched): direct runs answer/write/print, while file-symlink and dir-symlink invocations all exit 0 with no output and no files. Probe: ~/git/fleet/probe-2026-11-02-laneA-entryguard/. Meta-exporter instance is excluded — already tracked by #2350. Filed only; enqueued for triage.
dezren39 commentedon Nov 2, 2026
🤖 Agent note · done
git grepon origin/main: the raw compareimport.meta.url === pathToFileURL(process.argv[1]).hrefis present at bin/codedb-bridge.mjs:317, pm-stack/supabase-export/supabase-quota-export.mjs:399, pm-stack/cloudflare-export/cloudflare-quota-export.mjs:589, pm-stack/opencode-claimant/install.mjs:132 (isMain const). Repo-wide, the pattern occurs in exactly those four files plus pm-stack/meta-exporter/meta-quota-export.mjs (excluded — tracked by issue 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).fs.realpathSync(process.argv[1]) === fs.realpathSync(fileURLToPath(import.meta.url)).9 remaining items
developing-today commentedon Nov 3, 2026
agent-note:v1
state: triaged (coverage pass)
Coverage pass 2026-11-03: reviewed in the fleet-wide per-issue pass (drift / overlap / already-handled / stale / blockers / ordering). Verdict: still live; queued in repo-health-code-pilot as triage at priority 40 (priority/normal). If this is already handled at current main, the triage closes it with evidence; if it needs splitting, the triage files the split.
Found via: coverage pass 2026-11-03
dezren39 commentedon Nov 3, 2026
agent-note:v1
event: picked_up
task: 8376 (repo-health-code-pilot, lane c8b9355e-319a-4640-8096-7ad19480d151)
state: claimed via atomic queue claim at 2026-11-03T19:40Z (openchamber scheduled lane)
fresh evidence: #4325 still OPEN on origin/main 3e363c9; the raw compare is still present in all four named files (bin/codedb-bridge.mjs:317, pm-stack/supabase-export/supabase-quota-export.mjs:399, pm-stack/cloudflare-export/cloudflare-quota-export.mjs:645, pm-stack/opencode-claimant/install.mjs:132).
prior work: task 6406 already opened PR #4583 (queue/6406-4325-realpath-entrypoint, "Closes #4325"), currently OPEN, MERGEABLE, mergeStateStatus CLEAN, basic guard SUCCESS. Diff matches intent (realpathSync on both sides + symlink and inert-import regression tests for the bridge and Cloudflare exporter).
next: verify and merge PR #4583 under standing criteria; record any residual instance separately rather than widening that PR.
Merge pull request #4583 from developing-today/queue/6406-4325-realpa…
dezren39 commentedon Nov 3, 2026
agent-note:v1
state: done (triage)
task: 8376 (repo-health-code-pilot, lane c8b9355e-319a-4640-8096-7ad19480d151)
verdict: CONFIRMED and now FIXED — PR #4583 merged as b7d274c at 2026-11-03T19:42Z under the standing criteria (MERGEABLE, mergeStateStatus CLEAN, basic guard SUCCESS, diff matches intent: realpathSync on both sides plus symlink and inert-import regression tests for the codedb bridge and the Cloudflare exporter). GitHub closed this issue at 19:42:16Z from the PR's "Closes #4325".
residual: one raw-path instance survives this issue's four-file scope — pm-stack/opencode-usage-export/opencode-usage-export.mjs:383 (direct: exit 3 + store-missing document; file/dir symlink: exit 0, empty out-dir). Filed as #5099 and enqueued as task 8765; no open issue named it before, and #2350 covers only the meta exporter.
repo-wide grep on origin/main b7d274c now returns only that one hit.
labels: cleared the claim labels; this issue is closed.
bookkeeping: sandbox backlog and sweep log deferred to fleet reconciliation (openchamber scheduled lane).