Skip to content

callgraph_triage.py: bucket every missed and wrong call link into a ranked backlog #3774

Description

@squid-protocol

Part of #3772.

Why

During #3756–#3767, deciding what to fix next meant writing throwaway scripts and reading samples by eye. That was the largest token cost of the round. This tool productizes that step.

What

python tests/tools/callgraph_triage.py <lang> [--samples 3] [--json out.json] compares the engine against the cached reference graph and assigns every miss and every wrong link to a bucket.

Recall, reference edge not linked confidently:

  • not_extracted: the callee name isn't in calls_out_to. Sub-bucketed where the source shows why:
    • inside a string or template literal;
    • after a nested function (truncated span);
    • same name as the caller;
    • the caller isn't a unit at all.
  • caller_unmapped: the reference's caller has no engine function.
  • ambiguous: named but only an ambiguous row, split by step (receiver, nearest, tie, unseen).
  • external_resolution: the name resolved to none.

Precision, engine link the reference disagrees with:

Output

A markdown table ranked by count, meaning recall at stake. Each bucket gets 3 source lines, so a reader sees the pattern without opening files. The JSON form is what the callgraph-miss-sweep skill and the triage-scout agent consume.

Done when

  • zod (TypeScript) and language-crucible Python both produce a table.
  • On zod, the bucket counts reconcile with the gate's totals: 2,661 reference edges, of which 1,519 are linked confidently.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature, sensor, or structural signaturetestingUnit, integration, and E2E pipeline verification

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions