Skip to content

fix(channels): grade the rotation boundary the splitter cannot see - #13494

Merged
iamwhatever merged 2 commits into
mainfrom
fix/rotation-seam-credential-12293
Sep 28, 2026
Merged

iamwhatever merged 2 commits into
mainfrom
fix/rotation-seam-credential-12293

Conversation

@chenmingwei23

@chenmingwei23 chenmingwei23 commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: A credential can no longer be read off the screen by joining two messages that a long turn was rotated into.

When a turn outgrows one message, the renderers rotate it into several. Each piece is
scanned for credentials on its own, so a key that straddles the rotation boundary passes
every per-piece scan, and the reader joins the halves back together on screen. Nothing
warns anyone: both halves passed, so no redaction notice is posted.

Merged #13984 closed this at the splitter's seams (_seam_safe). The rotation boundary in
_rotate_on_length is a different cut, and on main it is still ungraded:

  • Discord splits without a redactor on either path, so both of its rotation boundaries
    are ungraded.
  • Telegram does redact before it cuts, but that pass reads the text as written. A ---
    rule between the two halves of a key keeps them apart for that reading, while the seal
    strips rules, so the halves land flush on screen. Measured on this branch:
    raw_severs=False, both_severs=True.

Why it matters

The leak is silent and user-visible. An agent that echoes an AWS key, a PEM header or a
bearer token in a long reply gets it redacted in the ordinary case and published in the
long case, which is the case a verbose agent hits most. Because each half passes its own
scan, no redaction notice appears and no test that reads one message can see it. The
reader who reassembles the two bubbles is the only party who learns the secret leaked.

Not a goal

What changed (motivation -> approach -> change)

Symptom -- a straddled credential is readable across a rotation boundary.
Cause -- the boundary is never graded: Discord passes no redactor to its splitter, and
Telegram's pre-split pass reads a form of the text the reader never sees.
Change -- grade the boundary at the point where the pieces are already in their delivered
shape.

  • messaging/display_safety.py: severs_a_credential and safe_split_offset now grade the
    raw and the delivered form, and a sever in either answers true.
  • discord/renderer.py, telegram/renderer.py: the three rotation boundaries that the
    splitter cannot reach now consult that primitive, and pass the text as it will be
    presented rather than pre-transforming it.
  • discord/renderer.py: the presentation path's fallback carves until the remainder fits
    the budget
    rather than taking one offset and retaining the whole rest. That retained piece
    is parked as _delivery_text with no rotation ahead of it, so the only cut left is
    _seal_current's own re-split -- length only, no grade. Taking a single offset therefore
    bought the first boundary by handing every later boundary in the same text to that ungraded
    cut. Raised by the GPT 5.6 review as F1 and upheld under adjudication.
  • messaging/display_safety.py: the sequence grader reads each boundary both ways. Every
    reading ran to the end of the list, so it always carried the next message's first letter,
    and the credential patterns anchor there. A key finished across messages 1 and 2, with
    message 3 opening on a letter, matched nothing while the reader saw one whole key. Prefixes
    are now read alongside the existing suffixes, which stays linear in the piece count. Raised
    by the GPT 5.6 review as F1 on this head and upheld fenced.
  • messaging/display_safety.py: the grader also reads bounded interior runs. A credential
    can sit with a spoiling message on EACH side of it, and every whole, prefix and suffix
    reading carries at least one of those frames, where the anchor classes reject the match. A
    rotation of model text makes both frames ordinary rather than crafted -- the splitter rstrips
    each chunk, so an alphanumeric edge is the common case. A window of at most
    _INTERIOR_RUN_PIECES consecutive messages is slid across the interior, which is a linear
    number of readings over bounded-size strings. Raised by the GPT 5.6 review as F1 and upheld
    fenced. The docstring's "linear" claim is corrected in the same pass: the reading COUNT is
    linear, the bytes copied are not, because a prefix and a suffix are rebuilt at each boundary.
  • discord/renderer.py: _seal_current's own split now passes redactor=_redact_all, as
    telegram/renderer.py has all along, at both call sites. That is the last cut before the
    wire with no rotation behind it -- and a buffer the rotation WITHHELD as unsafe is parked
    whole and arrives there over the cap, so the withhold routed text TO the one ungraded cut
    rather than away from it. Raised by the Opus 5 review as a BLOCK, and it closes discord: _seal_current re-splits an over-cap payload with no redactor, so that cut is graded by nothing #14587.
  • telegram/renderer.py: the upload-hold branch grades its prefix as a sequence before
    sealing it. That branch keeps the image reference and everything after it in the live tail,
    seals every chunk before it and returns -- ahead of the length path's own grade. Both
    readings that did run are blind to one shape: the splitter reads the RAW pieces, where a
    horizontal rule still stands between two credential fragments, and the seam repair reads the
    delivered form but against ONE predecessor. A key split across three pieces by rules was
    clean in both and flush on screen. The prefix is now carved when it severs, and withheld
    whole when no safe cut exists. Raised by the GPT 5.6 review as F1 on this head and upheld
    fenced under Opus adjudication.
  • discord/renderer.py: the rotation re-grades the held pair before assigning it. The
    offset search grades the source, but the rotation ships the source's remainder plus the held
    image reference. An image reference starting at or before the budget makes the source
    shorter than the budget, so the search early-returns the whole string and the re-assignment
    hands back the exact pair the gate had just refused, ungraded. Raised by the Opus 5 review
    as a BLOCK on this head.

Grading both forms is the second defect this fixes, in my own first design. Trimming
reveals a join that whitespace kept apart, and equally conceals one whose pattern needs
that whitespace: -----BEGIN beside RSA PRIVATE KEY----- reads clean once trimmed and
ships an intact PEM anchor. Three of nine straddle shapes failed a delivered-only rule. The
old docstring claim that more trimming is always stricter was false and is corrected.

One boundary is deliberately left ungraded: Telegram's held image tail. It begins at the
ref span, so it always starts ![, and ! survives canonicalising between the sealed chunk
and anything the tail can contribute -- five shapes measured, every canonical join reading
AKIAIOSF!.... A gate there is unreachable, so it was removed and the reason is a comment at
that branch so nobody re-adds it.

Backwards compatibility

Compatible. The both-form grading arrives as an optional parameter whose default is the
identity transform, pinned by test_the_default_is_identity, so every existing caller keeps
its current behaviour. No public name is renamed or removed, and no input main accepts today
is rejected.

Tests

scope command result
the primitive pytest test/test_display_split_safety.py -n 0 -p no:randomly 60 passed
both renderers' seams pytest test/test_telegram.py::TestRotationSeamCredentialSafety test/test_discord.py::TestRotationSeamCredentialSafety -n 0 -p no:randomly 31 passed
discord rotation, whole class pytest test/test_discord.py::TestRotationSplitting -n 0 -p no:randomly 30 passed
the lanes that were red pytest 'test/test_channel_table_rendering.py::TestDiscordStreaming::test_a_still_arriving_table_is_not_frozen_half_built' test/test_discord_render_config.py::TestTurnFooter -n 0 -p no:randomly 9 passed
the two review findings pytest test/test_display_split_safety.py test/test_discord.py::TestSeversACredential test/test_discord.py::TestRotationSplitting test/test_discord.py::TestRotationSeamCredentialSafety -n 0 -p no:randomly 108 passed
the boundary corpus pytest test/test_split_credential_boundary.py -n 0 -p no:randomly 140 passed
sibling channels' seams pytest test/test_telegram.py::TestRotationSeamCredentialSafety test/test_wecom.py -k seam -n 0 -p no:randomly 26 passed
the upload-hold prefix pytest test/test_telegram.py::TestSplitText test/test_telegram.py::TestTableAwareSplitting test/test_telegram.py::TestRotationSeamCredentialSafety test/test_display_split_safety.py -n 0 -p no:randomly 93 passed
interior runs and the seal's split pytest test/test_display_split_safety.py test/test_split_credential_boundary.py test/test_discord.py::TestRotationSplitting test/test_discord.py::TestRedactionNotice test/test_discord.py::TestRotationSeamCredentialSafety test/test_telegram.py::TestRotationSeamCredentialSafety test/test_telegram.py::TestSplitText -n 0 -p no:randomly 275 passed, 5 skipped
the cost guard the windows could have broken pytest test/test_discord.py -k pathological -n 0 -p no:randomly 2 passed, 1.63s

What the new cases lock in: a key severed between two pieces is caught; one spanning three
pieces is caught though no adjacent pair shows it; a markup span covering a whole piece is
caught; the pieces are graded as delivered, not as split; a raw-only grade accepts an offset
the reader can rejoin, and the delivered grade moves that offset back; a rule between the
halves hides the key from a pre-split scan but not from this one; an innocent body still
rotates; a safe head that renders over the cap is shrunk rather than abandoned; a retained
buffer holds only source text; no piece a presentation fallback retains exceeds the budget; a
key finished across a pair is caught when the message after it opens on a letter; a held image
reference at or before the budget does not let a refused pair through; a prefix sealed whole by
the upload-hold branch is graded as a sequence, so three fragments separated by rules do not
reach the screen flush.

Every new pin was proven to see the regression it guards: each reviewer's exact pre-fix code
was restored in isolation and the pin failed, then the file was restored to a matching
sha256. Two of them needed their fixture corrected before that proof held, and both
corrections are the same lesson -- a fixture must be measured, not assumed:

  • The upload-hold pin asserts its own precondition, that the splitter's chunk list is clean to
    the raw grade and severing to the delivered one. With SHORT rules the last two fragments pack
    into one chunk, where the blank line between them survives canonicalising and the hazard is
    never exercised.
  • The interior-run pin uses a token whose last segment is a FIXED length. A pattern with an
    open-ended tail just absorbs the alphanumeric frame and matches anyway, so a suffix reading
    catches it and the window proves nothing. With the fixed-length token, no pre-existing
    reading hits it and only the interior window does.
  • The seal-split pin uses an emphasis run SHORTER than the platform cap. Longer than the cap,
    every boundary is inside the run and no redactor can help -- that case is channels: the final seal's cut has no safe boundary when the over-cap text is one unbreakable run #14644, not this
    fix, and using it made the pin fail against a correct fix.

The third row matters for the board: those lanes were red on shards 3 and 6 because their
fakes lacked edit_message_visibility. Dropping the superseded layer drops that verb, so the
lanes clear with no edit to those files -- they are not in this diff.

Manual verification

N/A -- unit coverage is sufficient. Every boundary this touches is reached by a renderer test
that drives the real rotation path against a fake client and asserts on the frames delivered,
so there is no integration seam the tests cannot observe.

Related Issues

Closes #12293
Closes #14587

Pattern harvest

Rule candidate: review-prompt (and agents-md)

Pattern: model text cut into pieces that are then scanned or redacted individually, with
nothing grading the boundary. The scan is sound per piece and unsound across the pair, so the
defect is invisible to every test that reads one message.

This is the third instance of the class and the second fix for it. #11727 found it in WeCom's
_push, where the cut was a plain body[:room] slice; this one is in the two renderers'
_rotate_on_length, where the cut comes from a markdown splitter. The cut's shape differed
each time, which is why the rule should name the property and not the syntax: any path that
turns one piece of model text into more than one separately-scanned delivery must grade the
boundary.

A second, narrower candidate falls out of the fix: a boundary grader that reads only ONE form
of the text is unsound in both directions. Grading the delivered form alone misses a join the
raw form shows, and grading the raw form alone misses a join trimming creates. Either way the
grader looks correct and passes its own tests.

A third, from the review rounds on this branch: a grader that reads a boundary in ONE
direction only inherits whatever the far end of its reading window contains. Every
forward-only reading here ran to the end of the list, so it always carried the next message's
first character, and a pattern that anchors on a character class was decided by that
character rather than by the boundary. A boundary reader must be read from both sides, and a
gate that refuses a pair must be the same gate the code re-consults before shipping that pair.

Checklist

  • At most two commits (two), with a Conventional Commits title
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (docs/system-specs/modules/messaging.md)
  • No secrets, credentials, or internal references in the diff

@chenmingwei23
chenmingwei23 requested review from a team and Zedmor September 24, 2026 19:25
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Sep 24, 2026
@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5) — 🟡 CONCERNS

Premise-level review of f16e7ff8f6dcc10d8fbe08fa49931edccf26a25a — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

First-Principles-Verdict: CONCERNS

The seal-redactor hunks ship what the frozen ## Not a goal excludes verbatim — "pass none, on main and here" — closing #14587 inside this PR.

Not justified as shipped

What this change ships

Inventory (9 items) — 8 justified

Intent: stop a reader reassembling a credential from the pieces a long turn is rotated into — a FIX (provenance: tests added here fail on base; measured raw_severs=False, both_severs=True).

  1. Discord: a rotation that would rejoin a key across messages now cuts elsewhere or withholds — justified
  2. Discord: presentation/card snapshots get the same graded cut, carving until every piece fits the budget — justified
  3. Discord: a held image reference is re-graded with the delivered remainder before assignment — justified
  4. Discord: the final seal's own over-cap split and the upload-failure recovery split now avoid severing boundaries — oversized (frozen Not-a-goal excludes it verbatim)
  5. Telegram: the rotation length cut is graded in delivered form (rules, markers, whitespace stripped), carved or withheld — justified
  6. Telegram: the upload-hold prefix is graded as a sequence before sealing — justified
  7. New shared grader severs_a_credential with bounded interior runs — justified (6 production call sites counted, grep severs_a_credential in src/)
  8. safe_split_offset gains an optional delivered-form parameter — justified (4 callers pass it; wecom keeps the identity default)
  9. messaging.md spec rows updated in the same commit — justified

joins_to_a_credential keeps 3 production consumers (split.py ×2, whatsapp/turn_renderer.py ×1), so no orphaned second spelling. Residuals are each named with a tracking issue (#13743, #14613, #14644, #14645); no pinned test or assertion is deleted.

[FIRST-PRINCIPLES-REVIEWED] f16e7ff

@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Fable 5) — 🟡 CONCERNS

Design-level review of f16e7ff8f6dcc10d8fbe08fa49931edccf26a25a — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: CONCERNS

_delivered_form hand-mirrors each seal's transform with no pin tying them together; a seal-side edit silently re-opens the exact leak this PR closes.

Watch

  • Telegram's _delivered_form docstring says it "Mirrors _segment_text followed by _seal_current's own strip" — a hand-maintained copy of another function's pipeline. The PR's own root-cause analysis ("Telegram does redact before it cuts, but that pass reads the text as written") shows what happens when the graded form and the delivered form drift: a new seal-side strip (the next _strip_hr-shaped transform) is invisible to both graded forms, and the straddle leak returns with every existing shape-corpus test still green. Refactor so one named function owns "what the seal delivers," called by both the seal and the gate, or add a pin asserting the mirror equals the seal's real output over the straddle corpus.
    Clears when: the gate's delivered-form transform is derived from (or pinned equal to) the seal's actual transform, not restated beside it.
  • The description contradicts itself on discord: _seal_current re-splits an over-cap payload with no redactor, so that cut is graded by nothing #14587: "Not a goal" states Discord's four split_markdown_safe sites "pass none, on main and here," while the diff adds redactor=_redact_all at two of them and "What changed" says it closes discord: _seal_current re-splits an over-cap payload with no redactor, so that cut is graded by nothing #14587. The change itself is justified (the withhold routes over-cap text to that cut), but a triager reading only the frozen non-goal will mis-track the issue.
    Clears when: a human reconciles the Not-a-goal bullet or a PR comment states which half is current.

Suggestions

  • Hoist the carve-until-remainder-fits loop (Discord's inline copy, Telegram's _carve_graded) into display_safety with the rendered-cap shrink as a caller hook — the diff's own "ONE rule across the sites" argument applies to the loop as much as to the transform.

[DESIGN-REVIEWED] f16e7ff

@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5 Review — ✅ no blocking findings

Reviewed f16e7ff8f6dcc10d8fbe08fa49931edccf26a25a — this comment is updated in place on each push.

Review details

The graded fallback replaces the splitter's boundaries but not the verdicts and the fence balancing that were derived from them.

FINDING — src/kiro_crew/discord/renderer.py:1129 — sealed = candidate_sealed installs a seam that neither the per-chunk protected_ref_spans scan nor seam_carries_markup_debt ever graded, while _segment_uploads_safe still carries the verdict computed from the now-discarded split, so an offset ending inside an unclosed inline-code run lets the later semantic seal read a marker the full text read LITERAL as REAL — uploading a file the author wrote as literal text, or the mirror case where a real reference is dropped and its raw local path shipped as display text → Fix: on the branch that takes candidate_sealed/candidate_tail, set self._segment_uploads_safe = False (or re-run seam_carries_markup_debt(split_source[:offset], candidate_tail) plus the per-piece span scan) so the verdict describes the boundary that actually ships.

FINDING — src/kiro_crew/telegram/renderer.py:1581 — chunks = [head, raw[offset:]] is a raw character slice chosen by a fence-unaware search, so when the gate fires on a sever at a later boundary while limit falls inside a ``` block, the sealed head carries an unbalanced opener: _FENCE_RE matches nothing, the code body is escaped and then run through `_HEADING_RE`/`_BOLD_STAR_RE`/`_ITALIC_USCORE_RE`/`_LINK_RE` as prose, and the retained tail's now-dangling closer pairs with the next real opener and inverts fence state for the rest of the segment — `discord/renderer.py:1114` and `_carve_graded` slice the same way, and the table arm additionally loses its row awareness and rich budget → Fix: feed the graded offset back through `_split_markdown_bounded(head, rendered_cap)` (table arm: `_split_markdown_table_aware`) and re-grade that output, instead of sealing raw source slices.

[OPUS-REVIEWED] f16e7ff

Verdict parsed from the review's SHA-scoped output markers for commit f16e7ff8f6dcc10d8fbe08fa49931edccf26a25a.

False positive or not applicable? A repository writer can comment:
/ai-review override fable f16e7ff8f6dcc10d8fbe08fa49931edccf26a25a: <one-sentence reason>

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 24, 2026
@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ✅ human override accepted

Human judgment by @chenmingwei23 overrides the GPT 5.6 finding for f16e7ff8f6dcc10d8fbe08fa49931edccf26a25a; the recorded reason is authoritative for this commit.

[GPT-OVERRIDE] f16e7ff

This comment is updated in place on each push.

The model was not re-run because an authorized human decision supersedes it.

False positive or not applicable? A repository writer can comment:
/ai-review override gpt f16e7ff8f6dcc10d8fbe08fa49931edccf26a25a: <one-sentence reason>

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Sep 24, 2026
@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Fable 5) — ⏭️ skipped

Revision f16e7ff8f6dcc10d8fbe08fa49931edccf26a25a touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Advisory — does not block merge.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running and removed readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention labels Sep 24, 2026
@chenmingwei23
chenmingwei23 force-pushed the fix/rotation-seam-credential-12293 branch from 8db5ae4 to 62515a5 Compare September 24, 2026 23:11
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running and removed readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention labels Sep 24, 2026
@chenmingwei23
chenmingwei23 force-pushed the fix/rotation-seam-credential-12293 branch from c0a6a2a to 0e17027 Compare September 25, 2026 00:07
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Sep 25, 2026
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 25, 2026
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 25, 2026
@chenmingwei23
chenmingwei23 force-pushed the fix/rotation-seam-credential-12293 branch from 27f3c94 to 7570394 Compare September 25, 2026 14:55
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 25, 2026
@chenmingwei23
chenmingwei23 force-pushed the fix/rotation-seam-credential-12293 branch from 7570394 to 4d4bfca Compare September 25, 2026 15:23
@github-actions github-actions Bot removed the readiness: action required A blocking check or review needs attention label Sep 25, 2026
`_rotate_on_length` cuts the raw buffer on a length budget and each chunk is
sealed as its own message, redacted alone. #13984 closed most of this by giving
the shared splitters the redactor, so they reduce the text before choosing any
boundary. Two boundaries are outside that fix.

Discord's rotation splitter takes no redactor at all -- `split_markdown_safe` is
called with text and a limit on both its paths -- so its chunk boundaries are
ungraded. And on Telegram the pre-split pass reads the text AS WRITTEN: a
horizontal rule standing between the halves of a key keeps them apart there,
while the seal strips horizontal rules, so the halves sit flush on screen.

`severs_a_credential` is the n-piece case of `joins_to_a_credential`: it grades a
delivered SEQUENCE, over the whole join and over each boundary against the rest,
because neither reading subsumes the other. Both renderers gate their rotation on
it and fall back to `safe_split_offset` to move the cut, withholding the buffer
when no sampled offset is safe.

Both take an optional `present` and grade BOTH the raw and the delivered form. A
delivered-only grade is unsound in one direction that measured here: trimming
reveals a join where whitespace kept the halves apart, and CONCEALS one where the
pattern needs that whitespace, so `-----BEGIN ` beside `RSA PRIVATE KEY-----`
reads clean trimmed and is an intact PEM anchor as sent. Three of nine straddle
shapes failed on the delivered-only rule and pass on both.

No gate on Telegram's held-image tail. That tail begins AT the ref span, so its
first characters are always `![`, and `!` survives canonicalising between the
sealed chunk and anything the tail contributes; measured over alt-text,
link-target, trailing-text and bare-adjacency shapes, no join reaches a pattern.

Tests: 99 pass -- the two rotation-seam classes, the primitive's own unit tests
including the both-forms rule, and the `TurnFooter` and table-streaming cases that
were red before.

Refs #13743
Fixes #12293
The presentation fallback took one safe offset and retained the whole
remainder, which is parked as `_delivery_text` where the only cut left is
`_seal_current`'s ungraded length re-split. It now carves until the
remainder fits the budget and reads the finished list once as a whole.

The sequence grader read each boundary forwards only, so every reading ran
to the end of the list and carried the next message's first letter, which
the patterns anchor on. It now reads prefixes alongside suffixes.

It also reads BOUNDED interior runs. A credential can sit with a spoiling
message on each side, which no whole, prefix or suffix reading reaches. A
window of at most four consecutive messages is slid across the interior,
which is a linear number of readings over bounded-size strings; reading
every contiguous run is quadratic in a piece count the author controls.

The rotation's re-assignment handed back the source remainder plus the held
image reference without re-grading, and an image starting at or before the
budget makes the source shorter than the budget, so the offset search
early-returns the whole string and the refused pair ships unchanged. The
pair is now re-graded in its delivered form before it is assigned.

Telegram's upload-hold branch sealed its whole prefix and returned before
the length path's sequence grade. The splitter reads the raw pieces, where
a horizontal rule still stands between two credential fragments, and the
seam repair reads the delivered form against one predecessor only. The
prefix is now graded as a sequence and carved when it severs.

Discord's `_seal_current` split its over-cap payload with no redactor,
where Telegram's splitter call has carried one all along. That is the last
cut before the wire, with no rotation behind it, and a buffer the rotation
withheld as unsafe is parked whole and arrives there over the cap -- so the
withhold routed text TO the one ungraded cut. Both of its
`split_markdown_safe` calls now pass one.

Closes #14587
@chenmingwei23

Copy link
Copy Markdown
Contributor Author

/ai-review override gpt f16e7ff: Reachability test applied: not reachable on a normal path (needs model-authored text deliberately cut into 5+ consecutive interior messages, each end framed by an alphanumeric spoiler), and no regression - measured here, main's pairwise gate misses every spread W>=3 while this head catches W=3 and W=4, so the residual shrinks. The demanded unbounded scan is the measured DoS in #14613 (2451 pieces, ~3M passes, fails test_a_rotation_terminates_on_pathological_input); residual tracked there.

@github-actions

Copy link
Copy Markdown
Contributor

Human judgment recorded

@chenmingwei23 marked the gpt AI finding as false positive, not applicable, or explicitly accepted for f16e7ff8f6dcc10d8fbe08fa49931edccf26a25a.

Reachability test applied: not reachable on a normal path (needs model-authored text deliberately cut into 5+ consecutive interior messages, each end framed by an alphanumeric spoiler), and no regression - measured here, main's pairwise gate misses every spread W>=3 while this head catches W=3 and W=4, so the residual shrinks. The demanded unbounded scan is the measured DoS in #14613 (2451 pieces, ~3M passes, fails test_a_rotation_terminates_on_pathological_input); residual tracked there.

This decision applies only to this commit. A new push requires a new judgment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants