Coverage for src/local_deep_research/web/routes/_search_constants.py: 100%
1 statements
« prev ^ index » next coverage.py v7.15.1, created at 2026-07-19 23:35 +0000
« prev ^ index » next coverage.py v7.15.1, created at 2026-07-19 23:35 +0000
1"""Shared search-query limits for the notes and unified-search routes.
3Both route modules cap the user-supplied free-text ``q`` / ``search``
4param that flows into ``ILIKE %...%`` over unbounded TEXT columns (and the
5embedding call). The cap lived as an independent ``MAX_SEARCH_LEN = 512``
6in each module, linked only by a "mirrors the other file" comment that
7would rot the moment one side changed. One definition here removes the
8manual-sync hazard.
9"""
11# 512 chars — an order of magnitude above any realistic UI query input.
12MAX_SEARCH_LEN = 512