LegacyLens to understand old Fortran code

has the Fortran code and also a tool to help understand it, which I have not tried.

LegacyLens + NSHMP Fortran
This repository contains two things:

  1. The original National Seismic Hazard Mapping Project (NSHMP) Fortran codebase and data/config assets.

  2. LegacyLens, a retrieval-augmented code intelligence app built to analyze this legacy Fortran system with line-level evidence and architecture context.

Problem / Solution / What / Why / How

Problem

Legacy scientific Fortran systems are hard to work with:

  • critical logic is spread across many files and decades of style drift

  • call chains and dependencies are expensive to trace manually

  • onboarding often takes months before engineers can make safe changes

For teams, this means codebase insight that traditionally takes years of accumulated context now blocks delivery speed and change safety.

Solution

LegacyLens combines vector retrieval, lexical symbol search, and graph retrieval into one deterministic workflow so engineers can move from question to grounded evidence quickly.

What

LegacyLens is a code intelligence tool for NSHMP-style legacy repositories that returns:

  • architecture context (entrypoints, flows, impact)

  • line-level evidence and citations

  • retrieval diagnostics and confidence signals

Why

The goal is to compress understanding time:

  • from slow manual archaeology to fast, evidence-backed exploration

  • from uncertain edits to traceable, citation-grounded decisions

  • from siloed expert knowledge to team-accessible understanding

In practice: what used to take weeks or months to trace can often be scoped in hours.

How

  1. Route each query to the best retrieval plan (vector, keyword+vector, graph+vector, or escalation).

  2. Use graph signals to identify high-probability candidate files.

  3. Retrieve and rerank Pinecone chunks with deterministic scoring and dedupe.

  4. Expand context and enforce identifier guardrails.

  5. Return architecture + evidence with debug telemetry.

What LegacyLens does

LegacyLens helps engineers query a large legacy Fortran repository with:

  • semantic retrieval from Pinecone

  • exact-identifier lexical retrieval

  • graph-assisted architecture retrieval via GitNexus MCP

  • deterministic reranking and grounded citations

  • a hybrid UI showing architecture graph + evidence panel