fix: expose bin/* in package exports for Node 22+ (closes #734) - #737
Conversation
@aiox-squads/core 5.2.2/5.2.3/5.2.4 broke under Node 22+ with
ERR_PACKAGE_PATH_NOT_EXPORTED. The exports field introduced during
Epic 124 only exposed ./resilience/* and ./installer/*, blocking the
compat/aiox-core/bin/aiox-core.js shim from require()-ing the canonical
CLI binaries.
Fix:
- Add "./bin/*": "./bin/*" pass-through pattern to exports.
- Bump @aiox-squads/core 5.2.4 -> 5.2.5.
- Bump compat aiox-core 5.2.4 -> 5.2.5 + dependency pin.
Validated locally on Node 22.16 against packed tarballs:
- aiox --version: 5.2.5
- aiox-core --version (legacy wrapper): 5.2.5
- require('@aiox-squads/core/bin/aiox.js'): loads CLI without
ERR_PACKAGE_PATH_NOT_EXPORTED
Closes #734
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The existing publish_legacy_aiox_core smoke uses npx --yes which resolves bin shims internally and does NOT trigger Node's package-exports gate. That gap let Issue #734 (ERR_PACKAGE_PATH_NOT_EXPORTED) slip into 3 consecutive releases (5.2.2/.3/.4) unnoticed by CI. Add smoke_test_exports job: - Matrix Node 20/22/24 - Runs after publish (depends on build + publish + publish_legacy_aiox_core) - Forces external require('@aiox-squads/core/bin/aiox.js') which DOES trigger the exports gate - notify job updated to surface failures This is a regression guard, not a replacement for the existing bin-shim smoke. Both paths are now validated. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Story documenting Issue #734 fix: - Root cause analysis (Story 124.8 wrapper + restrictive exports field) - Acceptance criteria - Tasks (impl + CI hardening + publish + deprecation) - File list - Dev notes including CI gap analysis (why npx smoke missed it 3 times) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughAdds ChangesPackage exports and version alignment with CI regression guard
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related issues
Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
📊 Coverage ReportCoverage report not available
Generated by PR Automation (Story 6.1) |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/npm-publish.yml:
- Around line 499-506: The shell pipeline in the smoke test (the block that
creates SMOKE_DIR and runs node -e "require('@aiox-squads/core/bin/aiox.js')
2>&1 | head -20") can hide failures because the exit status of the first command
is lost; add a shell option to enable failing on any pipe element by invoking
set -o pipefail (or equivalently set -euo pipefail if you prefer stricter mode)
before running the pipeline so a failing node require() will correctly cause the
if-condition to fail and surface export/require regressions.
In
`@docs/stories/epic-124-aiox-squads-scope-migration/STORY-124.13-fix-issue-734-exports-bin.md`:
- Line 41: Update the incorrect story filename reference by replacing
`STORY-124.9-fix-issue-734-exports-bin.md` with the correct
`STORY-124.13-fix-issue-734-exports-bin.md` in the File List entry so the
documentation points to the current story file.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 22b53962-b8ca-4701-b70f-8dec3c7f3194
📒 Files selected for processing (4)
.github/workflows/npm-publish.ymlcompat/aiox-core/package.jsondocs/stories/epic-124-aiox-squads-scope-migration/STORY-124.13-fix-issue-734-exports-bin.mdpackage.json
- ci: add `set -o pipefail` to smoke_test_exports so node's non-zero exit from require() failure isn't masked by `head -20`. Without this, the regression guard silently passes on any future ERR_PACKAGE_PATH_ NOT_EXPORTED, defeating its purpose. - docs: correct File List self-reference in STORY-124.13 (was pointing to the old 124.9 filename used during draft). CodeRabbit findings: - Major (workflow L506): pipefail missing - Minor (story L41): stale filename reference Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
@Pedrovaleriolopez @oalanicolas — codeowners review request PR fixes Issue #734 (broken CLI on Node 22+, affects every fresh install of Status:
Quando puderem revisar — fix bloqueia release. Obrigado. |
… (SynkraAI#737) * fix: expose bin/* in exports for Node 22+ compat [Story 124.13] @aiox-squads/core 5.2.2/5.2.3/5.2.4 broke under Node 22+ with ERR_PACKAGE_PATH_NOT_EXPORTED. The exports field introduced during Epic 124 only exposed ./resilience/* and ./installer/*, blocking the compat/aiox-core/bin/aiox-core.js shim from require()-ing the canonical CLI binaries. Fix: - Add "./bin/*": "./bin/*" pass-through pattern to exports. - Bump @aiox-squads/core 5.2.4 -> 5.2.5. - Bump compat aiox-core 5.2.4 -> 5.2.5 + dependency pin. Validated locally on Node 22.16 against packed tarballs: - aiox --version: 5.2.5 - aiox-core --version (legacy wrapper): 5.2.5 - require('@aiox-squads/core/bin/aiox.js'): loads CLI without ERR_PACKAGE_PATH_NOT_EXPORTED Closes SynkraAI#734 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * ci: add Node 22/24 exports regression guard [Story 124.13] The existing publish_legacy_aiox_core smoke uses npx --yes which resolves bin shims internally and does NOT trigger Node's package-exports gate. That gap let Issue SynkraAI#734 (ERR_PACKAGE_PATH_NOT_EXPORTED) slip into 3 consecutive releases (5.2.2/.3/.4) unnoticed by CI. Add smoke_test_exports job: - Matrix Node 20/22/24 - Runs after publish (depends on build + publish + publish_legacy_aiox_core) - Forces external require('@aiox-squads/core/bin/aiox.js') which DOES trigger the exports gate - notify job updated to surface failures This is a regression guard, not a replacement for the existing bin-shim smoke. Both paths are now validated. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs(stories): add STORY-124.13 [Story 124.13] Story documenting Issue SynkraAI#734 fix: - Root cause analysis (Story 124.8 wrapper + restrictive exports field) - Acceptance criteria - Tasks (impl + CI hardening + publish + deprecation) - File list - Dev notes including CI gap analysis (why npx smoke missed it 3 times) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(ci,docs): address CodeRabbit review [Story 124.13] - ci: add `set -o pipefail` to smoke_test_exports so node's non-zero exit from require() failure isn't masked by `head -20`. Without this, the regression guard silently passes on any future ERR_PACKAGE_PATH_ NOT_EXPORTED, defeating its purpose. - docs: correct File List self-reference in STORY-124.13 (was pointing to the old 124.9 filename used during draft). CodeRabbit findings: - Major (workflow L506): pipefail missing - Minor (story L41): stale filename reference Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
Fixes #734 —
@aiox-squads/core@5.2.2/5.2.3/5.2.4all crash on Node 22+ withERR_PACKAGE_PATH_NOT_EXPORTEDbecause theexportsfield omits./bin/*.Three commits, atomic and reviewable independently:
5df6d061package.json+compat/aiox-core/package.json— add"./bin/*": "./bin/*"to exports, bump 5.2.4 → 5.2.509b80b87npm-publish.yml— newsmoke_test_exportsjob with Node 20/22/24 matrix to catch this regression class4aa7d539STORY-124.13Root cause
Story 124.8 introduced
compat/aiox-core/bin/aiox-core.jswhich does:The root
package.jsonexportsfield (Epic 124) only exposes./resilience/*,./installer/*,./package.json. Node 22+ enforces the package-exports spec strictly and rejects subpaths not declared, even when the file physically exists.Why CI missed it 3 releases in a row: the existing
Smoke test legacy npxstep usesnpx --yes aiox-core --version, which resolves via npm bin shims — those bypass Node's package-exports gate (internal resolution withinnode_modules). Only externalrequire('@aiox-squads/core/bin/aiox.js')triggers the gate, which is what happens when a user runsnpm i -g aiox-core@5.2.xin Node 22+.The fix
"exports": { "./resilience": "./.aiox-core/core/resilience/index.js", "./resilience/agent-immortality": "./.aiox-core/core/resilience/agent-immortality.js", + "./bin/*": "./bin/*", "./installer/aiox-core-installer": "./packages/installer/src/installer/aiox-core-installer.js", ... }Pass-through pattern (no
.jssuffix transform) because the shim already passes the full filename including extension.CI hardening (regression guard)
New job
smoke_test_exportsruns afterpublish/publish_legacy_aiox_core:node: ['20', '22', '24']node -e "require('@aiox-squads/core/bin/aiox.js')"— forces external resolution that the existing smoke does not exerciseLocal validation (Node 22.16)
Reproduced the bug against
aiox-core@5.2.4then validated the fix locally vianpm pack+ tempdir install:Pre-fix, the same
require()call threwERR_PACKAGE_PATH_NOT_EXPORTED.Test plan
smoke_test_exports(Node 20/22/24)v5.2.5→ workflow auto-publishesnpm deprecate aiox-core@{5.2.2,5.2.3,5.2.4} "Broken on Node 22+. Use 5.2.5+."(both unscoped and@aiox-squads/core)npm i -g aiox-core@5.2.5 && aiox --versionon Node 22/24/25Related
docs/stories/epic-124-aiox-squads-scope-migration/STORY-124.13-fix-issue-734-exports-bin.md🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Chores
Tests
Documentation