Skip to content

fix(jcode-transport): assert the kcode- pipe prefix production actually uses - #343

Merged
KooshaPari merged 3 commits into
masterfrom
fix/transport-pipe-fallback-stem
Nov 24, 2026
Merged

KooshaPari merged 3 commits into
masterfrom
fix/transport-pipe-fallback-stem

Conversation

@KooshaPari

@KooshaPari KooshaPari commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

User description

Closes #162

What

crates/jcode-transport/src/windows.rs has one test, pipe_name_falls_back_when_stem_is_empty, that asserted the named-pipe prefix \\\\.\\pipe\\jcode-. Production path_to_pipe_name falls back to the literal stem kcode (both the unwrap_or and the empty-stem branch), so the assertion could only ever fail on Windows. This is the single remaining line of the branch after syncing master.

Evidence

git show origin/master:crates/jcode-transport/src/windows.rs | sed -n '13,23p'
    .unwrap_or("kcode")
...
    let stem = if stem.is_empty() { "kcode" } else { &stem };

Residual diff against current master is exactly:

-            name.starts_with(r"\\.\pipe\jcode-"),
+            name.starts_with(r"\\.\pipe\kcode-"),

Validation

  • git diff --name-only --diff-filter=U after merging master: 0 conflicts.
  • git diff origin/master HEAD: 1 file, 1 insertion, 1 deletion.
  • NOT_RUN for the test itself: crates/jcode-transport/src/windows.rs is Windows-only (tokio::net::windows::named_pipe), and this repository's windows-latest CI job is SKIPPED, so no runner exercises it. Linux CI can only prove the crate still builds. Stated rather than claimed as green.

tx-agent: jcode
tx-validated: none
tx-scope: crates/jcode-transport, windows named-pipe test
tx-intent: land the one real line of the pipe-name fallback branch, closing #162


CodeAnt-AI Description

Correct the Windows pipe fallback test expectation

What Changed

  • The Windows test now expects the kcode- prefix produced when a pipe name has an empty stem.

Impact

✅ Accurate Windows pipe fallback validation

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

`path_to_pipe_name` falls back to the stem "kcode" (both via
`unwrap_or("kcode")` and via the empty-after-filter branch), but
`pipe_name_falls_back_when_stem_is_empty` asserted a "jcode-" prefix.

Trace: `Path::new("...").file_stem()` == `Some("..")`; the character
filter keeps only ASCII alphanumerics, '-' and '_', so both dots are
dropped and the string is empty; the empty branch then yields "kcode".
The assertion therefore could never pass.

The defect was latent: `lib.rs` gates the module with `#[cfg(windows)]`,
so the test only compiles on Windows, and the `windows-build-test` job
in ci.yml is pinned `if: false` while `windows-smoke.yml` is
workflow_dispatch-only. It would have failed the moment either was
re-enabled.

`pipe_name_matches_the_typescript_sdk` is left untouched: Node's
`path.win32.parse(p).name` (basename minus extension) and Rust's
`file_stem()` agree on both pinned literals ("jcode-api" and "jcode"),
and both pinned hashes were independently reproduced. The user-visible
socket names stay "jcode"; only the fallback is "kcode".

tx-agent: jcode
tx-validated: none
tx-scope: crates/jcode-transport
tx-intent: fix a Windows-only test assertion that could never pass
tx-agent: jcode
tx-validated: none
tx-scope: transport-pipe-fallback-stem
tx-lane: jcode:session_iwazaru_1795472450499_bcf77f2c366985f8
Copilot AI balanced review requested due to automatic review settings November 24, 2026 00:35
@codeant-ai

codeant-ai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

CodeAnt  CodeAnt Review Status

✅  Review completed

Status Commit Started (UTC) Finished (UTC)
✅  #56a61 Reviewed your PR b17c59f Nov 24, 2026 · 00:35 00:36

@codeant-ai

codeant-ai Bot commented Nov 24, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@coderabbitai

coderabbitai Bot commented Nov 24, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 20 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: b0a267fa-2b86-40ff-be58-9ee7fd5625a0
Commits

Reviewing files that changed from the base of the PR and between c129e15 and b17c59f.

Files selected for processing: 1

  • crates/jcode-transport/src/windows.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

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 insufficient remaining quota. Try requesting a review at a lower effort level.

@codeant-ai codeant-ai Bot added the size:XS This PR changes 0-9 lines, ignoring generated files label Nov 24, 2026
@kilo-code-bot

kilo-code-bot Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Overview

The PR changes a single line in crates/jcode-transport/src/windows.rs: the pipe_name_falls_back_when_stem_is_empty test assertion was corrected from jcode- to kcode- to match the actual production fallback behavior in path_to_pipe_name.

The change is correct: path_to_pipe_name falls back to the stem "kcode" both via .unwrap_or("kcode") (line 17) and via the empty-after-filter branch (line 22). When Path::new("...") is passed, file_stem() returns Some(".."), filtering drops both dots, and the empty stem yields "kcode". The previous jcode- expectation could never pass.

No inline comments required. The PR is a one-line test fix, Windows-only (#[cfg(windows)]), and does not affect any other code.

Files Reviewed (1 files)
  • crates/jcode-transport/src/windows.rs - 0 issues

Reviewed by free · Input: 49.1K · Output: 4.2K · Cached: 151.8K

@codeant-ai

codeant-ai Bot commented Nov 24, 2026

Copy link
Copy Markdown

CodeAnt  CodeAnt PR Risk

🟢  Low Risk

  • The PR appears safe to merge; no actionable issues were identified in the review.

Assessed commit: b17c59f12a04

@sonarqubecloud

Copy link
Copy Markdown

@KooshaPari
KooshaPari merged commit 0b31bd3 into master Nov 24, 2026
23 checks passed
@KooshaPari
KooshaPari deleted the fix/transport-pipe-fallback-stem branch November 24, 2026 01:03
@KooshaPari
KooshaPari restored the fix/transport-pipe-fallback-stem branch November 25, 2026 11:38
@KooshaPari
KooshaPari deleted the fix/transport-pipe-fallback-stem branch November 26, 2026 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(jcode-transport): Windows pipe-name fallback test asserts a 'jcode-' prefix that production never produces

2 participants