Skip to content

Avoid CLI option parsing for clp-s query strings #2526

Description

@coderabbitai

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:

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions