topmark.pipeline.synthetic¶
topmark / pipeline / synthetic
Synthetic pipeline contexts for resolver-level outcomes.
Some user-facing outcomes are discovered before a file can enter normal pipeline
execution. This module builds ProcessingContext instances for those outcomes
so presentation, machine-readable output, summaries, and exit-code selection can treat
them like ordinary pipeline results.
These helpers are shared by CLI and public-API orchestration, but this module
remains internal pipeline infrastructure. Callers outside TopMark should use
topmark.api entry points instead of constructing synthetic contexts manually.
build_missing_file_contexts ¶
Build synthetic filesystem contexts for missing explicit input paths.
Missing literal paths are detected by file-list resolution before the normal
pipeline runs. Representing them as contexts keeps diagnostics visible in
human and machine-readable output and lets exit_code_from_pipeline_results() derive
ExitCode.FILE_NOT_FOUND from the same result collection as other
filesystem outcomes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
paths
|
Sequence[Path]
|
Explicit literal input paths that were requested but do not exist. |
required |
config
|
FrozenConfig
|
Effective runtime configuration for the current command. |
required |
run_options
|
RunOptions
|
Runtime options used to bootstrap synthetic contexts. |
required |
Returns:
| Type | Description |
|---|---|
list[ProcessingContext]
|
Synthetic processing contexts with |
list[ProcessingContext]
|
filesystem hint. |
Source code in src/topmark/pipeline/synthetic.py
map_selection_reason_to_probe_reason ¶
Map a discovery selection reason to the corresponding probe reason.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
reason
|
FileSelectionReason
|
Selection reason emitted by file discovery for an explicit input. |
required |
Returns:
| Type | Description |
|---|---|
ResolutionProbeReason
|
Probe-layer reason used by synthetic filtered |
Source code in src/topmark/pipeline/synthetic.py
build_filtered_probe_contexts ¶
Build synthetic probe contexts for explicit inputs filtered before probing.
The normal probe pipeline only runs for files selected by file-list resolution. Explicit input paths that are excluded before that point still need probe-shaped results so CLI, machine-readable output, summaries, and the public API can explain why they never reached file-type resolution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
selection_results
|
Sequence[FileSelectionProbeResult]
|
Discovery explanations for explicit input paths. Selected inputs are ignored because they are represented by real probe pipeline contexts. |
required |
config
|
FrozenConfig
|
Effective immutable configuration for the current command. |
required |
run_options
|
RunOptions
|
Runtime options used to bootstrap synthetic contexts. |
required |
Returns:
| Type | Description |
|---|---|
list[ProcessingContext]
|
Synthetic processing contexts whose |
list[ProcessingContext]
|
explicit inputs filtered before probing. |