Skip to content

Kurvball

Kurvball is where a team agrees on what to build. Its repository holds a Tauri desktop app (apps/desktop), a Fastify API (apps/api), a worker (apps/worker) and shared packages. It has its own architecture gate, so here Ashlar runs beside it, as a proof that it fits a repository it wasn't built in.

The config, two reach scripts and the script live in examples/kurvball/. Kurvball's repository is private, so the script runs only with access to it. What it shows is what it printed.

Terminal window
examples/kurvball/prove.sh
import { defineConfig } from '@kurvball/ashlar';
export default defineConfig({
include: ['apps', 'packages'],
ignore: ['node_modules', 'dist', 'out', 'target', 'coverage', 'storybook-static', '.turbo', 'generated'],
onboard: {
owner: '@daguenette',
areas: ['packages/*', 'packages/modules/*'],
},
apps: [
{
root: 'apps/desktop',
stack: 'tauri',
main: ['src-tauri'],
renderer: ['src'],
shared: [],
features: ['src/features/*'],
client: ['src/platform'],
primitives: ['src/ui'],
areas: [],
},
{ root: 'apps/api', stack: 'web', main: ['src'], renderer: [], shared: [], areas: ['src/*'] },
{ root: 'apps/worker', stack: 'web', main: ['src'], renderer: [], shared: [], areas: [] },
],
});
  • The desktop is a tauri app. Its main process is Rust, which Ashlar doesn't read, so its rules watch the TypeScript renderer: features in src/features/*, the client in src/platform, primitives in src/ui. client-only and shared-is-pure know Tauri's packages, @tauri-apps/api and its plugins.
  • The API and the worker are web apps with no renderer (renderer: []), so they have areas but no features.
  • Kurvball's domain modules become onboarding areas through onboard.areas.

They are web apps with renderer: []: one process, no features, no client and no primitives.

  • ashlar map lists no feature of theirs; the map is the desktop's.
  • The rules about two processes or about features don't apply to them. A brief for an API file carries public-api-only, no-comment, no-disable and max-lines, never no-cross-process-import.
  • ashlar onboard takes each folder under apps/api/src as an area. The worker names no areas (areas: []), so it has none. The domain modules in packages/modules/* are areas through onboard.areas.

Kurvball's gate allows what Ashlar counts, so Ashlar takes a baseline first and holds every file to it. Its first check fails, as it should; after check --shrink it passes, and from then on no file may get worse. Here Ashlar's findings are a second opinion, not a gate Kurvball runs.

At Kurvball's commit b4a57d57:

Command On Kurvball
ashlar check, first run fails, as it should: Kurvball has no baseline yet
ashlar check --shrink, then check 3,316 files in about 2.3 s; the baseline holds about 439,000 counts, mostly max-lines and no-comment, and the check passes
ashlar affected on a desktop feature's file and an API route 179 tests
ashlar map 18 features, 2 with the reach scripts the example adds, 274 proofs
ashlar onboard 53 areas and 71 questions: what to know before changing each area, how to reach 16 features, who owns what, and whether the README is current

The baseline is large. That is the point of the ratchet: nothing is cleaned up in a sweep, and no file may get worse.

The two reach scripts, for the Ideas and Settings features, are written from the labels in Kurvball's code. Kurvball has no drive command, so the map shows them as data; nothing walks them.