Skip to main content

Module style

Module style 

Source
Expand description

Two gates over every string spar sends to GitHub.

Style. Models comply unreliably with negative instructions, especially over a long run, so prompting is necessary but not sufficient. Every commit message, PR body, and comment is scrubbed deterministically and then re-verified. A leak is a hard error, not a warning.

Shape. The reader of a PR is a human with other work. What made a thread unreadable was never the length of the findings, it was spar narrating itself: which agent spoke, which round it was, counts of things listed on the next line. So spar composes every comment itself from structured fields, and that is where brevity comes from.

The length budgets below are safety valves, not editors. They are sized so that real content is never touched, and when one does fire it completes the sentence in progress rather than stopping mid-thought. Cutting substance was a mistake worth naming: a reader who cannot act on a finding has been given nothing, and the characters saved bought nothing. Brevity is asked for in the prompts, which is free, and enforced only on shape.

Structs§

Style
Everything the two gates need to know. Mirrors the [style] config block.

Functions§

body
An issue or PR body. Multi-line is fine here; bloat is not.
clip
Truncate to roughly max characters, ending on a complete sentence.
clip_bare
The same, without an ellipsis when it does have to cut.
detail
A finding’s explanation, as it appears in the PR thread. Kept on one line so a bullet stays a bullet.
issue_body
A filed issue’s body.
one_line
Collapse to a single line of single-spaced words.
scrub
Remove banned style artifacts. Idempotent: scrubbing scrubbed text is a no-op, which matters because text passes through here more than once.
sentence
Capitalise the first letter, so a model’s fragment reads as a sentence when spar sets it after one of its own.
strip_empty_sections
Drop a heading whose section holds nothing, and the bare “## Summary” style heading that only announces the body underneath it.
summary
A one-sentence verdict or disposition reason.
tighten
The full outbound treatment for a block of model prose: strip structural noise, then clip to a budget.
title
A finding title, issue title, or PR title: always one line, always short.
violations
Anything the scrub should have caught. Used as a post-check, so that a pattern the scrub cannot fix becomes a loud failure rather than a leak.