Skip to content

Remove IPC version to indicate unstable nature at this moment - #192

Merged
Guria merged 1 commit into
mainfrom
worktree/brave-field-2950
Jul 28, 2026
Merged

Guria merged 1 commit into
mainfrom
worktree/brave-field-2950

Conversation

@Guria

@Guria Guria commented Jul 28, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Remove the IPC protocol version field and document the IPC surface as unstable

Breaking change for IPC clients. The version field is gone from IPC requests, responses, and event envelopes, and the protocolVersion field is gone from the version command and the capabilities query. The server no longer rejects requests over a version mismatch, so the protocol_mismatch error code is removed too. The number never changed as the protocol grew, so it could not tell a client anything useful.

The IPC protocol and nehirctl output format are documented as unstable: they can change in any release. Integrations should key on the Nehir app version, still reported as appVersion by nehirctl version and the capabilities query.

Release notes

Choose one:

  • Added a .changeset/*.md for user-visible changes (mise run changeset -- patch "...").
  • No user-visible change; apply the no release note label to make CI skip intentional.

Validation

  • Ran relevant tests/checks.

Summary by CodeRabbit

  • Breaking Changes

    • Removed IPC protocol version fields from requests, responses, events, version results, and capability information.
    • IPC clients are no longer rejected for protocol version mismatches.
    • Removed the protocol_mismatch error.
    • nehirctl version and capabilities now report only the Nehir app version.
  • Documentation

    • Updated IPC architecture and CLI documentation to reflect the simplified, unstable protocol.

Copilot AI review requested due to automatic review settings July 28, 2026 21:06

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.

@coderabbitai

coderabbitai Bot commented Jul 28, 2026 •

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The IPC protocol version fields, protocol mismatch validation, and protocol_mismatch error are removed from models, runtime handling, CLI output, tests, and documentation. App version reporting remains available through version and capabilities queries.

Changes

IPC protocol version removal

Layer / File(s) Summary
Update IPC contracts
Sources/NehirIPC/IPCModels.swift
IPC envelopes and query results no longer contain protocol version fields, and the protocol mismatch error and version constant are removed.
Remove runtime mismatch handling
Sources/Nehir/IPC/*.swift
Request handling no longer compares protocol versions; version and capabilities results expose only the app version.
Adjust CLI output handling
Sources/NehirCtl/CLIRenderer.swift
CLI status, version, and capabilities rendering no longer includes protocol version information.
Align validation and documentation
Tests/NehirTests/*.swift, docs/*.md, .changeset/*.md
Mismatch tests are removed or updated, IPC documentation reflects the revised wire format, and the breaking change is recorded.

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

Suggested reviewers: copilot

Sequence Diagram(s)

sequenceDiagram
  participant IPCClient
  participant IPCApplicationBridge
  participant IPCQueryRouter
  IPCClient->>IPCApplicationBridge: Send request without protocol version
  IPCApplicationBridge->>IPCQueryRouter: Request version or capabilities
  IPCQueryRouter-->>IPCApplicationBridge: Return appVersion
  IPCApplicationBridge-->>IPCClient: Return response without protocol version
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% 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
Title check ✅ Passed The title matches the main change: removing IPC version handling and marking the protocol unstable.
Description check ✅ Passed The description follows the template with all required sections present and a clear summary of the change.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch worktree/brave-field-2950

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.

@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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
docs/ARCHITECTURE.md (1)

882-883: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Remove the stale "version": 6 field from this flow example.

The request example immediately above still shows the removed top-level version field at Line 876, while this updated flow says authorization is the only check. This contradicts the new contract and docs/IPC-CLI.md.

🤖 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 `@docs/ARCHITECTURE.md` around lines 882 - 883, Update the flow example
surrounding “verifies authorization token” in docs/ARCHITECTURE.md by removing
the stale top-level "version": 6 field from the request example above it,
leaving authorization as the only check and keeping the remaining flow
unchanged.
Tests/NehirTests/IPCModelsTests.swift (1)

81-82: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Add negative assertions for the removed fields.

These deletions remove checks for obsolete symbols but do not verify the new contract. Assert that encoded request, response, and event envelopes omit version (and that version results omit protocolVersion) so a future reintroduction of those fields fails tests.

🤖 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 `@Tests/NehirTests/IPCModelsTests.swift` around lines 81 - 82, Add negative
JSON assertions to publicDTOsRoundTripThroughJSON for request, response, and
event envelopes, verifying encoded output omits version and version results omit
protocolVersion. Ensure the assertions fail if any removed field is reintroduced
while preserving the existing round-trip checks.
🤖 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 `@docs/IPC-CLI.md`:
- Around line 182-184: Update the fenced code block containing the `nehirctl
version --json` example to specify an appropriate language identifier,
preferably `sh` (or `text`), while preserving the command unchanged.

---

Outside diff comments:
In `@docs/ARCHITECTURE.md`:
- Around line 882-883: Update the flow example surrounding “verifies
authorization token” in docs/ARCHITECTURE.md by removing the stale top-level
"version": 6 field from the request example above it, leaving authorization as
the only check and keeping the remaining flow unchanged.

In `@Tests/NehirTests/IPCModelsTests.swift`:
- Around line 81-82: Add negative JSON assertions to
publicDTOsRoundTripThroughJSON for request, response, and event envelopes,
verifying encoded output omits version and version results omit protocolVersion.
Ensure the assertions fail if any removed field is reintroduced while preserving
the existing round-trip checks.
🪄 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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c8db6af9-9548-4cab-9a48-4c17260646cb

📥 Commits

Reviewing files that changed from the base of the PR and between 7bcd1b3 and 299d031.

📒 Files selected for processing (10)
  • .changeset/20260728221243-remove-the-ipc-protocol-version-field-and-docume.md
  • Sources/Nehir/IPC/IPCApplicationBridge.swift
  • Sources/Nehir/IPC/IPCQueryRouter.swift
  • Sources/NehirCtl/CLIRenderer.swift
  • Sources/NehirIPC/IPCModels.swift
  • Tests/NehirTests/CLIRendererTests.swift
  • Tests/NehirTests/IPCModelsTests.swift
  • Tests/NehirTests/IPCServerTests.swift
  • docs/ARCHITECTURE.md
  • docs/IPC-CLI.md
💤 Files with no reviewable changes (2)
  • Tests/NehirTests/CLIRendererTests.swift
  • Tests/NehirTests/IPCServerTests.swift

Comment thread docs/IPC-CLI.md
Comment on lines +182 to +184
```
nehirctl version --json
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Specify the fenced-block language.

Use ```sh (or ```text) for the nehirctl version --json example to satisfy Markdown linting.

🧰 Tools
🪛 markdownlint-cli2 (0.23.1)

[warning] 182-182: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 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 `@docs/IPC-CLI.md` around lines 182 - 184, Update the fenced code block
containing the `nehirctl version --json` example to specify an appropriate
language identifier, preferably `sh` (or `text`), while preserving the command
unchanged.

Source: Linters/SAST tools

@Guria

Guria commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator Author

@coderabbitai stop

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

@Guria: Pausing automatic reviews for this PR.

✅ Action performed

Reviews paused.

@Guria
Guria force-pushed the worktree/brave-field-2950 branch from 299d031 to 1fb1df3 Compare July 28, 2026 21:22
@Guria
Guria merged commit 38503d9 into main Jul 28, 2026
3 checks passed
@Guria
Guria deleted the worktree/brave-field-2950 branch July 28, 2026 21:23
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