refactor: remove transform_llm_output hook registration #2

Merged
BarnacleBoy merged 1 commit from refactor/remove-hook-registration into main 2026-09-10 14:47:45 +00:00
Owner

Removes the transform_llm_output hook registration from em-dash-sub.

The new barnacleboy-output wrapper plugin now owns the hook. It imports transform_em_dashes from this module and transform_vocabulary from spongebob-vocab, applying them in sequence. This solves two problems:

  1. Mutual exclusion: Two plugins were fighting over a single transform_llm_output slot. Only the first registered callback's result was used. Now the wrapper composes both transforms.

  2. Wrong order: If SpongeBob vocab ran first (hypothetically), it would add words like "Tartar sauce!" that then got split by em dash replacement. Now em dashes are always cleaned first, then vocab applies on clean text.

The register() function is kept as a no-op for backward compatibility.

Removes the `transform_llm_output` hook registration from em-dash-sub. The new `barnacleboy-output` wrapper plugin now owns the hook. It imports `transform_em_dashes` from this module and `transform_vocabulary` from `spongebob-vocab`, applying them in sequence. This solves two problems: 1. **Mutual exclusion**: Two plugins were fighting over a single `transform_llm_output` slot. Only the first registered callback's result was used. Now the wrapper composes both transforms. 2. **Wrong order**: If SpongeBob vocab ran first (hypothetically), it would add words like "Tartar sauce!" that then got split by em dash replacement. Now em dashes are always cleaned first, then vocab applies on clean text. The `register()` function is kept as a no-op for backward compatibility.
Hook registration moved to barnacleboy-output wrapper plugin.
The barnacleboy-output plugin now owns the transform_llm_output hook
and imports this module's transform_em_dashes function directly.

This allows multiple output transforms (em dash sub + SpongeBob vocab)
to compose sequentially instead of competing for the single hook slot.
BarnacleBoy deleted branch refactor/remove-hook-registration 2026-09-10 14:47:45 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
KrustyPlanet/em-dash-sub!2
No description provided.