#1777

0.4.1: remaining --npm-static=auto refusals for a pi-coding-agent worker (namespace re-export cycle, createRequire computed specifier, CJS entries not joining)

OpenHagegeRopened 21d ago

Tested a Node 24/26 worker built on @earendil-works/pi-coding-agent with scriptc 0.4.1: scriptc build src/main.ts (default --npm-static=auto). Coverage is now 97% of 7,995 statements, up from 94% on 0.3.6, and the refusals dropped from 11 to 8. The remaining refusals are all SC2013 on npm packages. Package versions are those resolved from a clean npm ci:

Package (version)RefusalPossibly related
@earendil-works/pi-coding-agent 1.3.0SC1016 circular imports dist/core/sdk.js → agent-session-runtime.js → agent-session-services.js → sdk.js; "the namespace re-export at sdk.js:26 names a module of the cycle"#1495 covers class-only cycles, not namespace re-exports
@earendil-works/pi-tui 1.3.0"createRequire result escapes or is used with a computed specifier" (dist/native-module-path.js, dist/native-platform.js)#1691 / #1685 (Node islands)?
pi-mcp-adapter 5.3.2"ships no own .d.ts declaration surface" (ships .ts sources)
diff 8.0.4"its entry diff/libcjs/index.js did not join the type-checked program"#1331
retry 0.13.1 (via proper-lockfile 4.1.2)"its entry retry/index.js did not join the type-checked program"#1331
marked 18.0.11 (via pi-tui)"its shipped JS looks minified"#1324 (open)
lru-cache 11.5.3 (via hosted-git-info 9.0.3)"its shipped JS looks minified", which cascades into SC1010 in hosted-git-info#1324 (open)

Questions:

  1. Is the namespace re-export inside an import cycle (pi-coding-agent sdk.js:26) planned, or should packages like this go to a Node island?
  2. diff and retry are plain CJS packages. Is "did not join the type-checked program" expected for them on 0.4.1? Is there a flag to force them in?
  3. For packages that ship only .ts sources and no .d.ts (pi-mcp-adapter), is compiling from those sources planned?

The front end ran on Ubuntu 22.04 (no clang, so linking wasn't reached).

Activity

2
HagegeR17d ago

Status on 0.4.5 (same worker, Node 26.12.1, scriptc build --npm-static=auto; --node-islands=auto gives the same result):

Fixed since 0.4.1: the pi-coding-agent namespace re-export cycle (SC1016) and pi-tui's computed createRequire no longer refuse. pi-coding-agent and pi-tui now report static, and so do marked and lru-cache. Thanks!

Still refused (4 × SC2013, down from 8):

  • diff: entry diff/libcjs/index.js did not join the type-checked program (from pi-coding-agent/dist/core/tools/edit-diff.js)
  • retry: entry retry/index.js did not join the type-checked program (from proper-lockfile/lib/lockfile.js)
  • proper-lockfile: SC1010 at proper-lockfile/lib/lockfile.js:5: the 'retry' module is not supported yet (follows from retry)
  • pi-mcp-adapter: ships no own .d.ts declaration surface

scriptc coverage reports 75,496 / 76,256 statements as static (99%).

HagegeR7d ago

Status on 0.4.8 (same worker, Node 26.13.0, scriptc coverage --node-islands=auto / scriptc build):

Since 0.4.5: diff now compiles statically. retry no longer refuses as an entry that does not join the program. Coverage is 3356/3368 statements static (99%).

Still refused (from coverage blockers:):

  • pi-mcp-adapter: SC2013 "ships no own .d.ts declaration surface". Its exports["."].types points at TypeScript source (./index.ts); only the ./types / ./config subpaths ship dist/*.d.ts. Is shipping .ts sources as the declaration surface meant to be supported, or should this go through a type patch? This is the only error scriptc build prints (it stops there).
  • cross-spawn: SC1010 at cross-spawn/lib/util/resolveCommand.js:4: the 'which' module is not supported yet (from pi-coding-agent/dist/utils/child-process.js)
  • proper-lockfile: SC1010 at proper-lockfile/lib/lockfile.js:5: the 'retry' module is not supported yet (from pi-coding-agent/dist/core/settings-manager.js)
  • hosted-git-info: SC1010 at hosted-git-info/lib/index.js:3: the 'lru-cache' module is not supported yet (from pi-coding-agent/dist/utils/git.js)

In --node-islands=auto (report-only), cross-spawn and hosted-git-info are listed as gap islands. proper-lockfile is listed as object-model.

Written by Devin