Skip to content

chore: clear release build warnings - #62

Merged
BunsDev merged 3 commits into
mainfrom
chore/clean-release-warnings
Sep 4, 2026
Merged

chore: clear release build warnings#62
BunsDev merged 3 commits into
mainfrom
chore/clean-release-warnings

Conversation

@BunsDev

@BunsDev BunsDev commented Sep 1, 2026

Copy link
Copy Markdown
Member

Clears every warning the v0.0.1 release build emits, so a clean build is the baseline rather than something to be read past.

Rust dead code — 4 warnings

The flagged items are reachable only under feature = "phase1-conformance" or from tests, but were defined unconditionally. Gated them with #[cfg(...)] matching their real reachability rather than papering over them with #[allow(dead_code)] — the compiler keeps telling the truth about what is live.

Item Gate
keyring.rs — 4 native_keyring_backend definitions all(feature = "phase1-conformance", target_os = ...)
lib.rscancel_all_operations, operation_registry, mutation_queue feature = "phase1-conformance"
operation.rscancel_all feature = "phase1-conformance"
operation.rsNativeOperationInput::new any(test, feature = "phase1-conformance")

CSS descending specificity — 7 warnings

Six were cross-scope false positives: a .fam-*/.set-* selector paired against an unrelated earlier .chat-demo .* rule that can never match the same element. One (.fam-check-mark) was a genuine ordering bug — the base rule sat after its own .is-pass modifier.

The .fam-*/.set-* block styles FamiliarsPage and SettingsPage, neither of which is rendered anywhere, so 778 lines of orphaned rules were living in the shared demo stylesheet. Extracted them to src/demo/familiars-settings.css, imported from the two pages that own them, and moved the .fam-check-mark base rule above its modifier.

Oversized chunk — 541.83 kB > 500 kB

main.tsx statically imported both demo surfaces, so demo-only code and CSS shipped inside the production bundle. Made them React.lazy behind a Suspense boundary and moved each stylesheet into the module that owns it.

Asset Before After
Production JS entry 541.83 kB 315.09 kB
Production CSS ~84 kB 12.08 kB
chat-demo chunk (inlined) 175.73 kB JS + 41.13 kB CSS, lazy
minimal-macos chunk (inlined) 39.55 kB JS + 30.40 kB CSS, lazy

Demo code now loads only under ?demo=chat / ?demo=minimal. No Rollup chunk-size warning.

Verification

  • cargo check — clean
  • cargo clippy --all-targets --all-features -- -D warnings — clean
  • pnpm lint — clean (was 7 warnings)
  • pnpm typecheck — clean
  • vite build — no chunk-size warning
  • 59 demo tests pass, including chat-shell.test.tsx's assertions that read chat-demo.css from disk

Touches no harnessAuthority or chatAuthority file, so no conformance repin is required.

Copilot AI lite review requested due to automatic review settings September 1, 2026 07:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to make the v0.0.1 release build “warning-free” by tightening Rust cfg reachability, addressing CSS specificity/lint warnings, and reducing production bundle size by ensuring demo surfaces are code-split and only loaded when explicitly requested.

Changes:

  • Lazy-load demo entry points (?demo=chat / ?demo=minimal) to keep demo-only JS/CSS out of the production bundle.
  • Extract orphaned Familiars/Settings CSS into a dedicated stylesheet imported only by the pages that own it, and fix a modifier/base ordering issue.
  • Gate Rust items with #[cfg(...)] so dead-code warnings match actual feature/test reachability.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/main.tsx Replaces static demo imports with React.lazy + Suspense to avoid shipping demo code in prod bundle.
src/demo/chat-demo.tsx Moves demo CSS import into the demo module so it loads only when the demo loads.
src/demo/chat-demo.css Removes Familiars/Settings CSS block from the shared demo stylesheet.
src/demo/minimal-macos.tsx Imports demo-specific CSS from the module so it loads only when that demo chunk loads.
src/demo/minimal-macos.css No functional change shown in diff; referenced by the updated module import pattern.
src/demo/familiars-page.tsx Imports extracted Familiars/Settings CSS locally.
src/demo/settings-page.tsx Imports extracted Familiars/Settings CSS locally.
src/demo/familiars-settings.css New extracted stylesheet for Familiars/Settings pages to avoid global demo CSS bloat/warnings.
src-tauri/src/lib.rs Gates conformance-only helper methods behind feature = "phase1-conformance".
src-tauri/src/operation.rs Gates conformance/test-only APIs (new, cancel_all) behind appropriate cfg.
src-tauri/src/keyring.rs Gates backend-identification helpers behind conformance feature + target OS to match actual reachability.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/main.tsx Outdated
@BunsDev

BunsDev commented Sep 1, 2026

Copy link
Copy Markdown
Member Author

Independent verification of 49b9944 on a clean checkout, macOS arm64, Node 24.18.1 / pnpm 10.34.0 / Rust 1.95.0.

Check Result
pnpm typecheck clean
pnpm lint Checked 111 files in 109ms. No fixes applied.zero diagnostics, including the 7 noDescendingSpecificity warnings that were previously emitted for src/demo/chat-demo.css
pnpm build succeeds
cargo build zero warnings (the 4 dead-code warnings are gone)
pnpm exec vitest run 381 passed, 61 skipped, 0 failed (25 files)

The chunk-size warning is genuinely fixed, not suppressed

Before, one 541.83 kB chunk tripped Rollup's 500 kB advisory. After:

dist/assets/index-Dh0YyzBC.js           315.14 kB │ gzip: 92.78 kB
dist/assets/chat-demo-D6N6fRVm.js       175.73 kB │ gzip: 57.65 kB
dist/assets/minimal-macos-CxPhbISo.js    39.55 kB │ gzip: 10.86 kB
dist/assets/minimal-icons-z7QZluKu.js    13.18 kB │ gzip:  4.09 kB

No chunkSizeWarningLimit was raised. The demo surfaces are genuinely split out, so the production entry no longer carries code that only the demo routes use — the largest chunk dropped by 42%.

On the CSS split

Moving the .fam-* / .set-* rules into src/demo/familiars-settings.css is the right fix rather than a rule suppression: those 122 rules belong to FamiliarsPage and SettingsPage, which are demo-only surfaces, and their interleaving with the chat rules in one file is what produced the descending-specificity diagnostics in the first place.

Signature status

Both commits report verified: true, reason: valid from the GitHub API. 49b9944 shows as E under a local git log --show-signature only because it is signed with GitHub's web-flow key, which is not in a local keyring — not because it is unsigned.

One caveat

pnpm test (which runs the heavy suite as well) failed once for me at src/phase1-conformance-lock.test.ts — but on the stale 2a78517, and the failure was Error: Hook timed out in 10000ms in the afterEach that tears down scratch git checkouts, with 88 passed and no assertion failure. That is machine-load flake in cleanup, not a content failure, and it is unrelated to this diff, which touches no conformance path. Worth watching in CI rather than treating as a signal here.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Comment thread src/demo/familiars-settings.css Outdated
@BunsDev
BunsDev force-pushed the chore/clean-release-warnings branch 3 times, most recently from 37a7f0a to 3f0596f Compare September 2, 2026 04:35
@BunsDev

BunsDev commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

Rebased onto current main at f5be2ab and pushed 3f0596f. The refreshed Web checks and image verification are failing on a pre-existing reasoning-card mismatch introduced by 25b31a2: the tests/e2e expect a <button aria-expanded> disclosure with tool/timing/provenance fields, while src/demo/chat-demo.tsx still renders the older native <details>/<summary> card. The failure reproduces locally and is outside this warning/CSS/Rust diff; Rust, lint, typecheck, and production build pass. I did not fold the separate reasoning-card implementation into PR #62.

@BunsDev
BunsDev force-pushed the chore/clean-release-warnings branch from 3f0596f to 31a1777 Compare September 4, 2026 04:35
@BunsDev

BunsDev commented Sep 4, 2026

Copy link
Copy Markdown
Member Author

Rebased onto current `main` (was 11 commits behind) and resolved the conflict in `src/main.tsx`. Everything else — the CSS extraction, the Rust dead-code gating, the other demo files — merged cleanly with no changes needed.

The conflict existed because this branch predates the `?demo=chat` swap to `FamiliarsShell` and the "scope suspense to demo surfaces" fix that both landed on `main` since. Resolved by keeping current `main`'s routing (`chat` → `FamiliarsShell`, `messages` → `DemoShell`) and applying this PR's lazy-loading pattern to `FamiliarsShell` too, which didn't exist as a demo target when the PR was written — otherwise it would silently reintroduce the exact bundle-size regression this PR fixes, just via a different surface. Moved `familiars-shell.css` into `familiars-shell.tsx` itself, matching how `chat-demo.css`/`minimal-macos.css` already moved into their own modules.

Verified locally: `cargo check/clippy/fmt/test` (default and `--all-features`) clean, `pnpm typecheck`/`lint`/`format:check` clean (0 warnings, confirming the CSS specificity and dead-code fixes both still hold), full unit suite 472/472 real tests (1 known unrelated environment flake in `phase1-schema-v2-evidence.test.ts`, reproduces identically on a clean `main` checkout), full e2e suite 10/10, and a production `vite build` — no chunk-size warning, `FamiliarsShell` now correctly split into its own lazy chunk (86 kB JS + 58 kB CSS) alongside the original `chat-demo`/`minimal-macos` chunks.

Same CI-outage caveat as elsewhere: can't get a fresh recorded green run right now (org-wide GitHub Actions billing lockout), so this is verified locally, not yet re-verified in CI.

🤖 Generated with Claude Code

@BunsDev
BunsDev force-pushed the chore/clean-release-warnings branch from 31a1777 to 0c09688 Compare September 4, 2026 06:56
@BunsDev

BunsDev commented Sep 4, 2026

Copy link
Copy Markdown
Member Author

Rebased once more onto current main — it now includes #88 (the harness-authority repin that landed right after your last check), which clears the 3 "expected red until post-merge repin" failures that showed up in the last CI run. Verified locally: phase1-conformance.test.ts 132/132, lint 0 warnings, format clean. Pushed.

@BunsDev BunsDev added the ci:full Run the macOS and Windows CI jobs on this pull request label Sep 4, 2026
@BunsDev BunsDev closed this Sep 4, 2026
@BunsDev BunsDev reopened this Sep 4, 2026
BunsDev and others added 3 commits September 4, 2026 05:10
Three classes of warning stood between v0.0.1 and a clean release build.

Rust dead code (4 warnings): the affected items are reachable only under
`feature = "phase1-conformance"` or from tests, but were defined
unconditionally. Gated them with `#[cfg(...)]` to match their real
reachability instead of suppressing with `#[allow(dead_code)]`, so the
compiler keeps telling the truth about what is live.

CSS descending specificity (7 warnings): six were cross-scope false
positives pairing `.fam-*`/`.set-*` selectors against unrelated earlier
`.chat-demo .*` rules; one (`.fam-check-mark`) was a genuine ordering bug.
The `.fam-*`/`.set-*` block styles FamiliarsPage and SettingsPage, neither
of which is rendered from the demo shell, so it was 778 lines of orphaned
rules sitting in the shared stylesheet. Extracted it to
`src/demo/familiars-settings.css`, imported from the two pages it belongs
to, and moved the `.fam-check-mark` base rule above its `.is-pass`
modifier.

Oversized chunk (541.83 kB > 500 kB): `main.tsx` statically imported both
demo surfaces, so demo-only code and CSS shipped in the production bundle.
Made them `React.lazy` and moved each stylesheet into the module that owns
it. The production entry drops to 315.09 kB and production CSS to
12.08 kB; the demo code splits into chunks that only load under
`?demo=chat` / `?demo=minimal`.

Verified: `cargo check` and `cargo clippy --all-targets --all-features
-- -D warnings` both clean, `pnpm lint` and `pnpm typecheck` clean, `vite
build` emits no chunk warning, and the 59 demo tests pass.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: BunsDev <68980965+BunsDev@users.noreply.github.com>
Give the detail-pane and analytics empty states distinct selectors so their spacing is intentional. Keep settings fixtures in a side-effect-free module so extracting page CSS does not pull it into the chat demo chunk.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@BunsDev
BunsDev force-pushed the chore/clean-release-warnings branch from de7a4b7 to 5f4b99a Compare September 4, 2026 10:16
@BunsDev
BunsDev merged commit 7ef76ad into main Sep 4, 2026
10 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:full Run the macOS and Windows CI jobs on this pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants