From 6f041daaf8506c58bb30326d42fd32ef09cb1ee0 Mon Sep 17 00:00:00 2001 From: jedarden Date: Thu, 9 Jul 2026 05:57:48 -0400 Subject: [PATCH] =?UTF-8?q?docs(bf-5izsg):=20rate-limit=20fix=20pre-flight?= =?UTF-8?q?=20verification=20=E2=80=94=20fix=20NOT=20present?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CODE PRE-FLIGHT verification (split-child of bf-146g8, step 2 of 4). Recorded outcome, no code reimplemented. Findings: the fix the parent (bf-146g8) claims is already present is NOT confirmed as a new/pending change: - search.rs rate-limit logic exists but is COMMITTED (~6wk ago), no uncommitted diff - search-ui rate-limit test: ABSENT (only admin-login test p10_7 exists, committed) - CHANGELOG: empty [Unreleased], no rate-limit entry, no uncommitted diff git status shows only bookkeeping files modified; no code is uncommitted. Co-Authored-By: Claude --- notes/bf-5izsg.md | 83 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 notes/bf-5izsg.md diff --git a/notes/bf-5izsg.md b/notes/bf-5izsg.md new file mode 100644 index 0000000..49a26f4 --- /dev/null +++ b/notes/bf-5izsg.md @@ -0,0 +1,83 @@ +# bf-5izsg — Rate-limit fix presence verification (CODE PRE-FLIGHT) + +Split-child of **bf-146g8**, step 2 of 4. Verification only — **no code +reimplemented** (per instructions). Outcome recorded below and flagged for the +parent. + +## Premise under test (from bf-146g8) + +> The fix is ALREADY in the working tree — `crates/miroir-proxy/src/routes/search.rs` +> + a search-ui rate-limit test + `CHANGELOG.md`. + +## git state (working tree) + +- `git status --short`: only `.beads/issues.jsonl` + `.needle-predispatch-sha` + modified (bookkeeping). `.beads/traces/bf-146g8/` + `bf-5h6d3/` untracked. +- `git diff --stat`: only the two bookkeeping files (20 + 2 lines). **No code + changes are uncommitted anywhere.** + +## Per-element findings + +### 1. `crates/miroir-proxy/src/routes/search.rs` — PRESENT, COMMITTED, no pending diff + +- File exists (56 KB). Tracked; last commit `73a29e1` (~6 weeks ago). +- Rate-limit **logic is present and committed** (plan §4): + - L192–236 and L1029–1073: "Check rate limit for search UI" → reads + `state.config.search_ui.rate_limit.per_ip`, branches on `.backend` + (`redis` → `check_rate_limit_search_ui`; else `local_search_ui_rate_limiter`), + returns `429 TOO_MANY_REQUESTS` when exceeded. +- **But:** `git diff` on this file is empty — this is long-pre-existing + functionality, **not** a new/pending fix. + +### 2. search-ui rate-limit test — **ABSENT** + +- No `search_ui_rate_limit.rs` anywhere in the repo (by name or by content grep). +- Closest test files are unrelated to a *search-ui* rate-limit test: + - `crates/miroir-proxy/tests/p10_7_admin_login_rate_limit.rs` — **tracked/committed**, + 720 lines, 54 `admin` refs, **0** `search_ui` refs. Tests **admin login** + rate limiting (plan §9), not the search-ui route. + - `charts/miroir/tests/bad-search-ui-rate-limit-local-multi.yaml` — tracked/committed + (~3 months ago). A Helm `values.schema.json` rejection test (rule 3: local + rate-limit backend with replicas>1). Different layer than a proxy route test. + - `crates/miroir-core/src/config/validate.rs:273 rejects_search_ui_rate_limit_redis_without_redis` + — committed config-schema validation test, not a proxy route test. +- Definitive grep (`fn .*search.?ui.*rate`, `mod search_ui_rate`, etc.) over all + `crates/**/*.rs` returns nothing relevant. **No search-ui rate-limit test exists, + committed or uncommitted.** + +### 3. `CHANGELOG.md` — PRESENT, COMMITTED, no rate-limit-fix entry, no pending diff + +- Tracked; last commit `e348157` (~7 weeks ago). +- The `[Unreleased]` section is **empty** (Added/Changed/Deprecated/Removed/Fixed/Security all blank). +- Only "rate limit" mention is the pre-existing v0.1.0 line about + `values.schema.json` rejecting incompatible configs ("local rate limits in + multi-replica"). **No entry for a search-ui rate-limit fix.** +- `git diff` on the file is empty. + +## Conclusion — premise NOT confirmed + +The fix, **as a new/pending change** (search.rs diff + a search-ui rate-limit test ++ CHANGELOG entry), is **not present** in the working tree: + +| Element | Expected | Actual | State | +|---|---|---|---| +| search.rs rate-limit change | pending/uncommitted | logic present but **committed ~6wk ago**, no diff | pre-existing | +| search-ui rate-limit test | present | **absent** (only admin-login test exists) | missing | +| CHANGELOG entry | present | **empty Unreleased**, no mention | missing | + +The underlying search-ui rate-limit *functionality* in `search.rs` does exist and +is committed, but the accompanying test and CHANGELOG entry the parent expected do +not, and there is **no uncommitted diff** representing a fix-in-progress. + +**Recommendation to parent (bf-146g8):** do not assume the fix is already done. +If a distinct search-ui rate-limit fix is required, it (test + CHANGELOG entry, +and any search.rs delta beyond the pre-existing committed logic) still needs to be +written. A build cycle is **not** warranted to "verify" a fix that isn't present. + +## Verification method + +`git status --short`; `git diff --stat`; `git ls-files --error-unmatch`; +`git log -1 -- `; `find -iname '*rate*limit*'`; content grep over +`crates/**/*.rs` and `CHANGELOG.md`. Corrected an initial path error (proxy tests +live in `crates/miroir-proxy/tests/`, not `crates/miroir/tests/`) — that file is +tracked, not new.