Case study
One character, end to end
An em dash leaves the model, passes one hook at its seam and arrives in the transcript as a hyphen.
The model
The model writes a typographic dash. Nothing in the harness has touched it yet.
- normalize-dash U+2014 — - the dash family: em, en, and seventeen exotic relatives
The seam
The hook holds one listener on the stream, and the stream is where every token passes.
| Kind | Name | What |
|---|---|---|
| listener | llm/stream | normalizes the unicode dash family live in the transcript (text/reasoning deltas, assembled block-end blocks, tool arguments gated) |
| listener | tools/post-execute | overpass arm, opt-in via scopes.toolResults (prepended, outermost vs the ccr gate) |
| listener | agent/pre-step | overpass arm, opt-in via scopes.batch |
The setting
One knob decides the replacement; the rest decide what the hook touches.
| Field | Default | Meaning |
|---|---|---|
| log | true | write the durable ledger file (volatile) |
| logFile | ~/.dsh/playform/hook-dsh-normalize-dash.log | the normalize-dash ledger (volatile) |
| replacement | - | the transform's only knob - hot-editable, the next stream picks it up with no remount (volatile) |
| normalizeReasoning | true | normalize reasoning deltas and the assembled reasoning block too |
| normalizeToolArguments | false | rewrite the tool-call argumentsDelta and the assembled ToolCallBlock.arguments when on - execution-critical raw JSON, the user's accepted risk |
| scopes | see below | gates every arm independently; the whole object is volatile |
| scopes.conversation | true | text-delta text + the assembled text/reasoning blocks |
| scopes.reasoning | true | the reasoning-delta sub-gate (ANDed with normalizeReasoning) |
| scopes.toolInput | false | the tool-call arguments arm (OR-ed with normalizeToolArguments) |
| scopes.toolResults | false | the tools/post-execute arm |
| scopes.files | true | inert in a stream flavor (present so one patch override drives the whole family) |
| scopes.batch | false | the agent/pre-step arm |
| toolResultsExempt | read, edit, raw-write, normalize-file, ccr_retrieve, subagent, ask_user_question | a tool result whose exec name is listed passes the tool-results arm by identity (volatile) |
The transcript
The rewrite reaches the live view and the stored block, because the normalization is the feature.
- Model a — b
- Transcript a - b
1 character changed: U+2014 to U+002D
Transcripta - b and another - with the family
Modela — b and another — with the family
Drag the handle, or use the arrow keys, to compare.
the model wrote: a — b
the transcript: a - bThe ledger
The hook writes one line when it activates.
cat ~/.dsh/playform/hook-dsh-normalize-dash.log
hook-dsh-normalize-dash: activated (replacement=-, reasoning=on, toolArgs=off)