User configuration¶
TopMark runtime configuration may be provided through:
topmark.tomlpyproject.toml([tool.topmark])- CLI overrides
- API overlays
Configuration is resolved through layered discovery, normalization, and precedence rules. Higher-precedence layers override lower-precedence layers.
Note
The canonical vocabulary used throughout the documentation is defined in Terminology and Canonical Vocabulary.
CLI, configuration, and API value spelling¶
Configuration keys use consistent naming across the CLI, API, and TOML configuration surfaces. Some
options accept predefined multi-word values such as add_only or whitespace_empty.
TopMark uses different spelling conventions depending on the interface: CLI examples prefer hyphenated forms for readability, while TOML configuration, Python API values, and machine-readable output use canonical underscore forms.
Note
CLI spelling vs configuration/API spelling
TopMark uses hyphenated spelling for CLI option names:
For multi-word option values, the CLI accepts both hyphenated and canonical underscore forms:
TOML configuration, Python API values, and machine-readable output use the canonical underscore form:
CLI option names themselves do not accept underscores. Use --header-mutation-mode, not
--header_mutation_mode.
Unless otherwise noted, configuration and policy values shown throughout this page use the canonical TOML/API/machine-readable underscore form.
File type identifiers¶
TopMark accepts file type identifiers in local form, such as python, or qualified form, such as
topmark:python.
Local identifiers are accepted only when unambiguous. Internally, TopMark normalizes identifiers to canonical qualified file type identities before filtering, runtime resolution, policy evaluation, diagnostics, and registry lookup.
See file-type filtering for the full identifier contract.
File type identifiers participate in stable runtime behavior such as:
include_file_typesexclude_file_typespolicy_by_type- CLI file-type filters
- API file-type filters and policy overlays
File-type filters¶
File-type filters allow restricting runtime processing to a selected subset of file types.
Example using local identifiers:
Equivalent configuration using canonical qualified keys:
Exclude filters work the same way:
[NOTE] Internally, TopMark normalizes configured file type identifiers to canonical qualified identities before filtering, runtime resolution, policy evaluation, diagnostics, and registry lookup.
Per-file-type policy¶
policy_by_type allows file-type-specific policy overrides for selected file types.
Example using a local identifier:
Equivalent configuration using canonical qualified keys:
Both forms are accepted when the local identifier resolves unambiguously.
Internally, TopMark stores and resolves per-file-type policies using canonical qualified file type identities.
Example: Different policy per file type¶
[policy]
header_mutation_mode = "add_only"
[policy_by_type."topmark:python"]
header_mutation_mode = "update_only"
[policy_by_type.markdown]
allow_content_probe = false
In this example:
- the global default policy uses
add_only - Python files override this with
update_only - Markdown files disable runtime content probing
Ambiguous identifiers¶
When more than one registered file type shares the same local identifier, TopMark requires the canonical qualified form.
For example, if both:
topmark:pythonacme:python
are registered, then:
is ambiguous.
Use:
instead.
Ambiguous identifiers are ignored diagnostically during configuration normalization and staged configuration-loading validation.
Unknown and malformed identifiers¶
Unknown identifiers are ignored diagnostically during configuration normalization and staged configuration-loading validation.
Malformed qualified identifiers are also ignored diagnostically during configuration normalization and staged configuration-loading validation.
Examples of malformed identifiers:
CLI and API parity¶
CLI options, TOML configuration, API overlays, and runtime policy evaluation all share the same file type identity semantics.
Examples:
Runtime configuration model¶
TopMark intentionally separates:
- TOML-source loading
- staged configuration-loading validation
- layered configuration deserialization and merging
- runtime configuration resolution
- runtime overlay application
- runtime policy evaluation
- runtime pipeline gatekeeping and execution
Reporting, API surfaces, and machine-readable output expose a flattened compatibility view derived from these internal runtime stages.
This layered runtime configuration model keeps behavior deterministic while preserving stable configuration, policy, diagnostics, and machine-readable compatibility contracts.