25 Commits

Author SHA1 Message Date
jeremy 660d9152c9 chore: rebaseline size/panic/swallowed-error ratchets 2026-07-30 00:47:44 -07:00
jeremy cd8d35ab4b chore: rebaseline size/panic/swallowed-error ratchets after intentional growth
Regenerated with scripts/check_guardrails.sh --fix against a clean checkout
so the release tag passes CI's quality guardrails.
2026-07-29 19:23:15 -07:00
jeremy 78604b5e52 chore: remove legacy jcode-desktop crate and its plumbing
The desktop app is now jcode-desktop2. Drop the legacy crate from the
workspace, collapse the selfdev Desktop build target into Desktop2,
delete legacy-only scripts/packaging, refresh budget baselines, and mark
the legacy desktop design docs as historical.
2026-07-29 16:01:12 -07:00
jeremy 031f0538e4 chore(ci): rustfmt and rebaseline ratchets after branch integration 2026-07-26 22:13:22 -07:00
jeremy adbbed225a chore: rustfmt and rebaseline guardrail budgets 2026-07-25 05:17:28 -07:00
Jeremy Huang e354460ea2 chore(ci): unblock red CI on master (fmt, clippy, ratchet baselines) (#581)
* style: cargo fmt --all to unblock CI on master

* fix(fuzzy): drop redundant trim before split_whitespace to satisfy clippy

* chore(ci): unblock guardrails - explicit output_style re-exports and synced ratchet baselines (refs #547)

- Replace the cross-crate glob re-export in jcode-base/src/output_style.rs
  with explicit items so the wildcard ratchet passes without a baseline bump.
- Re-sync the code-size, test-size, panic, and swallowed-error baselines to
  current master, matching the approach in #550.
2026-07-24 13:44:50 -07:00
jeremy 84c10f3cd8 chore(ci): sync guardrail baselines and recognize cfg(all(test, ...)) blocks
- test-size and swallowed-error baselines drifted behind already-merged
  master commits, leaving master CI red and blocking PR #493
- panic and swallowed-error budget scripts now treat #[cfg(all(test, ...))]
  modules as test code, which drops the panic baseline from 56 to 43
2026-07-17 02:52:15 -07:00
Jeremy Huang b8e0329cac feat(windows): improve setup, launcher, and hotkey lifecycle (#487)
Harden Windows installation, uninstallation, hotkey, Copilot-key, power-inhibition, terminal mouse, and onboarding behavior.

Includes strict installer verification, lifecycle cleanup, Windows-specific CI coverage, and the reviewed safety fixes added before merge.

Closes #488.
2026-07-16 22:38:16 -07:00
jeremy 2b8865c31b fix(ci): restore workspace guardrails and e2e protocol 2026-07-15 20:51:16 -07:00
jeremy 0506d723f0 chore(ci): drive panic-prone budget below baseline (67 -> 33)
The panic ratchet tripped after parallel commits added new production
.unwrap()/.expect() uses. Instead of updating the baseline upward, fix
them:

- plan/dag ops + schedule: replace post-validation unwraps with
  DagError::UnknownNode / early returns; expand_node and
  inject_from_gate collect validated ids once instead of re-unwrapping
  spec.id
- comm_control assign path: index-based item resolution instead of
  double-lookup unwrap/expect
- session_search_index: skip a missing rebuilt slot instead of
  panicking in the search path
- hotkey_feedback/shortcut_hints: get_or_insert_with + filter_map over
  expect/unwrap
- desktop benchmarks: ignore impossible mpsc send errors
- plan/mermaid examples: graceful error reporting instead of expect
- also fix clippy hex-grouping lints in swarm_plan_graph_inline tests

Net: baseline lowered 35 -> 33 tracked panic-prone uses.
2026-07-05 00:19:22 -07:00
jeremy 1556695166 refactor(base): move provider-doctor cluster to jcode-provider-doctor crate
Move provider_e2e.rs, live_provider_probes.rs, and lifecycle_driver.rs
(~6600 lines) out of jcode-base into a new downstream crate
jcode-provider-doctor, so doctor edits no longer rebuild the
base -> app-core -> tui spine and base compiles faster with lower peak
memory.

- lifecycle_driver had no base-internal consumers outside its own
  #[cfg(test)] module, so it moves too (as a test-only module).
- native_doctor_supports_provider stays in base (auth/doctor.rs) because
  live_tests' roster annotation calls it; the doctor crate re-exports it
  and a sync test asserts the roster matches NativeProviderKind's specs.
- crate:: paths in the moved files rewritten to jcode_base::.
- src/cli/provider_doctor.rs now imports jcode_provider_doctor::*.
- Budget baselines relocated to the new paths (provider_e2e +29 LOC for
  the new sync test).
2026-07-02 01:18:19 -07:00
Jeremy Huang 5737ab3ddf Make master CI green: fmt, clippy, e2e transport flake, budget baselines (#419)
* style: cargo fmt --all to clear formatting drift

Master's CI Format/Quality-Guardrails checks were red from accumulated
rustfmt drift across ~18 files (unrelated to any single change). Apply
`cargo fmt --all` so the formatting gate passes again.

* test(e2e): fix flaky transport parity test (memory sidecar race)

The websocket transport-parity test failed in CI: the WS resume snapshot
saw 1 message while unix saw 2. Root cause: the memory sidecar's
background extraction made its own provider `complete()` call that
consumed the single queued mock response, so the actual user turn streamed
an empty reply and never persisted an assistant message. The unix scenario
only avoided it by incidental timing.

Fixes:
- Disable the memory sidecar/extraction in the e2e test env
  (JCODE_MEMORY_ENABLED=0, JCODE_MEMORY_SIDECAR_ENABLED=0) so background
  LLM calls can't steal queued mock responses.
- Deterministically wait for the assistant message to persist (poll live
  history until 2 messages) before resuming in both transport scenarios,
  instead of relying on incidental latency.

Full e2e suite: 49 passed / 0 failed (was 48/1).

* fix(clippy): clear clippy -D warnings debt across workspace

Master's Quality Guardrails clippy step (`clippy --all-targets
--all-features -- -D warnings`) had accumulated failures (it never ran in
CI because the earlier fmt step failed first). Fix them:

- Idiomatic auto-fixes: needless borrows, needless into_iter, collapsible
  ifs, sort_by -> sort_by_key, unnecessary casts, redundant clones, etc.
  (jcode-base, jcode-import-core, jcode-tui*, jcode-tui-render/-mermaid).
- Gate platform-only launch-hotkey/menubar helpers used solely by macOS
  code (+ tests) with `#[cfg(any(test, target_os = "macos"))]` and a
  crate-level allow for the non-macOS test build, so they aren't reported
  as dead code on Linux.
- memory_recall_bench (dev-bins): factor complex tuple types into
  ExtractionJob/RecallResultRow aliases, allow intentionally-unused corpus
  fields and the dynamic_gate wrapper, fix doc-list indentation.

`cargo clippy --all-targets --all-features -- -D warnings` is now clean.

* chore(ci): refresh quality-guardrail budget baselines

The code-size, test-size, panic-prone, and swallowed-error baselines were
last refreshed Jun 13-20 and had drifted behind master as PRs merged
(commands.rs/dispatch.rs growth, etc.), so the ratchet steps failed on
every CI run regardless of the change under test. Refresh all four
baselines to the current tree (which also accounts for the e2e
test_support growth from the transport-parity fix) so the guardrails
reflect reality again.

* chore(ios): untrack committed Swift build artifacts (.build/.build-ios)

2284 iOS Swift build outputs under ios/.build and ios/.build-ios were
committed before ios/.gitignore existed. They include symlinks
(ios/.build/debug -> arm64-apple-macosx/debug) that resolve to
directories on checkout, which broke CI's security-preflight secret scan
('grep: ... : Is a directory' -> exit 2 -> 'secret scan failed to
execute'), failing Build & Test (ubuntu).

Remove them from the index (they stay on disk and are already covered by
ios/.gitignore) so the tree no longer ships build artifacts and the scan
runs cleanly.

* fix(security): unblock CI security preflight (quinn-proto bump + lopdf ignore)

The security-preflight cargo-audit step flagged 2 vulnerabilities:

- RUSTSEC-2026-0185 (quinn-proto remote memory exhaustion): fixed by
  bumping quinn-proto 0.11.14 -> 0.11.15 (Cargo.lock only).
- RUSTSEC-2026-0187 (lopdf stack overflow on deeply nested PDFs): lopdf
  0.34 is pinned by pdf-extract 0.8.2 and cannot be upgraded to the fixed
  >=0.42 without an upstream pdf-extract release. Only reachable when
  extracting text from a user-opened PDF, not in the auth/provider/network
  path. Added to the documented audit-ignore list in
  scripts/security_preflight.sh with a tracking row in
  docs/SECURITY_DEPENDENCIES.md, matching the existing pattern.

Combined with untracking the ios build artifacts, this makes the
Build & Test (ubuntu) security-preflight step pass.
2026-06-28 21:23:16 -07:00
jeremy 28342a9030 refactor: eliminate production-path unwraps in productivity-core and memory bench
- scan.rs: replace poison-prone Mutex<u64> counters with AtomicU64
  (removes 2 .lock().unwrap() calls; also lighter for the rayon loop)
- aggregate.rs: replace .last().unwrap() with a let-else guard
- memory_recall_bench.rs: replace .unwrap() on Path::parent / Option /
  partial_cmp with explicit handling
- refresh panic budget baseline: productivity-core fully cleared;
  register the previously-untracked dev bench (expect-on-bad-CLI-arg only)
2026-06-20 04:49:02 -07:00
jeremy 5f84f44589 chore(ci): regenerate code-size/panic/swallowed-error/test-size baselines
These four Quality Guardrails baselines were last refreshed on 2026-05-14,
before the Phase A/B crate extraction (4dd91a9c, 4aec863e) moved most modules
from src/ to crates/jcode-app-core/ and crates/jcode-base/. The baselines still
keyed the old src/ paths, so every relocated file registered as a brand-new
oversized/panic-prone/swallowed-error file and the guardrails failed on every
commit. CI only surfaced it now because the clippy step ran first and aborted
the job before these checks.

Regenerated from the current tree (no source changes in this commit). Verified
no new entries originate from this session's edits: the deltas are exactly the
src/ -> crates/ relocations from the earlier refactor.
2026-06-12 21:30:14 -07:00
jeremy d07bd8f2c1 Refresh panic usage ratchet baseline 2026-05-14 07:09:31 -07:00
jeremy c86e7719d5 Ratchet production panic budget to zero 2026-04-27 14:53:40 -07:00
jeremy a1bd72b44b Harden bash progress parser error handling 2026-04-27 14:49:21 -07:00
jeremy d1905bf3f0 chore: ratchet quality budgets after cleanup 2026-04-27 02:58:07 -07:00
jeremy 859a25fa26 Extract memory estimation helpers 2026-04-26 20:21:23 -07:00
jeremy 0bb0cf7bca Reduce mobile simulator test panic usage 2026-04-26 20:21:23 -07:00
jeremy 05100c368e Extract TUI copy point hit testing 2026-04-26 20:21:23 -07:00
jeremy 13d5764ead Harden TUI URL regex initialization 2026-04-26 20:21:23 -07:00
jeremy e120b048d7 Reduce panic-prone test helpers 2026-04-26 20:21:22 -07:00
jeremy 79a3091a52 Fix release readiness guardrails 2026-04-24 01:37:17 -07:00
jeremy dcab440cd6 Add quality regression budgets 2026-04-23 15:30:08 -07:00