Summary
query::clp_s_search passes the KQL query string to the clp-s s executable as a command-line argument. A query string that begins with - can be interpreted as a clp-s option instead of KQL.
Do not change the query string by automatically adding KQL parentheses. That workaround can change KQL semantics. For example, an invalid query such as a) AND (b could become valid after wrapping.
Required changes
Provide a query execution interface that accepts the KQL query string as data instead of as a command-line option candidate. The preferred direction is the planned Rust CLP library integration, either through a C FFI layer or a native Rust library.
Until that interface exists, keep the current behaviour consistent with the existing Python/Celery implementation.
Affected area
components/clp-tdl-package/src/task/query/search.rs
build_clp_s_search_args_for_result_cache
- Future Rust CLP query library or FFI API
Acceptance criteria
- A KQL query that begins with
- is accepted as a query and is not parsed as a clp-s command-line option.
- The implementation does not rewrite or wrap the KQL query text.
- Invalid KQL remains invalid under the library or FFI query interface.
- Add tests for leading-dash queries and invalid unbalanced-parenthesis queries.
Context
Requested by @LinZhihao-723.
Backlinks:
Summary
query::clp_s_searchpasses the KQL query string to theclp-s sexecutable as a command-line argument. A query string that begins with-can be interpreted as aclp-soption instead of KQL.Do not change the query string by automatically adding KQL parentheses. That workaround can change KQL semantics. For example, an invalid query such as
a) AND (bcould become valid after wrapping.Required changes
Provide a query execution interface that accepts the KQL query string as data instead of as a command-line option candidate. The preferred direction is the planned Rust CLP library integration, either through a C FFI layer or a native Rust library.
Until that interface exists, keep the current behaviour consistent with the existing Python/Celery implementation.
Affected area
components/clp-tdl-package/src/task/query/search.rsbuild_clp_s_search_args_for_result_cacheAcceptance criteria
-is accepted as a query and is not parsed as aclp-scommand-line option.Context
Requested by @LinZhihao-723.
Backlinks:
query::clp_s_searchtask. #2512query::clp_s_searchtask. #2512 (comment)