pub struct LogicalGroup {
pub name: String,
pub children: Vec<String>,
pub auto_discover: Vec<String>,
pub authored_rule: Option<AuthoredRule>,
pub fallback_zone: Option<String>,
pub source_zone_index: usize,
pub status: LogicalGroupStatus,
pub merged_from: Option<Vec<usize>>,
pub original_zone_root: Option<String>,
pub child_source_indices: Vec<usize>,
}Expand description
A user-declared zone that fanned out into one or more child zones via
autoDiscover. Surfaced verbatim through fallow list --boundaries --format json so consumers (config UIs, Sankey renderers, agent-driven
config tooling, dashboards) can reconstruct the original grouping intent
after expansion has flattened the parent name out of zones[].
Fields§
§name: StringLogical parent zone name as authored by the user (e.g. "features").
children: Vec<String>Discovered child zone names in stable directory-sorted order
(e.g. ["features/auth", "features/billing"]). Empty when the parent
directory was empty or unreadable; status discriminates the two.
auto_discover: Vec<String>The exact autoDiscover strings the user wrote, preserved verbatim
(no normalization). Round-trip tooling depends on byte-exact match
against the user’s config source.
Pre-expansion rule keyed on this parent zone name, captured before
expand_auto_discover rewrote it into per-child rules. None when
the user wrote no rule for the parent (the children are then
unrestricted unless a per-child rule exists).
fallback_zone: Option<String>When the parent zone also carried explicit patterns, it stayed in
zones[] after expansion as a fallback classifier. This is its name
(always equal to Self::name). None when the parent had no
patterns and was dropped from zones[] entirely. Lets consumers wire
the logical-group entry to its zone twin without name-matching
heuristics.
source_zone_index: usizePosition of the parent zone in the user’s pre-expansion zones[]
array. Enables byte-accurate config patches by agent tooling without
re-parsing the user’s config source.
status: LogicalGroupStatusWhy Self::children is what it is.
merged_from: Option<Vec<usize>>Parent zone indices whose declarations were merged into this group
because they shared a name ({ name: "features", autoDiscover: [...] }
declared twice). None on the common case (single declaration);
Some([i, j, ...]) when at least two declarations were merged. The
FIRST entry equals Self::source_zone_index; subsequent entries are
the positions of the additional declarations in user-declaration order.
Surfaced in JSON so consumers (config-edit agents, config-hygiene
dashboards) can detect duplicates that tracing::warn! would otherwise
hide from --format json consumption.
original_zone_root: Option<String>The parent zone’s root (subtree scope) as the user authored it,
echoed onto the logical group so monorepo-aware tooling can tell
whether root was set on the parent (and inherited by every
discovered child) or set per-child. None when the parent had no
root field. The string is verbatim from the user’s config (not
the post-normalize_zone_root form) for byte-exact round-trip.
child_source_indices: Vec<usize>For each entry in Self::children, the index into
Self::auto_discover of the path that produced it (or the FIRST
path that produced it when multiple autoDiscover entries each yield
the same child name). Empty when only one autoDiscover path was
authored (every child trivially maps to index 0); populated only when
the parent has two or more autoDiscover entries so consumers can
attribute children to specific source directories. The length equals
children.len() when populated.
#[serde(default)] pairs with skip_serializing_if so the JSON
runtime omits this field on the common single-path case AND the
derived schema marks it optional (schemars 1 promotes any field with a
serde(default) attribute out of required).
Trait Implementations§
Source§impl Clone for LogicalGroup
impl Clone for LogicalGroup
Source§fn clone(&self) -> LogicalGroup
fn clone(&self) -> LogicalGroup
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LogicalGroup
impl Debug for LogicalGroup
Source§impl JsonSchema for LogicalGroup
impl JsonSchema for LogicalGroup
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more