On this page
Chunk
A chunk is the unit Skryba rewrites and selects independently. --max-words-per-chunk sets its whitespace-word budget; the caller states it, and Skryba assumes none.
Construction
src/text/humanizer/rewrite.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:
- samples strategies from the policy;
- generates
--candidatesrewrites through the selected generator, applying the same required style and language to every candidate; - scores and quality-checks every candidate, including both profile checks;
- selects a passing candidate, or keeps the source only if the source matches the required style and language;
- records the source, selected candidate, all generated candidates, and fallback flag in
chunks[].
If neither a candidate nor the source is eligible, the whole rewrite fails before final output and report files are written. 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.
Generation budget
Brama candidates are requested with no max_tokens: the routed model writes until it ends. A completion its own output limit cut short is still an error (Brama response was truncated at the model's own output limit). Local generation passes --local-max-new-tokens to ster generate; it is required with --generator local, because Ster assumes no token budget.
Invariants
--max-words-per-chunk 0is refused withmaximum 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: truemeans no generated candidate passed all checks and the original chunk matched both profile requirements.
The desktop Rewrite view takes this setting as a typed number; the CLI accepts any positive integer.
Maintained as part of the website-owned Skryba documentation corpus.