The Drift Log · Software inventory you can trust
Grading Internal Package Call Sites to Map Load-Bearing Logic
24 November 2026 · 3 min read · 527 words · established

Package download counts measure build churn, not criticality. Grade downstream call sites against live execution paths to map true architectural risk.
Your internal package registry claims @corp/string-utils is downloaded 80,000 times a week. It sits in every repository’s package.json because a scaffolding tool put it there three years ago. If the registry went down tomorrow, CI pipelines would halt. But if you stripped the package out of production bundles, nothing would crash—except perhaps one webhook handler in a deprecated service.
Registry telemetry measures build churn, not criticality. When engineering teams run a code reuse audit, they routinely mistake package download counts and lockfile presence for architectural importance. The result is an internal library maintenance schedule driven by noise: engineers spend weeks updating minor version bumps across forty services where the package is dead code, while a genuinely fragile, load-bearing utility with low download volume escapes scrutiny.
Categorising Call Sites Beyond the Import Statement
Static import counting fails because not all imports represent execution risk. To convert a raw list of dependencies into an accurate software inventory, you have to grade the call sites where the package is actually invoked.
A reliable classification model separates internal dependencies into three tiers:
- Ambient references: The package is declared in dependency manifests or imported at the root of a module, but no exported symbol is reached by any live entry point. This is dead code preserved by inertia.
- Ancillary execution: The utility runs strictly during test setup, in offline batch scripts, or inside non-critical telemetry formatters. An unhandled exception here degrades operational visibility or fails a build, but it does not drop user transactions.
- Load-bearing paths: The package executes on synchronous request paths, inside core mutation pipelines, or at database boundary transactions. If its contract breaks or its runtime assumptions fail, production state corrupts or outages occur.
Running an AST sweep across downstream repositories exposes how often declared dependencies diverge from live execution paths. When you map imports against reachable call graphs, packages that appeared ubiquitous often collapse into small clusters of real usage.
Turning Call Site Inspection into an Actionable Inventory
Knowing a package is called on a hot path is only half the battle. The next failure mode is assuming that because a call site exists, the interface contract is safe.
Teams often maintain an internal library by guessing how downstream consumers use it. A utility might expose twelve functions, but production services only use two—and they pass edge-case inputs that the library's unit tests never anticipated.
Grading call sites requires pairing AST analysis with execution. As we detail in our guide on moving from a static registry to an executable inventory, a catalog entry is merely a claim until it is verified against real execution constraints. If you cannot execute an internal utility against the actual invariants demanded by its load-bearing call sites, your inventory is just a manifest of assumptions.
An executable posture runs the extracted artifact against a harness that asserts these boundary conditions directly. If the harness cannot exercise the input contract, the verdict remains inconclusive; if the contract breaks, the artifact fails. Verifying the component against live call-site constraints lets you isolate the true dependency, confirm its behavior, and delete the ambient references that were only inflating your build graph.
This post supports the longer argument in From Static Registry to Executable Inventory: Ensuring Real Component Availability.
Keep reading
Next in the log
- From Static Registry to Executable Inventory: Ensuring Real Component Availability
Turn static registry rows into executable tests so you know exactly which components truly work.
- Locking Internal Utility Versions to Stop Silent Drift
Copy-pasting utility functions across microservices creates drifting failure modes. Pinning versioned artifacts restores verified behavior.
- Runtime Smoke Tests for Registry Components
Static analysis only verifies syntax trees; runtime smoke testing catches missing peer dependencies, unhandled top-level crashes, and dead stubs.
The Strategic Master Library · written and reviewed under the house's own epistemic rules: nothing claimed that we cannot show.