Skip to main content

query_contracts

Function query_contracts 

Source
pub fn query_contracts(
    git: &dyn GitOps,
    query: &ContractsQuery,
) -> Result<ContractsOutput, GitError>
Expand description

Build a contracts-and-dependencies view for a file (or file+anchor).

In v3, contracts come from gotcha wisdom entries and dependencies from insight wisdom entries whose content matches the dependency pattern (“Depends on :”).

  1. Get commits that touched the file via log_for_file
  2. For each commit, parse annotation via parse_annotation
  3. Filter wisdom entries matching the query file
  4. Deduplicate by keeping the most recent entry per unique key