Skip to content

Direct and transitive dependencies, and through which package - #115

Merged
BoaThor merged 2 commits into
mainfrom
claude/sleepy-brahmagupta-bnpx14
Dec 4, 2026
Merged

BoaThor merged 2 commits into
mainfrom
claude/sleepy-brahmagupta-bnpx14

Conversation

@BoaThor

@BoaThor BoaThor commented Dec 4, 2026

Copy link
Copy Markdown
Owner

Changes

Direct or transitive, and through which package

Before, an entry was marked transitive only in its applicability reason, as (transitive dependency -5). Now the entry itself says whether its component is direct or transitive. For a transitive one, it also names the direct dependencies it comes in through. The fix is mostly an update of that direct dependency.

SbomFilterExtractor.ps1

  • Via: a transitive inventory component gets Via. It lists the direct dependencies of the main component from which it is reachable in the dependency graph, as inventory labels, e.g. express@4.17.1; lodash@4.17.20.

  • Lockfiles with a graph: these lockfiles now give a main component and CycloneDX dependencies, so direct / transitive and Via come out as for an SBOM:

    Lockfile Source of direct / transitive
    package-lock.json v2 / v3 the root's dependencies, resolved like npm through nested node_modules
    pnpm-lock.yaml importers . (v6 / v9) or the top-level dependencies (v5), plus the package dependencies
    packages.lock.json type: Direct and the dependencies of each package
    Gemfile.lock DEPENDENCIES and the dependency lines under each spec
    Cargo.lock the crates without source are the project
    uv.lock the virtual / editable project
  • Lockfiles without a graph leave Direct unknown, as before, so no deduction applies: yarn.lock, poetry.lock, Pipfile.lock, requirements*.txt, composer.lock, go.sum, gradle.lockfile.

metascraper.ps1 (build 2026-12-04a)

  • Add-DependencyScope sets DependencyScope on each entry: direct when one matched component is direct, transitive when every known one is transitive.
  • A transitive entry also gets Via.
  • The schema is updated.

GUI

Where What
Results column Dep. right of Net, with the way in as tooltip; the line Dependency in the details; CSV columns DependencyScope and Via; search is:direct, is:transitive, via:, dep:
Workbench Dependency in the details and the CSV; a change is noted
Attack paths transitive via ... in the finding lists, GUI and report
Auto Report transitive via ... in the column Fix
SBOM comparison column Dependency in the window, CSV and HTML (Compare-Sbom.ps1)
Inventory window column Via, read-only, right of Direct
Heavy mode scan the scope is taken from the inventory

The user agreed to the look from screenshots.

Docs

  • README: a new subsection on direct / transitive with the table above, and which lockfiles carry a graph.
  • CHANGELOG.

Tests

  • New script test tests/dependency-graph.ps1 (15 checks). It covers:

    • CycloneDX, including two ways in to the same component;
    • each lockfile with a graph;
    • yarn.lock without a graph;
    • Add-DependencyScope of metascraper.ps1.

    The existing script tests are green.

  • New smoke area dependency (14 checks). It covers the run file, search, details, CSV, Workbench, Auto Report, SBOM comparison, inventory window, Heavy mode scan, the column with its tooltip and the attack paths list.

  • Existing checks adjusted: three checks of the column order now include the new columns Dep. and Via.

  • The full smoke run in a fresh output folder is green: 1613 checks.


Generated by Claude Code

…ntry

SbomFilterExtractor.ps1: a transitive inventory component names the direct
dependencies it comes in through (Via, from the dependency graph). Lockfiles
with a graph give Direct and Via too: package-lock v2/v3, pnpm-lock,
packages.lock.json, Gemfile.lock, Cargo.lock, uv.lock.

metascraper.ps1 (build 2026-12-04a): each entry gets DependencyScope
(direct / transitive) and Via from its matched components. Schema updated.
New script test tests/dependency-graph.ps1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019kjGYYNvsfXvLhePqaNsL3
Results tab: column Dep. (tooltip with the way in), the line Dependency in
the details, CSV columns DependencyScope and Via, search is:direct,
is:transitive, via:, dep:. The Workbench keeps it (details, CSV, change
noted), the attack paths and the Auto Report name the way in, the SBOM
comparison has a column Dependency (window, CSV, HTML), the inventory
window a column Via, and the Heavy mode scan takes the scope from the
inventory. Smoke area dependency; README and CHANGELOG.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019kjGYYNvsfXvLhePqaNsL3
@BoaThor
BoaThor merged commit 5513ffc into main Dec 4, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants