[PR #6742] [CLOSED] fix(signals): retain Unicode literal matches across sigma word positions (#6714) #7403

Closed
opened 2026-11-01 21:47:36 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/6742
Author: @Totopo27
Created: 10/23/2026
Status: ❌ Closed

Base: main ← Head: fix/6714-signal-decoder-search-sigma


📝 Commits (1)

  • 8e95e35 fix(signals): retain Unicode literal matches across sigma word positions (#6714)

📊 Changes

2 files changed (+45 additions, -5 deletions)

View changed files

📝 src/signals/parseDecoderDiscovery.ts (+9 -5)
📝 tests/boundary/signals/decoderDiscovery.test.ts (+36 -0)

📄 Description

Summary

Fixes #6714. Retains Greek sigma matches in decoder catalog names and help lines across all word positions under case-insensitive discovery queries.

Problem and expected behavior

inspect_signal_decoders uses parseDecoderDiscovery to filter decoder names and help lines. Because it relied on toLowerCase(), word-final Greek sigma in producer text (e.g. ΟΣ) was transformed into final sigma ς, while an isolated search query Σ (or σ) became σ. As a result, .toLowerCase().includes(...) failed to match exact substrings. A case-insensitive literal search must retain exact literal matches regardless of Unicode contextual casing rules.

Change and scope

  • In src/signals/parseDecoderDiscovery.ts, escaped regex metacharacters in input.query and compiled a Unicode case-insensitive literal RegExp (iu).
  • Filter catalog records and help lines using queryPattern.test(...).
  • Scope is strictly bounded to the decoder discovery parser; no external provider or schema changes.

Contract and boundary impact

  • Semantic owner and earliest changed stage: src/signals/parseDecoderDiscovery.ts, transport/projection of sigrok decoder discovery.
  • Contribution scope fit and linked maintainer decision: not applicable (bugfix within existing boundaries).
  • CLI and MCP/tool-catalog contract: unchanged.
  • Provider, bridge, target-format, or platform compatibility: sigrok decoder discovery filtering.
  • Evidence, artifact, provenance, or reconstruction contract: unchanged.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): none.
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact: none.

Expected effects:

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests added or updated: tests/boundary/signals/decoderDiscovery.test.ts. Added regression covering catalog names and help lines with Σ, σ, ς, ΟΣ, ASCII controls, and empty queries.
  • Base reproduction or other evidence: On base, queries for Σ against ΟΣ failed returning 0 matches. With the fix, 1 match is found as expected.
  • User-visible CLI/MCP output (if applicable): rea signals decoders --query Σ correctly returns matching decoders/help lines.
  • Remaining proof gaps: Executed against synthetic producer text fixtures; live sigrok CLI with hardware was not executed.

For evidence-bearing changes:

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

  • node node_modules/vitest/vitest.mjs run tests/boundary/signals/decoderDiscovery.test.ts — 4 passed.
  • npm run check:fast — 2 successful (turbo typecheck and lint passed).
  • Git pre-push hook executed check:fast cleanly in 310ms.

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: platform-independent parser logic; executed on Windows.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: safe regex escape prevents ReDoS.

Author readiness

Human owner:

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/6742 **Author:** [@Totopo27](https://github.com/Totopo27) **Created:** 10/23/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/6714-signal-decoder-search-sigma` --- ### 📝 Commits (1) - [`8e95e35`](https://github.com/morluto/rea/commit/8e95e359e1d046b58d1a4129368e267d96912d62) fix(signals): retain Unicode literal matches across sigma word positions (#6714) ### 📊 Changes **2 files changed** (+45 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `src/signals/parseDecoderDiscovery.ts` (+9 -5) 📝 `tests/boundary/signals/decoderDiscovery.test.ts` (+36 -0) </details> ### 📄 Description ## Summary Fixes #6714. Retains Greek sigma matches in decoder catalog names and help lines across all word positions under case-insensitive discovery queries. ## Problem and expected behavior `inspect_signal_decoders` uses `parseDecoderDiscovery` to filter decoder names and help lines. Because it relied on `toLowerCase()`, word-final Greek sigma in producer text (e.g. `ΟΣ`) was transformed into final sigma `ς`, while an isolated search query `Σ` (or `σ`) became `σ`. As a result, `.toLowerCase().includes(...)` failed to match exact substrings. A case-insensitive literal search must retain exact literal matches regardless of Unicode contextual casing rules. ## Change and scope - In `src/signals/parseDecoderDiscovery.ts`, escaped regex metacharacters in `input.query` and compiled a Unicode case-insensitive literal RegExp (`iu`). - Filter catalog records and help lines using `queryPattern.test(...)`. - Scope is strictly bounded to the decoder discovery parser; no external provider or schema changes. ## Contract and boundary impact - Semantic owner and earliest changed stage: `src/signals/parseDecoderDiscovery.ts`, transport/projection of sigrok decoder discovery. - Contribution scope fit and linked maintainer decision: not applicable (bugfix within existing boundaries). - CLI and MCP/tool-catalog contract: unchanged. - Provider, bridge, target-format, or platform compatibility: sigrok decoder discovery filtering. - Evidence, artifact, provenance, or reconstruction contract: unchanged. - Target selection, authority, upstream behavior, and cleanup details (if applicable): none. - Generated metadata (`docs/public/product-catalog.json`), package, or installation impact: none. Expected effects: - [ ] Read existing files or captured data. - [ ] Launch or attach to a process. - [ ] Inject instrumentation or run scripts/code. - [ ] Change process memory, registers, files, or configuration. - [ ] Contact network services. - [ ] Recover protected code or work around protections. - [x] Documentation or usability only; no target interaction. - [ ] Not sure yet; investigation or maintainer guidance needed. ## Evidence and regression coverage - Tests added or updated: `tests/boundary/signals/decoderDiscovery.test.ts`. Added regression covering catalog names and help lines with `Σ`, `σ`, `ς`, `ΟΣ`, ASCII controls, and empty queries. - Base reproduction or other evidence: On base, queries for `Σ` against `ΟΣ` failed returning 0 matches. With the fix, 1 match is found as expected. - User-visible CLI/MCP output (if applicable): `rea signals decoders --query Σ` correctly returns matching decoders/help lines. - Remaining proof gaps: Executed against synthetic producer text fixtures; live sigrok CLI with hardware was not executed. For evidence-bearing changes: - [x] Observed, derived, and inferred claims remain distinguishable. - [x] Artifact identity, source provenance, and failed attempts remain preserved. - [x] Unsupported, incomplete, unavailable, or uncertain outcomes remain visible. ## Validation performed - `node node_modules/vitest/vitest.mjs run tests/boundary/signals/decoderDiscovery.test.ts` — 4 passed. - `npm run check:fast` — 2 successful (turbo typecheck and lint passed). - Git pre-push hook executed `check:fast` cleanly in 310ms. ## Compatibility, safety, and release - Breaking changes or migration steps: none. - Real Hopper/Ghidra, browser, or OS coverage: platform-independent parser logic; executed on Windows. - Package or release metadata impact: none. - Security, privacy, process, or containment review: safe regex escape prevents ReDoS. ## Author readiness Human owner: <!-- @GitHub-handle --> - [ ] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [ ] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [ ] I declare this PR ready for initial maintainer review. ## Before merge - [ ] This PR addresses a concrete problem or an agreed enhancement. - [ ] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [ ] The PR has one focused outcome and the title follows `type(scope): outcome`. - [ ] Related issue is linked, or the reason for not linking one is stated above. - [ ] Tests cover changed observable behavior and meaningful failure paths. - [ ] Owning docs, contracts, and generated metadata are updated where needed. - [ ] User-visible CLI/MCP changes include representative output. - [ ] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-01 21:47:36 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#7403
No description provided.