Skip to content

topmark.pipeline.pipelines

topmark / pipeline / pipelines

Named pipeline variants for TopMark (immutable, typed step sequences).

This module exposes immutable, typed step tuples and a registry mapping names to pipelines. Pipelines are built from class-based steps that implement the Step protocol.

Overview

  • PROBE: probe resolution only
  • SCAN: resolve → sniff → read → scan
  • CHECK_RENDER: SCAN + build → render
  • CHECK (summary): CHECK_RENDER + compare
  • CHECK_* (apply/patch): CHECK + update → (patch/write) variants
  • STRIP (summary): SCAN + strip → compare
  • STRIP_* (apply/patch): STRIP + update → (patch/write) variants

Mermaid (orientation)

flowchart TD

  subgraph Discovery
    P[prober]
    R[resolver]
    S[sniffer]
    D[reader]
    N[scanner]

    R --> S --> D --> N
  end

  subgraph Check
    B[builder]
    T[renderer]
    C[comparer]

    N --> B --> T --> C
  end

  subgraph Strip
    X[stripper]

    N --> X --> C
  end

  subgraph Mutations
    U[updater]
    H[patcher]
    W[writer]

    C --> U
    U -->|patch| H
    U -->|apply| W
  end

Notes: * Pipelines are immutable (Final[tuple[Step, ...]]) and steps are instantiated objects (not functions). * Steps only write to the status axes they declare; outcome classification is derived centrally at the view/API layer.

PROBE_PIPELINE module-attribute

PROBE_PIPELINE = (ProberStep(),)

Probe file type and header processor resolution for a given file.

SCAN_PIPELINE module-attribute

SCAN_PIPELINE = (
    ResolverStep(),
    SnifferStep(),
    ReaderStep(),
    ScannerStep(),
)

Perform basic TopMark header scanning.

CHECK_RENDER_PIPELINE module-attribute

CHECK_RENDER_PIPELINE = SCAN_PIPELINE + (
    BuilderStep(),
    RendererStep(),
)

Render-only pipeline: resolves, sniffs, reads, scans, builds, and renders (no compare/update/patch).

CHECK_SUMMMARY_PIPELINE module-attribute

CHECK_SUMMMARY_PIPELINE = CHECK_RENDER_PIPELINE + (
    ComparerStep(),
)

A lightweight pipeline that stops after comparison (no update/patch).

CHECK_PATCH_PIPELINE module-attribute

CHECK_PATCH_PIPELINE = CHECK_SUMMMARY_PIPELINE + (
    PlannerStep(),
    PatcherStep(),
)

Only for generating unified diffs.

STRIP_PIPELINE module-attribute

STRIP_PIPELINE = SCAN_PIPELINE + (StripperStep(),)

NOTE: we do not run ComparerStep in a strip pipeline.

STRIP_PATCH_PIPELINE module-attribute

STRIP_PATCH_PIPELINE = STRIP_PIPELINE + (
    ComparerStep(),
    PlannerStep(),
    PatcherStep(),
)

Only for generating unified diffs.

Pipeline

Bases: tuple[Step[ProcessingContext], ...], Enum

Available execution pipelines for file processing, mapped to their step sequences.

steps property

steps

Return the instantiated, ordered step sequence for this pipeline.

Returns:

Type Description
Step[ProcessingContext]

tuple[Step, ...]: An immutable tuple of step instances that

...

implement the Step protocol. The

tuple[Step[ProcessingContext], ...]

runner will invoke them as callables in order.