Implement query search value #14

Closed
opened 2026-09-03 14:22:18 +00:00 by JayKobe6k · 0 comments
Owner

Goal

Search indexed value declarations/definitions with regex, scope, and lineage-connectivity filters.

Command contract

claritree query --index <index-selector> search value \
  [--identifier <regex>] \
  [--translation-unit <regex>] \
  [--function <regex>] \
  [--name <regex>] \
  [--struct <regex>] \
  [--min-upstream-count <n>] \
  [shared search options]

--min-upstream-count replaces the ambiguous term --min-parents: it counts distinct direct value producers contributing to the matched definition. An origin definition such as an un-derived literal initialization has zero upstream value producers. Document whether literals are represented as source facts without counting as value producers.

All supplied filters combine with AND. Each regex is matched against its documented canonical/display field. Results identify whether the hit is a declaration, definition, or use and include a canonical value handle suitable for query lineage.

Acceptance criteria

  • Search distinguishes a symbol from its value definitions and uses.
  • Tests cover same-named globals/statics/locals, shadowing, function/struct scope, translation-unit paths, canonical identifier matching, zero/nonzero upstream counts, multiple simultaneous filters, and no matches.
  • --min-upstream-count uses direct producer count rather than total transitive lineage size.
  • Shared max/group/order behavior from #13 works for value results.
  • Text output includes enough scope/location to disambiguate hits; JSON includes typed handles and exact source anchors.
  • Query behavior is revision-scoped and has typed LadybugDB mapping tests.

Dependencies

Depends on #7, #10, #11, and #13.

## Goal Search indexed value declarations/definitions with regex, scope, and lineage-connectivity filters. ## Command contract ```text claritree query --index <index-selector> search value \ [--identifier <regex>] \ [--translation-unit <regex>] \ [--function <regex>] \ [--name <regex>] \ [--struct <regex>] \ [--min-upstream-count <n>] \ [shared search options] ``` `--min-upstream-count` replaces the ambiguous term `--min-parents`: it counts distinct direct value producers contributing to the matched definition. An origin definition such as an un-derived literal initialization has zero upstream value producers. Document whether literals are represented as source facts without counting as value producers. All supplied filters combine with AND. Each regex is matched against its documented canonical/display field. Results identify whether the hit is a declaration, definition, or use and include a canonical value handle suitable for `query lineage`. ## Acceptance criteria - Search distinguishes a symbol from its value definitions and uses. - Tests cover same-named globals/statics/locals, shadowing, function/struct scope, translation-unit paths, canonical identifier matching, zero/nonzero upstream counts, multiple simultaneous filters, and no matches. - `--min-upstream-count` uses direct producer count rather than total transitive lineage size. - Shared max/group/order behavior from #13 works for value results. - Text output includes enough scope/location to disambiguate hits; JSON includes typed handles and exact source anchors. - Query behavior is revision-scoped and has typed LadybugDB mapping tests. ## Dependencies Depends on #7, #10, #11, and #13.
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
JayKobe6k/ClariTree#14
No description provided.