Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
017c283
fix: pass element constructor to getElement to satisfy no-unnecessary…
PolarWolf314 Oct 15, 2026
72587e2
fix: install typescript as converter devDependency so typecheck works
PolarWolf314 Oct 15, 2026
99cffb2
test: add Vitest/Playwright test tooling and media fixtures
PolarWolf314 Oct 15, 2026
29daa20
fix: verify existing fixtures and report child signals in media gener…
PolarWolf314 Oct 15, 2026
1b16db3
test: pin full wire contracts; hoist server eslint ignores; document …
PolarWolf314 Oct 15, 2026
d3ab065
feat(diagnostics): add issue store with incident merging and normaliz…
PolarWolf314 Oct 15, 2026
1717e76
feat(diagnostics): bound diagnostic ring and allowlist diagnostics ex…
PolarWolf314 Oct 15, 2026
c57b2bf
feat(diagnostics): add runtime error handlers and bootstrap failure b…
PolarWolf314 Oct 15, 2026
50339d6
fix(diagnostics): address client diagnostics code-review findings
PolarWolf314 Oct 15, 2026
fec8e29
feat(client): safe storage wrapper for preference persistence
PolarWolf314 Oct 15, 2026
58e2f67
feat(client): drop Web Audio graph for native element volume
PolarWolf314 Oct 15, 2026
1491c06
feat(client): validate settings and derive the socket URL robustly
PolarWolf314 Oct 15, 2026
356d59f
fix(client): address code-review findings in Task 3 client files
PolarWolf314 Oct 15, 2026
83630ff
feat(shared,server): playback wire contract and authoritative clock
PolarWolf314 Oct 15, 2026
baf293f
feat(client): projection clock for server playback snapshots
PolarWolf314 Oct 15, 2026
d34404a
feat(cinema): validated snapshots and media identity on the wire
PolarWolf314 Oct 15, 2026
ab67e19
fix(cinema): address task 4 code-review findings
PolarWolf314 Oct 15, 2026
1024c28
feat(server): TTY-aware application logger
PolarWolf314 Oct 15, 2026
9762306
fix(server): safe room membership and owned listener cleanup
PolarWolf314 Oct 15, 2026
120668e
feat(server): createApplication factory with isolated lifecycle state
PolarWolf314 Oct 15, 2026
b63eb63
feat(client): guard the approve button against duplicate emits
PolarWolf314 Oct 15, 2026
49e21e2
fix(server): contain async room listener rejections
PolarWolf314 Oct 15, 2026
187f3bd
fix(server): refcount waiting-room ips across re-seat windows
PolarWolf314 Oct 15, 2026
7b7b991
fix(server): guard unseat against disconnect/join-failure races
PolarWolf314 Oct 15, 2026
02aea35
fix(server): log Errors readably and survive circular metadata
PolarWolf314 Oct 15, 2026
46f4bc1
fix(server): derive TTY rewrite height from the rendered state
PolarWolf314 Oct 15, 2026
a3c27ba
refactor(server): single shared FakeSocket with honest socket typing
PolarWolf314 Oct 15, 2026
9c6f868
refactor(server): single http close, honest shutdown, corrected socke…
PolarWolf314 Oct 15, 2026
59dd652
test(server): event-driven waits replace fixed sleeps in admission tests
PolarWolf314 Oct 15, 2026
b115128
test(client): player harness drives the real playback controller in Node
PolarWolf314 Oct 15, 2026
8056243
feat(client): mediaErrors classifies native media failures
PolarWolf314 Oct 15, 2026
8da853f
feat(client): idempotent admission media loading in the playback cont…
PolarWolf314 Oct 15, 2026
9ffb780
feat(client): projection-driven seeks with metadata gating and stale-…
PolarWolf314 Oct 15, 2026
5ddc952
feat(client): media-error coalescing and media-mismatch handling
PolarWolf314 Oct 15, 2026
3e8fa50
feat(client): disconnect lifecycle and trusted command emission
PolarWolf314 Oct 15, 2026
f74a4bf
feat(client): slow-load bound and recovery API
PolarWolf314 Oct 15, 2026
f8d616b
refactor(client): movie.ts becomes thin wiring over the playback cont…
PolarWolf314 Oct 15, 2026
19579fd
test(client): real-server browser playback suite with per-test rooms
PolarWolf314 Oct 15, 2026
a5575bb
chore: ignore playwright test artifacts
PolarWolf314 Oct 15, 2026
9de9ee3
docs(client): correct the operation-token comment (loads/disconnects …
PolarWolf314 Oct 15, 2026
4362137
fix(client): plug pause-marker leak and harden Task 6 test surfaces
PolarWolf314 Oct 15, 2026
a5036ec
feat(converter): pure MP4 output-path derivation and ffmpeg args
PolarWolf314 Oct 15, 2026
4363135
feat(converter): ffprobe preflight/postflight parsing with bounded st…
PolarWolf314 Oct 15, 2026
ba1682b
feat(converter): data-driven H.264 level 4.1 compatibility envelope
PolarWolf314 Oct 15, 2026
016e869
feat(converter): temp-file + verified-promotion transcode pipeline
PolarWolf314 Oct 15, 2026
4bf58a3
feat(converter): batch CLI with collision pre-check, summary, nonzero…
PolarWolf314 Oct 15, 2026
7b5f14e
test(converter): real-ffmpeg integration suite for the mp4 pipeline
PolarWolf314 Oct 15, 2026
4849c94
fix(converter): ffmpeg-mirroring stream selection + postflight dimens…
PolarWolf314 Oct 15, 2026
29f2a32
feat(client): production static server (serve.mjs) replacing vite pre…
PolarWolf314 Oct 15, 2026
4e8d67c
fix(client): code-review fixes for serve.mjs + HTTP contract suite
PolarWolf314 Oct 15, 2026
5291941
test(client): cross-engine browser matrix (chromium+firefox+webkit) +…
PolarWolf314 Oct 15, 2026
d32f596
fix(client): probe real engine media capabilities (decode + seek surv…
PolarWolf314 Oct 15, 2026
d4d1577
ci: GitHub Actions checks workflow (client-server, converter, browser…
PolarWolf314 Oct 15, 2026
60ec782
docs: operator playback-troubleshooting guide + README matrix/serving…
PolarWolf314 Oct 15, 2026
07bb4cb
test(browser)+ci: probe-based truncation gating, visible skip evidenc…
PolarWolf314 Oct 15, 2026
0cb01c6
fix(diagnostics): render real media ids in export; refresh README sha…
PolarWolf314 Oct 15, 2026
fdd480f
ci(client): materialize settings.json from tracked template before ty…
PolarWolf314 Oct 17, 2026
e92b1ab
chore: move test suites and CI into stacked tests PR
PolarWolf314 Oct 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,12 @@ yarn.lock
coverage/
*.log

# Test artifacts
test-results/
playwright-report/

# dev env
.direnv

# pnpm local store index (created by root installs)
.pnpm-store/
87 changes: 85 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ The project is split into three workspaces:
The `client/src/shared/` and `server/src/shared/` directories contain mirrored type definitions:

- `BaseUser` — Minimal user representation (`id`, `username`, `isAdmin`, `joinedAt`)
- `ClientEvents` — Events sent from client to server (`cinema:play`, `cinema:pause`, `cinema:seek`, `admin:kick`, `admin:ban`, `admin:approve`)
- `ServerEvents` — Events sent from server to client (`connection:accepted/rejected`, `cinema:joined/left/users/playing/paused/seeked`, `waiting-room:joined/left`, `admin:added/left/users/kicked/banned/approved`)
- `ClientEvents` — Events sent from client to server (`cinema:play`, `cinema:pause`, `cinema:seek`, `cinema:select`, `admin:kick`, `admin:ban`, `admin:approve`)
- `ServerEvents` — Events sent from server to client (`connection:accepted/rejected`, `cinema:joined/left/users/playing/paused/seeked/state/command-rejected`, `waiting-room:joined/left`, `admin:added/left/users/kicked/banned/approved`)

## Prerequisites

Expand Down Expand Up @@ -110,6 +110,32 @@ cd server && pnpm start
cd client && pnpm start
```

`pnpm start` serves `client/dist/` through `serve.mjs` (a small Node static
server with correct byte-range, 404, dotfile, symlink, and cache-header
behavior — `vite preview` is not used in production because it mishandles
range requests and falls back to `index.html` for missing files). It listens
on port 1730; override with `PORT`/`HOST`.

Known, deliberate serving gaps (details in
[docs/playback-troubleshooting.md](docs/playback-troubleshooting.md)):

- No conditional revalidation — `Last-Modified` is decorative, media
re-downloads on reuse (no `304` for `If-Modified-Since`).
- Multi-range requests are truncated to the first range (browsers never
send multi-range for `<video>` playback).

Operational notes:

- **Volume is what it says**: the player applies the stored volume
directly — it now sounds exactly as set, with no hidden boost.
- **Deploy client and server together**: the cinema wire protocol
(`client/src/shared/` ↔ `server/src/shared/`) changes lockstep; a
mixed-version room can misbehave, so ship both sides in one deploy.
- **One distinct media URL per movie**: every viewer must load the same
file for sync to mean anything, and the room identifies the movie by its
media URL — re-using a URL for different content breaks mismatch
detection.

### Converter

```sh
Expand Down Expand Up @@ -137,6 +163,63 @@ pnpm typecheck # TypeScript type checking
pnpm lint # ESLint (client and server only)
```

### Testing

Unit tests run with vitest (client/server) and bun test (converter):

```sh
pnpm --dir client run test
pnpm --dir server run test
cd converter && bun run test && bun run test:integration
```

The client vitest run also includes an HTTP contract suite that boots the
production static server (`serve.mjs`) over a real socket and pins its
range/404/header behavior (`client/tests/http/mediaServing.test.ts`).

Browser tests run Playwright against real engines — chromium, firefox, and
webkit, one project each. Engine-specific launch options live in one place
(`client/tests/browser/engineLaunch.ts`); `test:browser` runs the whole
matrix:

```sh
pnpm --dir client run test:browser
```

The browser suite needs two one-time bootstraps after cloning:

```sh
# generates the tiny H.264/AAC fixture clips under client/tests/fixtures/public/
# (gitignored; requires ffmpeg)
node client/tests/scripts/generate-media.mjs

# downloads the three Playwright browser engines
pnpm --dir client exec playwright install chromium firefox webkit
```

Engine coverage honesty: chromium and firefox decode the production-shaped
H.264/AAC fixtures and run the full playback suite. Playwright's bundled
WebKit is where coverage is honestly partial, and the suite probes each
engine's real capabilities once per run instead of assuming:

- **Decode**: Playwright's macOS WebKit build has no H.264/AAC decoders
(it stalls at `HAVE_METADATA` forever, even though `canPlayType`
answers "probably"); Linux WebKit decodes fine through system GStreamer
codecs. Decode-dependent tests run where decoding works and skip with
a documented reason where it does not.
- **Seek survival**: WebKit's media clock stalls permanently after
seeking a playing element (verified on Linux WebKit 26.6), so the two
seek-choreography tests skip on WebKit and run on chromium/firefox.

Real-Safari codec coverage is deliberately left to the manual device
matrix in
[docs/playback-troubleshooting.md](docs/playback-troubleshooting.md).

CI (GitHub Actions, `.github/workflows/checks.yml`) runs the same gates on
every push and pull request: client/server typecheck+lint+tests+builds,
the converter suite including its real-ffmpeg integration tests, and the
three-engine browser matrix on Linux.

### Formatting

This project uses [Prettier](https://prettier.io/) and [EditorConfig](https://editorconfig.org/) for consistent formatting:
Expand Down
6 changes: 5 additions & 1 deletion client/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,8 @@ dist/
public/data/*
!public/data/put movie here.txt

settings.json
settings.json

# Generated test fixtures and browser-test artifacts
tests/fixtures/public/
test-results/
24 changes: 22 additions & 2 deletions client/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';

export default tseslint.config(
{
// Standalone `ignores` objects are global; tests/scripts holds plain-JS
// Node scripts that run outside type-aware linting.
ignores: ['eslint.config.js', 'build/**', 'node_modules/**', 'tests/scripts/**'],
},
eslint.configs.recommended,
...tseslint.configs.strictTypeChecked,
...tseslint.configs.stylisticTypeChecked,
Expand All @@ -14,7 +19,6 @@ export default tseslint.config(
tsconfigRootDir: import.meta.dirname,
},
},
ignores: ['eslint.config.js', 'build/**', 'node_modules/**'],
rules: {
// Possible Problems (https://eslint.org/docs/latest/rules/#possible-problems)

Expand Down Expand Up @@ -58,5 +62,21 @@ export default tseslint.config(
'@typescript-eslint/prefer-readonly': 'error', // Immutability is always preferred.
'@typescript-eslint/switch-exhaustiveness-check': 'error', // Exhaustiveness checks are always good.
}
}
},
{
// serve.mjs is production Node code (the `start` script entry),
// linted type-aware here and type-CHECKED by tsc with checkJs
// (see tsconfig.node.json). Two rules cannot read JSDoc and have
// no TS annotation syntax in plain JavaScript:
// - no-undef: subsumed by checkJs (Node globals come from
// @types/node there); typescript-eslint itself disables this
// rule for every file type it type-checks.
// - explicit-function-return-type: serve.mjs documents every
// return type as JSDoc @returns, which tsc enforces.
files: ['serve.mjs'],
rules: {
'no-undef': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
},
},
);
4 changes: 3 additions & 1 deletion client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
<meta property="og:image" content="/eyes.png" />
</head>
<body>
<script type="module" src="/src/main.ts"></script>
<div id="startup-fallback" hidden></div>

<script type="module" src="/src/bootstrap.ts"></script>

<div id="entry-card" hidden>
<h1></h1>
Expand Down
16 changes: 12 additions & 4 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,26 @@
},
"scripts": {
"build": "tsc && vite build",
"typecheck": "tsc",
"lint": "eslint src --max-warnings=0",
"typecheck": "tsc && tsc --project tsconfig.node.json",
"lint": "eslint src tests serve.mjs --max-warnings=0",
"check-all": "pnpm run typecheck && pnpm run lint",
"start": "vite preview --host --port=1730",
"test": "vitest run",
"test:browser": "playwright test",
"start": "node serve.mjs",
"dev": "vite --host --port=1730"
},
"devDependencies": {
"@eslint/js": "^10.0.1",
"@playwright/test": "1.63.0",
"@types/node": "^25.9.3",
"eslint": "^10.4.1",
"socket.io-client": "^4.7.5",
"typescript": "^6.0.3",
"typescript-eslint": "^8.61.0",
"vite": "^8.0.16"
"vite": "^8.0.16",
"vitest": "4.1.6"
},
"dependencies": {
"serve-handler": "6.1.7"
}
}
Loading