# runtimeconditions/python-rc-profiler architecture

> Architecture diagram of the GitHub repository runtimeconditions/python-rc-profiler, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/runtimeconditions/python-rc-profiler
- Repository: https://github.com/runtimeconditions/python-rc-profiler

## Overview

This is a Python static profiler that turns workload declarations into a validated Runtime Conditions Profile without importing bindings or running the workload. The documented primary workflow is: inspect workload imports, find and verify installed generated-binding distributions, statically extract declarations, validate the complete profile against core and extension schemas, then write YAML. The repository also retains a legacy mapping workflow and archived SDK-composition code. The graph follows documented flows and source-index references; unsampled implementations are represented only where the tree or README supports them.

Main entry points: [`runtimeconditions_profiler/cli.py`](https://github.com/runtimeconditions/python-rc-profiler/blob/main/runtimeconditions_profiler/cli.py) (Profiler CLI), [`runtimeconditions_profiler/project/verify.py`](https://github.com/runtimeconditions/python-rc-profiler/blob/main/runtimeconditions_profiler/project/verify.py) (Binding verification), [`runtimeconditions_profiler/profile/generated.py`](https://github.com/runtimeconditions/python-rc-profiler/blob/main/runtimeconditions_profiler/profile/generated.py) (Generated extraction), [`runtimeconditions_profiler/project/installed.py`](https://github.com/runtimeconditions/python-rc-profiler/blob/main/runtimeconditions_profiler/project/installed.py) (Installed bindings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["CLI entry"]
  node_cli["Profiler CLI<br/>[cli.py]"]
end

subgraph group_binding["Binding verification"]
  node_installed["Installed bindings<br/>[installed.py]"]
  node_verify["Binding verification<br/>[verify.py]"]
  node_binding_resources["Binding resources<br/>[definition.py]"]
  node_extension_identity["Extension identity<br/>[identity.py]"]
end

subgraph group_analysis["Static extraction"]
  node_source_index["Python source index<br/>[python.py]"]
  node_generated["Generated extraction<br/>[generated.py]"]
  node_static_values["Static value analysis<br/>[static_values.py]"]
end

subgraph group_profile["Profile output"]
  node_semantic["Profile validation<br/>[semantic.py]"]
  node_writer["YAML writer<br/>[writer.py]"]
  node_profile_file["Profile YAML"]
end

subgraph group_legacy["Legacy mapping"]
  node_mapping_resolver["Mapping resolver<br/>[resolver.py]"]
  node_direct_sdk["Direct SDK mapping<br/>[direct.py]"]
  node_manifest_parser["Manifest parser<br/>[parser.py]"]
  node_manifest_mapping["Manifest mappings<br/>[mapping.py]"]
  node_legacy_extractor["Legacy profile extraction<br/>[extractor.py]"]
  node_legacy_validator["Legacy validation<br/>[validator.py]"]
  node_archive_composition["Archived composition<br/>[composition.py]"]
  node_archive_python["Archived Python SDK<br/>[python.py]"]
end

node_user(("Profiler user"))

node_user -->|"runs commands"| node_cli
node_cli -->|"discovers imports"| node_installed
node_installed -->|"supplies packages"| node_verify
node_verify -->|"verifies resources"| node_binding_resources
node_cli -->|"analyzes workload"| node_source_index
node_cli -->|"generates profile"| node_generated
node_generated -->|"uses verified bindings"| node_verify
node_generated -->|"resolves static values"| node_static_values
node_cli -->|"validates profile"| node_semantic
node_semantic -->|"checks binding closure"| node_verify
node_cli -->|"writes YAML"| node_writer
node_writer -->|"serializes profile"| node_profile_file
node_verify -->|"checks identities"| node_extension_identity
node_cli -->|"resolves mappings"| node_mapping_resolver
node_mapping_resolver -.->|"uses direct mappings"| node_direct_sdk
node_manifest_parser -->|"provides mappings"| node_manifest_mapping
node_cli -->|"runs legacy generation"| node_legacy_extractor
node_legacy_extractor -->|"uses symbol mappings"| node_manifest_mapping
node_cli -.->|"validates legacy profile"| node_legacy_validator
node_archive_python -->|"uses composition"| node_archive_composition

click node_cli "https://github.com/runtimeconditions/python-rc-profiler/blob/main/runtimeconditions_profiler/cli.py"
click node_installed "https://github.com/runtimeconditions/python-rc-profiler/blob/main/runtimeconditions_profiler/project/installed.py"
click node_verify "https://github.com/runtimeconditions/python-rc-profiler/blob/main/runtimeconditions_profiler/project/verify.py"
click node_binding_resources "https://github.com/runtimeconditions/python-rc-profiler/blob/main/runtimeconditions_profiler/extension/definition.py"
click node_source_index "https://github.com/runtimeconditions/python-rc-profiler/blob/main/runtimeconditions_profiler/source/python.py"
click node_generated "https://github.com/runtimeconditions/python-rc-profiler/blob/main/runtimeconditions_profiler/profile/generated.py"
click node_static_values "https://github.com/runtimeconditions/python-rc-profiler/blob/main/runtimeconditions_profiler/profile/static_values.py"
click node_semantic "https://github.com/runtimeconditions/python-rc-profiler/blob/main/runtimeconditions_profiler/profile/semantic.py"
click node_writer "https://github.com/runtimeconditions/python-rc-profiler/blob/main/runtimeconditions_profiler/profile/writer.py"
click node_extension_identity "https://github.com/runtimeconditions/python-rc-profiler/blob/main/runtimeconditions_profiler/extension/identity.py"
click node_mapping_resolver "https://github.com/runtimeconditions/python-rc-profiler/blob/main/runtimeconditions_profiler/sdk/resolver.py"
click node_direct_sdk "https://github.com/runtimeconditions/python-rc-profiler/blob/main/runtimeconditions_profiler/sdk/direct.py"
click node_manifest_parser "https://github.com/runtimeconditions/python-rc-profiler/blob/main/runtimeconditions_profiler/manifest/parser.py"
click node_manifest_mapping "https://github.com/runtimeconditions/python-rc-profiler/blob/main/runtimeconditions_profiler/manifest/mapping.py"
click node_legacy_extractor "https://github.com/runtimeconditions/python-rc-profiler/blob/main/runtimeconditions_profiler/profile/extractor.py"
click node_legacy_validator "https://github.com/runtimeconditions/python-rc-profiler/blob/main/runtimeconditions_profiler/profile/validator.py"
click node_archive_composition "https://github.com/runtimeconditions/python-rc-profiler/blob/main/archive/research-v1/sdk/composition.py"
click node_archive_python "https://github.com/runtimeconditions/python-rc-profiler/blob/main/archive/research-v1/sdk/python.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_user toneBlue
class node_installed,node_verify,node_binding_resources,node_extension_identity toneAmber
class node_source_index,node_generated,node_static_values toneMint
class node_semantic,node_writer,node_profile_file toneRose
class node_mapping_resolver,node_direct_sdk,node_manifest_parser,node_manifest_mapping,node_legacy_extractor,node_legacy_validator,node_archive_composition,node_archive_python toneIndigo
```

## Components

### CLI entry

- [Profiler CLI](https://github.com/runtimeconditions/python-rc-profiler/blob/main/runtimeconditions_profiler/cli.py): `runtimeconditions_profiler/cli.py`

### Binding verification

- [Installed bindings](https://github.com/runtimeconditions/python-rc-profiler/blob/main/runtimeconditions_profiler/project/installed.py): `runtimeconditions_profiler/project/installed.py`
- [Binding verification](https://github.com/runtimeconditions/python-rc-profiler/blob/main/runtimeconditions_profiler/project/verify.py): `runtimeconditions_profiler/project/verify.py`
- [Binding resources](https://github.com/runtimeconditions/python-rc-profiler/blob/main/runtimeconditions_profiler/extension/definition.py): `runtimeconditions_profiler/extension/definition.py`
- [Extension identity](https://github.com/runtimeconditions/python-rc-profiler/blob/main/runtimeconditions_profiler/extension/identity.py): `runtimeconditions_profiler/extension/identity.py`

### Static extraction

- [Python source index](https://github.com/runtimeconditions/python-rc-profiler/blob/main/runtimeconditions_profiler/source/python.py): `runtimeconditions_profiler/source/python.py`
- [Generated extraction](https://github.com/runtimeconditions/python-rc-profiler/blob/main/runtimeconditions_profiler/profile/generated.py): `runtimeconditions_profiler/profile/generated.py`
- [Static value analysis](https://github.com/runtimeconditions/python-rc-profiler/blob/main/runtimeconditions_profiler/profile/static_values.py): `runtimeconditions_profiler/profile/static_values.py`

### Profile output

- [Profile validation](https://github.com/runtimeconditions/python-rc-profiler/blob/main/runtimeconditions_profiler/profile/semantic.py): `runtimeconditions_profiler/profile/semantic.py`
- [YAML writer](https://github.com/runtimeconditions/python-rc-profiler/blob/main/runtimeconditions_profiler/profile/writer.py): `runtimeconditions_profiler/profile/writer.py`
- **Profile YAML**

### Legacy mapping

- [Mapping resolver](https://github.com/runtimeconditions/python-rc-profiler/blob/main/runtimeconditions_profiler/sdk/resolver.py): `runtimeconditions_profiler/sdk/resolver.py`
- [Direct SDK mapping](https://github.com/runtimeconditions/python-rc-profiler/blob/main/runtimeconditions_profiler/sdk/direct.py): `runtimeconditions_profiler/sdk/direct.py`
- [Manifest parser](https://github.com/runtimeconditions/python-rc-profiler/blob/main/runtimeconditions_profiler/manifest/parser.py): `runtimeconditions_profiler/manifest/parser.py`
- [Manifest mappings](https://github.com/runtimeconditions/python-rc-profiler/blob/main/runtimeconditions_profiler/manifest/mapping.py): `runtimeconditions_profiler/manifest/mapping.py`
- [Legacy profile extraction](https://github.com/runtimeconditions/python-rc-profiler/blob/main/runtimeconditions_profiler/profile/extractor.py): `runtimeconditions_profiler/profile/extractor.py`
- [Legacy validation](https://github.com/runtimeconditions/python-rc-profiler/blob/main/runtimeconditions_profiler/profile/validator.py): `runtimeconditions_profiler/profile/validator.py`
- [Archived composition](https://github.com/runtimeconditions/python-rc-profiler/blob/main/archive/research-v1/sdk/composition.py): `archive/research-v1/sdk/composition.py`
- [Archived Python SDK](https://github.com/runtimeconditions/python-rc-profiler/blob/main/archive/research-v1/sdk/python.py): `archive/research-v1/sdk/python.py`

### Other components

- **Profiler user**

## Connections

- Profiler user → Profiler CLI: runs commands (evidence: `README.md`)
- Profiler CLI → Installed bindings: discovers imports (evidence: `runtimeconditions_profiler/cli.py`)
- Installed bindings → Binding verification: supplies packages (evidence: `runtimeconditions_profiler/project/installed.py`)
- Binding verification → Binding resources: verifies resources (evidence: `README.md`)
- Profiler CLI → Python source index: analyzes workload (evidence: `README.md`)
- Profiler CLI → Generated extraction: generates profile (evidence: `runtimeconditions_profiler/cli.py`)
- Generated extraction → Binding verification: uses verified bindings (evidence: `runtimeconditions_profiler/profile/generated.py`)
- Generated extraction → Static value analysis: resolves static values (evidence: `runtimeconditions_profiler/profile/generated.py`)
- Profiler CLI → Profile validation: validates profile (evidence: `runtimeconditions_profiler/cli.py`)
- Profile validation → Binding verification: checks binding closure (evidence: `runtimeconditions_profiler/profile/semantic.py`)
- Profiler CLI → YAML writer: writes YAML (evidence: `README.md`)
- YAML writer → Profile YAML: serializes profile (evidence: `README.md`)
- Binding verification → Extension identity: checks identities (evidence: `README.md`)
- Profiler CLI → Mapping resolver: resolves mappings (evidence: `runtimeconditions_profiler/cli.py`)
- Mapping resolver → Direct SDK mapping: uses direct mappings
- Manifest parser → Manifest mappings: provides mappings (evidence: `runtimeconditions_profiler/manifest/mapping.py`)
- Profiler CLI → Legacy profile extraction: runs legacy generation (evidence: `runtimeconditions_profiler/cli.py`)
- Legacy profile extraction → Manifest mappings: uses symbol mappings (evidence: `runtimeconditions_profiler/profile/extractor.py`)
- Profiler CLI → Legacy validation: validates legacy profile
- Archived Python SDK → Archived composition: uses composition (evidence: `archive/research-v1/sdk/python.py`)
