Skip to content

chore: codify aimux launch contracts - #277

Merged
TraderSamwise merged 2 commits into
masterfrom
chore/core-sidecar-next
Jul 3, 2026
Merged

chore: codify aimux launch contracts#277
TraderSamwise merged 2 commits into
masterfrom
chore/core-sidecar-next

Conversation

@TraderSamwise

@TraderSamwise TraderSamwise commented Jul 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • replace the generic Aimux CLI launch helper with named daemon, dashboard, and diagnostics contracts
  • move runtime coherence to read current CLI identity instead of depending on a launch helper
  • tighten the one-shot Node inventory test so new launch contracts must be explicitly allowed

Verification

  • yarn vitest run src/cli-launcher.test.ts src/dashboard/command-spec.test.ts src/runtime-coherence.test.ts src/one-shot-node-inventory.test.ts
  • yarn typecheck
  • yarn lint
  • yarn vitest run
  • yarn build
  • pre-push: yarn typecheck && yarn lint && yarn test

Summary by CodeRabbit

  • New Features

    • Added dedicated launch behavior for the daemon, dashboard, and current CLI identity, improving consistency across different startup modes.
    • Dashboard launches now use a stable internal entry for more predictable session handling.
  • Bug Fixes

    • Improved runtime coherence reporting so stale native paths and launch details are more accurate.
    • Updated and expanded launcher-related test coverage to match the new launch behavior.

@vercel

vercel Bot commented Jul 3, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
app Ready Ready Preview, Comment Jul 3, 2026 5:51pm

@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c5b422c9-72d5-4b0e-acb8-2f37564eba6b

📥 Commits

Reviewing files that changed from the base of the PR and between 8fd160b and baed006.

📒 Files selected for processing (1)
  • src/cli-launcher.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/cli-launcher.test.ts

📝 Walkthrough

Walkthrough

The CLI launch helper is split into contract-specific exports for daemon, dashboard, and current-identity use cases. Daemon startup, dashboard command construction, runtime coherence reporting, and inventory checks now use those contracts, with tests updated to match.

Changes

Launch Command Contract Split

Layer / File(s) Summary
Core launcher refactor
src/cli-launcher.ts
Removes shellQuote, makes the shared resolver internal, and adds getAimuxDaemonLaunchCommand, getAimuxDashboardLaunchCommand, and getAimuxCurrentCliIdentity.
Launcher contract tests
src/cli-launcher.test.ts
Updates contract coverage for daemon, dashboard, and current-identity launch behavior and removes the old shell-command test.
Daemon spawn wiring
src/daemon.ts
Switches daemon launch command creation to getAimuxDaemonLaunchCommand().
Dashboard command spec wiring
src/dashboard/command-spec.ts
Switches dashboard launch derivation to getAimuxDashboardLaunchCommand({ env, currentArgvEntry }).
Runtime coherence identity wiring
src/runtime-coherence.ts, src/runtime-coherence.test.ts
Uses getAimuxCurrentCliIdentity for cliLaunch and updates the test mock and options interface.
Inventory allowlist enforcement
src/one-shot-node-inventory.test.ts
Tracks allowed launch-contract usage per function and flags remaining getAimuxCliLaunchCommand references.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
    participant Daemon as src/daemon.ts
    participant Dashboard as src/dashboard/command-spec.ts
    participant Runtime as src/runtime-coherence.ts
    participant Launcher as src/cli-launcher.ts

    Daemon->>Launcher: getAimuxDaemonLaunchCommand()
    Launcher-->>Daemon: command/args/source

    Dashboard->>Launcher: getAimuxDashboardLaunchCommand({ env, currentArgvEntry })
    Launcher-->>Dashboard: command/args/source

    Runtime->>Launcher: getAimuxCurrentCliIdentity()
    Launcher-->>Runtime: cliLaunch identity
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately summarizes the main change: codifying Aimux launch contracts.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ 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 chore/core-sidecar-next

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

@TraderSamwise

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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

🧹 Nitpick comments (1)
src/cli-launcher.test.ts (1)

45-47: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Assert the full daemon contract args after the entry path.

Line 47 would still pass if "daemon" were accidentally dropped. Tighten this to protect the named launch contract.

Proposed test tightening
     expect(launch.command).toBe(process.execPath);
     expect(launch.args[0]).toMatch(/main\.(js|ts)$/);
-    expect(launch.args.at(-1)).toBe("run");
+    expect(launch.args.slice(1)).toEqual(["daemon", "run"]);
     expect(launch.source).toBe("current-entry");
🤖 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 `@src/cli-launcher.test.ts` around lines 45 - 47, The launch contract assertion
in cli-launcher.test.ts is too loose and can miss if the daemon command is
dropped. Tighten the checks around launch.args in the test by asserting the full
ordered daemon contract immediately after the entry path, using the existing
launch and args expectations so the test verifies both the presence and
placement of "daemon" before the trailing "run" argument.
🤖 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.

Nitpick comments:
In `@src/cli-launcher.test.ts`:
- Around line 45-47: The launch contract assertion in cli-launcher.test.ts is
too loose and can miss if the daemon command is dropped. Tighten the checks
around launch.args in the test by asserting the full ordered daemon contract
immediately after the entry path, using the existing launch and args
expectations so the test verifies both the presence and placement of "daemon"
before the trailing "run" argument.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ff20506c-b773-44b1-86a2-7846780186ac

📥 Commits

Reviewing files that changed from the base of the PR and between c3621be and 8fd160b.

📒 Files selected for processing (7)
  • src/cli-launcher.test.ts
  • src/cli-launcher.ts
  • src/daemon.ts
  • src/dashboard/command-spec.ts
  • src/one-shot-node-inventory.test.ts
  • src/runtime-coherence.test.ts
  • src/runtime-coherence.ts

@TraderSamwise
TraderSamwise merged commit 18f089c into master Jul 3, 2026
3 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.

1 participant