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.

Concision. The reader of a PR is a human with other work. Model prose defaults to three paragraphs where one sentence would do, and asking nicely has the same reliability problem as asking for no em-dashes. So spar composes every comment itself from structured fields and clips each field to a budget, rather than forwarding whatever the model felt like writing.

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 max characters, preferring a sentence boundary.
detail
A finding’s explanation, as it appears in the PR thread. Kept on one line so a bullet stays a bullet.
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.
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.