Repository navigation
fix(messaging): keep a '>' inside an angle-wrapped image path - #21565
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing to check. [DESIGN-REVIEWED] 2aff975 Description read[DESCRIPTION-READ] fd5c24833d975c4950246e0ffcbe6f46683052548ea2b082a2a486856cf5b3cf 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 Check on POSIX that a real Slack reply now carries an image from a data home with What this change shipsInventory (3 items) — 3 justifiedIntent: when a path contains
[FIRST-PRINCIPLES-REVIEWED] 2aff975 Description read[DESCRIPTION-READ] 9cd96534096dceb47c939258329cdf0f97d0a4b1ab2cd9872827dbb4266669e1 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: |
930cdac to
5417a11
Compare
|
|
|
|
|
The outbound reader undid the composer's \> escape and then closed the <...> wrap at the first '>', so a data home whose path holds '>' lost its outbound picture. The walk now records which characters arrived escaped and the wrap closes at the first unescaped '>', as in CommonMark. The transcript rewrite closes the raw wrap with the same tokenisation (angle_wrap_close), so a newly resolved path is replaced whole. Part of #10871
5417a11 to
2aff975
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: an angle-wrapped image destination now closes at the first unescaped > in both the scanner and the raw-markup cut, so a path holding an escaped > stays whole; new tests cover the escaped and title cases.
Problem / Motivation
Goal: a picture whose path holds a
>is sent to Slack instead of being dropped.The composer wraps an odd path in
<...>and writes a>in it as\>. The outbound reader undid that escape first, then cut the path at the FIRST>. Soread as/data/a, and the picture was left out of the Slack reply.Why it matters
A POSIX data home with
>in a folder name loses every outbound picture, with no error. Rare, but silent.Not a goal
persist_imagesseam of feat(slack): one renderer for both ingress kinds, images flow both ways #10369 and wait for it.?/#split instrip_url_syntax, which the issue calls a separate question.What changed (motivation → approach → change)
The cause is that
_walk_destination(src/kiro_crew/messaging/outbound_files.py) is the only step that sees\>vs a bare>, and it dropped that fact before_finish_destinationlooked for the wrap's close._walk_destinationnow records which characters of the destination arrived escaped and passes them to_finish_destination._finish_destinationcloses a<...>wrap at the first UNESCAPED>, as CommonMark does. No guess about titles or suffixes: a bare>after the wrap (</a.png> b>)) still closes at the first one, so every input without an escaped>reads exactly as before.src/kiro_crew/chat_attachments.py(_destination_span) cut the RAW markup at the first raw>, which is the\>itself. Once the scanner resolves such a path,persist_inline_imageswould copy the image and then replace only/data/a\, leaving>b/.../x.png>in the saved row (the Opus and GPT finding on the first head). It now finds the close with a new shared helper,outbound_files.angle_wrap_close, which uses the walk's own escape tokenisation, so the scanner and the rewrite close the wrap at the same>.The
)that ends the markup does not move, so the shared end pinned bytest/test_markdown_link_parentheses.pyis unchanged.Backwards compatibility
Compatible: a wrapped destination with no escaped
>parses and rewrites the same as before. A path that holds an escaped>is now whole instead of cut. The upload gate still checks the resolved path.Tests
test/test_image_artifacts.py(TestMarkdownDestinationParsing):test_escaped_close_angle_in_wrapped_path_is_kept:\>in the path keeps the whole path.test_escaped_close_angle_with_title_suffix: same, with a"title"that itself holds>.test_single_quoted_title_after_wrap: a'title'suffix.test_wrap_followed_by_junk_closes_at_first_unescaped_angle:</tmp/a.png> junk)still reads/tmp/a.png.test_bare_angle_after_the_wrap_does_not_move_the_close:</a.png> b>)still reads/a.png(pins the old first->reading for a bare>).test_escaped_angle_before_unrecognised_suffix_is_kept:</a\>b/x.png> junk)reads/a>b/x.png.test/test_chat_attachments.py:test_an_escaped_angle_in_a_wrapped_source_path_is_replaced_whole(POSIX only;>is not a legal Windows path character): a source underscr>atch/is copied and the saved markup is exactly. Red with the oldmarkup.find(">")in_destination_span(the row kept the source tail), green here.Related suites (
test_image_artifacts,test_chat_attachments,test_outbound_files,test_markdown_link_parentheses,test_chat_persistence_inline_attachments,test_history_inline_attachments): 1672 passed, 2 skipped. Determinism: the new tests ran 3 more times under-n 2(xdist scheduling order varies) and once alone, all green; they use onlytmp_pathand pure strings.scripts/check_comment_history.pypasses locally.Manual verification
N/A: pure string parsing, covered by unit tests.
Screenshots / video
N/A: no UI change.
Issue link
Part of #10871
Pattern harvest
Not generalizable: one parser closed a wrap at the first delimiter after an earlier step had already removed the escapes that told delimiters apart; the fix keeps that information where it is known.