yams/tests/unit
trvon ed2bde4f7c
fix(grep): bound the regex fallback instead of backtracking without limit
RE2 rejects backreferences and lookaround, and grep fell back to
std::regex for those patterns. std::regex backtracks with no limit, so
a pattern like (x+x+)+y\1 runs in exponential time (2 s at 24 chars on
grim, 4x per 2 more) and libstdc++ recursion can overflow the stack on
long lines. A daemon grep request could pin a worker indefinitely.

Use Boost.Regex (header-only, already a dependency) for the fallback.
It is non-recursive and abandons a search after
max(N*S^2, min(N^2, cap)) + 1e5 states; the cap is 1e7 here. An
abandoned line counts as no match, and grep reports the count as
searchStats.regex_budget_exceeded. The fallback also gains lookbehind.

findNext now passes the preceding bytes as context to both engines, so
^ and \b no longer match at a resumed offset ("^a" on "aa" counted 2).

Signed-off-by: trvon <me@trevon.dev>
2026-10-26 22:32:47 -06:00
..
api chore: promote experimental to main (#156) 2026-09-19 16:27:50 -06:00
app/services fix(grep): bound the regex fallback instead of backtracking without limit 2026-10-26 22:32:47 -06:00
benchmarks chore: promote experimental to main (#156) 2026-09-19 16:27:50 -06:00
chunking Remediate Fold SAST findings 2026-05-27 22:41:44 -04:00
cli fix(graph): rank explore targets and stop version crowding (#322) 2026-10-18 10:38:55 -06:00
common test(infra): give every Catch2 process a private XDG_STATE_HOME (#296) 2026-10-14 08:32:56 -06:00
compression fix(cli): decode compressed content in yams get 2026-09-26 21:10:00 -06:00
config chore: promote experimental to main (#156) 2026-09-19 16:27:50 -06:00
content fix(extraction): tighten UTF-8 detection and keep units after bad surrogates 2026-09-23 17:56:59 -06:00
core fix(core): correct feature-test detection in cpp23_features.hpp (#278) 2026-10-08 14:30:27 -06:00
crypto feat: optimizations based on profile runs in hashing and work coordinator. test updates and correctness fixes 2026-02-24 21:06:43 -05:00
daemon fix(daemon): give each ServiceManagerFsm its own state 2026-10-26 05:52:52 -06:00
detection fix(tests): replace frozen expectations and harden release gates (#323) 2026-10-19 19:16:57 -06:00
downloader fix(downloader): emit the Resolving and Verifying progress stages 2026-09-24 18:20:21 -06:00
extraction test(memory-sync): stop the sync service off the apply lock in stage hooks (#352) 2026-10-25 20:54:41 -06:00
ingest plugin improvements. continued gtest -> catch2 test migration 2025-12-19 22:27:31 -05:00
integrity chore(warnings): clean up compiler warnings on GCC, Clang and Apple Clang (#279) 2026-10-08 14:30:28 -06:00
manifest fix(storage): harden manifest and graph cleanup 2026-07-29 02:35:04 -04:00
mcp chore: promote experimental to main (#156) 2026-09-19 16:27:50 -06:00
memory_sync fix: Windows and macOS CI failures on experimental (#370) 2026-10-26 05:53:12 -06:00
metadata feat(memory-sync): apply paged winners through bounded adapters (#330) 2026-10-22 07:12:24 -06:00
plugins test(plugins): use host library names in the ORT resolution tests 2026-10-01 23:55:40 -06:00
repair chore: promote experimental to main (#156) 2026-09-19 16:27:50 -06:00
resolve perf(ingest): harden daemon batching and shutdown (#58) 2026-07-17 07:04:30 -04:00
search perf(search): build the topology route index off the query path (#346) 2026-10-25 14:58:26 -06:00
storage fix(tests): replace frozen expectations and harden release gates (#323) 2026-10-19 19:16:57 -06:00
topology fix(topology): make louvain moves independent of hash order (#313) 2026-10-16 09:43:38 -06:00
vector fix(vector): prepare backend statements only once per connection (#351) 2026-10-25 20:54:40 -06:00
wal fix(wal): encode the entry header field by field, never via padding (#274) 2026-10-08 14:30:25 -06:00
meson.build test: expand coverage and harden ci 2026-05-20 10:37:54 -04:00