Architecture

A small TypeScript ESM CLI and library. No backend, no database — state lives in the scanned repository.

CLIScannernpm adapterOSV providerPlannerApplyOptional AIGitHub init

Data flow

The CLI orchestrates scan, fix, and init. The scanner talks to an ecosystem adapter and an advisory provider. Remediation planning is pure. Apply mutates files, then rescans. Optional AI only enriches already-confirmed findings.

Layout

src/
  cli.ts commands.ts scanner.ts config.ts output.ts
  cli/           # style + progress UI (zero-dep)
  core/          # types + errors (incl. FixResult)
  ecosystems/    # EcosystemAdapter (npm today)
  advisories/    # AdvisoryProvider (OSV today)
  remediation/   # planner + atomic apply
  ai/            # optional explanations
  automation/    # GitHub workflow generation
templates/eridas.yml
eridas.schema.json

Adapter contracts

EcosystemAdapter discovers a dependency inventory from a project path. v0.1 ships npm lockfile support.

AdvisoryProvider queries advisories for exact versions. v0.1 ships OSV with batching, timeouts, retries, and response validation.

AI is intentionally not an advisory provider. It cannot create findings or choose versions.

Domain types

TypeRole
DependencyInstalled package identity + paths
AdvisoryNormalized OSV advisory
FindingDependency + advisory (+ optional AI)
ScanResultVersioned scan report (schemaVersion: 1)
RemediationPlanPlanned changes + unresolved findings
ApplyResultWhether changes applied + post-rescan

Testing

AreaLocation
Lockfile parsingtest/npm-lockfile.test.ts
OSV clienttest/osv.test.ts
Planner / apply / rollbacktest/remediation-*.test.ts
AI isolationtest/ai.test.ts
Workflow generationtest/automation.test.ts
End-to-end with mockstest/integration.test.ts