Repository navigation
Phase 5: tests, dashboard sync, docs, and backup - #7
Merged
Merged
Conversation
…iles. Add the named API, settings, Piper, and EventSub tests plus pytest-cov, keep the dashboard checkboxes and errors in step with the server, document the real Twitch scopes and defaults, and zip data, persona, and config without .env. Co-authored-by: Kisahime <Kisahime@users.noreply.github.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.
Phase 5 of PLAN-v2.md. PR #6 has merged, so this targets
main. Phase 4 CI was already green (both test jobs on97c9058), so that branch was left as-is.V5-01 API and integration tests
Added
tests/test_api.py,tests/test_eventsub_session.py,tests/test_piper.py, andtests/test_settings.py. Pinnedpytest-cov==7.1.0inrequirements-dev.txt.create_app(prepared=...)was already the injection point (Phase 2). N-25's claim that nothing tests the API, that there is no CI, and that ruff is only E,F,I is stale: the suite was already hermetic, Windows CI already runs ruff and pytest, and.gitattributesalready exists. This phase adds the named modules and coverage rather than a second factory.update_configkeeps surrounding comments and CRLF. The mic state machine is driven with synthetic chunks.safety.is_blockedcovers the slur backstop and the advice patterns.Line coverage with
pytest --cov=src.main --cov=src.settings --cov=src.memory --cov=src.policy --cov=src.safety:src/main.pysrc/settings.pysrc/memory.pysrc/policy.pysrc/safety.pyThe real hardware lifespan in
create_app(model download and mic start) is still uncalled. Tests passprepared=so they never hit the network or a device.V5-02 Dashboard state sync and error handling
Status now includes
post_voice,duck_enabled, andwake. The dashboard sets those checkboxes from status when the control is not focused. EverydefPostcall goes throughpost(), which writes the error into#hintand does not leave a rejected promise. Success hints return early whenokis false.JSON.parseon/wsis guarded. Areconnecting…banner shows when the socket closes.N-26 is only partly current. Forget and Replay were already on the dashboard from Phases 2 and 4. The checkbox, parse, and rejection gaps were still real.
Headless Chrome, two tabs on one fake booth: unchecking Post voice in one tab cleared it in the other within 100ms. A non-JSON socket frame produced no window errors. Stopping the server showed the banner, with no unhandled rejections.
Dashboard after Post voice was turned off from the other tab
Reconnecting banner after the preview server stopped
V5-03 README refresh
README and
.env.examplenow list every Twitch scope a reader needs to tick (chat, EventSub feeds, shoutouts, stream markers), the localhost plus control-token model, the mod-only commands (!soand!pixel mute|unmute|chill|hype|stop), the two profiles,requirements-dev.txt/ pytest-cov / Windows CI, andlogs/cohost.log.N-04's "optional feeds are on" is stale. Shipped
config.yamlhas bits, channel points, hype train, polls, predictions, wake word, ducking, andsafety.allow_linksoff.welcome_first_time, barge-in, echo gate, events, and post-voice replies are on. The README table matches that.V5-04 Backup script
scripts/backup.ps1zipsdata/,persona.yaml, andconfig.yamltobackups/YYYYMMDD-HHMM.zip, skips every.env, and keeps the last 10.backups/is gitignored. The plan title says "update"; the steps are backup only, so there is no updater.tests/test_backup.pyruns the script with-Rootagainst a temp tree (PowerShell 7).Tests
ruff check src testspassed. Full pytest: 94 passed.Needs owner
To show artifacts inline, enable in settings.