On this page

Rewrite

A rewrite is Skryba's complete detector-directed transformation of one input text. It is not a single model response. Skryba generates several candidates for each chunk, measures every candidate with the configured detector ensemble and the quality judge, then selects the least detectable candidate that still passes the quality gate.

Shape

skryba rewrite --json and --report serialize a RewriteResult:

  • text: selected chunk texts joined with a blank line;
  • chunks[]: the source chunk, selected CandidateScore, all generated candidates, and used_source_fallback;
  • each candidate: strategy index and name, text, ensemble ai_probability, weighted quality_score, quality_passed, full quality evaluation, and per-detector results.

The complete wire field list is in the CLI reference.

Lifecycle

  1. Reject empty input, a zero candidate count, a zero chunk limit, temperature outside 0..=2, or minimum quality outside 0..=1.
  2. Split the input into chunks.
  3. For each chunk, sample --candidates strategy indices from the policy, using --seed.
  4. Ask Brama's generator model for one rewrite per sampled strategy.
  5. Score all generated candidates with every configured detector.
  6. Ask the Brama-backed quality judge to evaluate all candidates.
  7. Keep only candidates whose six quality dimensions meet their thresholds and whose critical_error is false.
  8. Select the survivor with the lowest ai_probability. If none survives, score the original chunk and select a synthetic source-fallback candidate.
  9. Join selected texts. Print text or JSON and optionally write --output and --report files.

Candidates are processed chunk by chunk. Detector calls for a candidate set run concurrently, while each detector still enforces its own interval and cache.

Selection invariants

  • Quality is a hard gate, not a ranking preference.
  • Detectability decides only among quality-passing candidates.
  • A detector failure fails the rewrite; Skryba never changes the ensemble silently.
  • The original text is always available as the fallback, so a chunk is not replaced by a candidate that failed the quality contract.
  • --seed controls strategy sampling, not remote model determinism.
  • --policy is loaded and validated; a missing or invalid policy is an error, not a fallback to the built-in policy.

Exact refusals

  • input text cannot be empty
  • candidate count must be positive
  • maximum words per chunk must be positive
  • temperature must be between 0 and 2
  • minimum quality must be between 0 and 1
  • BRAMA_TOKEN is required for Brama inference

The offline rewrite walkthrough shows a real selected plainspoken candidate and a complete score record.

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