You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Entry-point guards under src/: one unresolved comparison, five that answer false when realpath fails #381
#372 fixes entry-point guards under scripts/ and benchmarks/, and its pin test scans only those two roots. The same family exists under src/, untouched by that change (all present at 3a04eace).
1. src/transports/http/server.ts:1313-1315 — unresolved argv[1] against a realpathed import.meta.url
Node realpaths the main module and leaves process.argv[1] as typed, so node dist/transports/http/server.js reached through a symlink misses this comparison. What saves it today is only the next clause, || process.argv[1]?.endsWith('memesh-http') — the bin shim's name.
2. Five guards that answer "not the entry point" when realpath fails
src/transports/cli/cli.ts:2831 and src/host-runtime/{acp,claude,codex,codex-session}.ts resolve both sides (symlinks are fine) but wrap it in catch { return false }. scripts/lib/verify-core.mjs documents why that answer is wrong for a gate: the process then exits clean having done nothing. For a CLI the trade may be different (a crash on start-up is also bad) — decide it, then make the five agree.
Suggested shape
One shared isMain() for src/ (it cannot import from scripts/lib/), the six call sites delegating to it, and the #372 pin test's scan extended to src/ once they do.
PR #650 uses a shared entry-point check in the active source entries. Direct and symlinked startup, import-only behavior and child-process paths have regression coverage. The five entry-point helper tests passed on Windows Node 22 as well as Linux.
Activity
kevintseng commentedon Dec 2, 2026
PR #650 uses a shared entry-point check in the active source entries. Direct and symlinked startup, import-only behavior and child-process paths have regression coverage. The five entry-point helper tests passed on Windows Node 22 as well as Linux.