On this page

Spawn contract

The spawn contract is the complete boundary between Skryba Desktop and the installed skryba executable.

Executable resolution

On the first run, SkrybaCLI searches directories in this order:

  1. every current PATH entry;
  2. ~/.cargo/bin;
  3. ~/.local/bin;
  4. ~/.stado/bin;
  5. /opt/homebrew/bin;
  6. /usr/local/bin.

The first executable file named skryba is cached. Before reuse, the app checks that the cached path is still executable; otherwise it searches again.

Failure is:

skryba is not installed. Build it with cargo install --path . in the skryba repository, or place the binary on PATH, ~/.cargo/bin, ~/.local/bin, or ~/.stado/bin.

(The search also includes the two system package-manager paths.)

Process inputs

  • executable URL: resolved path;
  • arguments: exactly SkrybaCommandDraft.arguments;
  • environment: launch environment plus missing keys from ~/.config/skryba/env;
  • stdin: pasted text for Score/Rewrite, null device for status;
  • stdout and stderr: separate pipes.

The model initially derives a display command from skryba plus argv. After execution starts it replaces that with executable.lastPathComponent plus the same argv. Text sent through stdin is not embedded in the displayed command.

Completion

Both output pipes are drained concurrently before waiting for process exit, avoiding deadlock when a long rewrite fills a pipe buffer. The outcome retains command line, Int32 termination status, stdout decoded as UTF-8, and stderr decoded as UTF-8.

  • Nonzero status: stderr becomes the failure without paraphrase; empty stderr becomes skryba exited with status <status>.
  • Zero status: Score and Rewrite decode stdout JSON; status keeps stdout verbatim.

Compatibility contract

Desktop depends on the CLI command names, argv flags, and serialized Score/Rewrite field names mirrored in SkrybaResults.swift. Additive fields are tolerated by Swift decoding. Renaming or removing required fields, changing their types, or changing successful stdout away from JSON breaks the view. The CLI remains the only place allowed to interpret detector, quality, policy, or RentAHuman behavior.

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