Skip to content

Components

The building blocks of krites and how they fit together. Full layout in 0001 §7.

The deterministic engine (pkg/)

krites' value is its engine, and it lives in pkg/ as a deliberate public API. The engine is pure Go and cgo-free — it compiles to GOOS=js GOARCH=wasm today and must keep doing so. It never imports a native backend directly; those sit behind provider interfaces.

  • analyze/quality — sharpness and exposure maths.
  • dedup — perceptual hashing + clustering of near-duplicate bursts.
  • cull — verdict resolution from a cull profile.
  • develop (straighten, crop, look, bake) — the geometry + colour edit records and the pure-Go export bake.
  • shoot — the workspace model: manifest, sidecar, verdicts, edit records, removal patches.
  • xmp — Lightroom XMP sidecar round-trip.
  • export — the render: the only pixel-producing path.

Provider seams

Every heavy/native backend is injected behind a narrow interface, faked in tests, selected from config. Each adapter is its own package (native code never leaks into the WASM engine):

  • Decoder — RAW decode + image ops (libvips).
  • FaceAnalyzer — face/eye landmarks & pose (local ONNX, spec 0004).
  • AestheticScorer — learned aesthetic scoring (local ONNX, spec 0007).
  • Inpainter — generative object removal (LaMa / MI-GAN ONNX, spec 0008).
  • Clusterer — burst clustering.

Adding a backend is purely additive: a new adapter package behind the same interface, with no call-site changes.

The studio

krites studio is the primary surface — a local, single-user, localhost-bound web UI (Svelte SPA embedded via go:embed) over the same shoot files, using GTB's HTTP service lifecycle and per-launch auth. The cull-review grid stays fast on 4,000+ frames (preview-backed, virtualised).

Built on go-tool-base (GTB)

The root command, DI container (props.Props: logger, config, assets, filesystem, error handling, tool metadata), Cobra command tree, config + keychain layers, MCP server and update machinery are all GTB. krites is a downstream consumer that leans on GTB primitives rather than re-implementing them. Generated files carry DO NOT EDIT; new commands are scaffolded with gtb generate command.