Repository navigation
fix(slack): keep bold and strike markers inside inline code - #27600
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the change protects code spans before the emphasis passes run, and it reuses the table renderer's existing CommonMark pairing instead of adding a third parser. Notes
[DESIGN-REVIEWED] 18a61c5 Description read[DESCRIPTION-READ] 867361f63dc4134ff01523e455bedbef5b7746efe96fc789e8486de932ef12d4 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Both changes trace to #27590: the code-span protection, and the backslash fix to Notes
What this change shipsInventory (5 items) — 4 justifiedIntent: Slack readers see inline code exactly as written. FIX.
[FIRST-PRINCIPLES-REVIEWED] 18a61c5 Description read[DESCRIPTION-READ] cc5f9405fdc11d58a5d289cd1b5455f34ac02c0bd86e40406632215486bd86c8 That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
b50b2f4 to
7eaccb6
Compare
|
7eaccb6 to
0845eca
Compare
|
Rebased onto main after #27599 merged: import conflict in slack/format.py resolved; CI re-running. |
|
Rebased onto main after #27598 merged: test conflict in test/test_messaging_tables.py resolved by keeping both test sets; CI re-running. |
0845eca to
18a61c5
Compare
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: fix (4 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, security checklist all-NO, no reviewer-lane findings, readiness signal fresh for this head SHA, declared category matches the diff. Category: bug fix: keeps bold and strike markers inside inline code in Slack rendering, and a backslash inside a code span no longer reaches past it; with tests.
Problem / Motivation
Goal: Slack shows inline code exactly as written, with
**and~~intact.Slack mrkdwn conversion turned
**into*and~~x~~into~x~across the whole line. Inside backticks that altered code:`f(**kwargs)`showed as`f(*kwargs)`.Why it matters
Python kwargs, globs and diff snippets in inline code reach Slack readers wrong, and a copied snippet no longer runs. This is the same bug #27260 fixed for previews.
Not a goal
What changed (motivation → approach → change)
_convert_inlineinslack/format.pyswaps each inline code span for a placeholder token, runs the bold and strike passes, then puts the spans back. Emphasis that wraps a code span still converts. A line that already holds a NUL character skips the swap, so input text can never pose as a token.Spans come from
_code_spansinmessaging/tables.py, the pairing the table renderer uses. It read a backslash as an escape inside a span too, so`C:\`paired with the next span. A backslash escapes a backtick only outside a span, as CommonMark says, and a table cell holding`C:\`keeps its column too.Backwards compatibility
Compatible: text outside inline code converts exactly as before.
Removes nothing: no key, path or function is taken away.
Tests
test/test_slack_handler_rendering.pypins**and~~kept inside code, emphasis around a span, a backslash inside code, and an escaped backtick outside code.test/test_messaging_tables.pypins a`C:\`cell.Proof: PROVEN test/test_messaging_tables.py::TestEscapedPipesAndInlineCode::test_a_backslash_inside_code_closes_on_its_own_backtick, test/test_slack_handler_rendering.py::TestToSlackMrkdwnInlineCode::test_bold_and_strike_markers_inside_inline_code_are_kept (head 18a61c5)
Determinism: pure string functions, no clock, IO or randomness. The two touched test classes ran 20 times with their node ids in shuffled order: 20 of 20 green.
Manual verification
N/A — unit coverage sufficient: the change is a pure string transform, pinned byte for byte.
Related Issues
Fixes #27590
Sibling sweep
Swept: git grep -nE "replace("**", "*")|_STRIKE_RE.sub" -- src/
Sibling: src/kiro_crew/preview_text.py:228 -- not affected -- inline code is protected there since #27260
Sibling: src/kiro_crew/messaging/tables.py:510 -- changed here
Pattern harvest
Rule candidate: review-prompt
Pattern: an emphasis rewrite run over a whole line without first protecting inline code spans
Checklist