fix(mcp): require confirmation before forgetting similar memories#1345
fix(mcp): require confirmation before forgetting similar memories#1345DisturbedCrow wants to merge 3 commits into
Conversation
| const confirmation = JSON.parse( | ||
| textDecoder.decode(this.fromBase64Url(payload)), | ||
| ) as Record<string, unknown> |
There was a problem hiding this comment.
The rule 'Avoid unnecessary type assertions' and 'Use type annotations instead of assertions for object literals' is violated here. The code uses as Record<string, unknown> to cast the result of JSON.parse(...). While JSON.parse returns any, the preferred approach is to use a type annotation on the variable rather than a type assertion:
const confirmation: Record<string, unknown> = JSON.parse(
textDecoder.decode(this.fromBase64Url(payload)),
)| const confirmation = JSON.parse( | |
| textDecoder.decode(this.fromBase64Url(payload)), | |
| ) as Record<string, unknown> | |
| const confirmation: Record<string, unknown> = JSON.parse( | |
| textDecoder.decode(this.fromBase64Url(payload)), | |
| ) | |
Spotted by Graphite (based on custom rule: TypeScript style guide (Google))
Is this helpful? React 👍 or 👎 to let us know.
| documentId = ((await created.json()) as { documentId?: string }) | ||
| .documentId |
There was a problem hiding this comment.
The rule 'Use type annotations instead of assertions for object literals' is violated. The code uses as { documentId?: string } as a type assertion on the result of created.json(). Instead, a type annotation should be used:
const body: { documentId?: string } = await created.json()
documentId = body.documentId| documentId = ((await created.json()) as { documentId?: string }) | |
| .documentId | |
| const body: { documentId?: string } = await created.json() | |
| documentId = body.documentId |
Spotted by Graphite (based on custom rule: TypeScript style guide (Google))
Is this helpful? React 👍 or 👎 to let us know.
Stops
forgetfrom immediately deleting a semantic near-match. It now previews the candidate and requires a short-lived signed confirmation.Focused tests and the Worker dry-run build pass.