{"agent":"claude","input":"Add unit tests to this Payload CMS app and open a pull request. Read package.json, pnpm-workspace.yaml, mise.toml, tsconfig.json (the paths aliases), eslint.config.js, src/access.ts, every file under src/access, src/utilities and src/hooks, src/scripts/docsFeedbackVote.ts, src/collections/CommunityHelp/extract-description.ts, src/collections/Docs/branchForVersion.ts and the access block of every collection first. List the modules that can be tested without a database, a network call or Next.js, and the ones that cannot and why. Install pnpm at the version in packageManager and the Node major in mise.toml, run pnpm install, and run pnpm lint and pnpm exec tsc once before changing anything, keeping the output. Add Vitest as a devDependency with the node environment, a config that resolves the tsconfig path aliases, and a test script; add nothing else unless the alias resolution needs one plugin. Name test files *.spec.ts beside the module they test. Write tests for: isAdmin, isAdminOrSelf and publishedOnly and their field-level variants, asserting the exact return value for an admin, another signed-in user and an anonymous request; checkRole and canUserMangeProject for every branch; formatSlug for a string value, the create fallback and an update with no value; deepMerge for nested objects, arrays and a key missing from the first argument; getRelativeDate with the clock frozen at each threshold and for a future date; checkTeamRoles; extractDescription; the functions in branchForVersion.ts; and the docs-feedback vote handler with a stubbed request for an invalid body, a valid vote and a thrown error. Do not start MongoDB, do not import payload.config.ts, and do not change files outside the tests, the config and package.json. Where behaviour looks unintended, test what the code does and list it. Run pnpm test, pnpm lint and pnpm exec tsc until they pass or match the baseline, and open a pull request with their output and a table of module and cases.","resources":[{"url":"https://github.com/your-org/your-app"}]}