On this page

Architecture

Skryba Desktop is a SwiftUI executable with a narrow process boundary.

SkrybaRootView
  ↕ bindings
SkrybaModel ── validates draft / owns run state
  ↓
SkrybaCLI actor ── resolves and spawns installed skryba
  ↓ stdin / ↑ stdout, stderr, status
skryba CLI ── Brama, detectors, cache, policy, RentAHuman

Components

Source Responsibility
SkrybaDesktopApp.swift application entry and model lifetime
SkrybaRootView.swift sidebar, forms, command, loading/failure/result panels
SkrybaCommand.swift three workflow cases, validation, argv and stdin construction
SkrybaModel.swift one-run state machine and successful-output dispatch
SkrybaCLI.swift executable search, environment merge, process I/O
SkrybaResults.swift Codable mirrors of CLI JSON

What Desktop owns

  • macOS presentation and workflow form ranges;
  • exact argv construction for the three views;
  • locating and spawning one installed CLI per run;
  • preserving stdout, stderr, exit status, and displayed command;
  • decoding successful Score/Rewrite JSON into views;
  • a Copy action for final rewritten text.

What Desktop does not own

  • model or subscription routing;
  • detector credentials, provider adapters, normalization, cache, or rate limiting;
  • chunking, generation, quality thresholds beyond passing the chosen value, source fallback, or candidate selection;
  • policy training or persistence;
  • RentAHuman validation or response interpretation.

Run state

SkrybaModel.run() ignores re-entry while isRunning. A run clears prior result, raw output, and failure; records startedAt; then awaits one actor invocation. defer clears running state. Switching workflows clears result, raw output, failure, and command line but retains draft field values.

Trust boundary

The installed CLI is trusted to honor the command contract but its outputs remain fallible: nonzero stderr is displayed, and zero-status typed JSON is decoded strictly. Desktop never treats malformed successful output as an alternative result. Credentials remain outside SwiftUI fields and are only included in the child process environment.

Maintained as part of the website-owned Skryba documentation corpus.