Skip to content

master CI red: cargo fmt, clippy -D warnings, and ratchet budgets fail on 4bb116454 #1907

Open

Description

@alecuba16

The quality job is failing on master at 4bb1164 (and later). Four gates fail:

  1. cargo fmt --all -- --check: three files drifted (session_picker.rs, auth_account_commands.rs, remote.rs, plus a couple of formatting-only spots elsewhere).
  2. cargo clippy --locked --all-targets --all-features -- -D warnings:
    • jcode-base fails on large_enum_variant: PollOutcome::Approved(MuseCredentials) carries a ~240 byte variant that dwarfs the rest of the enum.
    • test-only request_body helpers in jcode-base/src/jev.rs and jcode-app-core/src/tool/browser_jev.rs are dead code in production builds but only compiled under tests.
    • type_complexity on the test TEST_SLEEP_OVERRIDE static in src/cli/login/device_login.rs.
  3. Code-size / test-size / panic / swallowed-error ratchet budgets: the 10-19 pushes grew several tracked oversized files and added new ones, so all four budget scripts reject the current tree.
  4. Build & Test fails provider_matrix on the muse-subscription experimental gate (separate, tracked in CI red on master: provider_matrix muse-subscription profile counted as unconfigured, test panics at the experimental opt-in gate #1902).

The lib test suites themselves are green upstream (2790 passed / 0 failed on ubuntu at this commit), so the breakage is gate-level, not behavior-level.

Fix incoming in #1906: fmt the drifted files, box the MuseCredentials variant, cfg(test) the test-only helpers, and regenerate the four budget baselines with the scripts' own --update mode.

Activity

  1. added
    bugSomething isn't working
    area: ciCI workflows, automation, and build checks.
    on Oct 20, 2026
  2. 1jehuang commented on Oct 20, 2026

    @1jehuang
    Owner

    Thanks for the concrete gate list. I confirmed that the current code-size, test-size, panic, and swallowed-error budget checks still fail. I am keeping this open for review of #1906: automatically regenerating all four baselines would accept unrelated growth rather than establish that it is safe. Recommended next step: separate the mechanical lint/format fixes from reviewed budget changes or targeted cleanup. The independent Muse matrix failure is being addressed under #1902.


    Jcode agent (automated triage), on behalf of @1jehuang

  3. alecuba16 commented on Oct 21, 2026

    @alecuba16
    ContributorAuthor

    Rebased this PR onto master e168c36 and split it per the recommendation above: commit 1 is the mechanical clippy/machete/muse cleanups (no behavior changes), commit 2 is the budget-baseline refresh covering only the newly merged upstream code (kagi #1916, zellij/kitty-classic #1917). Details in the PR description. Everything the ratchets now grow is upstream-merged code, so the mechanical half is independently reviewable and the budget half is a pure 10-21 sync.

  4. alecuba16 commented on Oct 24, 2026

    @alecuba16
    ContributorAuthor

    Re-checked the gates on the current tip be64b54: still red, and the failure set moved since e168c36.

    What fails now (all reproduced locally, same list as the fork CI run on that commit):

    • cargo fmt --check: drift in the compaction floor test in jcode-config-types (from 638bc82).
    • clippy -D warnings: collapsible_if in jcode-todo-policy followup.rs (7c55a5c), jcode-tui-tool-display, jcode-tui auth_tests/commands_cloud/todos_view, and the root crate cloud_ephemeral/cloud_managed; octal_escapes in the cloud_git/cloud_status test literals; type_complexity on a boxed closure list; needless_borrow in cloud_managed.
    • Warning budget: dead format_todo_completion_confidence left by da87e0c.
    • Code-size, test-size, panic and swallowed-error budgets: growth from the Oct 22-24 upstream pushes (todo.rs 2853->3169, client_lifecycle_tests 1939->2420, todo-policy completion_report/followup new files, etc).
    • TUI lib tests: two reload-note assertions still expect the bg action="status"/"output" hint sentence removed by 90ee503, the KV cache notice test expects the pre-2934994d0 render, the remote catalog test misses the sonnet-4-6 entry added by 803d7e4, and the flicker copy badge test expects the pre-1a544fc5f [Z] form.

    I pushed a third commit on #1906 (b18faf5) that keeps the same split: all mechanical (collapse ifs, hex-escape the nulls, box the closure list, delete the dead fn) plus four test updates aligned with the new formats, and the budget baselines refreshed only to the counts the upstream-merged code produces. fmt, clippy -D warnings, warning budget and all four budget scripts pass locally on that head.

    The macOS-only hibernation/ambient-state failures stay in #1897 / #1880, not this PR.

  5. ianalitis commented on Oct 25, 2026

    @ianalitis
    Contributor

    Re-confirmed on today's origin/master (60ccebb00, "docs: update weekly stars chart"), independently of the earlier commit in this thread. All four ratchet scripts are red on unmodified master, plus fmt and clippy:

    gate result
    cargo fmt --all --check red
    cargo clippy --all-targets -- -D warnings red (e.g. unused import: HashSet in tool/communicate_tests.rs:22)
    scripts/check_test_size_budget.py red, 11 "oversized test file grew" entries
    scripts/check_swallowed_error_budget.py red, 13 entries (1 new file, jcode-tui-tool-display/src/lib.rs)
    scripts/check_code_size_budget.py red, 18 "oversized file grew" entries
    scripts/check_panic_budget.py red, total 174 -> 178
    scripts/check_wildcard_reexport_budget.py green
    scripts/check_warning_budget.sh green (0/0)

    Worst offenders worth deciding on first:

    • check_test_size_budget: server/client_lifecycle_tests.rs 1939 -> 2305, usage/tests.rs 1317 -> 1355, tui/ui_tests/tools.rs 1530 -> 1542, tui/ui_tests/prepare.rs 1374 -> 1394.
    • check_code_size_budget: server/client_lifecycle.rs 3974 -> 4030, tool/todo.rs 2853 -> 2884, server/swarm.rs 3518 -> 3519.
    • check_panic_budget: jcode-base/src/provider_activity_oauth.rs 3 -> 5, plus a new one in jcode-provider-openai-runtime/src/openai_stream_runtime.rs.

    For every flagged path I checked, the file is byte-identical to origin/master, so none of this is drift from an open PR branch — it accumulated on master. Two caveats on the fix strategy:

    1. --update on the ratchets would launder all of this in one commit. The budgets are the only thing keeping the refactor pressure on, so a bulk rebaseline effectively deletes that gate. Per-file rebaselines are the honest option, and even then only for files whose growth was reviewed.
    2. The underlying cause is real growth in client_lifecycle.rs / client_lifecycle_tests.rs / tool/todo.rs, which is a split refactor, not a formatting pass. That is the part that needs a decision here, not a mechanical --update.

    If it helps, I can take the fmt + the two genuinely mechanical clippy fixes (the unused import is one) as a small PR that leaves every budget untouched, and leave the ratchets for a maintainer call. Say the word and I'll open it.


    — Jcode agent (automated triage), on behalf of @1jehuang

  6. ianalitis commented on Oct 25, 2026

    @ianalitis
    Contributor

    Follow-up: opened #1963 for the fmt half (three files, formatting only, cargo fmt --all --check goes green). It is a prerequisite for anyone whose PR otherwise fails Format on unrelated drift, including #1962.

    Leaving clippy -D warnings and all four ratchets unopened, since those are not mechanical.

  7. ianalitis commented on Oct 25, 2026

    @ianalitis
    Contributor

    Triaged this on a fresh worktree of current master (4bb16b96c, not 4bb116454). The report is still accurate, but the concrete failure set differs from the original list, so here is the current breakdown. Fix PR: #1964.

    What fails today, and why

    Gate Current failure Cause
    cargo fmt --all -- --check one file only: crates/jcode-config-types/src/lib.rs:1630 drifted test formatting in the compaction config test
    cargo clippy -- -D warnings 9 files collapsible_if (3), needless_borrow (2), is_some()+unwrap() (1), unused imports (2), dead_code (1)
    Quality guardrails (macOS) warning budget format_todo_completion_confidence is pub(super) with no callers, so the macOS warning budget saw function ... is never used
    cargo test -p jcode-tui --lib 6 tests assertion drift from three intentional production changes

    The 6 tests are all assertions that lagged deliberate behavior changes, not logic bugs:

    • remote_events_reload_03 - 90ee50330 replaced the bg action="status"/"output" handoff copy with BACKGROUND_WAIT_GUIDANCE.
    • session_picker_tests - ff31b8bba / 59eabc409 collapse finished todo cards to status dots, so the fixture's completed todo no longer renders a card.
    • ui_messages - compact cache-miss notices render as a one-line summary.
    • frame_flicker - the copy badge now renders [<alt label>⇧Z]; the assertion should use copy_badge_alt_label().
    • remote_startup_input_02 - claude-sonnet-4-6 is in the shipped subscription catalog.

    Still red, deliberately untouched

    The ratchet budgets in the report are still red, and they are pre-existing growth rather than a gate that anybody turned off:

    • check_code_size_budget.py: ui_viewport.rs 1664 -> 1759, cloud_move.rs 2839 -> 2840, commands.rs 3632 -> 3917
    • check_test_size_budget.py: ui_tests/prepare.rs, ui_tests/tools.rs, commands_tests.rs
    • check_panic_budget.py and check_swallowed_error_budget.py: a handful of files

    Refreshing those baselines is a policy decision, not a mechanical fix: it either blesses the growth or requires splitting commands.rs. It needs a maintainer call, which is why this is labelled triage: needs-decision. #1964 does not touch the baselines.

    Verification of the fix

    cargo clippy --locked --all-targets --all-features -- -D warnings exits 0, cargo fmt --all -- --check exits 0, scripts/check_warning_budget.sh reports current=0 baseline=0, and the 6 TUI tests pass (283 passed, 0 failed in the filtered run).


    — Jcode agent (automated triage), on behalf of @1jehuang

  8. ianalitis commented on Oct 25, 2026

    @ianalitis
    Contributor

    Short update on #1964 after its first CI pass, since it changes two things I said above.

    Format is green now on the PR head, so the rustfmt half is done there. That also makes #1963 a no-op: its three hunks (ui_messages.rs, ui_messages/tests.rs, ui_tests/tools.rs) already exist verbatim on master. ui_messages.rs:2863 at 4bb16b96c already reads failure.reason.split_whitespace() broken across four lines, and git show 4bb16b96c:<path> | rustfmt --edition 2024 --check reports zero diffs for all three files. So #1963 would apply cleanly and change nothing, while its own Format job is red. Suggest closing it in favor of #1964; I have not closed it myself.

    CI caught a real mistake in my branch, and it is worth recording because the same trap will hit anyone doing lint cleanup here. The clippy findings included an unused use std::path::Path; in src/cli/cloud_managed_tests.rs. On macOS that import really is unused: both users sit inside mod shell, which is #[cfg(all(target_os = "linux", target_arch = "x86_64"))]. Removing it broke the Linux build with E0425/E0433: cannot find type Path in this scope at lines 47 and 387, failing both Quality Guardrails (check + clippy) and Build & Test (ubuntu-latest) at the compile step, before any test ran.

    Fixed in d738d1707 by moving the import inside the gated module. Verified by temporarily widening that module's cfg to unix locally so its body actually compiles (cargo check --locked --bins --tests clean), then restoring the cfg and re-running cargo clippy --locked --all-targets --all-features -- -D warnings clean on macOS.

    The general point: a clippy run on one OS says nothing about code behind cfg, so an "unused import" finding inside a platform-gated module is only safe to act on if you compile that module. This is also why the earlier master runs hid downstream breakage in both directions: master's ubuntu run failed at the TUI test step, so the cohorts after it never executed, and my first push failed at the compile step, so they still had not. The current head is the first commit where retention readiness, pty, browser liveness, embedding stability, stdin forwarding, provider matrix, e2e, and security preflight will actually run.

    Still expecting the four ratchets (Quality Guardrails steps 12-15) to stay red until you decide on --update versus splitting commands.rs; nothing else in #1964 touches them.


    — Jcode agent (automated triage), on behalf of @1jehuang

  9. ianalitis commented on Oct 25, 2026

    @ianalitis
    Contributor

    Addendum after running the suites locally rather than only reading CI logs. Two more reds exist on master that no CI job reports, and both are pre-existing at 4bb16b96c (verified on a clean worktree of that commit):

    Suite Red Why CI never saw it
    jcode-provider-gemini-runtime --lib build_tools_keeps_required_when_the_object_declares_no_properties asserts a required list survives an object with no properties; 7e6dec1e6 made prune_dangling_required drop it on purpose the job only compiles the target (--lib --bins --no-run), it never runs it
    jcode-tui --lib idle_hibernation_frozen_frames_do_not_repopulate_prepared_caches asserts the frozen frame says private mem, but process_memory::snapshot() is Linux/Windows only, so macOS renders type to resume the TUI library target runs on runner.os == 'Linux' only

    Both are in #1964 now, with the platform and provider reasoning recorded in the code comments. The gemini one is also answered on #1951, including the one-line alternative if the older #655 wording is preferred.

    Related, and unchanged: the TUI library suite still cannot run in parallel on master. cargo test --workspace --lib --bins deadlocks locally inside the jcode-tui test binary, many threads parked with no CPU use, until it is killed. That is the ordering/global-state problem the CI workflow comment and #592 already describe, so the serial --test-threads=1 command stays the honest signal and the one this branch was verified against.

    PR #1964 current state: on 16da8b3aa, Quality Guardrails is red only on the four ratchet gates listed above (format, module declarations, clippy, warning budget, dependency boundaries, SDK parity, wildcard reexports and unused deps all pass), and Format, TypeScript SDK, Setup Friction, PowerShell Syntax, Windows Cross-Target and Windows ARM64 are green.


    — Jcode agent (automated triage), on behalf of @1jehuang

  10. ianalitis commented on Oct 25, 2026

    @ianalitis
    Contributor

    Result on #1964's current head c4063c77f (run 40153071531):

    • Green: Format, TypeScript SDK, Release Automation, Setup Friction, PowerShell Syntax, Windows Cross-Target, Windows ARM64 Configuration, Cloud Acceptance, and Build & Test on ubuntu, macOS and Windows.
    • Red: Quality Guardrails, on the four ratchet steps only.

    The ubuntu job reaching the end matters more than it looks. Because master fails at Run TUI library tests, the cohorts after it had never executed: retention readiness, secret-input pty, browser liveness, embedding numeric stability, stdin forwarding, provider matrix, e2e, warning budget and security preflight. All of those pass on this head, so the four ratchets below are the only thing standing between master and green.

    Still open for you: whether the ratchet growth is intentional (--update and record new baselines) or should be split, chiefly src/cli/commands.rs at 3632 → 3917 and its test file at 1805 → 2183.


    — Jcode agent (automated triage), on behalf of @1jehuang

  11. 1jehuang commented on Oct 30, 2026

    @1jehuang
    Owner

    Partial mechanical repairs are published in #2015: account-row collapsible_if and public-base message-separator formatting. Changed-file rustfmt and strict library Clippy passed for the affected package set. No ratchet baseline was regenerated. Six existing todo parameter-description cap failures remain, so this issue stays open for the broader CI/budget decision.


    Jcode agent (automated triage), on behalf of @1jehuang

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: ciCI workflows, automation, and build checks.bugSomething isn't workingtriage: needs-decisionNeeds maintainer decision/design thought

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions