| title | Architecture Components |
|---|---|
| audience | developers, maintainers, contributors |
| prerequisites | contributor architecture guide |
| related | ../architecture.md, ../codebase-map.md, ../feature-to-code-map.md, ../testing-strategy.md |
| status | maintained |
| publication | reviewed |
The architecture shows how PRIK moves from inputs to an
importable extension. This page groups the build stages that transform those
inputs and the supporting components they depend on. Each guide maps one
architecture component to its prik source package, local modules, and tests.
The codebase map provides the complementary module and
hotspot inventory.
pipeline/ spans the complete build and is listed first because it composes
the stages below.
| Component | Responsibility | Relevant changes |
|---|---|---|
prik.pipeline |
Composes wrapper, contract, report, artifact, and build workflows. | Public build workflows, artifact layout, or cross-stage orchestration. |
prik.preprocessing |
Prepares Fortran input and measures target facts. | Includes, provenance, parser input, or target probes. |
prik.parsers |
Records Fortran and semantic-.pyi syntax facts. |
Declarations, locations, parser diagnostics, or raw .pyi AST. |
prik.semantics |
Builds the shared language-neutral semantic model. | Semantic types, shapes, origins, or raw contract metadata. |
prik.policy |
Completes interoperability and support decisions. | Ownership, projection, lifecycle, exports, or support choices. |
prik.planning |
Projects completed policy into backend-neutral wrapper plans. | Planned operations, ordering, namespaces, or backend views. |
prik.codegen |
Lowers plans into C and Fortran nodes and Python facades. | Binding, bridge, node, or facade mechanisms. |
prik.printers |
Serializes C, Fortran, and semantic .pyi representations. |
Generated text, formatting, escaping, or line wrapping. |
prik.compiler |
Constructs and executes native compilation and linking commands. | Compiler profiles, command arguments, linking, or native-support installation. |
| Component | Responsibility | Relevant changes |
|---|---|---|
prik.contracts |
Defines the public semantic .pyi vocabulary. |
Contract syntax or its public imported names. |
prik.naming |
Normalizes public names and constructs generated symbols. | Public-name normalization, collisions, or generated symbols. |
prik.runtime |
Provides imported native handles and bundled native support. | Runtime handle behavior or native-support payloads. |
prik.utilities |
Holds mechanisms with no stage-specific owner. | A genuinely stage-neutral helper. |
Each guide records the same local contract:
- Its responsibility and boundaries.
- Its inputs, outputs, modules, and important entrypoints.
- Direct-execution examples and the behavior they demonstrate.
- Focused tests, change routes, and invariants.
The guides cover the current Fortran-wrapper route. The C-input frontend is deferred material and does not change the generated CPython C binding backend.