Repository navigation
Layered config phase 6: layer typing and ownership, the firewall layered, and an effective view checked against the composed modules - #12
Merged
Conversation
nbarrett-anet
force-pushed
the
intent-refactor-07
branch
5 times, most recently
from
November 25, 2026 03:38
81bddfd to
aa8b5cb
Compare
…lay defaults, field_kind
…he edge layer bound to its profile
…rough field kinds
…from the profile's value
…d per layer; the firewall models are layered
… row on its error
… coupled groups, with the profile template's display defaults
…file's server-assigned IDs
…tart from the profile
…'s composed modules
…empty list is equal only where the view builds it
…irewall match writes vlan_type
…rm; the null refusal path is pinned
…itable as its display default
…gments, not the whole list
…bled and the edge's nulls
…velo.core row (Kind)
…against the objects its group names
… missing, a stored security key is compared as stored, a rule's segment path is the one the view gives, and the keys, types and builders are one table
nbarrett-anet
force-pushed
the
intent-refactor-07
branch
from
November 25, 2026 03:43
aa8b5cb to
afaef13
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Configuration models are now typed by layer: an edge's own values, a profile's values, what the edge uses (the effective view) and what the VCO composes for the edge are distinct types. The firewall is the first module converted. Each of its module-level values on an edge is owned, inherited or local, and a patch on an inherited value starts from what the profile has.
state.effectiveshows every value the edge uses with where it comes from, andpipeline.compare_effective(state)checks that view against the VCO's composed modules.Layers and ownership (
pyvelo.core)Layered[L]withLone ofEdge,Profile,Effective,Composed. A field declares its kind:Inheritable,EdgeOnly,ProfileOnly,AdditiveorUnconverted.field_kind()is the one place that reads a kind; the field readers, the merge engine and the save computation see through it.kind_default()gives defaults for non-Inheritablefields.Owned[T]is an edge's hold on an inheritable value:stored,is_local,local, and the intentsset_local,inherit,localize. The encodings areByPresence(the edge stores the key or inherits) andByFlag(an override flag). AnOwnedor aResolvedin a condition raisesTypeError, naming what to read instead, because an object is always true.MemberOf/OwnedGroup/GroupHandle: the members of a group change owner together. An edit through one member that would split the group raisesGroupOwnershipError, with the patch form to send instead.effective_viewandeffective_dumpgive each value as aResolvedwith itsorigin(EDGE,PROFILEorFACTORY, a display default) and itssource.Ownedis refused at class creation.model_copyrefuses an update that would replace who owns an edge value. A constructed profile or composed model reads a missingInheritableas its display default.The firewall
FirewallData[L]and its segments, rules and services are layered. The module-level values have no flag: the edge stores a key or inherits it. They fall into three groups (stateful,network_protection,atp), and the profile template's display defaults fill values neither layer stores.plan().nullmakes the edge inherit again. A value made local from the profile carries none of the profile's server-assigned IDs (ruleLogicalId).hostedLoggingEnabledandsyslogForwardingEnabled(absent unless read or set).vlan_typekey, notvlanType.Configuration reads and writes
get_configurationreturns the layer's type.get_configuration_modules(..., layer=)reads the composed modules.LayerUnknownError, which carries the row.compare_effectiveIt reads
edge/getEdgeConfigurationModulesfor the converted modules (the firewall), reads the profile again so a profile change since the load is not a finding, and compares by wire path and value.Six categories, three of them findings:
differs,client_only,server_only(findings);factory,ignored,unconverted(information). Segments the composer omits (not in use on the edge) areignoredwith that reason. Secrets areignoredand shown as***. A module the VCO composes asnullraisesComposedModuleError.Composer security keys are confirmed, not ignored. When a rule names a security service group, the composer adds
urlCategoryFiltering,urlReputationFilteringandatp_action.compare_effectivereads the enterprise's security objects (fourenterprise/getSecurityObjectsreads, only when a rule names a group) and expects:dataof the objects the group names;atp_action: built from the group's IDPS object.A missing group or object puts its reason on the affected key only.
EFFECTIVE_IGNORESis empty.Behaviour changes
Owned, so reading one gives.stored/.local/.is_local, not the bare value.state.effective.firewall.<field>.valueis what the edge uses.GroupOwnershipError.GroupOwnershipError,ComposedModuleError,LayerUnknownError.make_firewall_moduleandmake_firewall_segmentbuild an edge-layer object unless givenlayer=Profile.compare_effectivesends noencryptKeys, which the VCO may refuse.compare_effectiveneeds read access to security objects on edges whose rules name a group.Known gaps (follow-ups)
inbound,inboundV6, a segment'sfirewall_logging_enabledandetm. The comparison reports them asunconverted.atp_enabledis true whenever the group names an IDPS object.maliciousIpFilteringobject, since none was seen; a key the composer adds for one shows asserver_only.security_objects=argument once a bulk caller exists.clear_server_owneddoes not descend into anOwned.ByFlag(inherit_as=<lambda>)does not pickle.same_statecompares each side at its own level.dict[K, Model]in the comparison.vlan_type.presence_wins.{ENCRYPTED}need a short design (an opt-in decrypt throughenterprise/decodeEnterpriseKey, kept out of plans and errors) before device settings or WAN convert. The firewall holds none.Test plan
scripts/check.shon Python 3.14: ruff clean, basedpyright 0 errors, pytest 6717 passed / 2 skipped.compare_effectiveon the lab's edges with a profile gives 0 findings, with an empty ignore list (tests/integration/test_effective_live.py).