Skip to content

topmark.core package index

topmark / core

Core, UI-agnostic primitives shared across TopMark.

The topmark.core package provides small, reusable building blocks that are safe to import from anywhere in the codebase without pulling in CLI, presentation, pipeline execution, or public API command concerns.

Included modules:

  • constants Package metadata, marker strings, registry token patterns, resource names, and newline definitions shared across the project.

  • outcomes Stable outcome enum values, deterministic outcome ordering, and fallback reason text shared by API DTOs, pipeline classifiers, and presentation code.

  • errors Core exception types used to classify configuration, TOML, registry, processing, and runtime failures.

  • exit_codes Centralized exit codes for the CLI and runtime, aligned with BSD-style sysexits where practical, with a dedicated WOULD_CHANGE code for dry-run mode.

  • enum_mixins Typing-friendly enum utilities and mixins for introspection and parsing.

  • machine Shared machine-output envelopes, payload contracts, and schemas used by higher-level serializers.

  • presentation Minimal semantic presentation primitives that remain independent of concrete text, Markdown, or CLI renderers.

  • typing_guards Narrow runtime type guards used to keep public and internal parsing code precise under strict type checking.

Design goals:

  • Keep this package free of UI dependencies and side effects.
  • Avoid imports from CLI commands, presentation renderers, pipeline steps, or public API command helpers.
  • Prefer small, well-typed helpers over framework-specific utilities.
  • Maintain stable internal contracts that higher-level layers can rely on.

Immediate children in this package

topmark.core.constants
Core constants and package metadata used across TopMark.
topmark.core.enum_mixins
Generic Enum utilities for TopMark (typing-friendly, UI-agnostic).
topmark.core.errors
Core TopMark exceptions.
topmark.core.exit_codes
Exit codes for the TopMark runtime and CLI.
topmark.core.formats
Shared output format definitions used across TopMark frontends.
topmark.core.keys
Shared canonical argument keys.
topmark.core.logging
Custom TopMark logging with TRACE logging.
topmark.core.machine
Core machine-readable output infrastructure.
topmark.core.merge
Merge and extraction helpers for TopMark configuration.
topmark.core.outcomes
Stable outcome primitives shared by API, pipeline, and presentation layers.
topmark.core.presentation
Semantic presentation primitives for human-facing rendering.
topmark.core.typing_guards
Generic type guards and normalization helpers for TopMark.