DSH familySearch GitHub

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.

  1. 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.

The seam this hook listens on
KindNameWhat
listenerllm/streamnormalizes the unicode dash family live in the transcript (text/reasoning deltas, assembled block-end blocks, tool arguments gated)
listenertools/post-executeoverpass arm, opt-in via scopes.toolResults (prepended, outermost vs the ccr gate)
listeneragent/pre-stepoverpass arm, opt-in via scopes.batch

Turns every unicode dash into a plain hyphen, live

The setting

One knob decides the replacement; the rest decide what the hook touches.

Configuration of hook-dsh-normalize-dash
FieldDefaultMeaning
logtruewrite the durable ledger file (volatile)
logFile~/.dsh/playform/hook-dsh-normalize-dash.logthe normalize-dash ledger (volatile)
replacement-the transform's only knob - hot-editable, the next stream picks it up with no remount (volatile)
normalizeReasoningtruenormalize reasoning deltas and the assembled reasoning block too
normalizeToolArgumentsfalserewrite the tool-call argumentsDelta and the assembled ToolCallBlock.arguments when on - execution-critical raw JSON, the user's accepted risk
scopessee belowgates every arm independently; the whole object is volatile
scopes.conversationtruetext-delta text + the assembled text/reasoning blocks
scopes.reasoningtruethe reasoning-delta sub-gate (ANDed with normalizeReasoning)
scopes.toolInputfalsethe tool-call arguments arm (OR-ed with normalizeToolArguments)
scopes.toolResultsfalsethe tools/post-execute arm
scopes.filestrueinert in a stream flavor (present so one patch override drives the whole family)
scopes.batchfalsethe agent/pre-step arm
toolResultsExemptread, edit, raw-write, normalize-file, ccr_retrieve, subagent, ask_user_questiona 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.

  1. Model a — b
  2. 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 text the reader keeps text
the model wrote:  a — b
the transcript:    a - b

The ledger

The hook writes one line when it activates.

Ledger read-only

cat ~/.dsh/playform/hook-dsh-normalize-dash.log

hook-dsh-normalize-dash: activated (replacement=-, reasoning=on, toolArgs=off)