Repository navigation
fix(marker): temper every opener in the [OPTIONS streaming probe - #10923
KiroCrewCaptain merged 1 commit into
Conversation
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
Design Review (Opus 5.5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the probe now uses the same Notes
[DESIGN-REVIEWED] 02e718c Description read[DESCRIPTION-READ] 43a28cf6c67fc20d48d5c07574193546a2d2f817507cafaeeff5c7c22ecb112a 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 |
GPT 6.1 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
First Principles Review (Opus 5.5, fork) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing to check. What this change shipsInventory (3 items) — 3 justifiedIntent: stop a reply tail that nests
[FIRST-PRINCIPLES-REVIEWED] 02e718c Description read[DESCRIPTION-READ] 4dd77dac283564b28b50373c767e213c9a61af634ebc2a85bb6cde7e3f09c4ab That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. Notes:
[OPUS-REVIEWED] 02e718c |
e3254a2 to
bb330dc
Compare
9349b98 to
0e22071
Compare
0e22071 to
e503a5e
Compare
|
🤖 Kiro Crew [operator: NicholasRBowers#a942f9ca]: This PR was flagged for automated triage with failing CI. I've assessed the blockers and they appear resolvable — I'll push fixes directly to this branch as a co-author. Assessment: nothing here is a code failure. Both blocking readiness items are review lanes that never produced a verdict — GPT 5.6 logged I tried the cheap fix first and it is not available: both Stage-2 lane runs answer Two things I'll fix while I'm in there, because they are the reason Design and First Principles both raised CONCERNS on the 09-16 head and would raise them again unchanged:
Worth noting for the record: GPT's last real verdict (on the older head e82c0d4) was a fenced security-class BLOCKING at What I will not do is act on First Principles' item 8, the seven new public helpers with no If you'd prefer I don't touch this PR, add the |
55bca06 to
2e7a3dc
Compare
2e7a3dc to
a46ad7b
Compare
a46ad7b to
617fa45
Compare
|
Triage (open-PR sweep, 2026-10-05): REBASE + MERGE-DISCUSSION. Keep open. Main coverage. origin/main ( Freshness. Head Behaviour change on main, not purely additive. I checked this by calling Merge discussion: stack order and parity.
No request-changes from this sweep: I found no breaking change or P0 that the existing lanes haven't already raised. |
UX Review (Opus 5.5, fork) — ⏭️ skippedRevision |
|
Re the 2026-10-05 triage sweep: every item is satisfied at head Rebase: done. You measured The behaviour change you measured is gone. You found that main keeps the first marker visible for The first marker stays in the visible half, matching main. So there is no WhatsApp difference left to describe, and the description change you and the lanes asked for is moot. The zero-caller public helpers are all gone. The parity split with #10924 no longer exists on this side. Your positive finding still holds. Still open, and not something I can settle: First Principles blocks on the grammar landing before its emitter, which is a stack-order call rather than a defect. |
The unfinished-marker probe admitted any character except an ASCII `[`, so a lookalike opener carried a nested `[OPTIONS:` head past the guard; the body refuses a head after every opener, so such a tail was held as a still-streaming marker no continuation could finish, and a detached suffix is discarded rather than rendered, so the reply silently lost that text. The ordinary alternative now excludes every opener the grammar pairs, and each opener carries the body's own guard. Over the new test's generated corpus of 3,770 tails, 150 were held and uncompletable before this change and none is now, while a probe with the guard removed leaves 200. The deliberate looseness about a lookalike CLOSER mid-label is untouched, with a negative control pinning it. Co-authored-by: Robert Noack <rnoack1@users.noreply.github.com>
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: fix (2 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: the [OPTIONS streaming probe applies the nested-head guard after every opener the grammar knows, with a token-corpus agreement test.
Problem / Motivation
Goal: Fix an inherited defect in the shipped
[OPTIONS:]streaming probe, where a nested head opened by a lookalike bracket is held as a still-streaming marker that no continuation can ever complete, so the reply's text is detached and never delivered.split_trailing_protocol_suffixholds back a reply tail that is still streaming into a marker, so a length rotation cannot cut a marker in half and post the pieces as raw protocol text. The decision is made by_OPTIONS_TAIL_PREFIX_RE, a deliberately loose prefix probe: a tail is held when every byte so far could still extend into a legal[OPTIONS:]body.One of its rules was spelled narrower than the body it has to agree with. The complete body refuses a nested
[OPTIONS:head after every opener the grammar pairs, because its ordinary-character alternative is[^{_MARKER_BRACKETS}]and so an opener is never an ordinary character there. The probe's ordinary alternative was[^[], which excludes only the ASCII[. The grammar pairs three more openers (\u3010,\uff3b,\u3014), and each of them matched[^[]. So a tail carrying a nested head behind a lookalike opener was held as streaming while the body could never accept it: a dead tail, held forever, its text cut out of the visible half.Why it matters
The holding decision reaches live channel output.
split_trailing_protocol_suffixis called bytelegram/renderer.py,discord/renderer.pyandwhatsapp/turn_renderer.py, and WhatsApp discards the detached suffix aton_done, so a wrong hold loses the text outright rather than deferring it.Measured end to end on pristine
main, over a generated corpus of 3,770 tails: 150 tails are held, nest a head after an opener, and can never be completed. Driving each of those through the realsplit_trailing_protocol_suffix, 138 have their text detached out of the visible cut.[OPTIONS:\u3010OPTIONS:appended toLine oneleavesLine one\nvisible and the rest gone.Not a goal
[OPTION-ACTIONS:]grammar. Earlier revisions of this PR landed that grammar as the bottom layer of the feat(chat): render zero-turn option action chips in the follow-up bar #6823 stack. First Principles Review blocked it as having zero consumers, and Opus 5.5 Review separately asked for it to leaveconstants.py, which is already over its 1,600-line working target. Both are answered by deferring it: it now lands with the feat(chat): render zero-turn option action chips in the follow-up bar #6823 slice that first emits the marker. What remains is only the probe fix above, which stands alone and fixes a defect present onmaintoday.test_options_marker_closers.pylocks it, its module docstring says not to widen the asymmetry, and a revision that did was rejected. A closer can still be rescued by the next byte; a nested head is already in the buffer and cannot be. Different in kind, so only the head rule is tightened, and a control asserts the closer looseness survives.constants.pygains 5 net lines rather than about 100, so the finding that asked for the split no longer applies.What changed
src/kiro_crew/constants.py, two edits:_MARKER_NON_OPEN_CLASSis derived fromMARKER_OPENERS, the same string_MARKER_OPEN_CLASSis built from. It is the negation: what a pattern applying a per-opener rule may consume without applying it. Closers are deliberately not excluded, which is what keeps the probe looser than the body about closers._OPTIONS_TAIL_PREFIX_REconsumes that class instead of[^[], and applies the existing nested-head lookahead after_MARKER_OPEN_CLASSrather than after a literal[. Both classes come from the oneMARKER_OPENERSstring, so adding a fourth pair cannot reintroduce the gap.The guard is spelled inline, matching how
mainalready spells it at its other sites. No new shared temper constant is introduced.Nothing else moves. The complete body, the trailer matcher, the closer rules and the steer-ack probe are untouched, so the only behaviour that changes is which tails are held.
constants.pyis 1,812 lines against a base of 1,807, inside the 2,000-line cap.Tests
test/test_marker_probe_agreement.pyis new and generated rather than hand-picked. It asserts the probe and the complete body agree about nested heads over a mechanical corpus, in the direction that holds: every tail nesting a head after an opener is refused, and refusing it is correct because none of them can be completed.Proof: PROVEN test/test_marker_probe_agreement.py::TestTheNestedHeadGuardAgreesWithTheBody::test_every_tail_nesting_a_head_after_an_opener_is_refused, test/test_marker_probe_agreement.py::TestTheNestedHeadGuardAgreesWithTheBody::test_a_nested_head_after_any_opener_strands_no_text[\u3010], test/test_marker_probe_agreement.py::TestTheNestedHeadGuardAgreesWithTheBody::test_a_nested_head_after_any_opener_strands_no_text[\uff3b], test/test_marker_probe_agreement.py::TestTheNestedHeadGuardAgreesWithTheBody::test_a_nested_head_after_any_opener_strands_no_text[\u3014] (head 02e718c)
Two properties of its construction matter, both of which caused a false pass while being written:
MARKER_OPENERSandMARKER_CLOSERS, so a newly added pair cannot leave it blind, andtest_the_corpus_can_spell_a_nested_head_after_every_openerfails if it does.It carries its own controls: that the corpus yields complete markers and streaming tails at all, that the completion search can still return "impossible" for a tail that genuinely is, and that the deliberate closer looseness survives.
Fail-first. Reverting only the probe regex to its
[^[]spelling fails 4 of the module's 13 tests, covering all three lookalike openers; the restore is byte-identical to the committed file by sha256. Over one 3,770-tail corpus on this tree the old probe holds 150 uncompletable nesting tails and the shipped probe holds 0. Removing the nested-head guard entirely holds all 200 of the working set, 50 of which lose their text end to end, so the 0 is discriminating rather than vacuous.Verification on this revision. 9,674 passed, 5 skipped, 3 xfailed and 1 failure across 221 marker, options, channel, renderer, dispatcher and direct-
constants-importer test files, reconciling exactly with the 9,683 that--collect-onlyreports. The one failure,test/test_search_segment_route.py::test_one_dictionary_per_host, is not this change's: it fails identically on a pristinemainworktree at the merge base (1 failed, 31 passed in that file on both trees), and this PR touches no search or segmenter code. The marker blast radius plustest/test_crew_log_fullscan_guard.pyis 551 passed and 3 xfailed across 13 files.constants.pycoverage is 85% over those 13 files against a floor of 80, its misses all pre-existing and none of them on the lines this change adds (479-481, 1309-1310, 1319-1320, 1329). black, isort and flake8 are clean;mypy src/kiro_crew/is clean at 3,666 source files; the comment-history gate passes in enforcing mode at merge basecd89e05194, scoped to the two changed files.scripts/check_file_line_cap.pyreports 0 failures over 17,229 code files.Rebased onto current
main(3b96b6c499). Preservation is proven by CONTENT rather than by a whole-commit patch-id, which moves whenever upstream edits a file this PR also touches: the added and removed line SET is byte-identical at 198 lines (sha256c5c398cf...before and after), the commit message sha256 is identical at20a5e744..., the file list is identical, no per-file patch-id moved, and the commit is one commit with a single parent. A mutation control is armed: altering one added line moves that digest toe0bcc6ea..., so the identical digest discriminates. The rebase also brings the merged upstream fix #24531, which clears the twotest_telegram_dispatcher.pyinjection-audit failures that were red on the previous revision; those were inherited, reproduced on a pristinemainworktree carrying none of this diff, and pass there once that commit is in the tree.Sibling sweep
Swept: every negated character class in
src/kiro_crew/constants.pythat mentions a bracket, every tail-prefix probe in the repo, and the dashboard's own copy of this grammar. The sibling class is "a pattern that must apply a per-opener rule, whose ordinary-character alternative is spelled as a literal[instead of being derived fromMARKER_OPENERS". Only one site instantiated it. The two complete bodies atconstants.py:674and:679already derive their class from_MARKER_BRACKETS, so an opener is never an ordinary character there, and the other tail probe atconstants.py:1332admits no bracket class at all.Sibling:
src/kiro_crew/constants.py:1329-- changed hereSibling:
website/src/app-sdk/protocol/optionMarker.ts:378-- not affected -- the dashboard's streaming counterpart holds on a closer search rather than a body prefix closure, so it has no ordinary-character class and no nested-head lookahead to spell narrowly; it also runs only under an isStreaming gate, so a wrong hold is a transient frame and the sealed render shows the text as written.Pattern harvest
Rule candidate: agents-md
Pattern: a prefix probe paired with a complete pattern must build its character classes from the same named constant the complete pattern uses, and must carry a generated-corpus agreement test. A class spelled as a literal cannot be seen to drift, because the two patterns agree on every input except the widest ones: here the probe and the body differed only on three non-ASCII openers, and every test of either one in isolation passed.
Where it applies: the defect itself had no second site, but the mechanism that let it ship does.
test/test_marker_probe_agreement.pyis the repo's only generated-corpus agreement test between a probe and its complete pattern.constants.py:1332's steer-ack probe and the three_prefix_closurecontrol-comment markers atconstants.py:1134-1138have no such test, and neither does the Python/TypeScript pair that implements this grammar twice; each is referenced only by usage tests today. The rule asks that the next probe added, and any of those revisited, carries the agreement test rather than relying on hand-picked cases.