On this page

Examples

Runnable examples live in the repository root examples/:

  • score-stdin.sh scores stdin or a built-in sentence, then repeats the exact bytes so the second result can show a cache hit.
  • rewrite-file.sh takes INPUT_FILE GENERATOR MINIMUM_QUALITY [REWRITE_OPTIONS...], passes the quality floor as the global --minimum-quality, and writes rewritten text and the complete JSON report separately, to outputs/rewritten.txt and outputs/rewrite-report.json.
  • verify-corpus.sh takes SEED and verifies the repository's curated fixture entirely offline.

Required style and output language

These invocations use the reusable rewrite example; they are examples, not captured successful model runs. Every number a rewrite uses is the caller's: <Q> is the quality floor and $KNOBS stands for --candidates <N> --max-words-per-chunk <N> --temperature <T> --seed <N>:

./examples/rewrite-file.sh draft.txt brama <Q> $KNOBS --style academic --language en
./examples/rewrite-file.sh draft.txt brama <Q> $KNOBS --style message --language pl
./examples/rewrite-file.sh draft.txt brama <Q> $KNOBS --style preserve --language preserve

The first requests English academic prose, the second a Polish message, and the third keeps the source register and language. Any name skryba style list or skryba language list prints works the same way, including entries added with skryba style add (catalog). The script forwards the rewrite options without splitting their values. It owns the output and report paths; do not supply duplicate --output or --report options.

Check the returned profile, both match booleans in every selected quality evaluation, and the actual text. A profile refusal leaves final output files unwritten, including any existing files at those destinations. Score-cache writes and requests already made are not rolled back. See rewrite for the profile definitions and diagnostics.

Real style journeys

The permanent journeys in tests/styles/ run the actual CLI against Skryba's real fleet database, each in a schema of its own that it drops when it finishes:

cargo test --test catalog -- --nocapture
cargo test --test styles -- --nocapture
cargo test --test styles -- --ignored --nocapture

The first adds, shows, changes and removes a style and a language, reads the choices table after each command, and checks every refusal sentence and that a refusal leaves the rows unchanged. The second checks that a style or language the catalog does not hold is refused with exit 1 before any model or detector credential is read, without changing existing output and report files. The third calls the configured Brama generator, judge, and detector APIs for academic English, Polish messages, translation in both directions, the default preservation profile, and a style and a language added through the CLI. It checks the saved text and report, the resolved profile, retained identifiers and citations, and the selected quality evaluation. Configure BRAMA_TOKEN_ROLE=ROLE#FIELD resolving an authorized client token, BRAMA_URL, and detector credentials; SKRYBA_MODEL and SKRYBA_JUDGE_MODEL must name models that the resolved token may call. Every journey needs stado on PATH and the skryba-database-client bearer.

Each run retains its source revision and changes, binary checksum, commands with their schema, exit statuses, input, output, and available reports under the repository's target/style-journeys/. An ignored live journey is not a successful rewrite check. Missing credentials, service refusals, or failed profile and content assertions fail that journey. An English-only detector does not qualify Polish detection.

Credential expectations

score-stdin.sh needs at least one detector key. rewrite-file.sh needs a resolvable BRAMA_TOKEN_ROLE=ROLE#FIELD plus at least one detector key. verify-corpus.sh needs neither credentials nor network. The generator and judge must support the requested language; detector scores are the configured providers' measurements, not proof of authorship.

Global CLI options must precede the subcommand. The examples use environment configuration so the command itself stays readable; see configuration. Earlier offline walkthroughs used stand-ins and do not qualify the real style and language behavior.

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