Home

mweinbach / agent-coworker

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

test: cover review fingerprints, artifact CAS, and permission gates

open
Stack 2/2
#344 opened by cursor[bot]cursor/missing-test-coverage-3ae6→main
Conversation0
cursor[bot]
Commits
0
Files changed…
opened this pull request
Author
· last week

Risky behavior now covered

  • Task review material fingerprints — inactive/superseded requirements, decisions, questions, and blockers are excluded; work-item deps/outputs and question options are sorted; live-file SHA evidence is included. Reordering inputs cannot change the fingerprint, but an objective or live SHA change must.
  • Artifact content-addressed store — invalid SHA keys never touch the object tree; tampered blobs fail closed on read and rewrite; missing files fingerprint as null; directories are rejected; restore refuses fingerprint conflicts (including missing expected files) and only writes stored bytes when the expected fingerprint matches; concurrent putBytes of the same digest stays idempotent.
  • User-message turn helpers — attachment display names are basename-only (../secret/notes.md → notes.md); . / .. / empty names are dropped; branded task-lock abort errors round-trip with their session payload and are distinct from a plain ABORT_ERR; aborted signals count as abort-like.
  • H3 trusted-device permission mapping — default pairings get no task read, task mutation, or workspace-control flags; conversations alone enables reads, not mutations; mutation requires both conversations and turns; workspaceSettings toggles control events independently.
  • Bearer token parsing — only Bearer credentials yield a token; missing, empty, Basic, and token-less headers fail closed.

Test files added

  • test/server/tasks/taskReviewPolicy.material.test.ts
  • test/server/tasks/ArtifactVersionStore.test.ts
  • test/session/userMessageTurnHelpers.test.ts
  • test/server/transport/h3.permissions.connection.test.ts
  • test/server/transport/parse-bearer-token.test.ts

Why this reduces regression risk

These helpers sit on review completion, artifact restore, turn cancellation, and mobile/H3 auth paths. A fingerprint miss can pass a stale review; a CAS integrity miss can restore or accept the wrong bytes; a permission-mapping miss can let a default-paired device mutate tasks. Open coverage PRs #331–#343 do not cover them. Coordinator tests already exercise artifact restore rollback through TaskCoordinator; this run locks the extracted store/policy/permission helpers instead of duplicating that integration.

Production code is unchanged.

Validation

  • Targeted 21 tests + test/platform-boundary.test.ts: green
  • bun run check and bun run typecheck: clean
  • Isolated targeted files are the evidence for this run (full suite historically truncates late on this host)
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-3ae6

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 review fingerprints, artifact CAS, and permission gates

#344 main ← cursor/missing-test-coverage-3ae6

Updated last week

open