Repository navigation
fix(security): add opener set for CJK brackets in options markers - #9460
aniruddhaadak80 wants to merge 2 commits into
Conversation
|
👋 Hi! This PR's description is missing some required sections from our PR template. Workflow runs won't be auto-approved until the description is updated. Missing sections:
Please update your PR description to include these sections, then push or re-save the description. The workflows will be approved on the next cycle. |
Design Review (Fable 5, fork) — 🔴 BLOCK (blocking)Design-level review of Design-Verdict: BLOCK Phantom fix: the "CJK opener set" the title adds already exists in base; the diff ships only a dead constant and redundant tests. BlockersThe PR solves a problem the base already solved, and its own artifact is unused. Suggestions
[DESIGN-REVIEWED] 4a06c18 |
Opus 4.8 Review (fork) — ✅ no blocking findingsReviewed |
First Principles Review (Fable 5, fork) — 🔴 BLOCKPremise-level review of First-Principles-Verdict: BLOCK
Not justified as shipped
What this change shipsInventory (4 items) — 2 justifiedIntent: guard the index-aligned opener/closer strings against future drift — an ADDITION despite the
Blockers
[FIRST-PRINCIPLES-REVIEWED] 4a06c18 |
GPT 5.6 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
|
🤖 Kiro Crew [operator: NicholasRBowers#a942f9ca]: This PR has been inactive for 7+ days. I reviewed the blockers but they require your input:
GPT and Opus report no blocking findings; Design Review and First Principles both BLOCK on the points above. When you've addressed these, the pipeline will re-assess on its next cycle. |
3c46d3c to
6fe1891
Compare
|
@NicholasRBowers Rebased onto current main (443 behind -> 0, 3c46d3c...6fe1891, force-with-lease, 3 commits intact). Conflict was real overlap: upstream has since landed the CLOSERS half of this feature, so I took upstream's closer block verbatim and kept only this PR's additive opener set (MARKER_OPENERS + MARKER_PAIRS + pairing tests for #9375) — no duplication, symbols verified against the new base. Awaiting fresh CI (fork approval-gated) and re-review. |
6fe1891 to
fc551ea
Compare
|
@NicholasRBowers Rebased onto current upstream/main for re-review (CONFLICTING -> MERGEABLE). Before -> after: 6fe1891 -> fc551ea (force-with-lease to fork only, 3 commits intact). Base: 591c37c -> 534b003 (was 197 behind, now 0 behind, 3 ahead). Branch: fix/cjk-brackets-options in KiroCrew-wt-9460b. No index.lock issues. Conflict resolution (1 file, commit 83f952b, was 24fc523): src/kiro_crew/constants.py overlapped because upstream has since landed the full opener-aware grammar. Took upstream verbatim (MARKER_OPENERS + _MARKER_OPEN_CLASS + _MARKER_BRACKETS + typed _MARKER_LABEL_PAIR + docs) and kept only this PR additive bit: MARKER_PAIRS = tuple(zip(MARKER_OPENERS, MARKER_CLOSERS)) for #9375 plus existing TestOpenerCloserPairs. Verified via git log upstream/main..HEAD: 29a92d0 (line-continuation), 83f952b (opener set, now +6/-0 in constants.py), fc551ea (URL-rewrite notice). Other 2 commits applied cleanly, none emptied. After: gh pr view = MERGEABLE / BLOCKED / OPEN at fc551ea. gh pr checks = new run pending (Fork PR Description, Publish readiness signal pending; workflow-change guard skipping). No local pytest/node env in worktree, so CI-is-proof. Carried items (unchanged by this rebase, for next pass): test/test_security.py IndentationError (module-level def test_glued_payload_reaches_the_regex_tier_views(self) + stream-of-consciousness Wait-comment) takes down Backend Lint and Windows/3.12 shards; TestOpenerCloserPairs asserts list(...) == tuple(...) fails every shard; PR Hygiene wants 1-2 commits (has 3); Sept 12 review notes still open (MARKER_PAIRS consumed by no regex, 22-line ReDoS rationale now preserved via upstream-take, messaging/renderer redaction_notice + shell_normalizer line-folding flagged as split-or-drop, npm test claims). Coverage/Design gates to be re-read once pending CI completes. |
fc551ea to
b3a30fa
Compare
- Add MARKER_PAIRS constant for positional opener-closer pairing - Add tests for opener-closer pairing - Fix CJK bracket parsing in [OPTIONS:] markers
5066767 to
4a06c18
Compare
|
Fixed in the new head (2 commits preserved): 1) test_openers_and_closers_are_paired_positionally compared list(zip(...)) against the MARKER_PAIRS tuple - now list-to-list; 15/15 pass locally. 2) black formatting on the same test file (the Backend Lint red). Remaining reds are not this diff: test_pod_windows_run reservation failure is the upstream rt-vs-win IS_WINDOWS mock defect diagnosed on #7843, and the stub-ACP E2E memory_unavailable error is environmental. Coverage/PR-Readiness are cascade. |
|
CI triage: Backend Windows(4) fails 1/13255 on a dashboard-approval provenance assertion (untouched surface; my constants.py is black+mypy clean locally), Windows(5) similar single-assertion shape. No push - rerun should clear. |
|
Thank you, @aniruddhaadak80 — this raised a real security concern and it's now covered on Because the security fix is already in If you'd still like the alignment lock, a small standalone follow-up with just the |
Problem / Motivation
The
[OPTIONS:]marker grammar keeps index-alignedMARKER_OPENERSandMARKER_CLOSERS, but pairing is re-derived withzip()at each use site. No single constant names the pairing, and no test locks positional alignment, so a future edit can misalign the two strings and silently break CJK marker parsing.Why it matters
A misaligned opener/closer pair breaks the end anchor for CJK-closed markers. The marker then leaks into the visible message as literal text and follow-up pills are silently lost.
What changed (motivation → approach → change)
Unpaired parallel strings drift. The fix names the pairing once and locks it: added
MARKER_PAIRS = tuple(zip(MARKER_OPENERS, MARKER_CLOSERS))insrc/kiro_crew/constants.py, plus three tests intest/test_options_marker_closers.pycovering positional pairing, openers rejected as closers, and closers rejected as openers. No grammar behavior changes; upstream opener-aware parsing is untouched.Tests
TestOpenerCloserPairs:test_openers_and_closers_are_paired_positionally,test_openers_are_not_accepted_as_closers,test_closers_are_not_accepted_as_openers.git diff --checkclean.Manual verification
N/A ΓÇö unit coverage sufficient. The change adds a constant over existing grammar plus pairing tests; no integration path, UI, or external service involved.
Related Issues
N/A.
Pattern harvest
Not generalizable: one-off pairing lock for the marker grammar; no new defect class.
Checklist
feat|fix|docs|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Pattern harvest
Rule candidate: unicode-delimiter-pairing
Pattern: when extending a marker table for CJK lookalike brackets, add openers and closers as positional pairs and test acceptance in both directions (openers-not-closers, closers-not-openers); upstream may land one half first, leaving the other half inert.