Skip to content

fix: resolve real paths in CLI entry-point guard, close bin symlink bug - #15

Merged
qmarcelle merged 1 commit into
mainfrom
fix/agents-audit-bin-entrypoint
Jul 17, 2026
Merged

fix: resolve real paths in CLI entry-point guard, close bin symlink bug#15
qmarcelle merged 1 commit into
mainfrom
fix/agents-audit-bin-entrypoint

Conversation

@qmarcelle

Copy link
Copy Markdown
Contributor

Summary

  • npm exposes package bins through node_modules/.bin symlinks. agents-audit's entry-point guard compared resolve(process.argv[1]) against the resolved module URL, which never matched through a symlink — every subcommand (generate, scan) silently no-op'd and exited 0 instead of running. 0.4.1 was uninstallable; 0.4.2 installed but did nothing. Fixed by comparing realpathSync() of both paths.
  • Hardened scripts/verify-package-tarball.mjs so this class of bug can't slip through again: for agents-audit, after packing, it now installs the tarball fresh (plus locally-packed @workspacejson/rules/@workspacejson/spec, since the fixed-group version isn't on the registry yet pre-publish) and asserts .agents/workspace.json actually exists and parses, instead of trusting a clean exit code.
  • Bumped the fixed group (@workspacejson/spec, @workspacejson/rules, agents-audit) 0.4.2 → 0.4.3 via changesets. Schema bytes are unchanged (verified SHA-256 match against the 0.4.2 pin recorded in HAC-183).

Test plan

  • pnpm build / pnpm typecheck / pnpm test all green
  • Red/green: reverted the guard fix, confirmed the new smoke test fails with the exact silent-no-op symptom; restored it, confirmed green
  • pnpm run release:verify-packs passes end-to-end for all three packages, including the new artifact-existence assertion
  • Post-publish: capture npm tarball integrity for 0.4.3 and hand off to the site agent for the VR-664 schema pin re-verification (per HAC-183's method, since npm gitHead is unreliable for this fixed group)

npm exposes package bins through node_modules/.bin symlinks. The guard
compared resolve(process.argv[1]) against the resolved module URL, which
never matched through a symlink, so npx/npm exec agents-audit silently
skipped runCli() and exited 0 without doing anything. 0.4.1 was
uninstallable and 0.4.2 installed but every subcommand was a no-op.

Harden verify-package-tarball.mjs to catch this class of bug going
forward: after packing agents-audit, install the tarball fresh (along
with locally packed @workspacejson/rules and @workspacejson/spec, since
the fixed-group version isn't on the registry yet pre-publish), run
`generate`, and assert .agents/workspace.json actually exists and
parses instead of trusting a clean exit code.

Bump the fixed group to 0.4.3.
Copilot AI review requested due to automatic review settings July 17, 2026 10:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@qmarcelle
qmarcelle merged commit 5179bed into main Jul 17, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants