Skip to content

fix: align Pro install machine fingerprint - #781

Merged
rafaelscosta merged 2 commits into
mainfrom
fix/pro-install-machine-id-parity
May 21, 2026
Merged

fix: align Pro install machine fingerprint#781
rafaelscosta merged 2 commits into
mainfrom
fix/pro-install-machine-id-parity

Conversation

@rafaelscosta

@rafaelscosta rafaelscosta commented May 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Align Pro setup machine fingerprint with the @aiox-squads/pro runtime native machine-id format.
  • Add node-machine-id as a direct installer dependency.
  • Bump @aiox-squads/installer to 3.3.9 and add focused unit coverage.

Validation

  • npm test -- --runInBand packages/installer/tests/unit/pro-setup-machine-id.test.js
  • Published @aiox-squads/installer@3.3.9
  • E2E from clean temp project using published packages:
    • npx -y aiox-core@latest install --ci --yes --ide claude-code
    • npx -y @aiox-squads/aiox-pro-cli@latest install
    • npx -y @aiox-squads/aiox-pro-cli@latest validate
    • npx -y aiox-core@latest validate --detailed

Notes

  • Core-only install produced no Pro artifact files before Pro activation.
  • After Pro install, no new files were added under .claude/agents or .claude/skills; Pro squad commands were added under .claude/commands and .codex/agents as expected.

Summary by CodeRabbit

  • Improvements

    • Installer now prefers a native machine identifier for Pro setup, improving fingerprint stability and maintaining robust fallbacks.
  • Chores

    • Added a runtime dependency to support native machine-id retrieval.
  • Tests

    • Added unit tests covering native machine-id hashing and legacy fallback behavior.

Review Change Stack

@vercel

vercel Bot commented May 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
aiox-core Ready Ready Preview, Comment May 21, 2026 3:45pm

Request Review

@github-actions github-actions Bot added type: test Test coverage and quality area: installer Installer and setup (packages/installer/) area: docs Documentation (docs/) labels May 21, 2026
@coderabbitai

coderabbitai Bot commented May 21, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d52c6dbe-9985-430e-b8fa-61944c596806

📥 Commits

Reviewing files that changed from the base of the PR and between 7f90324 and d830211.

📒 Files selected for processing (1)
  • packages/installer/tests/unit/pro-setup-machine-id.test.js

Walkthrough

The PR improves Pro license machine-id generation by integrating native system fingerprinting via node-machine-id, deterministically hashing it with a fixed prefix, and falling back to legacy hostname/CPU/network-interface derivation when native retrieval fails. Tests were added to cover both native and fallback paths.

Changes

Pro Machine-ID Generation with Native Fingerprinting

Layer / File(s) Summary
Dependency and version management
packages/installer/package.json
Added node-machine-id runtime dependency and bumped package version from 3.3.8 to 3.3.9.
Native machine-id generation logic
packages/installer/src/wizard/pro-setup.js
Introduced MACHINE_ID_HASH_PREFIX constant. Refactored generateMachineId() to attempt generateNativeMachineId() (using node-machine-id) and SHA-256-hash the prefixed native id, falling back to generateLegacyMachineId() when native generation fails. Exposed generateNativeMachineId and generateLegacyMachineId via module.exports._testing for tests.
Machine-id generation tests
packages/installer/tests/unit/pro-setup-machine-id.test.js
Added Jest tests that assert the deterministic SHA-256 digest for the native path and a second test that mocks native failure and verifies the legacy fallback digest; tests isolate modules and clear mocks after each test.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • SynkraAI/aiox-core#648: Prior work on stable native machine-id using node-machine-id, hashing with a fixed prefix, and related tests.
  • SynkraAI/aiox-core#635: Overlapping changes to packages/installer/src/wizard/pro-setup.js's machine-id fingerprinting flow.

Suggested labels

area: pro

Suggested reviewers

  • Pedrovaleriolopez
  • oalanicolas
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: align Pro install machine fingerprint' directly summarizes the main change: aligning the Pro setup machine fingerprint with native machine-id format, which is the primary objective of this PR.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/pro-install-machine-id-parity

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

github-actions Bot commented May 21, 2026

Copy link
Copy Markdown
Contributor

📊 Coverage Report

Coverage report not available

📈 Full coverage report available in Codecov


Generated by PR Automation (Story 6.1)

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
packages/installer/tests/unit/pro-setup-machine-id.test.js (1)

4-4: ⚡ Quick win

Use an absolute import for pro-setup.

Import this module through the package’s exported path instead of reaching into ../../src/... so the test follows the repo’s import rule and stays stable if the folder layout changes. As per coding guidelines, "Use absolute imports instead of relative imports in all code".

🤖 Prompt for 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.

In `@packages/installer/tests/unit/pro-setup-machine-id.test.js` at line 4,
Replace the relative require('../../src/wizard/pro-setup') with the package’s
public export path and import the _testing symbol from that export (e.g.,
require('installer/wizard/pro-setup') or the package root export that exposes
pro-setup); update the statement that currently references _testing so it
imports from the package’s exported module instead of ../../src/wizard/pro-setup
to follow the absolute-import guideline and keep tests stable if folder layout
changes.
🤖 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 `@packages/installer/tests/unit/pro-setup-machine-id.test.js`:
- Around line 7-15: Replace the relative import with the package's absolute
import for the pro-setup module and update the test to force the legacy branch:
require the pro-setup module (the one exporting generateMachineId,
generateNativeMachineId, generateLegacyMachineId and loadProModule) via absolute
import, mock the node-machine-id export so machineIdSync (or the module used by
generateNativeMachineId) throws or returns a non-string to make
generateNativeMachineId return null, mock the os APIs (hostname, cpus,
networkInterfaces) to fixed, deterministic values so generateLegacyMachineId
produces a stable hash, and mock loadProModule('license-crypto') to a
no-op/undefined so it doesn’t short-circuit the code path; then call
generateMachineId() and assert it equals the deterministic legacy hash.

---

Nitpick comments:
In `@packages/installer/tests/unit/pro-setup-machine-id.test.js`:
- Line 4: Replace the relative require('../../src/wizard/pro-setup') with the
package’s public export path and import the _testing symbol from that export
(e.g., require('installer/wizard/pro-setup') or the package root export that
exposes pro-setup); update the statement that currently references _testing so
it imports from the package’s exported module instead of
../../src/wizard/pro-setup to follow the absolute-import guideline and keep
tests stable if folder layout changes.
🪄 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: 4e57d94a-976d-49ac-a0ad-80e422a096bb

📥 Commits

Reviewing files that changed from the base of the PR and between 71b14b6 and 7f90324.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (3)
  • packages/installer/package.json
  • packages/installer/src/wizard/pro-setup.js
  • packages/installer/tests/unit/pro-setup-machine-id.test.js

Comment thread packages/installer/tests/unit/pro-setup-machine-id.test.js
@rafaelscosta
rafaelscosta merged commit 77265d5 into main May 21, 2026
48 checks passed
@rafaelscosta
rafaelscosta deleted the fix/pro-install-machine-id-parity branch May 21, 2026 19:48
tuanmedeiros pushed a commit to tuanmedeiros/aios-core-synkraay that referenced this pull request Jun 2, 2026
* fix: align pro install machine fingerprint

* test: cover pro install machine id fallback
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 5.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: docs Documentation (docs/) area: installer Installer and setup (packages/installer/) released type: test Test coverage and quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant