Skip to content

harden(supply-chain): add Ecosystem::Unknown variant for depth-cap synthetic Unvettable #147

Closed

Description

@thehoff

Surfaced by Codex round-2 peer review of PR #146.

The recursion depth-cap (MAX_RECURSION_DEPTH) emits a synthetic `ParsedInstall` with `unvettable: Some(...)` so the caller fails CLOSED (`Verdict::Ask`) instead of silently dropping payloads at depth >= 6. The verdict behaviour is correct.

However, the synthetic `ParsedInstall` is hardcoded to `Ecosystem::Npm` — a deep-nested PyPI / mixed-ecosystem / shell-wrapper payload that hits the cap is labelled `[npm]` in the surfaced finding. Verdict is right, label is wrong.

Codex quote: "a deep recursive PyPI or mixed-shell payload will be labelled [npm] in the surfaced finding, which is misleading."

Proposal

Add a new variant to the Ecosystem enum: `Unknown` (or `Multi`) for cases where the gate detects something install-shaped but cannot determine the ecosystem.

enum Ecosystem {
    Npm,
    Pypi,
    Unknown,  // ecosystem-agnostic finding (depth-cap, future cases)
}

Then update the depth-cap synthetic emit:

out.push(ParsedInstall {
    ecosystem: Ecosystem::Unknown,
    ...
});

Cascade work

Pattern matches on `Ecosystem` exist elsewhere in supply_chain_gate.rs (display rendering, registry routing, the ordered table in detect_installs_into). Each needs a sensible behaviour for `Unknown`:

  • Display: render as `[?]` or `[unknown]`.
  • Registry routing: skip (no registry to query — verdict is already `Ask` via `unvettable`).
  • Aggregation: count separately.

Acceptance

  • New variant with sensible defaults.
  • Depth-cap synthetic emit uses it.
  • No regression in the existing 2,000+ tests.
  • 1 new test asserting the label on a deep-nest payload.

Severity

LOW — cosmetic mislabel. Verdict behaviour (`Ask` / fail closed) is unaffected.

🤖 Generated with Claude Code

Activity

  1. changed the title [-]harden(supply-chain): variant for depth-cap synthetic Unvettable[/-] [+]harden(supply-chain): add Ecosystem::Unknown variant for depth-cap synthetic Unvettable[/+] on May 23, 2026
  2. thehoff commented on May 26, 2026

    @thehoff
    OwnerAuthor

    Fixed in v0.1.11 via #184.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions