Skip to content

test: keep only user-facing behavior across the pipeline suite - #23

Open
anthony-hermes[bot] wants to merge 3 commits into
masterfrom
test/behavior-only
Open

anthony-hermes[bot] wants to merge 3 commits into
masterfrom
test/behavior-only

Conversation

@anthony-hermes

@anthony-hermes anthony-hermes Bot commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

What

This branch began as the whole-suite trim: keep a test only when a user can observe a different outcome. Master has since landed that same trim (through #13 and #18), and this branch is now merged up to c732ff2. What is left in the PR is the part master does not have:

  • Deletes tests/pipeline/test_fakes.py, the tests of the test doubles themselves. No remaining test imports it; tests/fakes.py stays as the fixture library the lane tests use. A double's own modes are exercised where they are load-bearing, not in a file that asserts the double.
  • Restores the two guards that review pass 1 proved had no replacement (PR-001, PR-002 on the review ledger):
    • test_fit_takes_the_cue_edges_from_the_words_not_the_segment (FT5.4): a Segment ending at 2800 ms whose last word ends at 2100 ms must still produce a cue edge at 2100.
    • test_the_prompt_asks_for_one_json_object_keyed_by_the_segment_ids: the composed prompt still tells the model to answer with one JSON object keyed by the source ids, on synthetic profiles only, so shipped TOML wording can still change freely.
  • Merge of origin/master at c732ff2, resolving the content conflicts in test_cues.py, test_prompt.py and test_speakers.py to master's MAX_DIALOGUE_LINES refactor with the trim kept, and the modify/delete on test_fakes.py to this branch's deletion.

Diff against master: 3 files, 16 insertions, 140 deletions. No production code changed.

Evidence

make check exit 0 at c17f23d: ruff format 47 files, ruff check clean, mypy clean on 47 source files, pytest 336 passed, 7 deselected (addopts is -q -m 'not slow'; the 7 deselected cases need a real model or a real ffmpeg run).

git merge-tree --write-tree origin/master HEAD prints no CONFLICT.

Mutation checks on a disposable copy of the head tree, one at a time and discarded afterwards:

  • build_drafts taking end_ms=segment.end_ms fails test_fit_takes_the_cue_edges_from_the_words_not_the_segment with (1240, 2800) == (1240, 2100).
  • Dropping BASE_RULES from the prompt blocks fails test_the_prompt_asks_for_one_json_object_keyed_by_the_segment_ids on assert 'json' in prompt.

@anthony-hermes

anthony-hermes Bot commented Dec 5, 2026

Copy link
Copy Markdown
Contributor Author

143ccc6: deleted tests/pipeline/test_fakes.py, the twelve tests that exercised the doubles themselves.

That file was the same inception as the stub SDK test: the only implementation it ran was the fake. Its useful effect is preserved by the lane tests that use those modes, which now assert the outcome the lane owes (a bad answer means a rejected chunk), so a mode breaking still fails a real test.

193 tests to 181; make check exit 0; CI green.

@anthony-hermes

anthony-hermes Bot commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor Author

Hermes PR Review

Reviewed commit: c17f23d4d4497424789c014bbcc55c51528c1de0

Review status: No actionable findings

Executive summary

Pass 2 of 3. The author's net change against base c732ff250eb8c226f893c260e4900a6f635b7e72 is three files under tests/pipeline/: test_fakes.py is deleted (140 lines, the self-tests of the test doubles), and one guard is restored in each of test_cues.py and test_prompt.py (8 lines each). The head is a merge commit of the pass-1 head 143ccc67727fdd5ae18e33819156f2477ebda608 and master c732ff2; the previously conflicted test files now carry master's MAX_DIALOGUE_LINES refactor from #18 and master's glossary-order test from #13, so nothing from master was dropped. No production module, spec file, instruction file, CI config, Makefile, pyproject.toml or dependency manifest is in the net diff.

Both pass-1 findings are verified fixed at this head. Each restored test is an active guard: I re-ran both mutations in a disposable copy of the head tree and each one turns exactly the new test red. The coordinator's gate run exits 0 with 336 passed and 7 deselected; the full selection including the slow cases reports 343 passed. CI run 47573449292 on this head concluded success, and the PR reports mergeable: true.

Findings

No actionable findings. I reviewed the net diff and its callers, re-ran the gate and both mutations, and checked the merge resolution for lost master content. This is not an approval; the merge decision is the human reviewer's.

Previously reported findings

ID Finding Pass 1 Pass 2 Pass 3
PR-001 Word-derived cue end times lost their only regression guard Confirmed Verified
PR-002 Translation prompt JSON and id contract lost its only assertion Confirmed Verified

PR-001, Medium, verified. tests/pipeline/test_cues.py:223 now holds test_fit_takes_the_cue_edges_from_the_words_not_the_segment. It builds a Segment over EARLY_WORDS with end_ms=2800 while the last word ends at 2100, calls the public fit_cues, and asserts the cue edges are (1240, 2100). Mutating build_drafts to end_ms=segment.end_ms in a disposable copy fails only that test with (1240, 2800) == (1240, 2100).

PR-002, Medium, verified. tests/pipeline/test_prompt.py:87 now holds test_the_prompt_asks_for_one_json_object_keyed_by_the_segment_ids. It calls compose_prompt(source(), target()).lower() on the file's synthetic aa/bb profiles and asserts json and id are present. Removing BASE_RULES from the prompt blocks in a disposable copy fails it on assert 'json' in prompt. Shipped TOML wording is not pinned.

Verification

  • cd /home/hermes/.hermes/work/subsmith/.worktrees/behave && PATH=/home/hermes/.hermes/work/subsmith/.venv/bin:$PATH make check: exit 0, check: pass (ruff format 47 files already formatted, ruff check clean, mypy clean on 47 source files, pytest complete).
  • python -m pytest in the same worktree: exit 0, 336 passed, 7 deselected in 1.01s. addopts is -q -m 'not slow'; the 7 are opt-in slow cases.
  • python -m pytest -o addopts='' -q -p no:cacheprovider in the ledger worktree: exit 0, 343 passed in 6.59s, so the slow cases pass too.
  • PR-001 mutation in /home/hermes/.hermes/profiles/builder/cache/scratch/verify-23-pass2-m1 (disposable copy of the head tree, end_ms=segment.words[-1].end_ms changed to end_ms=segment.end_ms): pytest exit 1, test_fit_takes_the_cue_edges_from_the_words_not_the_segment failed with assert (1240, 2800) == (1240, 2100).
  • PR-002 mutation in /home/hermes/.hermes/profiles/builder/cache/scratch/verify-23-pass2-m2 (f"{BASE_RULES.strip()}" removed from the prompt blocks): pytest exit 1, test_the_prompt_asks_for_one_json_object_keyed_by_the_segment_ids failed on assert 'json' in prompt.
  • git -C /home/hermes/.hermes/work/subsmith/.worktrees/behave merge-tree --write-tree origin/master HEAD: exit 0, tree 6b8f4887248ec15aa1ae72cdf6cf8dd2a6f191d9, no CONFLICT line.
  • git diff --name-status c732ff2 c17f23d -- AGENTS.md CLAUDE.md CONTRIBUTING.md .hermes.md .github/ pyproject.toml Makefile scripts/check.sh: empty, so no instruction, CI or dependency change.
  • rg -n "test_fakes|tests\.fakes" tests/ src/: only imports of the tests.fakes fixture library remain; nothing imports the deleted module.
  • GitHub Actions run 47573449292 on c17f23d4: pull_request, completed, success. PR test: keep only user-facing behavior across the pipeline suite #23: mergeable: true, base master at c732ff250eb8c226f893c260e4900a6f635b7e72.
  • Reviewer route: edi/alt via custom:litellm (delegation review option). Review-only run: no code, commit, push, approval or merge was performed.
  • Not run: nothing was skipped for budget. This pass reads the remediation diff plus the net author diff; master-origin files that arrived through the merge are unchanged from the base.

Implementation walkthrough

A job starts in subsmith.cli and is orchestrated by run._run_job. ingest probes and extracts 16 kHz mono audio; the Transcriber runs two passes whose spelling disagreements are settled by run.merge_passes; glossary nominates terms; translate.translate_segments chunks segments by id and calls the Translator through openai_client.OpenAILanguageTranslator.translate, which composes the system prompt with prompt.compose_prompt and then has answers checked by translate.validate_translation; cues.fit_cues builds drafts, tries split, extend, condense and a logged trim, and output.write_artifacts writes the cues, QA and SRT.

PR-001's restored test sits on the fit path. build_drafts sets each draft's start from segment.words[0].start_ms and its end from segment.words[-1].end_ms, deliberately ignoring a recognizer segment that runs longer. The test gives the segment an end 700 ms past its last word and asserts the public fit_cues output follows the words, which is the FT5.4 rule in docs/spec/05-fit-and-timing.md.

PR-002's restored test sits on the translation path. prompt.BASE_RULES requires one JSON object keyed by the exact source ids; compose_prompt puts it in the first block. The test asserts that instruction is present without binding any shipped language profile.

The deleted tests/pipeline/test_fakes.py held self-tests of FakeTranscriber and FakeTranslator. Nothing imports it. The fake modes that matter to outcomes stay exercised in test_translate.py (missing, missing_once, extra, non_string), test_run.py and test_cli.py; tests/fakes.py is unchanged as the fixture library.

Changed files

  • tests/pipeline/test_cues.py: one added test after test_build_falls_back_to_the_source_text_when_a_translation_is_missing; also carries master's MAX_DIALOGUE_LINES updates from the merge.
  • tests/pipeline/test_prompt.py: one added test after the master-origin glossary-order test; synthetic profiles only.
  • tests/pipeline/test_fakes.py: deleted (140 lines). No remaining imports or configuration references.

Assumptions and risks

  • The base AGENTS.md and CONTRIBUTING.md plus coding-standards/references/testing.md are the review policy. Base and head are byte-identical for every instruction, CI and dependency file.
  • The guarded production code is unchanged: cues.py and prompt.py are not in the net diff. The test additions are the whole author change.
  • The new FT5.4 test asserts exact edges, stricter than the spec's 200 ms tolerance. That matches current behavior and the intent of the deleted base test.
  • A test double's own modes are test infrastructure, not user-visible behavior; with the load-bearing modes covered in the lane tests, their self-tests are not a coverage finding.
  • The 7 deselected cases need a real model or a real ffmpeg run; they pass in the full-selection run above.

Recommended human review order

  1. tests/pipeline/test_cues.py:223-228 against src/subsmith/pipeline/cues.py:397-401,918-932: confirm the fixture and assertion protect word-derived cue edges.
  2. tests/pipeline/test_prompt.py:87-92 against src/subsmith/pipeline/prompt.py:20-26,85-92: confirm the JSON/id contract is asserted without binding shipped wording.
  3. The tests/pipeline/test_fakes.py deletion against tests/fakes.py, test_translate.py, test_run.py and test_cli.py: confirm the remaining fake-mode coverage is sufficient.
  4. The merge commit's two parent trees: confirm master's test refactor survived the conflict resolution and the base-to-head instruction/config diff stays empty.

Brings origin/master (c732ff2) into the suite trim. The content conflicts
in test_cues.py, test_prompt.py and test_speakers.py resolve to master's
MAX_DIALOGUE_LINES refactor with the branch's trim kept, and the
modify/delete on test_fakes.py keeps this branch's deletion because no
remaining test imports it.

Review pass 1 findings PR-001 and PR-002 come back as
test_fit_takes_the_cue_edges_from_the_words_not_the_segment (FT5.4) and
test_the_prompt_asks_for_one_json_object_keyed_by_the_segment_ids.
anthony-hermes Bot added a commit that referenced this pull request Dec 5, 2026
Resolved tests/pipeline/test_cues.py, test_prompt.py and test_speakers.py by taking
master's copy for every pipeline test file. The suite trim lives in #23, so this
branch carries no pipeline test change after the merge; its own diff is the ten
onscreen files.
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.

0 participants