# code-amalps/amstralift architecture

> Architecture diagram of the GitHub repository code-amalps/amstralift, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/code-amalps/amstralift
- Repository: https://github.com/code-amalps/amstralift

## Overview

AMstraLift modernizes frameworks and remediates dependency vulnerabilities through a CLI, GUI, or REST API. Its upgrade workflow discovers the project, prepares an isolated credential-scrubbed workspace, applies ecosystem-specific migrations, verifies changes, signs evidence, and can publish a pull request. A separate security workflow audits vulnerabilities and supports preview or verified remediation. The map includes documented capabilities whose implementation was not sampled; edges are limited to relationships evidenced by excerpts, the source index, or the README.

Main entry points: [`amstralift/service.py`](https://github.com/code-amalps/amstralift/blob/Dev/amstralift/service.py) (Upgrade orchestrator), [`amstralift/execution/stage_a.py`](https://github.com/code-amalps/amstralift/blob/Dev/amstralift/execution/stage_a.py) (Stage A execution), [`amstralift/security/orchestrator.py`](https://github.com/code-amalps/amstralift/blob/Dev/amstralift/security/orchestrator.py) (Security workflow), [`amstralift/execution/stage_b.py`](https://github.com/code-amalps/amstralift/blob/Dev/amstralift/execution/stage_b.py) (Stage B publishing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User entry points"]
  node_cli["CLI<br/>[cli.py]"]
  node_gui["Desktop GUI<br/>[gui.py]"]
  node_api["REST API<br/>[app.py]"]
end

subgraph group_upgrade["Upgrade workflow"]
  node_service["Upgrade orchestrator<br/>[service.py]"]
  node_monorepo["Project discovery<br/>[monorepo.py]"]
  node_workspace["Isolated workspace<br/>[workspace.py]"]
  node_stage_a["Stage A execution<br/>[stage_a.py]"]
  node_contracts["Upgrade contracts<br/>[models.py]"]
end

subgraph group_migration["Migration adapters"]
  node_adapter_base["Adapter interface<br/>[base.py]"]
  node_angular["Angular migrations<br/>[angular.py]"]
  node_other_adapters["Other ecosystems"]
end

subgraph group_security["Security remediation"]
  node_security_orch["Security workflow<br/>[orchestrator.py]"]
  node_dep_graph["Dependency analysis"]
  node_osv["OSV vulnerability scan<br/>[osv_client.py]"]
  node_security_models["Finding and plan models<br/>[models.py]"]
  node_governance["Vulnerability policy<br/>[vulnerabilities.py]"]
end

subgraph group_evidence["Verification and publishing"]
  node_stage_b["Stage B publishing<br/>[stage_b.py]"]
  node_crypto["Bundle signing<br/>[crypto.py]"]
  node_publisher["GitHub publisher<br/>[github.py]"]
  node_semantic["Semantic contract diff<br/>[engine.py]"]
  node_evidence_pipeline["Evidence pipeline<br/>[pipeline.py]"]
end

node_developer(("Developer"))
node_osv_service(("OSV.dev"))

node_developer -->|"invokes"| node_cli
node_developer -->|"uses"| node_gui
node_developer -->|"calls"| node_api
node_cli -->|"starts upgrades"| node_service
node_gui -->|"starts upgrades"| node_service
node_api -->|"starts upgrades"| node_service
node_api -->|"starts audits"| node_security_orch
node_service -->|"discovers projects"| node_monorepo
node_service -->|"runs Stage A"| node_stage_a
node_service -->|"runs Stage B"| node_stage_b
node_service -->|"selects adapter"| node_angular
node_service -->|"selects adapter"| node_other_adapters
node_stage_a -->|"prepares sandbox"| node_workspace
node_stage_a -->|"runs adapter"| node_adapter_base
node_angular -->|"implements"| node_adapter_base
node_adapter_base -->|"uses workspace"| node_workspace
node_stage_a -->|"scans dependencies"| node_dep_graph
node_stage_a -->|"checks vulnerabilities"| node_osv
node_osv -->|"queries"| node_osv_service
node_stage_a -->|"builds bundle"| node_contracts
node_stage_a -->|"checks contracts"| node_semantic
node_security_orch -->|"builds dependency graph"| node_dep_graph
node_security_orch -->|"requests audit"| node_osv
node_security_orch -->|"applies policy"| node_governance
node_security_orch -->|"produces plans"| node_security_models
node_stage_b -->|"verifies bundle"| node_crypto
node_stage_b -->|"creates pull request"| node_publisher
node_stage_b -->|"validates patch"| node_workspace
node_evidence_pipeline -->|"signs evidence"| node_crypto

click node_cli "https://github.com/code-amalps/amstralift/blob/Dev/amstralift/cli.py"
click node_gui "https://github.com/code-amalps/amstralift/blob/Dev/amstralift/gui.py"
click node_api "https://github.com/code-amalps/amstralift/blob/Dev/amstralift/api/app.py"
click node_service "https://github.com/code-amalps/amstralift/blob/Dev/amstralift/service.py"
click node_monorepo "https://github.com/code-amalps/amstralift/blob/Dev/amstralift/core/monorepo.py"
click node_workspace "https://github.com/code-amalps/amstralift/blob/Dev/amstralift/core/workspace.py"
click node_stage_a "https://github.com/code-amalps/amstralift/blob/Dev/amstralift/execution/stage_a.py"
click node_contracts "https://github.com/code-amalps/amstralift/blob/Dev/amstralift/core/models.py"
click node_adapter_base "https://github.com/code-amalps/amstralift/blob/Dev/amstralift/adapters/base.py"
click node_angular "https://github.com/code-amalps/amstralift/blob/Dev/amstralift/adapters/angular.py"
click node_other_adapters "https://github.com/code-amalps/amstralift/tree/Dev/amstralift/adapters"
click node_security_orch "https://github.com/code-amalps/amstralift/blob/Dev/amstralift/security/orchestrator.py"
click node_dep_graph "https://github.com/code-amalps/amstralift/blob/Dev/amstralift/security/dependency_graph.py"
click node_osv "https://github.com/code-amalps/amstralift/blob/Dev/amstralift/security/osv_client.py"
click node_security_models "https://github.com/code-amalps/amstralift/blob/Dev/amstralift/security/models.py"
click node_governance "https://github.com/code-amalps/amstralift/blob/Dev/amstralift/governance/vulnerabilities.py"
click node_stage_b "https://github.com/code-amalps/amstralift/blob/Dev/amstralift/execution/stage_b.py"
click node_crypto "https://github.com/code-amalps/amstralift/blob/Dev/amstralift/core/crypto.py"
click node_publisher "https://github.com/code-amalps/amstralift/blob/Dev/amstralift/publisher/github.py"
click node_semantic "https://github.com/code-amalps/amstralift/blob/Dev/amstralift/semantic/engine.py"
click node_evidence_pipeline "https://github.com/code-amalps/amstralift/blob/Dev/amstralift/evidence/pipeline.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_gui,node_api toneBlue
class node_service,node_monorepo,node_workspace,node_stage_a,node_contracts toneAmber
class node_adapter_base,node_angular,node_other_adapters toneMint
class node_security_orch,node_dep_graph,node_osv,node_security_models,node_governance toneRose
class node_stage_b,node_crypto,node_publisher,node_semantic,node_evidence_pipeline,node_developer,node_osv_service toneIndigo
```

## Components

### User entry points

- [CLI](https://github.com/code-amalps/amstralift/blob/Dev/amstralift/cli.py): `amstralift/cli.py`
- [Desktop GUI](https://github.com/code-amalps/amstralift/blob/Dev/amstralift/gui.py): `amstralift/gui.py`
- [REST API](https://github.com/code-amalps/amstralift/blob/Dev/amstralift/api/app.py): `amstralift/api/app.py`

### Upgrade workflow

- [Upgrade orchestrator](https://github.com/code-amalps/amstralift/blob/Dev/amstralift/service.py): `amstralift/service.py`
- [Project discovery](https://github.com/code-amalps/amstralift/blob/Dev/amstralift/core/monorepo.py): `amstralift/core/monorepo.py`
- [Isolated workspace](https://github.com/code-amalps/amstralift/blob/Dev/amstralift/core/workspace.py): `amstralift/core/workspace.py`
- [Stage A execution](https://github.com/code-amalps/amstralift/blob/Dev/amstralift/execution/stage_a.py): `amstralift/execution/stage_a.py`
- [Upgrade contracts](https://github.com/code-amalps/amstralift/blob/Dev/amstralift/core/models.py): `amstralift/core/models.py`

### Migration adapters

- [Adapter interface](https://github.com/code-amalps/amstralift/blob/Dev/amstralift/adapters/base.py): `amstralift/adapters/base.py`
- [Angular migrations](https://github.com/code-amalps/amstralift/blob/Dev/amstralift/adapters/angular.py): `amstralift/adapters/angular.py`
- [Other ecosystems](https://github.com/code-amalps/amstralift/tree/Dev/amstralift/adapters): `amstralift/adapters`

### Security remediation

- [Security workflow](https://github.com/code-amalps/amstralift/blob/Dev/amstralift/security/orchestrator.py): `amstralift/security/orchestrator.py`
- [Dependency analysis](https://github.com/code-amalps/amstralift/blob/Dev/amstralift/security/dependency_graph.py): `amstralift/security/dependency_graph.py`
- [OSV vulnerability scan](https://github.com/code-amalps/amstralift/blob/Dev/amstralift/security/osv_client.py): `amstralift/security/osv_client.py`
- [Finding and plan models](https://github.com/code-amalps/amstralift/blob/Dev/amstralift/security/models.py): `amstralift/security/models.py`
- [Vulnerability policy](https://github.com/code-amalps/amstralift/blob/Dev/amstralift/governance/vulnerabilities.py): `amstralift/governance/vulnerabilities.py`

### Verification and publishing

- [Stage B publishing](https://github.com/code-amalps/amstralift/blob/Dev/amstralift/execution/stage_b.py): `amstralift/execution/stage_b.py`
- [Bundle signing](https://github.com/code-amalps/amstralift/blob/Dev/amstralift/core/crypto.py): `amstralift/core/crypto.py`
- [GitHub publisher](https://github.com/code-amalps/amstralift/blob/Dev/amstralift/publisher/github.py): `amstralift/publisher/github.py`
- [Semantic contract diff](https://github.com/code-amalps/amstralift/blob/Dev/amstralift/semantic/engine.py): `amstralift/semantic/engine.py`
- [Evidence pipeline](https://github.com/code-amalps/amstralift/blob/Dev/amstralift/evidence/pipeline.py): `amstralift/evidence/pipeline.py`

### Other components

- **Developer**
- **OSV.dev**

## Connections

- Developer → CLI: invokes
- Developer → Desktop GUI: uses
- Developer → REST API: calls
- CLI → Upgrade orchestrator: starts upgrades (evidence: `amstralift/cli.py`)
- Desktop GUI → Upgrade orchestrator: starts upgrades (evidence: `amstralift/gui.py`)
- REST API → Upgrade orchestrator: starts upgrades (evidence: `amstralift/api/app.py`)
- REST API → Security workflow: starts audits (evidence: `amstralift/api/app.py`)
- Upgrade orchestrator → Project discovery: discovers projects (evidence: `amstralift/service.py`)
- Upgrade orchestrator → Stage A execution: runs Stage A (evidence: `amstralift/service.py`)
- Upgrade orchestrator → Stage B publishing: runs Stage B (evidence: `amstralift/service.py`)
- Upgrade orchestrator → Angular migrations: selects adapter (evidence: `amstralift/service.py`)
- Upgrade orchestrator → Other ecosystems: selects adapter (evidence: `amstralift/service.py`)
- Stage A execution → Isolated workspace: prepares sandbox (evidence: `amstralift/execution/stage_a.py`)
- Stage A execution → Adapter interface: runs adapter (evidence: `amstralift/execution/stage_a.py`)
- Angular migrations → Adapter interface: implements (evidence: `amstralift/adapters/angular.py`)
- Adapter interface → Isolated workspace: uses workspace (evidence: `amstralift/adapters/base.py`)
- Stage A execution → Dependency analysis: scans dependencies (evidence: `amstralift/execution/stage_a.py`)
- Stage A execution → OSV vulnerability scan: checks vulnerabilities (evidence: `amstralift/execution/stage_a.py`)
- OSV vulnerability scan → OSV.dev: queries (evidence: `amstralift/security/osv_client.py`)
- Stage A execution → Upgrade contracts: builds bundle (evidence: `amstralift/execution/stage_a.py`)
- Stage A execution → Semantic contract diff: checks contracts
- Security workflow → Dependency analysis: builds dependency graph (evidence: `amstralift/security/orchestrator.py`)
- Security workflow → OSV vulnerability scan: requests audit (evidence: `amstralift/security/orchestrator.py`)
- Security workflow → Vulnerability policy: applies policy (evidence: `amstralift/security/orchestrator.py`)
- Security workflow → Finding and plan models: produces plans (evidence: `amstralift/security/orchestrator.py`)
- Stage B publishing → Bundle signing: verifies bundle (evidence: `amstralift/execution/stage_b.py`)
- Stage B publishing → GitHub publisher: creates pull request (evidence: `amstralift/execution/stage_b.py`)
- Stage B publishing → Isolated workspace: validates patch (evidence: `amstralift/execution/stage_b.py`)
- Evidence pipeline → Bundle signing: signs evidence (evidence: `amstralift/evidence/pipeline.py`)
