Centralize account-authorized task run reads
Task-run reads previously required REST, API-key MCP, and delegated OAuth to fetch a provider run and remember to apply ownership policy separately. All three now use readTaskRunForAccount, which returns only a run allowed by the existing canReadTaskRun policy. OAuth keeps its smaller status projection; account overrides, scopes, errors, and other response shapes are unchanged.
A scoped ESLint rule directs transport imports through the authorized operation. Added route and delegated registration tests pin account resolution, exact output, and foreign-run denial. The task-domain verification recipe documents the two distinct internal raw consumers and the remaining deployed-client checks.
Validation on a fresh frozen-lockfile install using Node 24.18.0:
- Task/MCP task suites: 160 tests across 28 files passed.
- OAuth compatibility: 203 passed, one optional PostgreSQL test skipped; includes the existing loopback HTTP protocol lab.
pnpm typecheck:mcp-oauthandpnpm lint:checkpassed.- Ignoring the ownership predicate made 11 behavior checks fail, including each transport, while the import-boundary tests and changed-file lint still passed. Restored the guard and verified the focused checks.
- Full
tsc --noEmit --incremental falsereports the same 196 diagnostics (byte-identical output) on this branch and exact base067238da4ba650013263cc24675d4f09749da771with the same dependencies.
Task entry-point tests use synthetic credential, provider, and database boundaries. A credential-free GET to the READY PR preview returned HTTP 401 with the exact expected authentication error and x-matched-path: /api/tasks/runs. No paid job, deployed owned/foreign-run test, or live named-client verification was performed.