Extract the C facts required for search and value lineage #7

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

Goal

Complete the owned, typed libclang facts needed by persisted entity search and ClariTree-owned lineage analysis.

Scope

  • Associate declarations with complete supported types.
  • Emit record/struct and enum types, fields, enumerators, function signatures, parameter names/types, enclosing scopes, and qualified display identifiers needed by search.
  • Emit expression/operation facts for initialization, assignment, literals, conversions, unary/binary operations, field/index access, address/dereference, return values, and call arguments/results.
  • Populate definition sites and operation inputs without treating references or calls alone as proof of value flow.
  • Build deterministic callable control-flow blocks/edges for branches, loops, returns, and fallthrough rather than one synthetic block.
  • Preserve exact spelling and expansion anchors and translation-unit provenance as owned values; never retain libclang cursors beyond the translation unit.
  • Define conservative representation for unsupported/opaque constructs and indirect calls.

Acceptance criteria

  • Focused C fixtures cover global/local/static values, shadowing, structs and nested records, enums, function declarations/definitions, parameters, assignments, branches, loops, calls, returns, pointers, arrays, fields, and macros.
  • Every emitted ID and relationship endpoint is validated by the IR builder.
  • Facts are language-neutral after the parser boundary even where the libclang adapter performs C-specific extraction.
  • Parsing diagnostics and unsupported constructs are reported without panicking.
  • Existing handwritten and zlib indexing tests remain deterministic.

Dependencies

Depends on the durable identity/provenance model in #4. It can proceed in parallel with #5 and #6.

## Goal Complete the owned, typed libclang facts needed by persisted entity search and ClariTree-owned lineage analysis. ## Scope - Associate declarations with complete supported types. - Emit record/struct and enum types, fields, enumerators, function signatures, parameter names/types, enclosing scopes, and qualified display identifiers needed by search. - Emit expression/operation facts for initialization, assignment, literals, conversions, unary/binary operations, field/index access, address/dereference, return values, and call arguments/results. - Populate definition sites and operation inputs without treating references or calls alone as proof of value flow. - Build deterministic callable control-flow blocks/edges for branches, loops, returns, and fallthrough rather than one synthetic block. - Preserve exact spelling and expansion anchors and translation-unit provenance as owned values; never retain libclang cursors beyond the translation unit. - Define conservative representation for unsupported/opaque constructs and indirect calls. ## Acceptance criteria - Focused C fixtures cover global/local/static values, shadowing, structs and nested records, enums, function declarations/definitions, parameters, assignments, branches, loops, calls, returns, pointers, arrays, fields, and macros. - Every emitted ID and relationship endpoint is validated by the IR builder. - Facts are language-neutral after the parser boundary even where the libclang adapter performs C-specific extraction. - Parsing diagnostics and unsupported constructs are reported without panicking. - Existing handwritten and zlib indexing tests remain deterministic. ## Dependencies Depends on the durable identity/provenance model in #4. It can proceed in parallel with #5 and #6.
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#7
No description provided.