# runtimeconditions/go-rc-profiler architecture

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

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

## Overview

go-rc-profiler statically analyzes a Go workload and emits a validated Runtime Conditions Profile without executing workload code. The principal workflow loads and type-checks source, resolves installed generated bindings, reconstructs declaration values, validates the assembled profile, then serializes it to YAML or an output file. Separate CLI commands inspect one or all imported bindings. The graph preserves integrity checking, dependency closure, and schema validation as distinct concerns. Some internal calls are shown only in partial excerpts; uncertain links are omitted rather than inferred from package names.

Main entry points: [`extractor/generated.go`](https://github.com/runtimeconditions/go-rc-profiler/blob/main/extractor/generated.go) (Profile extraction), [`cli/cli.go`](https://github.com/runtimeconditions/go-rc-profiler/blob/main/cli/cli.go) (CLI commands), [`extensioncheck/generated_profile.go`](https://github.com/runtimeconditions/go-rc-profiler/blob/main/extensioncheck/generated_profile.go) (Profile finalization), [`extractor/internal/gosource/packages.go`](https://github.com/runtimeconditions/go-rc-profiler/blob/main/extractor/internal/gosource/packages.go) (Go source loading)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Command interface"]
  node_main["Executable entry<br/>[main.go]"]
  node_cli["CLI commands<br/>[cli.go]"]
end

subgraph group_analysis["Workload analysis"]
  node_source_load["Go source loading<br/>[packages.go]"]
  node_semantic["Go semantic data<br/>[semantic.go]"]
  node_extractor["Profile extraction<br/>[generated.go]"]
  node_reader["Declaration reader"]
  node_value_decode["Static value decoding"]
end

subgraph group_bindings["Binding verification"]
  node_package_discovery["Imported bindings<br/>[imported.go]"]
  node_package_graph["Dependency integrity<br/>[packagegraph.go]"]
  node_reference["Extension references<br/>[reference.go]"]
  node_release["Release identity checks<br/>[release.go]"]
end

subgraph group_profiles["Profile validation"]
  node_finalize["Profile finalization"]
  node_core_schema["Core schema checks<br/>[coreprofile.go]"]
  node_extension_schema["Extension schema checks<br/>[schema.go]"]
  node_yaml["YAML serialization<br/>[profile_yaml.go]"]
end

node_developer(("Developer"))
node_workload["Go workload"]
node_profile["Runtime Conditions Profile"]

node_developer -->|"runs"| node_main
node_main -->|"dispatches"| node_cli
node_cli -->|"generates via"| node_extractor
node_extractor -->|"loads and type-checks"| node_source_load
node_source_load -->|"builds type data"| node_semantic
node_extractor -->|"resolves bindings"| node_package_discovery
node_extractor -->|"reads declarations"| node_reader
node_reader -.->|"decodes values"| node_value_decode
node_extractor -->|"finalizes profile"| node_finalize
node_finalize -->|"validates core schema"| node_core_schema
node_finalize -->|"validates extensions"| node_extension_schema
node_cli -->|"marshals output"| node_yaml
node_yaml -->|"serializes"| node_profile
node_workload -->|"provides source"| node_source_load
node_cli -->|"validates bindings"| node_package_discovery
node_package_discovery -.->|"checks dependency closure"| node_package_graph
node_package_graph -.->|"checks release identity"| node_release

click node_main "https://github.com/runtimeconditions/go-rc-profiler/blob/main/main.go"
click node_cli "https://github.com/runtimeconditions/go-rc-profiler/blob/main/cli/cli.go"
click node_source_load "https://github.com/runtimeconditions/go-rc-profiler/blob/main/extractor/internal/gosource/packages.go"
click node_semantic "https://github.com/runtimeconditions/go-rc-profiler/blob/main/extractor/internal/gosource/semantic.go"
click node_extractor "https://github.com/runtimeconditions/go-rc-profiler/blob/main/extractor/generated.go"
click node_reader "https://github.com/runtimeconditions/go-rc-profiler/blob/main/extractor/generated_reader.go"
click node_value_decode "https://github.com/runtimeconditions/go-rc-profiler/blob/main/extractor/generated_values.go"
click node_package_discovery "https://github.com/runtimeconditions/go-rc-profiler/blob/main/extensioncheck/imported.go"
click node_package_graph "https://github.com/runtimeconditions/go-rc-profiler/blob/main/extensioncheck/packagegraph.go"
click node_reference "https://github.com/runtimeconditions/go-rc-profiler/blob/main/extensioncheck/reference.go"
click node_release "https://github.com/runtimeconditions/go-rc-profiler/blob/main/extensioncheck/release.go"
click node_finalize "https://github.com/runtimeconditions/go-rc-profiler/blob/main/extensioncheck/generated_profile.go"
click node_core_schema "https://github.com/runtimeconditions/go-rc-profiler/blob/main/extensioncheck/coreprofile.go"
click node_extension_schema "https://github.com/runtimeconditions/go-rc-profiler/blob/main/extensioncheck/schema.go"
click node_yaml "https://github.com/runtimeconditions/go-rc-profiler/blob/main/extractor/profile_yaml.go"

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_main,node_cli toneBlue
class node_source_load,node_semantic,node_extractor,node_reader,node_value_decode toneAmber
class node_package_discovery,node_package_graph,node_reference,node_release toneMint
class node_finalize,node_core_schema,node_extension_schema,node_yaml toneRose
class node_developer,node_workload,node_profile toneIndigo
```

## Components

### Command interface

- [Executable entry](https://github.com/runtimeconditions/go-rc-profiler/blob/main/main.go): `main.go`
- [CLI commands](https://github.com/runtimeconditions/go-rc-profiler/blob/main/cli/cli.go): `cli/cli.go`

### Workload analysis

- [Go source loading](https://github.com/runtimeconditions/go-rc-profiler/blob/main/extractor/internal/gosource/packages.go): `extractor/internal/gosource/packages.go`
- [Go semantic data](https://github.com/runtimeconditions/go-rc-profiler/blob/main/extractor/internal/gosource/semantic.go): `extractor/internal/gosource/semantic.go`
- [Profile extraction](https://github.com/runtimeconditions/go-rc-profiler/blob/main/extractor/generated.go): `extractor/generated.go`
- [Declaration reader](https://github.com/runtimeconditions/go-rc-profiler/blob/main/extractor/generated_reader.go): `extractor/generated_reader.go`
- [Static value decoding](https://github.com/runtimeconditions/go-rc-profiler/blob/main/extractor/generated_values.go): `extractor/generated_values.go`

### Binding verification

- [Imported bindings](https://github.com/runtimeconditions/go-rc-profiler/blob/main/extensioncheck/imported.go): `extensioncheck/imported.go`
- [Dependency integrity](https://github.com/runtimeconditions/go-rc-profiler/blob/main/extensioncheck/packagegraph.go): `extensioncheck/packagegraph.go`
- [Extension references](https://github.com/runtimeconditions/go-rc-profiler/blob/main/extensioncheck/reference.go): `extensioncheck/reference.go`
- [Release identity checks](https://github.com/runtimeconditions/go-rc-profiler/blob/main/extensioncheck/release.go): `extensioncheck/release.go`

### Profile validation

- [Profile finalization](https://github.com/runtimeconditions/go-rc-profiler/blob/main/extensioncheck/generated_profile.go): `extensioncheck/generated_profile.go`
- [Core schema checks](https://github.com/runtimeconditions/go-rc-profiler/blob/main/extensioncheck/coreprofile.go): `extensioncheck/coreprofile.go`
- [Extension schema checks](https://github.com/runtimeconditions/go-rc-profiler/blob/main/extensioncheck/schema.go): `extensioncheck/schema.go`
- [YAML serialization](https://github.com/runtimeconditions/go-rc-profiler/blob/main/extractor/profile_yaml.go): `extractor/profile_yaml.go`

### Other components

- **Developer**
- **Go workload**
- **Runtime Conditions Profile**

## Connections

- Developer → Executable entry: runs (evidence: `README.md`)
- Executable entry → CLI commands: dispatches (evidence: `main.go`)
- CLI commands → Profile extraction: generates via (evidence: `cli/cli.go`)
- Profile extraction → Go source loading: loads and type-checks (evidence: `extractor/generated.go`)
- Go source loading → Go semantic data: builds type data (evidence: `extractor/internal/gosource/packages.go`)
- Profile extraction → Imported bindings: resolves bindings (evidence: `extractor/generated.go`)
- Profile extraction → Declaration reader: reads declarations (evidence: `extractor/generated.go`)
- Declaration reader → Static value decoding: decodes values
- Profile extraction → Profile finalization: finalizes profile (evidence: `extractor/generated.go`)
- Profile finalization → Core schema checks: validates core schema (evidence: `extensioncheck/generated_profile.go`)
- Profile finalization → Extension schema checks: validates extensions (evidence: `extensioncheck/generated_profile.go`)
- CLI commands → YAML serialization: marshals output (evidence: `cli/cli.go`)
- YAML serialization → Runtime Conditions Profile: serializes (evidence: `README.md`)
- Go workload → Go source loading: provides source (evidence: `README.md`)
- CLI commands → Imported bindings: validates bindings (evidence: `cli/cli.go`)
- Imported bindings → Dependency integrity: checks dependency closure
- Dependency integrity → Release identity checks: checks release identity
