Skip to content

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

Description

@factnest365-ops

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 feat(hooks): support multiple client-scoped commands #758 head (3c5751474) shows the same pre-existing failures only; its touched crates pass. No new failures introduced by the PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingduplicateThis issue or pull request already existspriority: highP1 - important bug or impactful feature, fix soon

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions