Skip to content

Repository foundations: CI, lint boundaries, provider contract, theme snapshots and theme reference - #235

Merged
CodeZeno merged 12 commits into
mainfrom
repo-quality-foundations
Nov 25, 2026
Merged

CodeZeno merged 12 commits into
mainfrom
repo-quality-foundations

Conversation

@CodeZeno

Copy link
Copy Markdown
Owner

Summary

Makes the repository easier to change safely, by people and by agents. The version stays 2.25.3: everything lands under [Unreleased] in CHANGELOG.md, and nothing here builds or publishes a release (release.yml still runs only on v* tags).

Commits, each verified on its own with fmt, Clippy -D warnings, cargo test --locked and tests/Test-Repository.ps1:

  1. ci: a CI workflow (fmt, Clippy, tests, a locked release build, dependency security checks, repository checks) that reports one CI passed status. Releases now accumulate under [Unreleased], with scripts/New-Release.ps1, Publish-Release.ps1 and Build-Release.ps1 (see docs/releasing.md). Patch-level Dependabot Cargo updates auto-merge.
  2. build(lints): [lints] plus clippy.toml enforce the code boundaries:
    • unsafe code only in files that opt in;
    • // SAFETY: comments on new unsafe blocks, as a ratchet;
    • no unwrap() in production code;
    • HTTP agents only from build_agent;
    • no process-environment mutation.
  3. test(poller): a provider contract test. Each provider needs a redacted fixture its parser reads, usage that survives the cache and reaches theme fields, translated settings, and unique ids. Writing the test turned up untranslated Cursor and OpenCode Go descriptions, which are now translated.
  4. feat(themes): --render-theme renders themes to PNG with the clock, time zone and appearance fixed. Snapshot tests cover every surface of every built-in theme in dark and light mode, and CI uploads them as the theme-snapshots artifact.
  5. docs: docs/feature-map.md names each part of the app and where its code lives.
  6. feat(themes): theme_language.rs describes the theme language once. The evaluator, Theme Studio's helper and the generated docs/theme-reference.md all read it, and a test fails if the reference is stale. --render-theme now warns about unknown fields and suggests the closest field name for bad expressions.

Verification

  • 668 tests passed, 6 ignored. cargo fmt --check, Clippy -D warnings and Test-Repository.ps1 pass.
  • scripts/Build-Release.ps1 (dependency gates and the release build) passes on the final tree.

🤖 Generated with Claude Code

CodeZeno and others added 12 commits November 23, 2026 14:23
The release dependency checks fail on RUSTSEC-2026-0592 (stack overflow in
Url::origin() on nested blob: URLs). url is locked only through the optional
cookie_store dependency of ureq and is not compiled, but cargo audit scans the
whole lockfile. form_urlencoded 1.2.3 is required by url 2.5.9.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A paint can now carry `light_color`, used while Windows is in light mode,
so one layer serves both appearances instead of a pair of layers gated on
`system.dark`. Paints without it resolve and serialize exactly as before,
and contexts without the system binding count as dark.

Theme Studio's colour controls gain a sun and moon toggle that expands a
colour into separate Dark mode and Light mode rows; collapsing keeps the
dark colour. Scene swatches follow the current Windows appearance.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Stacked Rows shows each provider's logo beside joined four-section bars,
one row per limit the account reports, with a magenta pace marker. Bars
follow the Usage direction setting, and hovering a provider opens a
flyout with usage, reset times and pace, or its waiting, error and
no-usage states. One set of layers serves both appearances through
light-mode colours.

A new `provider_mark` content type draws a provider's brand mark from the
dashboard's Brand Marks font through GDI, tinted and fitted to the layer,
and Theme Studio offers it as "Provider logo" with a provider picker.
Unknown provider keys fail validation and warn when rendered.

The Brand Marks font gains an empty U+0020 glyph: GDI treats a font whose
characters all sit in U+F000..U+F0FF as a symbol font and then maps none
of its glyphs by codepoint.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…mode colours

Classic, Compact Fluent Quad and Classic Vertical drew every mode-dependent
element twice, once gated on `system.dark` and once on `1 - system.dark`.
Each pair now becomes one layer whose paints carry `light_color`, taking the
dark layer's place in the draw order (163 -> 124, 158 -> 118 and
133 -> 114 layers). Both appearances render pixel-identically to before.

Gated layers remain fully supported: a new test renders a custom theme with
separate dark and light layers against the equivalent single layer in both
modes. `theme::with_dark_mode` lets tests choose the Windows appearance.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add a CI workflow that runs formatting, Clippy with warnings denied,
tests, a locked release build, the dependency security checks and the
repository checks on every pull request and push to main, reporting a
single `CI passed` status for branch protection. The tagged Release
workflow now requires CI to pass first.

Merged work accumulates under `[Unreleased]` in CHANGELOG.md.
tests/Test-Repository.ps1 checks the release metadata, and
scripts/New-Release.ps1, Publish-Release.ps1 and Build-Release.ps1
prepare, tag and build releases (docs/releasing.md). Patch-level
Dependabot Cargo updates auto-merge once CI passes.

Also resolve the remaining Clippy warnings in test code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ints

Add [lints] to Cargo.toml and a clippy.toml so Clippy reports broken
project rules with the fix in the message:

- unsafe code is denied unless a file opts in with
  #![allow(unsafe_code, reason = "...")];
- new unsafe blocks need a // SAFETY: comment; files that predate the
  rule carry a ratchet allow until their blocks are documented;
- production code cannot call unwrap(); the 11 remaining calls are
  replaced;
- ureq agents are created only by poller::build_agent and
  updater::build_agent;
- code cannot modify the process environment.

CONTRIBUTING.md describes the rules.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
every_provider_meets_the_contract checks each provider in
ProviderId::ALL: a redacted response fixture in src/poller/fixtures
that the provider's own parser reads, usage that survives the usage
cache and reaches theme fields, translated setting text in every
language, and unique keys, cache keys and menu command ids. A new
provider does not compile until it adds a fixture parser.

The test found the Cursor and OpenCode Go setting descriptions
untranslated; translate them. CONTRIBUTING.md describes the contract.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add `--render-theme <theme.json | built-in id> --out <file.png | folder>`
with --surface, --appearance, --fixture, --now, --utc-offset and
--scale. Rendering fixes the clock, time zone and appearance, so the
same input always gives the same image.

A test renders every surface of every built-in theme in dark and light
mode from the sample usage and compares the result with the reference
images in tests/snapshots/themes (regenerate with
CCUM_UPDATE_SNAPSHOTS=1). CI uploads the renders as the
theme-snapshots artifact, so a theme pull request can be reviewed as
pictures. CONTRIBUTING.md and the pull request template describe the
workflow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs/feature-map.md names each part of the app (widget, tray icon,
context menu, dashboard pages, Theme Studio panels, themes, providers
and command-line flags) and where its code lives, so issues, pull
requests and agent prompts use the same names. CONTRIBUTING.md links it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…erence

src/theme_engine/theme_language.rs is now the single description of
the theme language: every field, value, operator, function, number and
date format, mouse action and window. The expression evaluator,
Theme Studio's helper and docs/theme-reference.md all read it, and
`cargo test` fails when the generated reference is out of date.
`--theme-reference` prints the reference; src/themes/README.md points
agents and theme authors to it.

`--render-theme` now warns about each unknown theme field with the
likely fix, and failing expressions name the closest field.

Also reject a layer background that is not a colour or gradient, and
validate surface offset expressions instead of silently falling back
to offset_x or offset_y.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two retry-after tests moved a cooldown's `received` 15 minutes into the
past with `Instant::now() - MAX_RETRY_AFTER`. On Windows `Instant`
counts from boot, so on a CI runner up for less than 15 minutes the
subtraction panicked with "overflow when subtracting duration from
instant". Age cooldowns by shortening their delay instead, which gives
the same remaining time.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@CodeZeno
CodeZeno merged commit 0a9eee8 into main Nov 25, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant