topmark.pipeline.steps.resolver¶
topmark / pipeline / steps / resolver
Resolve file type and select header processor.
Determines ctx.file_type from name/content signals and attaches a registered
HeaderProcessor if available. Sets ctx.status.resolve accordingly.
Sets
ResolveStatus→ {RESOLVED, TYPE_RESOLVED_HEADERS_UNSUPPORTED, TYPE_RESOLVED_NO_PROCESSOR_REGISTERED, UNSUPPORTED}
ResolverStep ¶
Bases: BaseStep
Resolve file type and attach a header processor (no I/O).
This step evaluates name rules (extensions, filenames, patterns) and, if
allowed by the file type's content gate, optional content probes to select
the best matching FileType. Multiple candidates may match a path; the
shared resolver applies a deterministic precedence and tie-break policy and
returns at most one effective winner.
Axes written
- resolve
Sets
- ResolveStatus: {PENDING, RESOLVED, TYPE_RESOLVED_HEADERS_UNSUPPORTED, TYPE_RESOLVED_NO_PROCESSOR_REGISTERED, UNSUPPORTED}
Source code in src/topmark/pipeline/steps/resolver.py
may_proceed ¶
Return True (resolver is the first step and always runs).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctx
|
ProcessingContext
|
The processing context for the current file. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if processing can proceed to the build step, False otherwise. |
Source code in src/topmark/pipeline/steps/resolver.py
run ¶
Resolve and assign the file type and header processor for the file.
Updates these fields on the context when successful: ctx.file_type,
ctx.header_processor, and ctx.status.resolve. On failure it appends a
human-readable diagnostic and sets an appropriate resolve status.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctx
|
ProcessingContext
|
Processing context representing the file being handled. |
required |
Side effects
Sets ctx.file_type, ctx.header_processor, and ctx.status.resolve.
Appends human-readable diagnostics when resolution fails or is partial.
Source code in src/topmark/pipeline/steps/resolver.py
hint ¶
Advise about resolution outcome (non-binding).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctx
|
ProcessingContext
|
The processing context. |
required |
Source code in src/topmark/pipeline/steps/resolver.py
apply_probe_resolution_to_context ¶
Apply probe-backed resolution state to a processing context.
This helper maps the shared ResolutionProbeResult contract onto the
effective pipeline fields and statuses used by normal processing pipelines.
It requests a halt for unsupported, unbound, or header-unsupported files, but
deliberately does not halt on successful resolution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctx
|
ProcessingContext
|
Processing context to update. |
required |
step
|
BaseStep
|
Pipeline step requesting halts and diagnostics. |
required |
Source code in src/topmark/pipeline/steps/resolver.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 | |