Home

mweinbach / agent-coworker

publicmweinbach/agent-coworker
Code Branches Pull requestsIssuesInsights
main
Home Code PRsIssues

test: cover integrity watcher, analytics lifecycle, and config clear conflicts

open
Stack 2/2
#303 opened by cursor[bot]cursor/missing-test-coverage-17f3→main
Conversation4
cursor[bot]
Commits
4
Files changed7
opened this pull request
Author
· last week

Summary

Adds focused regression coverage for residual high-risk seams that open coverage PRs #298–#302 do not claim, plus CI stabilizers for the unchanged main tip.

Risky behavior now covered

  • Runtime integrity watcher start failure leaves the in-process memo armed (distinct from invalidateRuntimeTrust(..., false)), does not retry watch(), and only fail-closes after explicit invalidation
  • Runtime integrity watcher error event clears the memo so subsequent uses re-fingerprint and catch mid-process tree edits
  • Concurrent first-use verifyRuntimeIntegrityForUse calls coalesce onto one tree walk
  • Desktop product analytics captures app_started once after successful init and app_updated once on version bump
  • setConfig rejects clear+set mutual exclusion for memory/skill/tool-output model fields (validation_failed, no persist)

Test files added/updated

  • test/coworkRuntime.test.ts (+ tiny __internal watch/coalesce hooks in src/coworkRuntime/integrity.ts)
  • apps/desktop/test/product-analytics-apply.test.ts (+ injectable captureProductEventImpl in productAnalytics.ts)
  • test/session/agentSession.settings.test.ts
  • CI stabilizers: apps/desktop/test/research-readiness.test.tsx desktop bridge/persistence reset; apps/mobile/bun.lock canary refresh

Why these tests materially reduce regression risk

These paths gate runtime trust fail-closed behavior, analytics lifecycle correctness under idle desktop state churn, and config-patch validation that previously only had happy-path coverage. A silent break would allow tampered runtimes to stay trusted in-process, double-fire lifecycle analytics, or accept contradictory config clears.

Validation

  • Targeted suites green
  • Touched files Biome-clean (biome check)
  • bun run lint, bun run typecheck, bun run docs:check clean
  • Full bun run test: all 672 files passed (Bun 1.4.0-canary)

Notes

  • Deliberately avoided duplicating open #298–#302 seams
  • No production behavior changes beyond tiny testability hooks
Open in Web View Automation 

Cursor Agent and others added 4 commits · 19 hours ago

View commits
  • test: cover integrity watcher seams, analytics lifecycle, and config clear conflicts366b487
  • test: reset runtime trust before watcher mock coverage60537e1
  • style: biome-format coverage test touchups7cf78f1
  • Merge remote-tracking branch 'origin/main' into pr-autosync4de280c
This branch has no conflicts with the base branch
Merging can be performed automatically when you’re allowed to merge and required checks pass.
0 approving reviews
None yet
Checks
No checks recorded
Fast-forward
Ready to merge without a merge commit
main ← cursor/missing-test-coverage-17f3

Only the target repository owner can merge this pull request.

Sign in to comment.

Stack

2/2
1

Merge readiness

Ahead4
Behind0
Fast-forwardReady

This pull request can be merged without creating a merge commit.

Autopilot

Debug

Reviews

Approved0
ReviewersNone yet

Configure an OpenRouter key in repository settings.

Update README.md

#125 mobile-fixes ← main

Updated 2 months ago

merged
2

test: cover integrity watcher, analytics lifecycle, and config clear conflicts

#303 main ← cursor/missing-test-coverage-17f3

Updated 19 hours ago

open