-
Notifications
You must be signed in to change notification settings - Fork 7
fix(slack): Unify finalized reply rendering #219
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
Draft
dcramer
wants to merge
18
commits into
main
Choose a base branch
from
dcramer/fix/slack-mrkdwn-normalization
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
00f422d
docs(specs): add draft Slack rendering spec for render intents
devin-ai-integration[bot] fdf42b6
docs(specs): drop work objects, make intents native, plugins teach vi…
devin-ai-integration[bot] 1afc304
feat(slack): add render-intent palette and block renderer
devin-ai-integration[bot] 22f623f
feat(slack): wire reply tool through delivery path with GitHub test bed
devin-ai-integration[bot] 3d9f490
docs(spec, plugins): drop phased framing, extend render-intent guidan…
devin-ai-integration[bot] b4a7eb2
feat(slack): centralize render-intent capability in system prompt, tr…
devin-ai-integration[bot] e000f4f
fix(slack): consolidate output contract and intent palette into singl…
devin-ai-integration[bot] c36c1c9
test(evals): add comparison_table and plain-reply intent selection ev…
devin-ai-integration[bot] 7520801
refactor(slack): remove render-intent tool infrastructure, focus on m…
devin-ai-integration[bot] 0f02708
test(evals): drop comparison-table scenario from slack-mrkdwn-hygiene
devin-ai-integration[bot] 4164c51
fix(slack): Normalize unsupported reply markdown
dcramer 2c50d78
fix(slack): Handle link edge cases in mrkdwn repair
dcramer f85b479
fix(slack): Expand mrkdwn repair coverage
dcramer 676482e
fix(slack): Harden mrkdwn normalization edges
dcramer 40b2693
fix(slack): Unify finalized reply rendering
dcramer 2393447
fix(slack): stabilize mrkdwn branch checks
dcramer 8e78121
fix(slack): normalize triple-asterisk emphasis
dcramer bfe1e48
fix(slack): restore canvas reply guidance
dcramer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
88 changes: 88 additions & 0 deletions
88
packages/junior-evals/evals/core/slack-mrkdwn-hygiene.eval.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| import { describe } from "vitest"; | ||
| import { mention, rubric, slackEval } from "../helpers"; | ||
|
|
||
| describe("Slack mrkdwn hygiene", () => { | ||
| slackEval("rewrites markdown tables into Slack-safe output", { | ||
| events: [ | ||
| mention( | ||
| "Give me a short comparison table of Sentry, Bugsnag, and Rollbar focused on deployment model and tracing.", | ||
| ), | ||
| ], | ||
| overrides: { | ||
| reply_timeout_ms: 120_000, | ||
| }, | ||
| requireSandboxReady: false, | ||
| taskTimeout: 150_000, | ||
| timeout: 210_000, | ||
| criteria: rubric({ | ||
| contract: | ||
| "Comparison output is Slack-safe: it may use bullets or a fenced code block, but it must not leave a raw markdown pipe table as the visible reply.", | ||
| pass: [ | ||
| "assistant_posts contains a single reply that compares Sentry, Bugsnag, and Rollbar.", | ||
| "If the reply uses a table-like layout, it is fenced as code or otherwise reformatted for Slack-safe rendering.", | ||
| ], | ||
| fail: [ | ||
| "Do not emit an unfenced markdown table with a separator row such as `| --- | --- |`.", | ||
| "Do not leave a raw pipe-table as the final visible reply.", | ||
| ], | ||
| }), | ||
| }); | ||
|
|
||
| slackEval( | ||
| "uses single-asterisk bold, single-tilde strike, and Slack link syntax", | ||
| { | ||
| events: [ | ||
| mention( | ||
| "In one short Slack reply, bold the word 'ready', strike through the word 'draft', and link the label 'docs' to https://docs.slack.dev/ .", | ||
| ), | ||
| ], | ||
| overrides: { | ||
| reply_timeout_ms: 120_000, | ||
| }, | ||
| requireSandboxReady: false, | ||
| taskTimeout: 150_000, | ||
| timeout: 210_000, | ||
| criteria: rubric({ | ||
| contract: | ||
| "Emphasis and link syntax follow Slack `mrkdwn`: single-asterisk bold, single-tilde strike, and `<url|label>` links. CommonMark/GFM equivalents are forbidden.", | ||
| pass: [ | ||
| "assistant_posts contains a single reply that addresses the bold, strike, and link asks.", | ||
| "Bold uses `*ready*` (single asterisks).", | ||
| "Strike uses `~draft~` (single tildes).", | ||
| "The docs link appears as `<https://docs.slack.dev/|docs>` or the bare URL.", | ||
| ], | ||
| fail: [ | ||
| "Do not emit `**ready**` (CommonMark bold).", | ||
| "Do not emit `~~draft~~` (CommonMark strike).", | ||
| "Do not emit `[docs](https://docs.slack.dev/)` (CommonMark link).", | ||
| ], | ||
| }), | ||
| }, | ||
| ); | ||
|
|
||
| slackEval("uses bold section labels instead of markdown headings", { | ||
| events: [ | ||
| mention( | ||
| "Give me a two-section Slack reply with short headings 'Summary' and 'Next steps', each with one sentence under it.", | ||
| ), | ||
| ], | ||
| overrides: { | ||
| reply_timeout_ms: 120_000, | ||
| }, | ||
| requireSandboxReady: false, | ||
| taskTimeout: 150_000, | ||
| timeout: 210_000, | ||
| criteria: rubric({ | ||
| contract: | ||
| "Section structure uses a bold label on its own line. Markdown heading syntax is forbidden because Slack does not render it.", | ||
| pass: [ | ||
| "assistant_posts contains a single reply with two sections.", | ||
| "Each section label appears as `*Summary*` and `*Next steps*` on their own lines (bold labels), followed by a sentence.", | ||
| ], | ||
| fail: [ | ||
| "Do not emit `# Summary`, `## Summary`, `### Summary`, or any other markdown heading syntax.", | ||
| "Do not emit `**Summary**` (CommonMark bold).", | ||
| ], | ||
| }), | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.