Skip to content

fix(setup-hints): update first_three_launches_can_include_hotkey_notice_too to assert retired spawn-notice behavior (#139) - #140

Merged
KooshaPari merged 4 commits into
masterfrom
fix/setup-hints-pr128-test-regression
Nov 10, 2026
Merged

KooshaPari merged 4 commits into
masterfrom
fix/setup-hints-pr128-test-regression

Conversation

@KooshaPari

@KooshaPari KooshaPari commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

User description

Summary

Fixes the always-broken test setup_hints_tests::first_three_launches_can_include_hotkey_notice_too so it asserts the post-PR-#128 behavior of startup_hints_for_launch (always returns None). Also carries the dead-code removal of StartupHints::with_spawn_notice from PR #137 so the branch satisfies cargo clippy -p jcode-setup-hints --all-targets --all-features -- -D warnings.

Root cause

The test was always broken — even before PR #128. The original startup_hints_for_launch gated on if !hotkey_configured || _state.startup_spawn_hint_dismissed { None } else { Some(notice) }, and the test's constructed state { hotkey_configured: true, ..SetupHintsState::default() } inherited startup_spawn_hint_dismissed: true from default — short-circuiting the gate to None. PR #128 retired the spawn notice entirely; its commit message explicitly acknowledged this test was already failing on master for that reason ("the test relies on a spawn notice that was dead code by the time it was written").

Decision

Test was wrong, not production. PR #128 was deliberate and correct: the gate was demonstrably unreachable (nothing in the crate wrote startup_spawn_hint_dismissed = false). The repo's aggressive-change policy forbids backwards-compat shims, so re-introducing a working gate would require also wiring up a state writer to flip the default to false on first launch — out of scope here. The right fix is to update the test.

Fix

  • crates/jcode-setup-hints/src/setup_hints_tests.rs: rewrite first_three_launches_can_include_hotkey_notice_too to assert startup_hints_for_launch(&state).is_none() for a state with both hotkey_configured: true and startup_spawn_hint_dismissed: true. Updated docstring to record PR refactor(setup-hints): remove unreachable startup spawn notice #128 provenance. Kept the #[cfg(target_os = "macos")] cfg so the test stays macOS-only, symmetric with the other launch-hotkey notice tests in the file.
  • crates/jcode-setup-hints/src/lib.rs (cherry-picked from PR fix(setup-hints): delete orphaned StartupHints::with_spawn_notice helper (#136) #137): delete the orphaned StartupHints::with_spawn_notice helper (-8 lines). Strictly required for cargo clippy -D warnings to exit 0.

Validation

Command Exit Notes
cargo test -p jcode-setup-hints --lib setup_hints_tests::first_three_launches_can_include_hotkey_notice_too 0 target test now passes
cargo test -p jcode-setup-hints --lib 101 (5 fail) 144 passed, 5 failed; same 5 pre-existing platform-specific failures as on origin/master (linux_env x2, linux_niri x2, macos_launcher x1). No new failures introduced.
cargo clippy -p jcode-setup-hints --all-targets --all-features -- -D warnings 0 clean
cargo fmt -p jcode-setup-hints -- --check 0 clean

Ledger

tx-agent:     jcode
tx-validated: test
tx-task:      #139
tx-scope:     jcode-setup-hints
tx-intent:    update PR #128 broken test to assert retired spawn-notice behavior

Closes #139


CodeAnt-AI Description

Keep startup hint checks aligned with the retired hotkey notice

What Changed

  • The macOS launch-hint test now checks that no notice appears, even when a hotkey is configured
  • Removed leftover code for creating the retired notice; runtime launch behavior is unchanged

Impact

✅ No obsolete hotkey notice expected at launch

💡 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:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

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:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

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.

…per (#136)

PR #128 ("refactor(setup-hints): remove unreachable startup spawn notice")
removed the only call site of `StartupHints::with_spawn_notice`, leaving the
helper as a dead-code associated function. The session doc
`docs/sessions/2026-10-18-resume-reland/00_SESSION_OVERVIEW.md` (~line 113)
records this leftover as an explicit follow-up. The CI "Quality Guardrails"
check now fails with:

    error: associated function `with_spawn_notice` is never used
       --> crates/jcode-setup-hints/src/lib.rs:201:8

Delete the `with_spawn_notice` associated function entirely. No
`#[allow(dead_code)]` — the call path is gone, the function should go too.
Aggressive-change policy: remove, do not silence.

Preserved:
- `StartupHints::with_status_and_display` (used in 7+ call sites)
- `SetupHintsState::startup_spawn_hint_dismissed` (state-file serde compat)
- `fn startup_hints_for_launch(_state: &SetupHintsState) -> Option<StartupHints>`
  (callers at lib.rs:1353 + setup_hints_tests.rs depend on the signature)
- `StartupHints::status_notice` field — read by `src/cli/tui_launch.rs:244`
  and `crates/jcode-setup-hints/src/setup_hints_tests.rs:272`, NOT dead.

Validation:
- cargo clippy -p jcode-setup-hints --all-targets --all-features -- -D warnings: exit 0
- cargo fmt -p jcode-setup-hints -- --check: exit 0
- cargo test -p jcode-setup-hints --lib: same pre-existing platform-specific
  failures as master; no new failures introduced. The one setup_hints_test
  failure (`first_three_launches_can_include_hotkey_notice_too`) was already
  broken by PR #128 and is out of scope here.

Closes #136

tx-agent:     jcode
tx-validated: test
tx-task:      #136
tx-scope:     jcode-setup-hints
tx-intent:    remove orphaned with_spawn_notice to clear CI Quality Guardrails dead-code error
…ce_too to assert retired spawn-notice behavior (#138)

PR #128 ("refactor(setup-hints): remove unreachable startup spawn notice",
commit 081c1cf) retired the macOS launch-hotkey spawn notice. The function
`startup_hints_for_launch` now always returns `None`, with a comment
explaining the prior gate (`if !hotkey_configured || dismissed`) was
unreachable because the crate never wrote `startup_spawn_hint_dismissed = false`
(the field defaults to `true` in `SetupHintsState::default()`).

The test `first_three_launches_can_include_hotkey_notice_too` was always
broken — even before PR #128, its `hotkey_configured: true` state with
`..SetupHintsState::default()` produced `dismissed = true`, which would
short-circuit the gate to `None`. PR #128 itself acknowledged this in its
commit message ("the macOS test was already failing on master for an
unrelated reason — the test relies on a spawn notice that was dead code by
the time it was written").

Fix the test to assert the post-#128 behavior: `startup_hints_for_launch`
returns `None` regardless of `hotkey_configured` or
`startup_spawn_hint_dismissed`. Kept the `#[cfg(target_os = "macos")]`
gate so the test remains macOS-only, symmetric with other launch-hotkey
notice tests in this file. Updated the docstring to record the PR #128
provenance so the test's intent is obvious to future maintainers.

Also cherry-picks PR #137 (dead-code removal of `StartupHints::with_spawn_notice`)
onto this branch so the branch satisfies `cargo clippy ... -D warnings` —
that helper was the only `dead_code` warning in the crate, and PR #128's
test retirement leaves the crate with the warning active. Both commits are
required for clippy to pass.

Diff scope:
- crates/jcode-setup-hints/src/setup_hints_tests.rs: test body + docstring (+17/-11)
- crates/jcode-setup-hints/src/lib.rs (cherry-picked from PR #137): -8 lines

Validation:
- cargo clippy -p jcode-setup-hints --all-targets --all-features -- -D warnings: exit 0
- cargo fmt -p jcode-setup-hints -- --check: exit 0
- cargo test -p jcode-setup-hints --lib setup_hints_tests::first_three_launches_can_include_hotkey_notice_too: ok
- cargo test -p jcode-setup-hints --lib: 144 passed, 5 failed; same 5 pre-existing
  platform-specific failures as on origin/master (linux_env x2, linux_niri x2,
  macos_launcher x1) — none caused by this change.

Closes #138

tx-agent:     jcode
tx-validated: test
tx-task:      #136
tx-scope:     jcode-setup-hints
tx-intent:    update PR #128 broken test to assert retired spawn-notice behavior
Copilot AI balanced review requested due to automatic review settings October 19, 2026 21:11
@codeant-ai

codeant-ai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

CodeAnt  CodeAnt Review Status

✅  Review completed

Status Commit Started (UTC) Finished (UTC)
✅  #60e19 Incremental review completed ad0dc62 Nov 03, 2026 · 07:24 07:25
✅  Incremental review completed d6e4cfa Oct 21, 2026 · 05:22 05:22
✅  Reviewed your PR 4b41081 Oct 19, 2026 · 21:11 21:14

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@codeant-ai

codeant-ai Bot commented Oct 19, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You'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 55 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: c02cd7d9-78d5-4026-bba7-03deaf1de3f0
Commits

Reviewing files that changed from the base of the PR and between ac34906 and ad0dc62.

Files selected for processing: 2
  • crates/jcode-setup-hints/src/lib.rs
  • crates/jcode-setup-hints/src/setup_hints_tests.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.

@codeant-ai codeant-ai Bot added the size:S This PR changes 10-29 lines, ignoring generated files label Oct 19, 2026
@codeant-ai

codeant-ai Bot commented Oct 19, 2026

Copy link
Copy Markdown

CodeAnt Nitpicks

1 code suggestion

1. With this flag true, the retired gate also returns None, so the assertion still passes if that gate is reintroduced and does not guard the intended behavior.

Logic error · crates/jcode-setup-hints/src/setup_hints_tests.rs:45

@codeant-ai

codeant-ai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

CodeAnt  CodeAnt PR Risk

🟢  Low Risk

  • The PR appears safe to merge; no actionable issues were identified in the review.

Assessed commit: ad0dc62fc53b

@KooshaPari

Copy link
Copy Markdown
Owner Author

FYI: the docs commit (docs(sessions): add cross-harness orchestration governance proposal, 6567919) that previously sat on this branch has been moved off and cherry-picked onto a fresh branch off the current master HEAD — see #145.

This PR (#140) is now back to its original two-file setup-hints-only diff, exactly as originally intended. No code changes here; the docs commit was reparented via cherry-pick, not rewritten.

No action requested on this PR.

// function must still return None — the spawn notice was retired,
// not gated. Re-introducing a hotkey-notice gate here would require
// also fixing this assertion.
startup_spawn_hint_dismissed: true,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: The regression guard is weakened by setting startup_spawn_hint_dismissed: true. The retired gate was if !hotkey_configured || dismissed { None }, so with dismissed = true the assertion still passes even if that gate is reintroduced with the wrong default. Set it to false so the test actually catches a re-introduced gate that fails to suppress the notice.

Suggested change
startup_spawn_hint_dismissed: true,
startup_spawn_hint_dismissed: false,

@kilo-code-bot

kilo-code-bot Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Code Review Summary

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
crates/jcode-setup-hints/src/setup_hints_tests.rs 45 Regression guard weakened by startup_spawn_hint_dismissed: true
Files Reviewed (2 files)
  • crates/jcode-setup-hints/src/lib.rs - 0 issues
  • crates/jcode-setup-hints/src/setup_hints_tests.rs - 1 issue

Fix these issues in Kilo Cloud


Reviewed by free · Input: 50.5K · Output: 1.4K · Cached: 182.1K

KooshaPari added a commit that referenced this pull request Oct 20, 2026
…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
crates/jcode-setup-hints/src/lib.rs conflicted because master added an #[allow(dead_code)] attribute to the private StartupHints::with_spawn_notice helper while this branch deleted the helper outright. Took the branch side: with_spawn_notice has no caller anywhere in the crate, so deleting it (rather than silencing the warning with an attribute) is the resolution that preserves the branch's intent and leaves no dead code.

tx-agent: jcode
tx-validated: manual
tx-scope: crates/jcode-setup-hints/src/lib.rs
tx-intent: Delete the uncalled with_spawn_notice helper so this branch merges into master cleanly
KooshaPari added a commit that referenced this pull request Oct 21, 2026
…olved 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
@sonarqubecloud

sonarqubecloud Bot commented Nov 3, 2026

Copy link
Copy Markdown

@KooshaPari
KooshaPari merged commit 0e91b8f into master Nov 10, 2026
18 of 19 checks passed
@KooshaPari
KooshaPari deleted the fix/setup-hints-pr128-test-regression branch November 10, 2026 02:14
KooshaPari added a commit that referenced this pull request Nov 28, 2026
… 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S This PR changes 10-29 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(setup-hints): update first_three_launches_can_include_hotkey_notice_too to assert retired spawn-notice behavior

2 participants