Skip to content

Phase 5: tests, dashboard sync, docs, and backup - #7

Merged
Kisahime merged 1 commit into
mainfrom
cursor/phase-5-polish-0e13
Oct 10, 2026
Merged

Kisahime merged 1 commit into
mainfrom
cursor/phase-5-polish-0e13

Conversation

@Kisahime

Copy link
Copy Markdown
Owner

Phase 5 of PLAN-v2.md. PR #6 has merged, so this targets main. Phase 4 CI was already green (both test jobs on 97c9058), 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, and tests/test_settings.py. Pinned pytest-cov==7.1.0 in requirements-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 .gitattributes already exists. This phase adds the named modules and coverage rather than a second factory.

update_config keeps surrounding comments and CRLF. The mic state machine is driven with synthetic chunks. safety.is_blocked covers 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:

Module Coverage
src/main.py 91%
src/settings.py 90%
src/memory.py 90%
src/policy.py 100%
src/safety.py 100%

The real hardware lifespan in create_app (model download and mic start) is still uncalled. Tests pass prepared= so they never hit the network or a device.

V5-02 Dashboard state sync and error handling

Status now includes post_voice, duck_enabled, and wake. The dashboard sets those checkboxes from status when the control is not focused. Every defPost call goes through post(), which writes the error into #hint and does not leave a rejected promise. Success hints return early when ok is false. JSON.parse on /ws is guarded. A reconnecting… 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.example now 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 (!so and !pixel mute|unmute|chill|hype|stop), the two profiles, requirements-dev.txt / pytest-cov / Windows CI, and logs/cohost.log.

N-04's "optional feeds are on" is stale. Shipped config.yaml has bits, channel points, hype train, polls, predictions, wake word, ducking, and safety.allow_links off. 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.ps1 zips data/, persona.yaml, and config.yaml to backups/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.py runs the script with -Root against a temp tree (PowerShell 7).

Tests

ruff check src tests passed. Full pytest: 94 passed.

Needs owner

  • V0-01 — commit any leftover personal tree in logical chunks, and turn on GitHub secret scanning. This phase commits its own work and does not change GitHub settings.
  • A live two-browser check on the Windows booth, and a real OBS Browser Source, still want the owner's machine. The headless two-tab check above covers the dashboard acceptance.
  • Twitch tokens are not generated here. The README now lists the scopes to tick.

To show artifacts inline, enable in settings.

Open in Web Open in Cursor 

…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>
@Kisahime
Kisahime marked this pull request as ready for review October 10, 2026 19:27
@Kisahime
Kisahime merged commit 933dd35 into main Oct 10, 2026
2 checks passed
@Kisahime
Kisahime deleted the cursor/phase-5-polish-0e13 branch October 10, 2026 19:27
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.

2 participants