Repository navigation
fix(tests): use CARGO_BIN_EXE_kcode in cli_exit_status.rs - #152
Conversation
…on test The root package's binary target is named `kcode` (`[[bin]] name = "kcode"`, path = src/main.rs); the library target is named `jcode` (`[lib] name = "jcode"`). cargo sets CARGO_BIN_EXE_<NAME> per BIN TARGET NAME, so CARGO_BIN_EXE_jcode is not defined at compile time. The fork's home env var is KCODE_HOME (see crates/jcode-storage/src/lib.rs::jcode_dir), and the CLI's clap command name is "kcode" (src/cli/args.rs:30 #[command(name = "kcode")]), so the version banner starts with "kcode ". Align this test with the fork's reality. PR #129 attempted the same fix using std::env::var("CARGO_BIN_EXE_jcode"), but CARGO_BIN_EXE_* is a compile-time cargo variable, never present at runtime; that form will fail at runtime with "environment variable not found". The correct form is env!("CARGO_BIN_EXE_kcode"). tx-agent: jcode tx-validated: test tx-task: cli-exit-status-kcode-bin tx-intent: unblock tests/cli_exit_status.rs compile on master after the kcode bin rename
Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
|
Warning Review limit reachedYou'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 58 minutes. View limit details
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. CodeRabbit Verify
|
| .env("HOME", root.path()) | ||
| .env("JCODE_HOME", root.path().join("jcode")) | ||
| .env("KCODE_HOME", root.path().join("kcode")) | ||
| .env("JCODE_NO_TELEMETRY", "1") |
There was a problem hiding this comment.
WARNING: Fork-residue env var not updated
Source code reads KCODE_NO_TELEMETRY (see crates/jcode-telemetry-core/src/lib.rs), and no source reads JCODE_NO_TELEMETRY. Leaving JCODE_NO_TELEMETRY here is inert and inconsistent with the rest of the fork.
| .env("JCODE_NO_TELEMETRY", "1") | |
| .env("KCODE_NO_TELEMETRY", "1") |
Code Review SummaryStatus: 1 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Files Reviewed (1 files)
Fix these issues in Kilo Cloud Reviewed by free · Input: 63.6K · Output: 1.5K · Cached: 154.3K |
|
… 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



User description
Closes #151
Summary
tests/cli_exit_status.rsonmasterdoes not compile after thejcode->kcodebin-target rename because it referencesenv!("CARGO_BIN_EXE_jcode"), which cargo does not define. This PRfixes that by using the correct compile-time variable,
env!("CARGO_BIN_EXE_kcode"), and brings the rest of the file in linewith the fork's CLI reality (
KCODE_HOME,kcodeversion banner).Root cause
The root package has both a library target and a binary target:
cargosetsCARGO_BIN_EXE_<NAME>per bin target name. Because thebinary is
kcodeand the library isjcode,CARGO_BIN_EXE_jcodedoesnot exist and
env!("CARGO_BIN_EXE_jcode")is a compile-time error.Every other integration test in the repo already uses the correct
spelling (
tests/e2e/binary_integration.rs,tests/api_stdio_cli.rs,tests/e2e/windows_lifecycle.rs).The fork residue in the same file also affects two assertions:
JCODE_HOME->KCODE_HOME(canonical fork env var; the onlyJCODE_HOMEreference insrc/andcrates/is this broken test).See
crates/jcode-storage/src/lib.rs::jcode_dir, which readsstd::env::var("KCODE_HOME"), andcrates/jcode-build-support/src/paths.rs,which reads
KCODE_HOME..starts_with("jcode ")->.starts_with("kcode ")becausesrc/cli/args.rs:30declares#[command(name = "kcode")], so theversion banner starts with
"kcode ".Fix
Four line changes in one file. No other files touched. Scope held tight
to the bin-target rename and the three obvious fork-residue assertions.
Validation
cargo test --test cli_exit_status --no-run-> exit 0. The testbinary compiles successfully (it did not compile on
master).cargo test --test cli_exit_status-> 2 passed, 2 FAILED on macOS.The two failures are caused by
self_heal_macos_code_signature()(
src/main.rs:156) running unconditionally on macOS and leakingxattr/codesignoutput into the spawned process's stderr, whichbreaks the
output.stderr.is_empty()assertion inhelp_exits_successfully_on_stdoutandversion_exits_successfully_on_stdout.This is a separate fork-introduced macOS stderr leak unrelated to the
bin-target rename and is intentionally left out of scope. Linux CI is
unaffected.
cargo fmt --all -- --check-> 9 files in master have rustfmt drift,none of them
tests/cli_exit_status.rs. Per the pre-existinginvestigation, those 9 files belong to PR fix(ci): clear repo-wide rustfmt drift + env! macro in cli_exit_status #129 / a follow-up fmt pass.
Relationship to PR #129
PR #129 (
fix/repo-ci-pre-existing-drift) attempted the same fix in thisfile by changing
env!("CARGO_BIN_EXE_jcode")tostd::env::var("CARGO_BIN_EXE_jcode").expect("CARGO_BIN_EXE_jcode").That conversion is incorrect at runtime:
CARGO_BIN_EXE_*is acompile-time cargo variable for integration test targets, never a
runtime environment variable. The
std::env::var(...)form would fail atruntime with "environment variable not found". This PR supersedes that
approach for
tests/cli_exit_status.rsby using the correct variablename (
CARGO_BIN_EXE_kcode) and keeping it as a compile-timeenv!().Ledger trailers
CodeAnt-AI Description
Align CLI exit-status checks with kcode's environment and version output
What Changed
KCODE_HOMEand check that invalid commands do not create kcode application statekcodebannerImpact
✅ CLI exit-status tests match kcode behavior✅ Version output checks reflect the kcode name💡 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:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
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:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
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.