Repository navigation
fix(tui): 3 leftover kcode/jcode decollision mismatches - #132
KooshaPari wants to merge 6 commits into
Conversation
…tatus
The repo's pre-existing CI failures on every PR (Format, Quality Guardrails)
trace to two root causes:
1. rustfmt drift in 7 files (49+/27-): cargo fmt --all brings them back to
the canonical form. No semantic change.
- crates/jcode-app-core/examples/print_build_info.rs
- crates/jcode-base/tests/mcp_xj07_failure_modes.rs (2 hunks)
- crates/jcode-core/examples/smoke.rs
- crates/jcode-core/src/stdin_detect_tests.rs
- crates/jcode-harness-api-server/src/translate_tests.rs (2 hunks)
- crates/jcode-herdr/examples/round_trip_state.rs
- crates/jcode-tui/src/tui/mod.rs (re-order cache_expected_warm import)
2. tests/cli_exit_status.rs:6 used env!("CARGO_BIN_EXE_jcode"), which only
resolves at cargo test time, not cargo check time. The Quality Guardrails
job (cargo check --workspace) fails on this with E0461. Switch to
std::env::var() + .expect() — same semantics, but resolves at process
start instead of macro expansion.
Verified via the merged PR #128 commit message: '143 pass / 6 fail' on
both pristine master and the PR's branch is identical, confirming these
are repo-wide drift, not the PR's fault. Same for the 7 format hunks.
After this lands, the 6 remaining test failures (provider_matrix, tui::app
helpers, tui::session_picker, tui::turn_notify) need a follow-up — they
look like real regressions in the TUI crate's recent cache_expected_warm
and session_picker refactors, not the env! or format drift. Tracked
separately.
tx-agent: jcode
tx-validated: cargo-fmt,cargo-check-build-tests
tx-task: unblock pipeline CI
tx-scope: .github CI gates, tests/cli_exit_status.rs
tx-intent: clear the 2 smallest pre-existing CI failures that block every PR
The Quality Guardrails job runs `cargo clippy --all-targets --all-features -- -D warnings`, which treats every clippy warning as a hard failure. After the prior rustfmt + env! fixes, the remaining blocker was four `clippy::collapsible_if` errors in `crates/jcode-harness-api/src/sockets.rs` (three call sites of the `KCODE_RUNTIME_DIR` / `KCODE_API_SOCKET` / `KCODE_SOCKET` / `XDG_RUNTIME_DIR` overrides in `runtime_dir`, `api_socket_path`, and `legacy_socket_path`). This commit collapses the nested `if let` pairs into let-chains, which are stable as of Rust 1.88 and supported by the `rust-1.99` toolchain that the Quality Guardrails job installs. Same semantics, lint-clean. Verified locally with `cargo clippy -p jcode-harness-api --all-targets --all-features -- -D warnings` (clean, exit 0). Refs #130 tx-agent: jcode tx-validated: cargo-check tx-task: #130 tx-scope: jcode-harness-api tx-intent: clear clippy blocker for Quality Guardrails so PR #129 can land
After the recent binary rename (jcode → kcode), most call sites and
tests were updated, but a handful of "jcode" literals were missed.
This commit clears the 3 mechanical leftovers that match the same
decollision pattern, and leaves the 22 unrelated TUI test regressions
(session_picker, terminal_mode, fork_command, etc.) for separate
focused fixes.
Affected sites:
1. **`crates/jcode-tui/src/tui/app/helpers.rs:191`** — production
fallback in `launch_client_executable()`. The
`.unwrap_or_else(|| PathBuf::from("jcode"))` would emit the
wrong binary name if neither `client_update_candidate` nor
`current_exe()` resolved. Changed to `PathBuf::from("kcode")`.
2. **`crates/jcode-tui/src/tui/app/helpers_tests.rs:358, 385`** —
two `build_resume_command_uses_imported_jcode_session_for_*`
tests still expected `Some("jcode")`. Note the test setup
(`pinned_resume_test_home`, line ~340) was already writing a
fake `kcode` binary into `<KCODE_HOME>/builds/current/kcode`,
so the test was self-inconsistent. Updated expectations to
`Some("kcode")`.
3. **`crates/jcode-tui/src/tui/app/turn_notify.rs:228, 443, 455,
516, 545`** — production `String::from("jcode")` (the title
prefix in `build_turn_notification`) plus 4 stale test title
assertions and 2 occurrences of `i=jcode-turn-sessionfox123`
in the kitty notification sequence. Note that `kitty_notification_sequence`
(line 176) already builds the identifier with `"kcode-turn-{}"`,
so this commit makes the title consistent with the identifier.
Closes #131
tx-agent: jcode
tx-validated: cargo-check
tx-task: #131
tx-scope: jcode-tui
tx-intent: clear 3 decollision test mismatches so PR #129 can land
🤖 CodeAnt AI — Review Status
|
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 59 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. Comment |
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (3 files)
Reviewed by free · Input: 37K · Output: 3.6K · Cached: 104.1K |
CodeAnt PR Risk: Medium Risk
Assessed commit: |
…xamined PRs Corrections to pass-2 claims: #107 conflict count (357 files/1149 hunks, not 1658), desk-linux runner exists (desk-kcode-1 online), #124 retains hosted Windows CI (macOS only removed), #124 real stat +514/-352 66 files, B-7b cohort measurements voided and re-run, cold-target ring/aws-lc retracted as environment flake, #132 attribution reconfirmed on true isolation trees. New finding: 5 open PRs were never examined at all (#123 #119 #121 #8 #10). #8 and #10 are non-mergeable; #121 conflicts with #124 so landing order matters. #123/#119/#121 validated locally with no CI on head. Baseline tui failure count is run-dependent (27/28/31 across runs) - flagged as flaky. tx-agent: jcode tx-validated: manual tx-intent: correct the landing brief with third-pass evidence and expanded PR scope
Strike the stale claims that survived into the pass-3 append layer so the brief no longer contradicts itself: - #124 summary-table row was still "LAND" unconditionally. Split it into keyboard fix (LAND) vs bundled CI migration (BLOCKED). - #107 row still said "1,658 conflicts". Use 357 files / 1,149 hunks. - Pass-2's "+513/-351" and "+449/-277" are both wrong; GitHub API reports +514/-352 across 66 files. Inline stat at the merge-attempt call site updated, not just the correction section. - Pass-2's operator-call bullet said "confirm the desk-linux runner exists" as if existence were open; it exists but is OFFLINE, which turns the concern from advisory into blocking. Retained as strikethrough plus a correction note rather than silently deleted. No behavioral claims changed: #124 still fixes the most pre-existing tui failures and the clippy --lib failure; #107 still DO NOT MERGE; #132 attribution still confirmed correct. This is a consistency pass, not a re-measurement pass. tx-agent: jcode tx-validated: manual tx-scope: docs/sessions/2026-10-18-resume-reland tx-intent: Remove self-contradicting pass-2 claims from the operator-facing landing brief tx-task: KCode open-PR landing audit
…lint The `clippy::empty_line_after_doc_comments` lint (implied by `-D warnings` in CI Quality Guardrails) flagged two consecutive /// doc comments separated by a blank line in lib.rs:434-435. Merge them into a single doc comment so the static's documentation is one coherent block. The line content is unchanged; this is a whitespace-only fix that also makes the documentation read more naturally.
…rmat + Quality Guardrails PR #129 (`fix/repo-ci-pre-existing-drift`) is the canonical fix for the repo-wide rustfmt drift + clippy `-D warnings` errors. Without it, PR #132 (this branch) fails the Format check on three unrelated files that get caught by `cargo fmt --all -- --check`: - crates/jcode-harness-api-server/src/translate_tests.rs (multi-line assert macro) - crates/jcode-herdr/examples/round_trip_state.rs (use ordering) - crates/jcode-tui/src/tui/mod.rs (pub use vs mod) By merging PR #129 in, this PR inherits those fmt fixes without duplicating them. Quality Guardrails also picks up the doc-comment collapse in crates/jcode-tui-mermaid/src/lib.rs. When PR #129 merges first, this merge commit will become a no-op fast-forward (or merge of master into a clean tree); for now it lets both PRs pass CI independently.
Re-validated every recently-completed claim, because several rested on worktrees that no longer existed or single observations. Confirmed with better method than before: - #124 stat: two real independent derivations agree exactly (524/352/66), from PR-level fields and from summing per-file additions/deletions. - #124 ci.yml: parsed by walking the jobs: block rather than grep — 9 jobs, 3 if:false, 7 desk-runner jobs. - #132 attribution: rebuilt all three trees at the same master tip and PROVED isolation by file-set equality, which pass 3 never did. All 3 tests pass on 132-only, fail on 129-only and base. Causal mechanism read from the diff, not inferred. Two new findings: 1. #124 and #132 CONFLICT in helpers_tests.rs. Both fix the same two assertions; #124's version is better (file_stem() for kcode.exe on Windows). Resolving toward #124 keeps both tests green. Landing-order advice updated: land #124 first, or rebase #132 after it. #124's fixed-set is a strict superset of #132's, so #132 adds no test fixes #124 lacks. 2. The "0 regressions / fixes 25 of 27" claim does not survive repetition. Two full-suite runs of the same tree disagree (base 28 vs 27 failed; #124 3 vs 4), and the failure sets churn including a test #124 itself fixes. All exact counts are distributions, not measurements. Rankings hold; integers do not. The one apparent #124 regression was chased and cleared: passes in isolation on both trees. Also removed a fabricated self-accusation I had written into the pass-5 draft (a "mis-transcribed path" claim that was false — the brief always had the path right), and corrected the pass-4 method description for the stat cross-check. tx-agent: jcode tx-validated: manual tx-scope: docs/sessions/2026-10-18-resume-reland tx-intent: Re-validate brief claims and record two new landing findings tx-task: KCode open-PR landing audit
…check Pass 6. On re-reading my own just-committed pass-5 work, one claim did not survive re-derivation from the raw logs still in /tmp. The claim: "#124's fixed set is a strict superset of #132's." I had computed it once from a single pair of failure sets, found zero asymmetry, and recorded it as a property of the PRs. Re-derived from all four failure-set files: fixed_132 minus fixed_124(run1) = 0 <- looked like a superset fixed_132 minus fixed_124(run2) = 1 <- build_resume_command_..._codex The counterexample is build_resume_command_uses_imported_jcode_session_for_codex, a test #124 fixed on run 1 and that fails again on run 2. So the superset is a property of one run, not of the PRs. Removed from the pass-5 conclusion, from the operator-call bullet, and recorded in the brief's error ledger. The narrower claim that survives: #132 fixes 3-4 tests, #124 fixes 25-26, and both fix build_resume_command_..._codex. That overlap is still evidence of real coupling and is consistent with the helpers_tests.rs conflict, so the landing advice (land #124 first, or rebase #132 after it) is unchanged. Also note in the ledger: my first written version of this retraction had the comparison direction described backwards, and I had to re-verify and correct that as well. Two wrong accounts of one relationship, both mine. Counts unchanged from pass 5: #124 = +524/-352 across 66 files, now confirmed by two independent derivations; #124 ci.yml = 9 jobs, 3 if:false, 7 desk-runner; #132 attribution confirmed with file-set isolation proof. tx-agent: jcode tx-validated: manual tx-scope: docs/sessions/2026-10-18-resume-reland tx-intent: Retract an overstated set-relationship claim from pass 5 tx-task: KCode open-PR landing audit
… head Deep re-derivation of every pass-5 claim against primary sources. THE BIG ONE: #132's head moved from 9ead396 to f8f4883, and the new head is a merge commit that brings in #129's branch. Verified by ancestry: 1922c0f (#129's head) IS an ancestor of f8f4883 (#132's head); the reverse does not hold. Both target master. Consequence: landing #132 now lands #129 too. The standing advice "split #129: land the rustfmt half, revert the env! half" is obsolete — that split has already happened inside #132. The operator's real choice is #127 plus ONE combined #132+#129 PR. Operator-call section updated; the old bullet kept struck through. Pass-5's results are therefore incomplete rather than wrong (the old head is a strict ancestor). Re-verified at the CURRENT heads: - isolation re-proven by file-set equality: #132 13/13, #129 10/10 exact match - attribution holds: build_resume_command tests 0 passed/2 failed on base, 2 passed on current #132 (EXIT 0). kitty_ test + #129 control still running. - #124 stat 524/352/66 confirmed twice AND the recorded command fixed: my pass-5 text used --json changed_files (not a real field; it is changedFiles) and claimed `changes` came from `gh pr view --json files` (it does not exist there, REST only). Numbers right, method wrong, now corrected. - #124 ci.yml re-parsed with yaml.safe_load (independent of my hand-rolled walker): 9 jobs, 3 if:false, 7 desk-routed. Refinement: only 6 of the 7 desk jobs are ENABLED (setup-friction is desk-routed and disabled), so 6 enabled jobs would queue forever on the offline runner, not 7. Non-desk enabled: none. - runner desk-kcode-1 still status=offline, busy=true, desk-linux label present, identical on two consecutive queries. Also recorded: worktree state (57 total, 54 baseline + 3 audit trees; zero prunable/locked/missing) and the fact that the main repo is NOT on master and moved twice mid-session (other agents switching branches), so it is not a reliable read-only baseline. Method lesson recorded: hardlink-cloning a warm target (cp -al) does NOT give parallel builds — all clones share one .cargo-lock inode (verified 958582255), so cargo serialises them. Safe but not parallel. tx-agent: jcode tx-validated: manual tx-scope: docs/sessions/2026-10-18-resume-reland tx-intent: Correct the landing advice now that #132 contains #129 tx-task: KCode open-PR landing audit
…rent heads All six test runs finished. Complete matrix, isolation proven by file-set equality on both PR trees: test base 132@f8f488392 129@1922c0f56 build_resume_command (2) 0P/2F 2P/0F 0P/2F kitty_notification (1) 0P/1F 1P/0F 0P/1F Exit codes base 101, #132 0, #129 101 on both invocations. The pass-5 attribution survives the head change intact: #132 fixes these tests, #129 alone does not, and #132 containing #129 does not dilute that. The #129 column is the control that makes the result meaningful. Replaces the "still running / treat as pending" placeholder that was in the section while the box sat at load average 848 under other agents' builds. tx-agent: jcode tx-validated: test tx-scope: docs/sessions/2026-10-18-resume-reland tx-intent: Record completed attribution matrix at current PR heads tx-task: KCode open-PR landing audit
|
Closed by #157 (this branch becomes obsolete once #157 lands). #157 The other 10 files in this branch (#129's rustfmt + clippy drift cleanup) have their own clean re-landing in #156 Please close this PR without merging; #157 carries the 3-file decollision block and #156 carries the rest. |
…#157) Re-land the 3-file TUI decollision block from PR #132, separating it from PR #129's rustfmt/clippy drift work which has its own clean fix-forward re-landing in PR A (fix/ci-rustfmt-clippy-drift-clean). Files touched (3): - crates/jcode-tui/src/tui/app/helpers.rs: launch_client_executable() fallback string "jcode" -> "kcode" (1 line, behavioural: the fallback exec name is what gets passed to std::process in the unit-test where std::env::current_exe() returns Err). - crates/jcode-tui/src/tui/app/helpers_tests.rs: build_resume_command session-name assertions for claude_code and codex backends now expect "kcode" (2 lines). - crates/jcode-tui/src/tui/app/turn_notify.rs: title "jcode" -> "kcode" on four sites (default title, two title-format tests, and a kitty i= payload in the notification sequence test). Title string is what the user-visible notification action labels render against; change is the operator's kcode rename carry-forward. tx-agent: jcode tx-validated: test tx-task: ci-stabilization-2026-10-19 tx-scope: jcode-tui tx-intent: complete the kcode rename in turn-notification title strings and resume-command names Closes #NEW_FOR_PR_B
|
Closing under the host-ops closure audit (2026-11-11): conflicts with master and has been unmergeable for 23 days; the change is not landable as-is. The branch |
… 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
Summary
Three TUI test failures are simple kcode/jcode decollision leftovers
from the recent binary rename. The production code was already migrated
to kcode, but a few hardcoded "jcode" literals in tests and one
production fallback were missed.
Affected sites
1.
crates/jcode-tui/src/tui/app/helpers.rs:191(production bug)This is the fallback for
launch_client_executable(). If neitherclient_update_candidatenorcurrent_exe()resolves, theproduction code falls back to the literal string "jcode". For the
KCode fork this should be "kcode".
Fix:
PathBuf::from("kcode").2.
crates/jcode-tui/src/tui/app/helpers_tests.rs:358, 385(test)Two tests in
build_resume_command_uses_imported_jcode_session_for_*assert the file_name is "jcode". After the rename, the production
returns "kcode". Note the test setup function (line ~340) already
creates a file called
kcodein<KCODE_HOME>/builds/current/kcode,so the test expectations are clearly stale.
Fix:
Some("kcode").3.
crates/jcode-tui/src/tui/app/turn_notify.rs:228, 443, 455, 516, 545(production + tests)Production:
let mut title = String::from("jcode");(line 228) —the title prefix for turn notifications.
Tests: 4 assertions checking for "jcode · ..." in the title and
2 occurrences of
i=jcode-turn-sessionfox123in the expectedkitty notification sequence.
After the rename, the code at line 176 already uses
"kcode-turn-{}"for the kitty notification identifier. The title at line 228 and the
corresponding test expectations were missed.
Fix: update production
String::from("kcode")and update 4 testtitle expectations + the 2 kitty identifier occurrences in line 545.
Evidence
The CI Build & Test failure log shows
left: Some("kcode")(actualproduction) vs
right: Some("jcode")(stale test expectation) forthe helpers tests, and the analogous kcode vs jcode mismatch in
turn_notify.
Out of scope (separate issues)
The remaining 22 TUI test failures (
tui::app::tests::test_fork_command_*,tui::session_picker::*,tui::terminal_mode_tests::*,tui::ui::messages::tests::render_system_message_*, etc.) arereal regressions from the TUI refactors (missing resume hints, ANSI
escape sequence drift, scrollbar glyph regressions, etc.). They
need their own focused fixes.
Resolution
Closes #131.
CodeAnt-AI Description
Use KCode branding in TUI notifications and launch fallback
What Changed
Impact
✅ KCode-branded turn notifications✅ Correct client launch fallback when executable discovery fails💡 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.