Skip to content

Building and Checks

Yogeswaran Amsavalli edited this page Oct 3, 2026 · 1 revision

Building and Checks

Build

You need the .NET 8 SDK and the WebView2 runtime. From the repo root:

dotnet build
dotnet build -c Release

The output is clayo.exe in bin\Debug\net8.0-windows\ (or bin\Release\...), with Assets\ copied next to it. A Debug build runs beside an installed Clayo instead of handing its folder over; see Install.

To install a build for daily use, publish it as described in Install.

The self-checks

checks/ holds small runnable programs that test the logic that can live without a window. They are not unit-test projects: each is a single C# file with its own entry point, and CcxShell.csproj leaves them out of the app (<Compile Remove="checks/**" />).

Each file starts with:

#:property TargetFramework=net8.0-windows
#:project ../CcxShell.csproj

so it is run as a file-based app that references the main project. Run one from the repo root:

dotnet run checks/scan.cs

checks/mascot.cs documents the equivalent long form, dotnet run --file checks/mascot.cs.

  • Running a .cs file directly with #: directives needs a .NET SDK that supports file-based apps (.NET 10 or later). The app itself still targets .NET 8.
  • Each check builds CcxShell.csproj. If a Debug Clayo is running, bin\Debug is locked; use dotnet run -c Release checks/scan.cs instead. Don't kill a Clayo you need.
  • Each prints a PASS or FAIL line per case, then all checks passed or N FAILED. The exit code is the number of failures.
  • Run them from the repo root: checks/status.cs expects the current folder to be inside a git checkout, and checks/mascot.cs looks for design/ relative to it.
Check What it covers
checks/env.cs SessionLauncher.ScrubInheritedSession: a child shell sees CLAUDE_CODE_CHILD_SESSION before scrubbing and not after, and configuration variables (ANTHROPIC_MODEL) are left alone.
checks/scan.cs TerminalPane.Scan: "API Error:" and "Do you want to" found in one chunk, split across two reads, or byte by byte; no false positives across a gap or inside UTF-8 box drawing; an error wins over a prompt.
checks/island.cs IslandTrigger, with made-up cursors and clocks: the 600 ms dwell, the 240 px zone and the top two rows, held buttons and window drags, busy and fullscreen, leaving after 400 ms, a second monitor at a different scale, notices (needs you, error, done, reserve), their order, the 4 s Done, Clayo in front, the compact pill, the login greeting, file drags and the drop target, dwell progress.
checks/settings.cs ClayoSettings load and save: defaults with no file, round trip, no temp file left, unknown, missing and wrong-type keys, reserve thresholds, themes by name only, half-written, empty and unreadable files. Uses a throwaway folder, never your real settings.
checks/startup.cs LoginStartup: on by default, follows the exe when it moves, off removes the entry and stays off, on again; a Debug build never writes the real Run key, a Release build does. Uses a throwaway registry key (HKCU\Software\ClayoTest) and marker.
checks/status.cs StatusStore: parsing a real captured status line payload, context sum and percent, limits from epoch or ISO reset times, the effort fallback order, ignoring bad files, newest limits winning across sessions, the watcher seeing a renamed-in file, the usage cache fallback. Also GitInfo: numstat parsing and repo detection.
checks/strip.cs StatusStrip: colour bands, token counts (340k, 1M, 1.5M), model names, reset countdowns, which fields show for which settings, limits in the footer or header, stale limits, effort steps, the reserve turning a limit red, ReserveWatch warning once per window.
checks/mascot.cs A visual check, not pass/fail. Renders the WPF mascot to PNGs and, if Microsoft Edge and design/mascot/clayo-mascot.html are present, screenshots the HTML design beside them, to compare by eye. Usage: dotnet run --file checks/mascot.cs [out-dir]; the default is %TEMP%\clayo-mascot. design/ is not in the repo, so in a fresh clone the HTML half is skipped.

Before a pull request

  1. dotnet build and dotnet build -c Release.
  2. Run every check in checks/ and make sure each ends with all checks passed.
  3. If you changed logic that can live without WPF, add cases to the matching check in the same Check(...) style, or a new checks/<name>.cs.

See Contributing.

Clone this wiki locally