Implement query search struct #16

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

Goal

Search C struct/union declarations and definitions with canonical identity and scope filters.

Filters and results

  • Support --identifier, --translation-unit, --function, --name, and --struct for nested/enclosing record scope where applicable.
  • Apply shared --max-results, --group-by, and --order-by behavior.
  • Match struct and union as explicit closed record kinds; do not infer record identity only from spelling strings.
  • Define canonical identity for tagged, typedef-named, anonymous, nested, forward-declared, and multiply declared records.
  • Return record kind, canonical/display name, enclosing scopes, definition/declaration status, source anchors, fields with canonical types, and a durable record handle.

Do not copy lineage-specific value filters such as upstream producer count onto records. “Similar to value search” means sharing applicable identity/scope and result-shaping options, not accepting semantically meaningless flags.

Acceptance criteria

  • Tests cover tagged/anonymous structs, unions, typedef aliases, forward declaration plus definition, same tag in different scopes/TUs, nested records, local records, fields, and combinations of scope regexes.
  • Declaration duplicates are canonicalized with all relevant source occurrences retained.
  • Grouping/ordering by translation unit, name, function, struct, and type has documented valid/invalid combinations.
  • Text output disambiguates anonymous and same-named records; JSON output preserves exact source anchors and typed record kind.
  • LadybugDB uses explicit record nodes/relationships with mapping tests.

Dependencies

Depends on record/type extraction in #7 and shared search behavior in #13.

## Goal Search C struct/union declarations and definitions with canonical identity and scope filters. ## Filters and results - Support `--identifier`, `--translation-unit`, `--function`, `--name`, and `--struct` for nested/enclosing record scope where applicable. - Apply shared `--max-results`, `--group-by`, and `--order-by` behavior. - Match `struct` and `union` as explicit closed record kinds; do not infer record identity only from spelling strings. - Define canonical identity for tagged, typedef-named, anonymous, nested, forward-declared, and multiply declared records. - Return record kind, canonical/display name, enclosing scopes, definition/declaration status, source anchors, fields with canonical types, and a durable record handle. Do not copy lineage-specific value filters such as upstream producer count onto records. “Similar to value search” means sharing applicable identity/scope and result-shaping options, not accepting semantically meaningless flags. ## Acceptance criteria - Tests cover tagged/anonymous structs, unions, typedef aliases, forward declaration plus definition, same tag in different scopes/TUs, nested records, local records, fields, and combinations of scope regexes. - Declaration duplicates are canonicalized with all relevant source occurrences retained. - Grouping/ordering by translation unit, name, function, struct, and type has documented valid/invalid combinations. - Text output disambiguates anonymous and same-named records; JSON output preserves exact source anchors and typed record kind. - LadybugDB uses explicit record nodes/relationships with mapping tests. ## Dependencies Depends on record/type extraction in #7 and shared search behavior in #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#16
No description provided.