Skip to content

fix(jcode-transport): correct the Windows pipe-name fallback stem assertion - #163

Closed
KooshaPari wants to merge 2 commits into
masterfrom
fix/transport-pipe-fallback-stem
Closed

KooshaPari wants to merge 2 commits into
masterfrom
fix/transport-pipe-fallback-stem

Conversation

@KooshaPari

@KooshaPari KooshaPari commented Oct 21, 2026 •

Copy link
Copy Markdown
Owner

User description

Summary

path_to_pipe_name falls back to the stem kcode, but pipe_name_falls_back_when_stem_is_empty asserted a jcode- prefix. The assertion could never pass.

Derivation

  1. Path::new("...").file_stem() returns Some("..").
  2. The character filter keeps only ASCII alphanumerics, - and _, so both dots are dropped and the stem becomes empty.
  3. The empty branch yields the fallback kcode.
  4. Production output is \\.\pipe\kcode-<hash>; the test asserted jcode-.

Why it is latent

  • crates/jcode-transport/src/lib.rs gates the module with #[cfg(windows)].
  • The windows-build-test job in ci.yml is pinned if: false (hosted Actions minutes are capped at $0).
  • windows-smoke.yml is workflow_dispatch-only and does not run on pull requests.

It would have failed the moment either Windows path was re-enabled.

Not changed (deliberately)

pipe_name_matches_the_typescript_sdk is left untouched. Rust file_stem() and Node path.win32.parse(p).name agree on both pinned literals (jcode-api and jcode), and those stems are user-visible socket names that are intentionally still jcode on the TypeScript side. Renaming them to kcode would break the cross-language parity contract and is out of scope. Only the fallback branch is kcode.

The TypeScript SDK already agrees: sdk/typescript/src/sockets.ts uses || "kcode" and sdk/typescript/test/pipe-name.test.ts asserts kcode-.

Scope

One line, one file: crates/jcode-transport/src/windows.rs.

Closes #162


CodeAnt-AI Description

Correct the Windows pipe-name fallback test

What Changed

  • The Windows test for paths with an empty usable stem now expects the existing kcode- fallback.

Impact

✅ Windows fallback tests match generated pipe names

💡 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
Copilot AI balanced review requested due to automatic review settings October 21, 2026 05:03
@codeant-ai

codeant-ai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

CodeAnt  CodeAnt Review Status

✅  Review completed

Status Commit Started (UTC) Finished (UTC)
✅  #a2a66 Incremental review completed 38aee77 Nov 03, 2026 · 07:23 07:24
✅  Reviewed your PR 145df90 Oct 21, 2026 · 05:04 05:07

@codeant-ai

codeant-ai Bot commented Oct 21, 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

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 Oct 21, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

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 57 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: 1be5b1e0-8640-4842-82d6-fcec88e174fc
Commits

Reviewing files that changed from the base of the PR and between 145df90 and 38aee77.

Files selected for processing: 1
  • crates/jcode-transport/src/windows.rs

No actionable comments were generated in the recent review.

Summary

Summary

The PR corrects the Windows fallback test to expect the kcode- prefix produced by path_to_pipe_name.

The change preserves the existing jcode parity literals and public APIs.

Must Fix

None identified.

Should Fix

None identified.

Consider

Windows test results were not supplied. Windows CI is currently inactive.

Approve / Request Changes

Approve.

The empty-stem Windows pipe-name test now expects the kcode- prefix used by the production fallback.

Changes: Windows pipe-name fallback

Layer / File(s) Summary
Align fallback test expectation
crates/jcode-transport/src/windows.rs
The empty-stem test now expects a pipe name beginning with \\.\pipe\kcode- instead of \\.\pipe\jcode-.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Bug fix · Severity of issue fixed: Low

Suggested reviewers: 1jehuang

Merge Risk: Minimal · previous review 145df

No actionable merge-blocking risk remains.

Architecture risk: Low · up to 145df

The change affects 1 system.

Changed systems: crates

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — crates (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in crates/jcode-transport/src/windows.rs: The pipe_name_falls_back_when_stem_is_empty test now expects the fallback pipe name to begin with \\.\pipe\kcode- instead of \\.\pipe\jcode-.
Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly and concisely describes the correction to the Windows pipe-name fallback stem assertion.
Description check Passed The description directly explains the incorrect fallback assertion, the one-line scope, and the preserved cross-language behavior.
Linked Issues check Passed Issue #162 requires the empty-stem Windows test to expect the kcode- fallback. The whole-PR diff changes pipe_name_falls_back_when_stem_is_empty from \\\\.\\pipe\\jcode- to \\\\.\\pipe\\kcode- in `cra…
Out of Scope Changes check Passed The whole-PR diff contains one assertion update in the file required by issue #162. The change directly aligns the test with the existing production fallback and introduces no unrelated source, parity…
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files.
Full details: Linked Issues check

Explanation

Issue #162 requires the empty-stem Windows test to expect the kcode- fallback. The whole-PR diff changes pipe_name_falls_back_when_stem_is_empty from \\.\pipe\jcode- to \\.\pipe\kcode- in crates/jcode-transport/src/windows.rs. The diff does not change the parity test or any TypeScript files.

Full details: Out of Scope Changes check

Explanation

The whole-PR diff contains one assertion update in the file required by issue #162. The change directly aligns the test with the existing production fallback and introduces no unrelated source, parity, or TypeScript changes.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
✨ Simplify code
  • Commit to this branch
  • Create a new PR
  • 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

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: c1133174-2fb5-42a8-8989-30fe37b521dc
📥 Commits

Reviewing files that changed from the base of the PR and between 2aea04d and 145df90.

📒 Files selected for processing: 1
  • crates/jcode-transport/src/windows.rs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📜 Recent review details
⏰ Context from checks skipped due to timeout: 9
  • GitHub Check: Require Linked Issue
  • GitHub Check: Build & Test (desk-linux)
  • GitHub Check: TypeScript SDK
  • GitHub Check: Windows Cross-Target Check (Linux)
  • GitHub Check: Format
  • GitHub Check: Release Automation
  • GitHub Check: Quality Guardrails
  • GitHub Check: Kilo Code Review
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments: 1
crates/jcode-transport/src/windows.rs: 1

487-487: LGTM!

@codeant-ai codeant-ai Bot added the size:XS This PR changes 0-9 lines, ignoring generated files label Oct 21, 2026
@codeant-ai

codeant-ai Bot commented Oct 21, 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: 38aee770e9b5

@kilo-code-bot

kilo-code-bot Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Code Review Summary

Status: No Issues Found | Recommendation: Merge

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

Reviewed by free · Input: 42.8K · Output: 879 · Cached: 285.1K

KooshaPari added a commit that referenced this pull request Oct 21, 2026
…olved conflicts

The recomputed residuals (recomputed against origin/master 2aea04d
via git merge-tree --write-tree) now cover 12 open PRs in the KCode
stack. The four PRs previously flagged as needing hand-resolved
conflicts (#140, #127, #157, #158) have already been merged against
origin/master by a parallel agent as real 2-parent merge commits at
d6e4cfa, b6508e6, 264c09a, and 47b42e2 respectively; merge-tree
reports zero conflict markers for all four. Two new PRs (#163 transport
pipe-stem, #164 CI timeout headroom) extend the stack to 12.

The CI Quality Guardrails clippy gate has a coverage gap that no
existing PR fixes: the command is 'cargo clippy --all-targets
--all-features -- -D warnings' with no --workspace, so exactly one
workspace member (jcode-sdk) is unreachable from the root package and
is never linted. In the green run id 39390720989 the cargo test -p
jcode-sdk parity step still emitted the 'never used' warning for the
Subscriber alias at crates/jcode-sdk/src/client.rs:330. The --workspace
change is NOT a no-op and may surface additional pre-existing
violations; this is recorded as an OPEN RISK, not a resolved fact.

The KCode self-hosted runner desk-kcode-1 wedged on 2026-10-21 in the
Build & Test (desk-linux) job of run 39530002307. Root cause: the
desk WSL2 instance is capped by .wslconfig at memory=16GB (not the
64GB the Windows host has), was competing with a 1h43m orphaned
cargo llvm-cov --workspace job, and the Build step in
.github/workflows/ci.yml has no per-step run_with_timeout.py wrapper.
Remediation (terminating the orphan) brought memory from 13.9/16 GB to
9.4/16 GB and recovered the runner.

Detailed conflict resolutions and the runner wedge root-cause analysis
moved to a new companion file 05a_MERGE_EVIDENCE.md so the plan itself
fits the 500-line cap.

tx-agent: jcode
tx-validated: manual
tx-scope: docs/sessions/2026-10-19-orchestration-governance/
tx-intent: Refresh the merge plan against recomputed 12-PR residuals + 4 applied conflict resolutions + clippy coverage gap + runner wedge
@sonarqubecloud

sonarqubecloud Bot commented Nov 3, 2026

Copy link
Copy Markdown

@KooshaPari

Copy link
Copy Markdown
Owner Author

Closing under the host-ops closure audit (2026-11-11): 21 days old with failing checks; not landable as-is. The branch fix/transport-pipe-fallback-stem is preserved on the remote, so the work is recoverable with git fetch origin fix/transport-pipe-fallback-stem or by reopening this PR. Nothing was deleted.

@KooshaPari KooshaPari closed this Nov 11, 2026
KooshaPari added a commit that referenced this pull request Nov 28, 2026
… plan (#375)

* docs(sessions): add cross-harness orchestration governance proposal

Proposes 4 enforcement mechanisms for the "Always Subagent — main context is management-only" operator directive (2026-10-11 21:08); records the 2026-10-19 manual cross-harness propagation of the rule to all 4 derivative AGENTS.md copies (codex, forge, kcode, helioslite); lists operator-approved next steps (none yet; each mechanism awaiting decision).

tx-agent: jcode
tx-validated: manual
tx-task: governance-2026-10-19
tx-scope: docs/sessions/2026-10-19-orchestration-governance
tx-intent: capture the cross-harness propagation decision + enforcement backlog in the repo

* docs(sessions): add fix-forward merge integration plan for the KCode PR stack

tx-agent: jcode
tx-validated: manual
tx-task: governance-2026-10-19
tx-scope: docs/sessions/2026-10-19-orchestration-governance
tx-intent: give the operator a no-force-push merge order for PRs #152/#127/#140/#148/#129/#132/#134/#150/#145

* docs(ci): rebuild the merge integration plan against master 2aea04d

tx-agent: jcode
tx-validated: manual
tx-task: 143
tx-scope: docs/sessions/2026-10-19-orchestration-governance
tx-intent: replace the stale 2026-10-19 PR stack plan with one built from current master ground truth

* docs(ci): rebuild the merge integration plan against master 2aea04d

tx-agent: jcode
tx-validated: manual
tx-task: 143
tx-scope: docs/sessions/2026-10-19-orchestration-governance
tx-intent: replace the stale 2026-10-19 PR stack plan with one built from current master ground truth

* docs(merge): refresh the merge plan with the recomputed stack and resolved conflicts

The recomputed residuals (recomputed against origin/master 2aea04d
via git merge-tree --write-tree) now cover 12 open PRs in the KCode
stack. The four PRs previously flagged as needing hand-resolved
conflicts (#140, #127, #157, #158) have already been merged against
origin/master by a parallel agent as real 2-parent merge commits at
d6e4cfa, b6508e6, 264c09a, and 47b42e2 respectively; merge-tree
reports zero conflict markers for all four. Two new PRs (#163 transport
pipe-stem, #164 CI timeout headroom) extend the stack to 12.

The CI Quality Guardrails clippy gate has a coverage gap that no
existing PR fixes: the command is 'cargo clippy --all-targets
--all-features -- -D warnings' with no --workspace, so exactly one
workspace member (jcode-sdk) is unreachable from the root package and
is never linted. In the green run id 39390720989 the cargo test -p
jcode-sdk parity step still emitted the 'never used' warning for the
Subscriber alias at crates/jcode-sdk/src/client.rs:330. The --workspace
change is NOT a no-op and may surface additional pre-existing
violations; this is recorded as an OPEN RISK, not a resolved fact.

The KCode self-hosted runner desk-kcode-1 wedged on 2026-10-21 in the
Build & Test (desk-linux) job of run 39530002307. Root cause: the
desk WSL2 instance is capped by .wslconfig at memory=16GB (not the
64GB the Windows host has), was competing with a 1h43m orphaned
cargo llvm-cov --workspace job, and the Build step in
.github/workflows/ci.yml has no per-step run_with_timeout.py wrapper.
Remediation (terminating the orphan) brought memory from 13.9/16 GB to
9.4/16 GB and recovered the runner.

Detailed conflict resolutions and the runner wedge root-cause analysis
moved to a new companion file 05a_MERGE_EVIDENCE.md so the plan itself
fits the 500-line cap.

tx-agent: jcode
tx-validated: manual
tx-scope: docs/sessions/2026-10-19-orchestration-governance/
tx-intent: Refresh the merge plan against recomputed 12-PR residuals + 4 applied conflict resolutions + clippy coverage gap + runner wedge
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