Home

mweinbach / agent-coworker

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

test: cover task, backup, workspace, and import fail-closed gates

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

Risky behavior now covered

  • Task RPC mutations fail closed on blank identities, missing brief fields, unknown work-item statuses, out-of-range decision confidence, question answers that are empty / both optionId and text / more than 3, and extra keys on completion paths.
  • Workspace backup RPCs reject blank cwd, missing/blank targetSessionId and checkpointId, and extras on read/delta/checkpoint/restore/delete.
  • Canvas and spreadsheet RPCs reject oversize document content/maxBytes, non-integer generations, empty style patches, unknown patch ops, and batches over 50,000 operations.
  • Conversation import mapping rejects unknown existing/fallback workspaces, blank create paths, missing or file (non-directory) create targets, and missing conversation cwd; it still matches known directories and proposes create otherwise.
  • Workflow sandbox messages reject unknown host types, missing agent payloads, overlong log/phase fields, isolation: "brief" without a briefing, and out-of-range timeoutMs.
  • Task review reuse prefers persisted reviews over activity-derived rounds, and still falls back to activity when reviews are absent.

Test files added/updated

  • test/jsonrpc.task-request-schema-rejects.test.ts (new)
  • test/jsonrpc.backups-request-schema-rejects.test.ts (new)
  • test/jsonrpc.workspace-request-schema-rejects.test.ts (new)
  • test/import/conversations.workspaceMapping.test.ts (new)
  • test/workflows/schema.test.ts (new)
  • test/server/tasks/taskReviewPolicy.rounds.test.ts (new)

Why these tests materially reduce regression risk

These are fail-closed gates on high-blast-radius surfaces: task mode, backup restore/delete, canvas/spreadsheet writes, import workspace targeting, and the workflow worker trust boundary. A schema or mapping regression here can reach the wrong workspace, accept oversized/malformed writes, leak pending workflow RPCs, or apply the wrong review history. The tests are deterministic unit/schema checks with no production behavior changes.

Recent perf-only commits (Promise.all config/workspace refresh, knip export narrowing) were skipped as behavior-preserving. Known production holes (startup {ready:true, error}, Codex absolute rollout paths, sync action() throw) were not locked as intended.

Validation

  • Targeted 17 new tests: pass
  • biome check on touched files: clean
  • bun run typecheck, bun run check, bun run docs:check, test/platform-boundary.test.ts: pass
  • Full bun run test: new files passed in-suite; run exited 1 after test/session.stream-pipeline.test.ts mid-file on this host (output dropped). Not introduced by these tests.
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-3f4c

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 task, backup, workspace, and import fail-closed gates

#331 main ← cursor/missing-test-coverage-3f4c

Updated 3 weeks ago

open