task-work: recognize app.notion.com URLs in notion dispatchers (#158)#161
Conversation
is_notion_url() in claude-notion/bin/task-work and kiro-notion/bin/task-work only matched notion.so / notion.site, so app.notion.com URLs (now the default form Notion serves and the Notion MCP returns) fell through to the slug-only branch — NOTION_URL was dropped and the worker launched with no task. Add notion.com to the predicate in both files. Fixes the --plan/--planner path transitively (it gates URL forwarding on the same predicate). No task-reviewer or planner change needed. Adds regression tests covering both the <slug> <url> and single-<url> forms for an app.notion.com URL in each dispatcher. Co-Authored-By: WOZCODE <contact@withwoz.com>
PR Review — #161: recognize app.notion.com URLs in notion dispatchersSpec complianceIssue #158 called for:
Full spec compliance. ✓ Code-review findingsNIT — bare substring match on
|
|
PM: clean-with-nits review — one change requested before merge. Please apply the reviewer's nit (harden is_notion_url() {
[[ "$1" =~ ^https?://(www\.|app\.)?notion\.(so|site|com)/ ]]
}Then add a regression test that exercises the false-positive case the nit describes — a slug like |
Per review: a bare *"notion.com"* substring test misclassifies a free-form slug that merely contains "notion.com" (e.g. "my-notion.com-feature") as a URL, so the third arg-resolution branch fires and NOTION_URL gets the slug instead of the real Notion URL. Replace the substring predicate with an anchored regex in both claude-notion/bin/task-work and kiro-notion/bin/task-work. Deviation from the reviewer's suggested form (www.|app.)?: that variant only allows www./app./no subdomain, which would silently drop the *.notion.site published-site subdomains the original substring predicate accepted. Used ([a-zA-Z0-9-]+\.)* instead so any subdomain (or none) is accepted — fixes the false-positive while preserving the original notion.site behavior. Tests: add the false-positive guard (slug containing "notion.com" + real URL → URL wins) and a notion.site-subdomain regression to both bats suites. Co-Authored-By: WOZCODE <contact@withwoz.com>
|
Addressed the nit in Hardened One deviation from the reviewer's suggested form, flagged for the merge decision: The reviewer proposed: [[ "$1" =~ ^https?://(www\.|app\.)?notion\.(so|site|com)/ ]]That only permits I used a subdomain-tolerant form instead, which fixes the false-positive and preserves the original behavior: [[ "$1" =~ ^https?://([a-zA-Z0-9-]+\.)*notion\.(so|site|com)/ ]]Verified under real bash (the predicate runs in a
Tests added to both
Results: If you'd prefer the exact |
Summary
is_notion_url()in the notiontask-workdispatchers only recognizednotion.so/notion.site, soapp.notion.comURLs (now Notion's default workspace/page form, and what the Notion MCPfetch/searchtools return) fell through to the slug-only branch —NOTION_URLwas dropped and the worker launched with no task.Fix: add
notion.comto the predicate in bothclaude-notion/bin/task-workandkiro-notion/bin/task-work. This also fixes the--plan//plannerpath transitively (it gates URL forwarding on the same predicate). Per the corrected spec, notask-revieweror planner-side change is needed.Changes
claude-notion/bin/task-work,kiro-notion/bin/task-work:is_notion_url()now also matches*notion.com*.tests/claude_notion_task_work.bats,tests/kiro_task_work.bats: regression tests covering both the<slug> <url>(verifiesNOTION_URLin.info) and single-<url>(verifies slug derivation) forms for anapp.notion.comURL.Verification
claude_notion_task_work— 28/28 passkiro_task_work— 22/22 passdrift_check— 8/8 pass (incl. live-repo default-manifest check;is_notion_urlsits outside drift-checked sentinel regions, both edits are identical)Closes #158
🧙 Built with WOZCODE