-
Notifications
You must be signed in to change notification settings - Fork 0
fix(review): mount the slack channels subtree so Slack pings actually deliver #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,6 +1,8 @@ | ||||||||||||||
| import assert from 'node:assert/strict'; | ||||||||||||||
| import test from 'node:test'; | ||||||||||||||
|
|
||||||||||||||
| import { parseIntegrations } from '@agentworkforce/persona-kit'; | ||||||||||||||
|
|
||||||||||||||
| import { | ||||||||||||||
| labelNames, | ||||||||||||||
| readPr, | ||||||||||||||
|
|
@@ -98,3 +100,21 @@ test('labelNames normalizes github label arrays defensively', () => { | |||||||||||||
| ]), ['no-agent-relay-review']); | ||||||||||||||
| assert.deepEqual(labelNames(undefined), []); | ||||||||||||||
| }); | ||||||||||||||
|
|
||||||||||||||
| // Cloud only mounts an integration's relayfile subtree from its `scope` (or | ||||||||||||||
| // from triggers β and this persona has github triggers only). A scope-less | ||||||||||||||
| // `slack: {}` mounts nothing, so every slackClient() post was written to | ||||||||||||||
| // unmounted local disk and silently dropped. persona-kit also discards empty | ||||||||||||||
| // scope objects client-side, so the scope must survive parsing as a non-empty | ||||||||||||||
| // string map covering the `/slack/channels/{channelId}/messages` writeback | ||||||||||||||
| // path. This pins both halves. | ||||||||||||||
| test('persona declares a slack scope that survives persona-kit parsing and covers the messages writeback path', async () => { | ||||||||||||||
| const { default: persona } = await import('../.test-build/review/persona.js'); | ||||||||||||||
| const parsed = parseIntegrations(persona.integrations, 'integrations'); | ||||||||||||||
| const scope = parsed?.slack?.scope; | ||||||||||||||
| assert.ok(scope && Object.keys(scope).length > 0, 'slack integration must declare a non-empty scope or cloud mounts no /slack paths'); | ||||||||||||||
| const covers = Object.values(scope).some( | ||||||||||||||
| (value) => typeof value === 'string' && value.startsWith('/slack/channels'), | ||||||||||||||
| ); | ||||||||||||||
|
Comment on lines
+116
to
+118
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The current assertion checks if any scope value starts with Updating the check to require a trailing slash (i.e.,
Suggested change
|
||||||||||||||
| assert.ok(covers, 'slack scope must cover /slack/channels/** so slackClient() drafts reach the writeback worker'); | ||||||||||||||
| }); | ||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: The coverage assertion is too permissive: checking
startsWith('/slack/channels')will also accept invalid scopes like/slack/channels-private/**, so this test can pass even when the writeback path is not actually mounted. Tighten the predicate to require the real channels subtree pattern (for example exact/slack/channels/**or at least a/slack/channels/boundary) so regressions are caught. [incorrect condition logic]Severity Level: Majorβ οΈ
Steps of Reproduction β
Fix in Cursor | Fix in VSCode Claude
(Use Cmd/Ctrl + Click for best experience)
Prompt for AI Agent π€