1jehuang / 1jehuang/jcode

master CI broken: src/cli/commands/menubar.rs + commands_tests.rs compile mismatch since v0.67.0

Open
#769 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug duplicate priority: high
Dominant language
Rust
Stars
19.9k
Forks
2.3k
Avg merge
2d 7h
Merged PRs (30d)
30

Description

master CI broken: src/cli/commands/menubar.rs + commands_tests.rs compile mismatch since v0.67.0

Summary

Master is red since v0.67.0 (156ae409250c20f7b3dd530ff282d8367d6d5cd5). The jcode lib test target does not compile, which breaks Build & Test (ubuntu/macos/windows) and Quality Guardrails on every PR against master. A fix has not landed as of 2026-08-04 (master is still at 156ae4092).

This is a pre-existing break on the v0.67.0 base, independent of PR #758 (feat(hooks): support multiple client-scoped commands). PR #758's CI stays red only because of it: its own changed files build and test cleanly (verified: jcode-base hooks 11/11 pass on the PR head, jcode-config-types 14/14 pass). Closing this requires fixing the master-side type mismatch, not touching PR #758.

Reproduction

git checkout 156ae409250c20f7b3dd530ff282d8367d6d5cd5
cargo test -p jcode --no-run

Result: error: could not compile 'jcode' (lib test) due to 7 previous errors.

Exact errors (verified 2026-08-04, rustc 1.96.0)

src/cli/commands/menubar.rs
  • menubar.rs:869:34 — E0308 mismatched types

    confidence: Some(95),
    

    expected 'ConfidenceState', found integer (arguments to the ConfidenceState enum variant are incorrect).

  • menubar.rs:488:9 — warning (trips Quality Guardrails clippy -D warnings)

    unsafe {
    

    warning: unnecessary 'unsafe' block.

src/cli/commands_tests.rs
  • commands_tests.rs:262:9 — E0308 mismatched types
    expected 'Option<ConfidenceState>', found 'Option<u8>' (binding confidence).
  • commands_tests.rs:263:9 — E0308 mismatched types
    expected 'Option<ConfidenceState>', found 'Option<u8>' (binding completion_confidence).
  • commands_tests.rs:296:36 — E0308 mismatched types
    todo.confidence_history = vec![0, 100];expected 'ConfidenceState', found integer.
  • commands_tests.rs:323:44 — E0308 mismatched types
    todo.confidence_history = vec![70, 80, 90, 100];expected 'ConfidenceState', found integer.
  • commands_tests.rs:408:13 — E0560 struct GateObservation has no field named score
    score: Some(70),
    
    Note: GateObservation (crates/jcode-base/src/todo.rs:138) only has kind, group, state. The score field was migrated to state (the doc comment explicitly notes legacy numeric score entries load with state: None), but the test constructor was not updated.
  • commands_tests.rs:469:13 — E0560 struct GateObservation has no field named score (same as above).

Impact

  • Build & Test (.github/workflows/ci.yml, ubuntu-latest + macos-latest): cargo test --no-run fails → job red.
  • Windows Smoke (.github/workflows/windows-smoke.yml, windows-latest): compiles library and binary tests → same failures → job red.
  • Quality Guardrails (.github/workflows/ci.yml): clippy with warnings denied + all-targets check → red.
  • Every PR based on current master inherits these failures regardless of its own changes.

Suggested fix

Update src/cli/commands/menubar.rs and src/cli/commands_tests.rs to the current types:

  • confidence / completion_confidenceOption<ConfidenceState> (use the enum variant, e.g. Some(ConfidenceState::...)), and
  • confidence_history entries → ConfidenceState values,
  • GateObservation { score: Some(70) } → use the state field (e.g. state: Some(...)).

Verification done

  • Master still at 156ae409250c20f7b3dd530ff282d8367d6d5cd5 as of 2026-08-04 — no fix landed.
  • All 7 errors reproduced locally against that exact commit.
  • PR #758 head (3c5751474) shows the same pre-existing failures only; its touched crates pass. No new failures introduced by the PR.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/cli/commands/menubar.rs and src/cli/commands_tests.rs, then inspect the current ConfidenceState and GateObservation definitions, including crates/jcode-base/src/todo.rs:138. Reproduce the failure with cargo test -p jcode --no-run, align the affected test and menubar values with those types, and confirm the jcode test target and Quality Guardrails checks pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
ci-cd, cli, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
75/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.