Files
ytLlive/HANDOFF.md
T

45 lines
2.8 KiB
Markdown

# HANDOFF — session state
> Current operational state, read right after `TASKS.md`. Trust this file as the
> truth of what is in flight — do not re-derive from git/fs unless it points at
> a problem. Conventions: [`schema.md`](schema.md). Rewrite this file at session
> end, compaction, or any interruption.
## Session state (last updated: 2026-08-13)
- **Branch:** `main`. TASK 4 ship step 5 (the live frame pipeline) is **shipped
and committed** — the `FramePump` frame producer
(`Services/Encoder/FramePump.cs`), `ScreenCaptureManager.GetLatestFrame(key)`,
the `MainViewModel` resolver/option-builders/pump lifecycle wiring, `FramePumpTests`
(7) + the `GetLatestFrame` test (1), and the memory updates (TASKS.md, ai.md,
Services/index.md — the previous session left `Services/index.md` stale and
HANDOFF unrewritten; both were fixed before the commit). Build **0 warnings**,
**147 tests passing**. A Windows patch reboot killed the prior session right
after the work was verified but before the commit.
- **Finished this session:** ship step 5 (re-verified: 0 warnings, 147/147 pass),
the `Services/index.md` FramePump row + de-stale'd encoder rows, and this
HANDOFF rewrite.
- **Landmines:**
- The pump reads the active scene on a background thread while the UI can still
edit it — a concurrent-mutation exception is contained (logged + `Failed` +
the pump stops), not a crash. The background thread + video pipeline is the
new reality since ship step 5.
- `StopAsync` must stop the encoder (closes stdin) **before** awaiting the pump
loop — closing stdin unblocks a write stuck on pipe backpressure; the reverse
order deadlocks.
- `FramePump.IsRunning` must be set true before the loop starts (a completed-task
delay can run the first iteration synchronously on the caller's thread).
- `StartAsync` never throws; the VM fires-and-forgets it. `Failed` while live
flips `StreamStatus.Error` (minimal — real health surfacing is ship step 6).
- Tests never instantiate `MainViewModel` directly except the round-clip
integration test (a real `MainWindow`), which never goes live — keep it that way.
- **Next step:** TASK 4 ship step 6 — health stats: bind `FramePump.HealthUpdated`
(bitrate/FPS/duration) into the bottom bar. Nothing else queued — do not expand
the task queue on your own.
- **Secret/DB/port facts live:** OAuth client id/secret in `Helpers/OAuthCredentials.cs`;
OAuth session token in `Helpers/TokenStore.cs` (DPAPI → `%APPDATA%\ytLlive\ytLlive.auth`);
layout DB `%APPDATA%\ytLlive\ytLlive.db` (schema v8; `SocialEntry.Software`
column is a column-presence migration like the others, no version bump); OAuth callback
`http://localhost:8765/oauth2/callback`; crash log `%APPDATA%\ytLlive\startup.log`.