CedarCopilot wants to merge 1 commit into main from staging
Not deployed
Libra has no production signal for this change yet because it has not deployed. Libra checks hourly for 3 days after each deploy.
This change preserves Mastra Tool prototypes when wrapping Master family tools and adds regression coverage for the previous request-context loss. The new source guard still misses several ordinary raw-spread forms that produce the same broken runtime object, and the wrapper contains a repository-rule violation that must be corrected before merging.
Do not merge until the repository-required removal of the unnecessary assertion is complete. The source-guard coverage gap is non-blocking but should be addressed to prevent the same request-context regression from being reintroduced through an unrecognized wrapper form.
The final findings are limited to improvement-level issues.
Files Needing Attention: apps/server/src/mastra/tools/master-surface.ts and apps/server/src/mastra/tools/tests/no-raw-tool-spread.test.ts
What T-Rex did
General comment
Raw tool-spread source guard misses shorthand and ordinary-property variants
apps/server/src/mastra/tools/__tests__/no-raw-tool-spread.test.ts:62, /\{\s*\.\.\.[A-Za-z_$][\w$]*\s*,\s*execute\s*:/ matches only a spread immediately followed by an explicit execute: key. It does not identify const execute = wrapped; return { ...tool, execute };, { ...tool, name: 'wrapped', execute: wrapped }, or { name: 'wrapped', ...tool, execute }. The validation executed the actual source regex and found all 3 harmful variants evade it.execute: syntax and immediate adjacency after the identifier spread; shorthand properties omit : and intervening/preceding ordinary properties violate the positional requirement.execute property (including shorthand), regardless of property order; alternatively broaden the guard deliberately and add contract cases for shorthand and intervening-property layouts.### Issue 1
apps/server/src/mastra/tools/master-surface.ts:132
**Remove redundant assertion**
`wrapped
Libra has not measured any production surfaces for this change yet.