Skip to main content

draft_commit_message

Function draft_commit_message 

Source
pub fn draft_commit_message(
    adapter: &dyn ModelAdapter,
    diff: &str,
) -> Result<Preprocessed<String>>
Expand description

Draft a commit-message subject line for diff by routing the whole diff through the local model (optional helper; card II-6).

A draft, never authoritative. The message is a lossy summary the human (or cloud model) must review and rewrite — the diff is not enumerably reduced here, so DropReport::dropped is empty and the report carries the “must be reviewed” caveat instead. The point is purely token-max: the full diff goes to the local model, and only a one-line draft is handed onward. With the echo stub the draft is the first diff line echoed back, plus ECHO_PASSTHROUGH_NOTE.