Shared interface design

Clean Interfaces

Configuration and result dataclasses for schematic and schematic-library normalization.

CleanFontSpec

Rationale

Font settings need a structured value instead of command-local dictionaries.

Purpose

Represents font family, size, style, and visibility defaults used by clean rules.

Test Requirements

Template and clean workflow tests must prove font fields round-trip through config creation.

Working Definition

Working when clean configs can be serialized and applied without losing font intent.

PinFontNormalizationConfig

Rationale

Pin text normalization must be opt-in and reproducible.

Purpose

Configures pin font normalization policy.

Test Requirements

Clean config tests must cover template creation and serialization.

Working Definition

Working when configured pin text rules apply consistently to schematic libraries.

SymbolBodyRectangleNormalizationConfig

Rationale

Symbol body rectangle order affects readability and should be deterministic.

Purpose

Controls body rectangle selection and ordering behavior.

Test Requirements

SchLib clean tests must cover body rectangle ordering against pins and graphics.

Working Definition

Working when the intended body rectangle is moved behind active symbol content.

PowerSymbolNormalizationConfig

Rationale

Power symbol style should be controlled by config rather than ad hoc edits.

Purpose

Configures power symbol cleanup behavior.

Test Requirements

Template tests must keep the config visible and serializable.

Working Definition

Working when enabled rules update power symbols without mutating disabled cases.

NetLabelNormalizationConfig

Rationale

Net label style cleanup needs one config surface.

Purpose

Configures net label normalization behavior.

Test Requirements

Clean template tests must preserve the configuration schema.

Working Definition

Working when net label style changes are deterministic and disableable.

ComponentDesignatorNormalizationConfig

Rationale

Designator text cleanup must be repeatable across sheets.

Purpose

Configures component designator text normalization.

Test Requirements

Clean workflow tests must prove config template creation remains stable.

Working Definition

Working when designator cleanup applies only when enabled.

ComponentParameterNormalizationConfig

Rationale

Component parameter visibility and text rules affect generated documentation.

Purpose

Configures component parameter cleanup.

Test Requirements

Config template tests must preserve the policy fields.

Working Definition

Working when parameters follow configured visibility and style policy.

SheetStyleNormalizationConfig

Rationale

Sheet-level style changes need explicit ownership.

Purpose

Configures sheet style normalization.

Test Requirements

Template tests must exercise schema creation.

Working Definition

Working when sheet style updates are deterministic and reversible through config.

ComponentFreeTextNormalizationConfig

Rationale

Free text associated with components should have a controlled cleanup policy.

Purpose

Configures component free-text normalization.

Test Requirements

Clean template tests must keep the config field covered.

Working Definition

Working when free-text changes are config-driven.

WireNormalizationConfig

Rationale

Wire style cleanup should not depend on manual formatting.

Purpose

Configures wire normalization rules.

Test Requirements

Clean workflow tests must preserve wire rule serialization.

Working Definition

Working when wire style follows config without changing connectivity.

NoErcNormalizationConfig

Rationale

No-ERC marker visibility and style are part of clean schematic output.

Purpose

Configures No-ERC normalization.

Test Requirements

Template tests must preserve the No-ERC policy.

Working Definition

Working when No-ERC changes are deterministic and config-owned.

SymbolInternalGraphicsMonochromeConfig

Rationale

Internal graphics can obscure symbol bodies and should be normalized predictably.

Purpose

Configures monochrome treatment for symbol internal graphics.

Test Requirements

SchLib clean tests must cover ordering with internal graphics.

Working Definition

Working when graphics style changes do not break symbol body ordering.

AltiumCleanConfig

Rationale

All schematic clean policies need one versionable root config.

Purpose

Aggregates clean rule configuration for commands and helpers.

Test Requirements

L3 must verify template creation and command loading.

Working Definition

Working when config templates load and disabled rules do not mutate inputs.

PinFontNormalizationResult

Rationale

Clean operations need structured result counts.

Purpose

Reports pin font normalization activity.

Test Requirements

Clean command tests must keep result construction valid.

Working Definition

Working when result counts reflect applied pin font changes.

SymbolBodyRectangleNormalizationResult

Rationale

Body rectangle cleanup needs inspectable counts.

Purpose

Reports body rectangle normalization decisions.

Test Requirements

SchLib ordering tests must exercise body rectangle behavior.

Working Definition

Working when result data matches selected and moved body rectangles.

PowerSymbolNormalizationResult

Rationale

Power symbol changes need structured reporting.

Purpose

Reports power symbol cleanup activity.

Test Requirements

Clean tests must keep result construction valid.

Working Definition

Working when counts match applied power symbol changes.

NetLabelNormalizationResult

Rationale

Net label cleanup should be auditable.

Purpose

Reports net label normalization activity.

Test Requirements

Clean tests must keep result construction valid.

Working Definition

Working when counts represent actual net label changes.

ComponentDesignatorNormalizationResult

Rationale

Designator cleanup needs traceable counts.

Purpose

Reports component designator normalization activity.

Test Requirements

Clean tests must keep result construction valid.

Working Definition

Working when counts match applied designator changes.

ComponentParameterNormalizationResult

Rationale

Parameter cleanup should report changed parameters.

Purpose

Reports component parameter normalization activity.

Test Requirements

Clean tests must keep result construction valid.

Working Definition

Working when counts match applied parameter changes.

ComponentFreeTextNormalizationResult

Rationale

Free text cleanup should be auditable.

Purpose

Reports component free-text normalization activity.

Test Requirements

Clean tests must keep result construction valid.

Working Definition

Working when counts represent applied free-text changes.

WireNormalizationResult

Rationale

Wire cleanup should report changed primitives.

Purpose

Reports wire normalization activity.

Test Requirements

Clean tests must keep result construction valid.

Working Definition

Working when counts match applied wire changes.

NoErcNormalizationResult

Rationale

No-ERC cleanup should report changed markers.

Purpose

Reports No-ERC normalization activity.

Test Requirements

Clean tests must keep result construction valid.

Working Definition

Working when counts match applied No-ERC changes.

SheetStyleNormalizationResult

Rationale

Sheet style cleanup needs a structured result.

Purpose

Reports sheet style normalization activity.

Test Requirements

Clean tests must keep result construction valid.

Working Definition

Working when counts match applied sheet style changes.

SymbolInternalGraphicsMonochromeResult

Rationale

Internal graphics cleanup should report affected primitives.

Purpose

Reports monochrome conversion activity.

Test Requirements

SchLib clean tests must cover graphics ordering.

Working Definition

Working when counts match applied internal graphics changes.

CleanApplyResult

Rationale

Command callers need one aggregate clean result.

Purpose

Aggregates per-rule result objects for one clean operation.

Test Requirements

L3 clean command tests and unit clean tests must keep result aggregation valid.

Working Definition

Working when all rule counts are available without inspecting raw documents.