aeat.application.operator_surface._contract module

Application-owned operator-surface contract for the workflow redesign.

This module declares the accepted RootSurface records, canonical BindingSourceKind subset, parser-only SourceKindAlias records, mounted MountedCommandFamily records, backend ServiceOwner inventory, log metadata, and registered error-code tuple that build the immutable OperatorSurfaceContract.

It owns contract data only: command adapters render and enforce this shape without redefining it. The module does not inspect storage, read environment variables, construct repositories, or traverse the live command tree.

build_operator_surface_contract()[source]

Build the immutable OperatorSurfaceContract.

Returns the canonical declaration of modelo lifecycle steps, accepted RootSurface values, parser-only SourceKindAlias records, mounted MountedCommandFamily values, and backend ServiceOwner mappings. The resulting OperatorSurfaceLogFields are emitted through the shared logger as stable, non-secret metadata. Consumers that need the singleton view should call get_operator_surface_contract(), which caches this builder.

Return type:

OperatorSurfaceContract

get_operator_surface_contract()[source]

Return the cached backend-owned operator surface contract.

Returns the OperatorSurfaceContract describing the accepted root surfaces, source-kind aliases, command families, service owners, log fields, and registered error-code contract. The cache guarantees every application and adapter consumer observes the same immutable contract object for the current process.

Return type:

OperatorSurfaceContract

require_accepted_root(name)[source]

Return the RootSurface for an accepted root.

Raises OperatorSurfaceContractError when name is outside the backend-owned root contract. The refusal carries localized reason and suggestion text, while the accepted path returns the exact RootSurface record from get_operator_surface_contract().

Return type:

RootSurface

Parameters:

name (str)

resolve_source_kind_alias(value)[source]

Resolve canonical source kinds and parser-only aliases.

Returns a canonical BindingSourceKind from either the enum token itself or an input-only SourceKindAlias. The accepted set is the SOURCE_KINDS subset, and aliases in SOURCE_KIND_ALIASES never introduce an operator-only source-kind taxonomy.

Return type:

BindingSourceKind

Parameters:

value (str)