AntFleet

Disagreement · 70f6bb2c-anthropic-6

Script entrypoint guard is fragile under bundling/symlinks

solo Opus
repo e24ef98c·PR #9·reviewed 1 week ago

Opus finding

Script entrypoint guard is fragile under bundling/symlinks

lowmaintainabilitymedium
  • apps/web/scripts/backfill-benchmark-flag.ts:195-204
The guard fires only when argv[1] ends with the literal '.ts'. Under bundling, compile-to-JS, or invocation via a wrapper that resolves to a different basename (e.g. tsx with a temp file), main() will not run. Also, importing this module from a sibling .ts file would still satisfy the suffix if a test ever runs the file directly via tsx. Not a correctness bug today but brittle.

Recommendation

Use `import.meta.url === pathToFileURL(process.argv[1]).href` (ESM equivalent of require.main === module).

Other reviewer

The other reviewer flagged nothing in this file/line range.

Why this didn't post

This finding didn't meet AntFleet's unanimous agreement threshold. Both frontier models review every PR independently; only findings they both flag with the same severity and category are posted to the PR. This one fell through.

read the methodology →

From the same review

These findings passed the unanimous gate on the same PR review. The disagreement above was filtered out; the findings below were posted.