The Drift Log · Software inventory you can trust
Harvesting Internal Utility Functions from Dormant Repositories
30 October 2026 · 3 min read · 738 words · established

Dormant codebases hide battle-tested utility logic. Discover how isolating and harness-testing dead functions prevents teams from solving solved problems twice.
The cost of invisible prior art
A team needs a resilient exponential backoff parser or an RFC-compliant URI template expander. The engineer tasked with the ticket opens a clean editor window, imports a fresh npm package or writes fifty lines of custom logic, and opens a pull request.
Two floors away or three years earlier, another team solved the exact same edge cases inside a service that has since been decommissioned. That repository sits read-only in GitHub Enterprise. Its CI pipeline is broken, its Node version is deprecated, and its Dockerfile fails to build.
The logic inside it was production-tested across millions of requests, but because it is trapped in a dormant repository, it is invisible. The company pays for the capability twice: first to build it in 2021, and again to rebuild, debug, and patch it in 2025.
Rebuilding standard utilities is rarely a deliberate choice. It is the rational response to unverified archives. If finding and validating a piece of legacy code takes longer than rewriting it from scratch, developers will rewrite it every time.
Why text search is not an inventory
Running git grep or using an enterprise code search tool is not a code reuse audit.
Textual search produces lists of string matches. It shows that a function called sanitizeHeaders exists across fourteen repositories. It does not tell you which version handles multi-line header injection, which version depends on a deprecated global state, or whether the accompanying test suite can actually run.
A search result is a claim of capability, not capability itself. As we detail in our guide on why a component count is not an inventory, a software inventory is only real when every entry can be pulled in isolation, executed against test assertions, and graded.
// Found in archive-billing-service (2022, unmaintained)
export function parseRetryAfter(header: string | null, now = Date.now()): number | null {
if (!header) return null;
const seconds = Number(header);
if (!Number.isNaN(seconds)) return Math.max(0, seconds * 1000);
const parsed = Date.parse(header);
if (Number.isNaN(parsed)) return null;
return Math.max(0, parsed - now);
}
This function is sixty characters of clean, self-contained logic. But because it sits inside a dead repository with failing dependencies, standard package tooling cannot consume it without importing hundreds of obsolete transitive modules.
Isolating and grading dormant utilities
Harvesting reusable logic out of legacy code requires three steps: isolation, harness execution, and packaging.
- Slice the AST from the host environment. Extract the target function and its immediate internal dependencies. Sever all links to the parent repository’s build configs, test runners, and ambient environment variables.
- Execute in an isolated harness. Run the extracted function through an external test harness. As discussed in running registry entries in isolation to validate inventory, an artifact must prove its invariants outside the repo where it was born.
- Assign an explicit verification state. Grade the extracted logic based on harness results:
- CERTIFIED: Executes cleanly, all invariant checks pass, contract is verified.
- PROVISIONAL: Reproducible execution, but full correctness bounds are not yet asserted.
- INCONCLUSIVE: The harness cannot exercise the input contract due to harness limits, not a proven bug.
- FAILED: The extracted logic throws, returns invalid states, or fails basic invariants.
Once graded, the utility can be published to your internal library as an independent, standalone artifact with zero parent baggage.
The SHPBL method
SHPBL extracts, verifies, and packages software capabilities so engineering teams stop rebuilding solved problems.
We process source repositories through a certification harness that runs every component in isolation and records an explicit verdict: CERTIFIED, PROVISIONAL, INCONCLUSIVE, or FAILED. Our release archives are repeatable and model-independent—no runtime model dependencies, no hallucination surface, and zero ambient lock-in.
You can inspect your own repositories using our free repository evaluation. For teams operationalising an executable software inventory, access is available across four doors—the offline file edition, the plain HTTP API, the typed TypeScript SDK via @shpbl/sdk, and our MCP server for agents—backed by our Practitioner tier ($39/month) or outright ownership of the Complete Master Library ($499).
What to run on Monday
Do not try to catalog your entire company archive in one pass. Start small:
- Identify three archived or read-only repositories that handled high-volume production workloads.
- Pick two common utility domains: string sanitisation, date/header parsing, or retry math.
- Copy one function into an empty directory, write a single standalone test file using node's built-in test runner (
node --test), and run it with zero external dependencies. - If it passes, commit it to a dedicated, shared internal repository.
You will have rescued verified logic from the scrapheap and saved the next engineer four hours of avoidable debugging.
Keep reading
Next in the log
- Evicting Stub Entries from Your Internal Component Registry
Static AST parsers count hollow stubs as reusable assets. Test your catalog entries in clean isolation to measure actual runtime capabilities.
- Finding Unused Transitive Packages with Dynamic Import Tracing
Use Node.js runtime resolution hooks during integration test runs to identify which transitive dependencies never actually execute.
- Harvesting Duplicated Retry Logic into Shared Artifacts
Deduplicating network retry loops by harvesting and testing production variants beats building theoretical greenfield platform libraries.
The Strategic Master Library · written and reviewed under the house's own epistemic rules: nothing claimed that we cannot show.