Sanitize public auth and scrape failure messages
Caught authentication exceptions and scrape-start/provider exceptions could expose internal details to clients. Return stable public messages from the existing auth helper and shared scrape operation, and from the batch/single route catch blocks. Preserve Projects 401 message, each scrape route's status/body shape, and existing started/failed charging rules.
Follow-up to #1038 and #1039 under https://github.com/recoupable/mono/issues/360; hosted verification remains separately tracked in https://github.com/recoupable/mono/issues/361. This PR does not close either broader tracker.
Validation:
- Harmless internal/provider canaries reproduce the original leaks, then pass with the repair. Tests call the actual Projects GET and both scrape POST exports; scrape transport tests use the real shared scrape operation with mocked provider/database/auth dependencies.
- 118 tests across 21 suites pass, including contract/schema, auth, scrape operation/consumer and billing regressions.
pnpm run typecheck:response-contracts,pnpm lint:check, changed-file formatting andgit diff --checkpass.- Server-only diagnostic logging retains caught exceptions in auth, shared scrape and route catch blocks. A focused test checks that the shared scrape error reaches the server logger while its returned failure remains generic.
Production effect after an approved merge/release: these failure responses use generic messages instead of internal exception strings. No schema, access policy, provider dispatch or charging change is intended. No live provider calls, customer/production writes, charges, migrations, credential changes or manual deployment were performed. Current evidence is synthetic source verification; review, final-head CI and normal release verification remain required. No merge is requested by this implementation assignment.
Final-head follow-up: the first completed full CI execution at bd05d158 had 6,544 passing tests and two old raw-message expectations in socialScrapeBillingRoutes. Commit 39adac47 changes only those two expectations; all 118 affected tests now pass locally. Final-head CI must complete before this PR is considered green.
Final readback at 39adac47eed7c37db151a6a841b3bfa25be1b81b: all six checks pass. Unit workflow 39288428233 reports 1,211 suites / 6,546 tests passed, 11 suites / 13 tests skipped; response-contract typechecking also passes. Cubic approves this exact head with zero findings. PR remains open and unmerged.