Skip to content

fix(engine): Notion row changes are checked before the card; a flaky calendar test fixed - #258

Merged
Lexirieru merged 2 commits into
mainfrom
fix/engine-notion-check-before-card
Nov 11, 2026
Merged

Lexirieru merged 2 commits into
mainfrom
fix/engine-notion-check-before-card

Conversation

@Lexirieru

Copy link
Copy Markdown
Contributor

From the full engine suite run on main after today's merges: 303 tests, 301 passed, 2 failed. Both are addressed here.

1. Notion: no card for a row that doesn't exist

skills-notion-update failed once: the model passed an invented row id (row-renew-domain instead of r14) and the owner got an approval card for it. It was already safe, because execute re-reads the row and refused after Approve with nothing written. But a card for a non-existent row shouldn't be shown at all.

The row checks (the row exists, the title matches, not archived, not a plain page, property names and types, old values) are now one function, rowRefusal, run in beforeApproval and again in execute, like the calendar move does. A refused change returns status: "refused" with a message telling the model to read the database again.

2. A flaky calendar test

a try-out run reads the sample calendar failed once: the first googlecalendar_list_events call failed validation (Mastra answers { error: true } as a tool.result) and the model called again. The test now checks the call that ran. Run alone it passed 3/3.

Tests

  • typecheck; test:unit 169/169. New in apps.test.ts: an invented id, a wrong title and a changed value are each refused before a card; a clear is still refused before any Composio call.
  • skills-notion-update live: 3/3 runs.
  • k6 load/chat.js 2 VUs 20 s: 30/30.
  • Engine only.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Q5ZrzK8une3S2YyhDG746e

Lexirieru and others added 2 commits November 11, 2026 15:50
… before writing

The full suite saw the model pass an invented row id ("row-renew-domain" for
r14) and the owner got an approval card for a row that doesn't exist; execute
refused it after Approve. The row checks (exists, title, archived, types, old
values) now run in beforeApproval too, like the calendar move, so no card is
shown for a change that can't happen and the model is told to read again.

Tests: typecheck; test:unit 169/169 (new: invented id, wrong title, changed
value refused before a card); skills-notion-update live 3/3; k6 load/chat.js
2 VUs 20 s.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q5ZrzK8une3S2YyhDG746e
The full suite failed once when the model's first googlecalendar_list_events
call failed validation (Mastra answers { error: true } as a tool.result) and
the second call ran. The test now checks the call that ran; alone it passed
3/3 before and after.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q5ZrzK8une3S2YyhDG746e
@Lexirieru
Lexirieru merged commit d9c1621 into main Nov 11, 2026
1 check passed
@Lexirieru

Copy link
Copy Markdown
Contributor Author

Merged (CI engine green). @AncungAulia FYI: a Notion change the engine can't make (wrong row, wrong title, value changed) now comes back as a notion_update_row result with status: "refused" and no approval card, which your step rows already show as failed (#241 follow-up). @Lin1er engine only.

🤖 Generated with Claude Code

@Lin1er

Lin1er commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Live on the hosted demo: main d9c1621 (automatic deploy after the merge).

  • Before: 56218ad, and the box matched git at that revision. CI: passed: test.
  • GET /v1/health → {"ok":true,"engine":true,"revision":"d9c1621"}. No rollback.
  • Rollback target: 56218ad (/opt/hellonear/release-old).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants