Repository navigation
feat(node): add configure() for embedder setting defaults - #1053
Conversation
Expose embedder setting defaults through the Node-API addon so hosts can set policy (e.g. minimumReleaseAge) programmatically instead of relying on env vars or per-project npmrc files. The addon previously hardcoded minimumReleaseAge=0 with no override. Also expose osvTransitiveCheck per install, matching the C ABI options. configure() must run before the first install: registration is process-global and first-write-wins, so late or repeated calls reject with the new stable code ERR_AUBE_EMBED_ALREADY_INITIALIZED, and unknown setting names reject with ERR_AUBE_EMBED_INVALID_SETTING instead of silently not applying. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 26 seconds Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Central YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (9)
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 |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b17dd18. Configure here.
Greptile SummaryAdds
Confidence Score: 4/5Safe to merge after fixing the "rejects" wording in README and docs — the Rust implementation is correct but the prose documentation will mislead JS callers into using .catch() on a synchronous function. The core Rust logic is sound: OnceLock correctly serializes concurrent configure/install races, merged_defaults properly handles override precedence, and osvTransitiveCheck is wired through both code paths. The only concrete defect is in the documentation — both README.md and docs/embedding/node.md use "rejects" for a synchronous function that throws, which is the wrong error-handling pattern for JS callers reading the prose docs. crates/aube-node/README.md and docs/embedding/node.md both need the "rejects" → "throws" fix. Important Files Changed
Reviews (2): Last reviewed commit: "fix(node): serialize embedder registrati..." | Re-trigger Greptile |
Review feedback: the AtomicBool flag let a concurrent install proceed before configure's embed::initialize completed (running under the standalone profile), and a typo'd setting name after initialization returned ERR_AUBE_EMBED_INVALID_SETTING where the documented contract promises ERR_AUBE_EMBED_ALREADY_INITIALIZED. OnceLock::get_or_init blocks racers until registration completes and records who won; configure fast-paths the already-initialized check before validation. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Both findings addressed in the follow-up commit:
This comment was generated by an AI coding assistant. |

Summary
configure({ defaults })to@jdxcode/aube-nodeso embedding hosts can register setting defaults (e.g.minimumReleaseAge) programmatically — previously the addon hardcodedminimumReleaseAge=0with no override short of env vars or per-project.npmrcERR_AUBE_EMBED_INVALID_SETTINGERR_AUBE_EMBED_ALREADY_INITIALIZED— registration is process-global and first-write-wins, so silent non-application would be a policy hazardosvTransitiveCheckonInstallInput, matching the C ABI's install optionsconfigurere-export,.d.tstypes, typecheck fixture, README + docsMotivation
opencode's aube adoption (anomalyco/opencode#37301) promises supply-chain policy on runtime installs — a cooldown matching its bunfig
minimumReleaseAge. The C ABI already supports this viaaube_inithost-profile defaults; the Node-API addon had no equivalent.Validation
cargo test --locked -p aube-node(new unit tests for default merging and name validation)cargo clippy --all-targets,cargo fmtdocs/error-codes.data.jsonregeneratedThis PR was written by an AI coding assistant (Claude Code), directed by @jdx.
Note
Medium Risk
Process-global embedder init and supply-chain settings (
minimumReleaseAge,osvTransitiveCheck) affect install behavior for all subsequent installs in the host; mis-orderedconfigurevsinstallis fail-closed but hosts must adopt the new API correctly.Overview
Adds
configure({ defaults })to@jdxcode/aube-nodeso hosts can register embedder setting defaults (e.g.minimumReleaseAge) before the firstinstall, paralleling C ABIaube_inithost-profile defaults. Defaults merge with built-ins (nodeLinker=hoisted,minimumReleaseAge=0), validate names viaaube_settings::find, and register once per process throughEMBEDDER_INITsoconfigureand the firstinstallrace safely.Late or duplicate
configurethrowsERR_AUBE_EMBED_ALREADY_INITIALIZED; unknown keys throwERR_AUBE_EMBED_INVALID_SETTING(new stable codes inaube-codesanddocs/error-codes.data.json).osvTransitiveCheckis wired throughInstallInputinto bothembed::addandembed::install.The npm layer re-exports
configure, updates.d.ts, README, embedding docs, and typecheck fixture;aube-nodegainsaube-settingsand unit tests for default merge/validation.Reviewed by Cursor Bugbot for commit 45ecae4. Bugbot is set up for automated code reviews on this repo. Configure here.