Repository navigation
feat(observability): fold TTS_FAULT into Settings and enforce the never-log rule - #22
Merged
Merged
Conversation
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.
Task T4.3 from docs/ARCHITECTURE.md §14 (refs §11, NFR-06).
What changed
Settingsgainsfault(TTS_FAULT, defaultnone);config.pyis now the only environment reader for the fault hook (§7.1 field list updated in this PR per §14.4). Unknown values warn and disable injection; arming the fault logs a warning.jobs/manager.pyreadsself._settings.faultinstead ofos.environ; both failure branches use a new_log_preview()helper capped at 80 characters.tests/unit/test_observability.py: a failed generation logs the §9.1 code + reason + 80-char preview and never the full input (difflib.SequenceMatcherlongest common run <= 80), with no timing JSON;Settings.load()fault parsing (default/override/unknown) is pinned; a manager built withfault='none'succeeds even whenTTS_FAULT=engineis set in the environment.fault_harnessand integrationfault_environment.Verification
python -m ruff format --check src/tts tests— 53 filespython -m ruff check src/tts testspython -m mypy --strict src/ttspytest tests/unit --basetemp .venv/ptmp-t43— 201 passed (5 new)TTS_DATA_DIR=.venv/tts-data pytest tests/integration/test_jobs_pipeline.py -m integration— 7 passed against realen_US-lessac-medium(injected fault still leaves no.wav/.part)git diff --checkDecisions
Settings.faultis validated (none/engine), normalized for case/whitespace, and an unknown value falls back tononewith a warning._log_preview) and the never-log rule is enforced by a longest-common-substring assertion instead of a brittle string search.