From ab770f9436a8a8028dc54f51cad4219589500301 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Sat, 28 Nov 2026 10:05:29 +0000 Subject: [PATCH] docs(requirements): 100 MEDUSA regex waiver and 101 Home flatten skips the pile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 100: security.py waives MM-SCAN-058 (PLA) and WM-SCAN-354 (ELS) findings whose line lacks the rule word as a whole word, plus an upstream issue and PR with anchored patterns, sent only after the operator reads it. 101: 044's flatten skips absolutely positioned or aria-hidden layers so the Match Home tile keeps its front card's look. Both build after the restart of 2026-11-28 (operator picks via kvb-think-choice). ๐ŸŽฏ Fix: 97 % ๐Ÿ’ฅ Break: 1 % ๐Ÿ’ธ Tokens: โ€“ โฑ๏ธ Velocity: โ€“ ๐Ÿ›ก๏ธ Security: 100 % ๐Ÿ† Score: 96 ๐Ÿšฆ Gate: โœ… 90/5, tokens and velocity <= 100, security 100 % Created-with: https://s.veen.world/skills Co-Authored-By: Claude Opus 5.5 --- docs/requirements/100-medusa-regex-waiver.md | 71 +++++++++++++++++++ .../101-home-flatten-skips-pile.md | 57 +++++++++++++++ docs/requirements/README.md | 2 + 3 files changed, 130 insertions(+) create mode 100644 docs/requirements/100-medusa-regex-waiver.md create mode 100644 docs/requirements/101-home-flatten-skips-pile.md diff --git a/docs/requirements/100-medusa-regex-waiver.md b/docs/requirements/100-medusa-regex-waiver.md new file mode 100644 index 0000000..3add55a --- /dev/null +++ b/docs/requirements/100-medusa-regex-waiver.md @@ -0,0 +1,71 @@ +# 100 - MEDUSA Regex False Positives Waived and Reported Upstream + +## User Story + +As the operator, I want the MEDUSA rules whose unanchored regexes match +everyday words waived in `kvb-check-security` and reported upstream, so +that a commit no longer needs dozens of accept rows for code that has +nothing to do with the attacks those rules describe. + +## Decisions (operator-confirmed 2026-11-28; do not re-litigate) + +1. **Waiver in kvb-check-security**: `security.py` drops findings of a + listed rule when the matched line does not hold the rule's word as a + whole word (`\bPLA\b`, `\bELS\b`); the list starts with + `MEDUSA-MM-SCAN-058` (pattern `PLA`, hits replay, place, plan, + replace) and `MEDUSA-WM-SCAN-354` (pattern `(?i)ELS`, hits else). A + finding whose line holds the whole word still counts. Rejected: keep + accept rows per line (62 rows on 2026-11-28, Quality hit 42 in one + file). +2. **Upstream report**: an issue, and a pull request with anchored + patterns and a test, to the MEDUSA repository, written by the + kvb-release style rules; it publishes only after the operator reads + the text. +3. **Accept rows stay valid**: the existing rows keep working; the waiver + only removes the need for new ones. +4. **Build after the restart of 2026-11-28**, not before. + +## Approach + +```mermaid +flowchart TD + subgraph P["๐Ÿงญ 0 ยท Preparation"] + P1["๐Ÿ“‹ Write requirement"] --> P2{"โœ… Operator approves?"} + P2 -- "โœ๏ธ corrections" --> P1 + end + P2 -- "๐Ÿค– yes" --> A1 + subgraph A["๐Ÿ›ก๏ธ A ยท Waiver"] + A1["๐Ÿงน Whole-word check per listed rule"] --> A2{"๐Ÿงช Unit tests green?"} + A2 -- "๐Ÿ”ด no: fix" --> A1 + end + A2 -- "๐ŸŸข yes" --> B1 + subgraph B["๐Ÿ“ฎ B ยท Upstream"] + B1["โœ๏ธ Issue and PR text with anchored patterns"] --> BF{"๐Ÿ’ฌ Operator reads and approves?"} + BF -- "โœ๏ธ changes" --> B1 + end + BF -- "๐Ÿ‘ publish" --> D1["๐Ÿ Commit with operator OK, hand-over"] +``` + +## Acceptance Criteria + +### Waiver + +- [ ] A MM-SCAN-058 finding on `errors="replace"` is dropped from the score. +- [ ] A MM-SCAN-058 finding on a line naming `PLA` as a word still counts. +- [ ] A WM-SCAN-354 finding on `x if y else code()` is dropped. +- [ ] Existing accept rows still remove their findings. + +### Upstream + +- [ ] The issue and PR text name both patterns, the false hits and the + anchored replacement, and the operator approved them before sending. + +### Tests + +- Unit: + - [ ] Waived, counted and accepted findings for both rules. +- Integration: + - [ ] `security.py --base HEAD` over a fixture repository with + `errors="replace"` reports 100 % without an accept row. +- E2E: + - n/a: no page. diff --git a/docs/requirements/101-home-flatten-skips-pile.md b/docs/requirements/101-home-flatten-skips-pile.md new file mode 100644 index 0000000..4fbc5fb --- /dev/null +++ b/docs/requirements/101-home-flatten-skips-pile.md @@ -0,0 +1,57 @@ +# 101 - Home Tile Flatten Skips the Match Card Pile + +## User Story + +As the operator, I want the Match card in a Home tile to look like the +card on the Match page, so that the widget shows the card itself instead +of a stripped pile layer. + +## Decisions (operator-confirmed 2026-11-28; do not re-litigate) + +1. **Flatten skips stacked decoration**: 044's flatten in `page-home.js` + picks the first box with its own border or background as the tile's + box; it now skips absolutely positioned or `aria-hidden` layers (the + Match pile layers behind the front card), so the front card's own + wrapper becomes the box. Rejected: a Match-only exception in the + flatten; leaving the layer stripped. +2. **Other tiles unchanged**: every tile whose box 044 flattened today + keeps the same box. +3. **Build after the restart of 2026-11-28**. + +## Approach + +```mermaid +flowchart TD + subgraph P["๐Ÿงญ 0 ยท Preparation"] + P1["๐Ÿ“‹ Write requirement"] --> P2{"โœ… Operator approves?"} + P2 -- "โœ๏ธ corrections" --> P1 + end + P2 -- "๐Ÿค– yes" --> A1 + subgraph A["๐Ÿงฑ A ยท Flatten"] + A1["๐Ÿ”Ž Skip stacked layers when picking the box"] --> A2{"๐Ÿงช Unit and E2E green?"} + A2 -- "๐Ÿ”ด no: fix" --> A1 + A2 -- "๐ŸŸข yes" --> AF{"๐Ÿ’ฌ Operator feedback on screenshots?"} + AF -- "โœ๏ธ changes" --> A1 + end + AF -- "๐Ÿ‘ fits" --> D1["๐Ÿ Review, commit with operator OK, hand-over"] +``` + +## Acceptance Criteria + +### Flatten + +- [ ] In the Match Home tile no element with `.match-pile` (or another + absolutely positioned or `aria-hidden` layer) carries `.home-flat`. +- [ ] The Match tile's front card keeps its border and background. +- [ ] Every other tile of `tests/e2e/test_home_flat_widgets_e2e.py` keeps + its flattened box. + +### Tests + +- Unit: + - [ ] The box pick skips an absolutely positioned and an `aria-hidden` + layer (node). +- Integration: + - n/a: no server change. +- E2E: + - [ ] `tests/e2e/test_home_flat_widgets_e2e.py` gains the Match tile. diff --git a/docs/requirements/README.md b/docs/requirements/README.md index 59005ea..92f3722 100644 --- a/docs/requirements/README.md +++ b/docs/requirements/README.md @@ -103,3 +103,5 @@ skill defines the format. - [097 - Match Show Filter in the Right-Click Menu](097-match-show-filter.md) - [098 - Docked Speech Bubbles with Avatar and Close](098-docked-bubble-face-and-close.md) - [099 - Match Card Headline Capped at 120 Characters](099-match-headline-cap.md) +- [100 - MEDUSA Regex False Positives Waived and Reported Upstream](100-medusa-regex-waiver.md) +- [101 - Home Tile Flatten Skips the Match Card Pile](101-home-flatten-skips-pile.md)