On this page

Chunk

A chunk is the unit Skryba rewrites and selects independently. --max-words-per-chunk sets its whitespace-word budget; the default is 400.

Construction

src/humanizer.rs first splits input on exact blank-line (\n\n) paragraph boundaries and trims empty pieces. A paragraph within the budget stays whole. A larger paragraph is split into consecutive groups of at most the configured number of whitespace-delimited words. Skryba then accumulates those pieces into chunks, preserving blank lines between pieces while the combined word count still fits.

The resulting chunks retain text order. The final rewrite joins selected chunk texts with \n\n.

Lifecycle

For each chunk Skryba:

  1. samples strategies from the policy;
  2. generates --candidates rewrites through Brama;
  3. scores and quality-checks every candidate;
  4. selects one candidate or the source fallback;
  5. records the source, selected candidate, all generated candidates, and fallback flag in chunks[].

No candidate crosses a chunk boundary. Facts and qualifications that depend on another chunk are therefore the caller's responsibility when choosing a small limit.

Invariants

  • --max-words-per-chunk 0 is refused with maximum words per chunk must be positive.
  • A non-empty input yields at least one chunk.
  • Source order is preserved.
  • Every result chunk has exactly one selected candidate.
  • used_source_fallback: true means no generated candidate passed the quality gate and the original chunk was selected.

The desktop Rewrite view constrains this setting to 50–2,000 words in steps of 50; the CLI itself accepts any positive integer.

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