Skip to content

Phase 2: wire PostProcessorChain (extract transcript cleanup to core) - #42

Merged
initcore0 merged 2 commits into
mainfrom
feat/wire-postprocessor-chain
Jun 23, 2026
Merged

Phase 2: wire PostProcessorChain (extract transcript cleanup to core)#42
initcore0 merged 2 commits into
mainfrom
feat/wire-postprocessor-chain

Conversation

@initcore0

Copy link
Copy Markdown
Owner

Replaces AppState'''s hardcoded postProcess() steps with TranscriptCleaner in OpenWhispCore — the OS-independent local pipeline (normalize → drop markers → vocab → smart-format → meta-strip), as both a sync clean() fast path and a composable PostProcessorChain. This is the plugin seam (Phase 2) and step 1 of the platform-agnostic core (Phase 2.5).

  • Pure marker/ignorable/formatting helpers moved out of AppState into the testable core.
  • The previously-unused PostProcessorChain is now actually used.
  • Behavior unchanged — verified by testCleanMatchesChain (fast path == chain) plus marker/ignorable/vocab-order/meta-strip-gating tests.

+9 tests; swift test 92/92; builds clean.

🤖 Generated with Claude Code

initcore0 and others added 2 commits June 23, 2026 12:34
… core

Replaces AppState's hardcoded postProcess() steps with TranscriptCleaner in
OpenWhispCore — the OS-independent local post-processing pipeline. Behavior is
identical; this is the plugin seam (Phase 2) and step 1 of the platform-agnostic
core (Phase 2.5).

- New OpenWhisp/Services/TranscriptCleaner.swift (Foundation-only, in OpenWhispCore):
  the normalize → drop-markers → vocab → smart-format → meta-strip pipeline as
  both a synchronous clean() fast path AND a composable PostProcessorChain
  (makeChain), with PostProcessor stage adapters (NonSpeechMarker / Normalize /
  IgnorableGuard / MetaInstruction). SmartFormatter + VocabularySubstitutor already
  conform to PostProcessor and slot in directly.
- AppState.postProcess() now delegates to TranscriptCleaner built from a settings
  snapshot; the marker-removal / ignorable / smartFormatter helpers are removed
  from AppState (moved into the testable core).
- The unused PostProcessorChain type is now actually used.

Tests: +9, incl. testCleanMatchesChain proving the fast path and the chain produce
identical output, plus marker/ignorable/vocab-order/meta-strip-gating coverage.
swift test 92/92; builds clean. No behavior change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
clean() and makeChain() now both build the vocab/format stages from shared
vocabularyStage/smartFormatterStage computed helpers, so they can't drift on
gating or formatter options. No behavior change (testCleanMatchesChain still
passes); 92/92.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@initcore0
initcore0 merged commit 41b3d85 into main Jun 23, 2026
4 checks passed
@initcore0
initcore0 deleted the feat/wire-postprocessor-chain branch June 23, 2026 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant