feat(runner): WS protocol server with handshake

apps/runner scaffold (app-tier, walking-skeleton story 04): WS server
speaking @repo/core-runner-protocol. Every inbound/outbound frame is
envelope-wrapped and zod-parsed; hello/ready handshake gates on the
workspace-scoped token (constant-time compare, redacted token on
rejection replies); named error events for version/schema/auth
rejections. Config via env only (token never argv); port announced on
stdout for the story-06 provisioner. Runtime deps: ws (the standard
Node WS server; ADR-022 traces do not apply to app-tier) and zod.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016j8z4VHjedXDTjEDNg7qHK
This commit is contained in:
2026-07-12 22:29:24 +02:00
parent 11e5012572
commit b090e26701
19 changed files with 1331 additions and 11 deletions

29
apps/runner/package.json Normal file
View File

@@ -0,0 +1,29 @@
{
"name": "@repo/runner",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"build": "tsc --noEmit",
"start": "node --import tsx src/main.ts",
"lint": "eslint .",
"test": "vitest run",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@repo/core-runner-protocol": "workspace:*",
"ws": "^8.18.0",
"zod": "^3.25.0"
},
"devDependencies": {
"@repo/core-eslint": "workspace:*",
"@repo/core-testing": "workspace:*",
"@repo/core-typescript": "workspace:*",
"@types/node": "^22.0.0",
"@types/ws": "^8.18.0",
"@vitest/coverage-v8": "^3.2.4",
"tsx": "^4.0.0",
"typescript": "^5.8.0",
"vitest": "^3.0.0"
}
}