Skip to main content

Module boundary_rules

Module boundary_rules 

Source
Expand description

Centralized, derived port-classification “rules broker” (Phase 1).

§What this is (and is NOT)

Stage formation today scatters its boundary decisions across several analyses: signal_flow decides feedback vs cascade, neighbor_roles infers per-terminal Load/Ref/Signal roles, the modulation-sink machinery (bind.rs) knows transducer ports, and graph knows the rail sets. Each re-derives a slice of “what does this port DO” from the device models.

This module is the single place that owns BOTH:

  1. the detection rules — PortClass::from_component derives a port’s class from the existing model facts (no new hand-maintained tag), and
  2. their declarative consequences — BoundaryPolicy is the whole rule table in one BoundaryPolicy::classify, and Directive is the consequence a later formation phase would apply.

Phase 1 is behaviour-neutral. Nothing here is wired into formation, find_flow_groups, partitioning, or stamping. Directive outputs are defined but UNUSED by compilation/audio. This mirrors how super::neighbor_roles landed safely: a pure classification + diagnostic that a later arbitration phase will consume.

§Derivation provenance (which model fact each PortClass comes from)

PortClassDerived from
PortClass::Railgraph.gnd_node / vcc_node / supply_nodes / ac_ground_nodes
PortClass::TransducerComponent::modulation_sink(pin) → ModulationSinkKind (the .led/.cv/.iabc/.vgs ports)
PortClass::ControlInputComponent::signal_terminals() Amplifier { input, control } (grid/base/gate, op-amp pos+neg)
PortClass::Conductingeverything else (stamped MNA/WDF terminals: plate, collector, R/C/L pins)

The forward-vs-back-edge bit consumed by BoundaryPolicy::classify is the directed, rail-blocked signal flow from [super::signal_flow] (Defect B’s directed_signal_distances_from_in). The broker does not re-derive flow.

Structs§

ClassifiedEdge
One classified edge (a from_port -> to_port boundary) in a compiled circuit, with its derived BoundaryPolicy.
ClassifiedPort
One classified port of one component pin in a compiled circuit.
DelayedCutDiagnostic
Public diagnostic view of the Phase-2a cut set for a PedalDef: the cut edges’ owning component ids, and the already-isolated (Behavioral) coupling component ids. Mirrors classify_edges as the external-test entry point (the internal delayed_cut_edges takes a compiled CircuitGraph).
DelayedCutSet
The set of edges a delayed-coupling formation pass must CUT before grouping, plus the tap-mouth boundary nodes each cut exposes as a stage port.

Enums§

BoundaryPolicy
The boundary policy for an edge between two ports, given the directed signal-flow orientation and component memory.
Directive
Declarative consequence of a BoundaryPolicy for a future formation pass.
Domain
Physical coupling domain of a transducer port.
PortClass
Device-agnostic classification of what a single port (a component.pin) is, derived entirely from existing model facts — no new annotation.

Functions§

classify_control_path
Classify the boundary along a passive PATH from out/a source node into a named control electrode, following the graph topology rather than a single component edge. This is the proof-diagnostic helper used to classify multi-hop boundaries such as LA-2A’s out -> ... -> V4.grid feedback tap or the V1.plate -> C_c1 -> Gain -> V2.grid makeup cascade: it resolves the control electrode’s node, derives its PortClass, and determines feedback vs forward by whether the control electrode is fed from the output side (see [control_sink_is_back_edge]).
classify_edges
Classify the boundary of every component edge in pedal into a BoundaryPolicy, oriented by directed signal flow.
classify_ports
Classify EVERY pin of EVERY component in pedal into a PortClass.
delayed_cut_diagnostic
Compute the Phase-2a DelayedCutDiagnostic for a parsed pedal.
delayed_cut_edges
Derive the delayed-coupling cut set for graph (Phase 2a).
detector_control_nodes
The nodes of every PortClass::ControlInput electrode that is fed from the output side (a BoundaryPolicy::DelayedSense sense sink) AND whose circuit contains a cross-network coupler — i.e. a true DELAYED feedback detector’s control electrode (LA-2A’s V4.grid).
detector_subnetwork_nodes
All circuit nodes belonging to the DELAYED detector SUB-NETWORK (Phase 2b).
distinct_classes
Set of all distinct PortClass discriminants seen in a corpus pass — helper for coverage assertions in the proof diagnostic.
smoke_classify
Robustness probe: classify every pin of every component for pedal and confirm the derivation never panics and yields a class for each resolved pin. Returns the number of pins classified. Used by the corpus smoke gate.