Home

mweinbach / agent-coworker

publicmweinbach/agent-coworker
Overview Code History Branches Pull requestsIssuesInsights
main
HomeOverview Code PRsIssues

test: cover transport auth, H3 document gates, and artifact validation

open
Stack 2/2
#336 opened by cursor[bot]cursor/missing-test-coverage-5081→main
Conversation0
cursor[bot]
Commits
0
Files changed…
opened this pull request
Author
· 2 weeks ago

Risky behavior now covered

  • Network-exposed /rpc: a listener bound to 0.0.0.0 must reject no-origin POST /rpc without the browser access token (Unauthorized server access). Non-POST, missing client id, and invalid JSON fail before a session is opened.
  • Auth primitives: parseBearerToken and isLoopbackHost fail closed on blank/non-Bearer credentials, non-loopback hosts, and 0.0.0.0. Bracketed IPv6 and IPv4-mapped loopback still count as local.
  • Pairing session lookup: RPC token lookup must not bump lastConnectedAt; event-stream verification must. Blank/null device-id headers and missing tokens fail closed.
  • H3 document + task flags: cowork/workspace/document/* requires workspaceSettings before dispatch (same blast radius as spreadsheet/presentation). Connection taskReadAllowed/taskMutationAllowed are assigned from conversations/turns; turns alone cannot mutate.
  • TLS renewal: persisted QUIC certs with ≤5 minutes remaining, or an unparseable notAfter, are unusable and must rotate.
  • Raw-loop artifacts: blank, relative, wrong-extension, and empty files are rejected with stable codes.

Test files added/updated

  • Added test/transport/auth-loopback.test.ts
  • Updated test/loopback-http-rpc.test.ts
  • Updated test/h3.pairing-store.test.ts
  • Updated test/h3.mobile-http-jsonrpc.test.ts
  • Updated test/h3.persisted-listener.test.ts
  • Updated test/harness.raw-loop-validation.test.ts
  • Tiny testability export on src/server/transport/h3/persistedListener.ts (__internal.isCertificateUsable)

Why these tests materially reduce regression risk

Recent main commits extracted H3 transport, pairing, loopback, and HTTP response helpers. Those paths gate remote RPC, mobile file access, and pairing identity. The new tests lock the fail-closed branches that integration coverage around /ws and presentation/spreadsheet did not hit.

Does not duplicate open coverage PRs #331–#335.

Validation

  • Targeted coverage + test/platform-boundary.test.ts: 111 tests green
  • bun run check, bun run typecheck, bun run docs:check: clean
  • biome check --write on touched files
Open in Web View Automation 
This branch can’t be merged automatically yet
Branch comparison failed — verify branches still exist in storage.
0 approving reviews
None yet
Checks
No checks recorded
Fast-forward
Source must contain the target branch tip
main ← cursor/missing-test-coverage-5081

Sign in to comment.

Stack

2/2
1

Merge readiness

Checking mergeability after the indexing worker computes the current branch state.

Autopilot

Debug

Reviews

Approved0
ReviewersNone yet

Configure an OpenRouter key in repository settings.

Update README.md

#125 mobile-fixes ← main

Updated 4 months ago

merged
2

test: cover transport auth, H3 document gates, and artifact validation

#336 main ← cursor/missing-test-coverage-5081

Updated 2 weeks ago

open