Skip to content

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

Description

@dezren39

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:

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

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

  1. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    queue/queuedHas a queued task in the Supabase agent queue
    source/creatorFiled by the new-issue-creator job
    task/triageQueue packet kind: verify, reproduce, and route this item
    priority/normalOrdinary priority (the default)
    app/codedb-bridgebin/codedb-bridge.mjs — stdio MCP bridge to the shared codedb daemon
    app/pm-stackpm-stack (Pad/Grist) in developing-today/code
    effort/sSmall: expected under 2 hours of work
    on Nov 2, 2026
  2. dezren39 commented on Nov 2, 2026

    @dezren39
    MemberAuthor

    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.

  3. dezren39 commented on Nov 2, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

  4. added
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    and removed on Nov 2, 2026
  5. 9 remaining items

  6. developing-today commented on Nov 3, 2026

    @developing-today
    Contributor

    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

  7. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    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.

  8. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 3, 2026
  9. added a commit that references this issue on Nov 3, 2026
  10. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

app/codedb-bridgebin/codedb-bridge.mjs — stdio MCP bridge to the shared codedb daemonapp/pm-stackpm-stack (Pad/Grist) in developing-today/codeeffort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobtask/triageQueue packet kind: verify, reproduce, and route this item

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions