Phase 2: wire PostProcessorChain (extract transcript cleanup to core) - #42
Merged
Conversation
… 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces AppState'''s hardcoded
postProcess()steps withTranscriptCleanerinOpenWhispCore— the OS-independent local pipeline (normalize → drop markers → vocab → smart-format → meta-strip), as both a syncclean()fast path and a composablePostProcessorChain. This is the plugin seam (Phase 2) and step 1 of the platform-agnostic core (Phase 2.5).PostProcessorChainis now actually used.testCleanMatchesChain(fast path == chain) plus marker/ignorable/vocab-order/meta-strip-gating tests.+9 tests;
swift test92/92; builds clean.🤖 Generated with Claude Code