Appendix
Overview
Preconfig Toolkit · deep detail

How the toolkit is built and how it was proven

For the engineer who has to explain it, extend it or challenge it. Every figure here is counted from files; every rule names the experiment behind it. Orchestrator, appliance and site names are lab placeholders.

Code map

The scripts: standard library plus Jinja2 and PyYAML

Each script adds its own folder to the import path; there is no package to install. Python 3.9 is the floor (CI runs 3.9 and 3.13). Every HTTP call goes through one client in common.py that counts writes. Since 1.3.0 (pull request #7) the scripts live only in the top-level toolkit/ folder; tools/build_skill.py builds the agent skill's copy and dist/. Line counts below are from 1.2.3 (16 scripts, 4,823 lines).

ScriptStageLines (1.2.3)What it does
cli.pyall693The edgeconnect-preconfig command: list, build, variables, compare, validate, upload, each running the stages below; the stage scripts still run by name. Since 1.3.2 validate and upload also take --yaml FILE|FOLDER.
capture.py0–1211Read-only capture of one appliance, live and cached, plus Orchestrator-scope data and the release's default template.
cache_check.py285Compares the live and cached copy of each endpoint, offline, so a stale cache is visible (edgeconnect-preconfig cache-check; it was the stage compare before 1.2).
translate.py4–7696Capture folder to reference preconfig, ledger, summary and verdict, variables sheet and site type.
mappers.py41,021One mapper per preconfig section, from captured API data to section values.
variables.py6281One reviewable row per leaf: variable or fixed, with the reason; reads the edited sheet back. Holds the section layout and the Top 10 / Top 20 ranking (references/variable-ranking.json) the variables command offers.
decisions.py697The older per-section choice of which leaves become columns.
generate.py7220Reference YAML to a Jinja2 template, CSV header, example row and column metadata.
cells.py8153Offline check of each CSV cell against columns.json, by row and column, before rendering.
render.py8184One YAML per CSV row with pyedgeconnect's Jinja settings plus StrictUndefined.
check.py8159Checks one site folder: renders, parses, mutation-tests each column, optional /validate.
validate.py9114Sends rendered YAML to Orchestrator's /validate, counted as a read, only on nicknames listed exactly in EC_VALIDATORS.
upload.py9–10273Row-by-row validation, immediate YAML for valid rows, conflict check, approval-gated upload with autoApply always off. upload --yaml (1.3.2) checks named files and uploads them without --approve, since uploading is not applying; it refuses <SECRET:…> placeholders, warns on 0.0.0.0 routes with an interface, skips name or serial conflicts and prints a result table per file.
synth.pytest138Swaps object names so a configuration from one Orchestrator can be validated on another.
options.pytest76Reads the documented options out of the default template's comments, for the option suite.
gui/all—Since 1.4.0: edgeconnect-preconfig gui, a web GUI on 127.0.0.1 with a one-time sign-in link. It calls the same stage code as the command line; uploads need <nickname>_gui_preconfig_uploads=on, and a CSV upload needs the Orchestrator’s nickname typed to approve; and it never applies a preconfig.
common.pyall422HTTP client with write counting, .env profiles (every key documented in .env.example), the EC_VALIDATORS list, certificate pins, serial and filename helpers, redaction, YAML 1.2 parser, toolkit version.
translate.py, function by function

What happens when you run translate

In the order main() calls them. Each step adds to one ledger list; nothing is removed from it.

main()

Parses the options and stops early, naming the cached releases, if there is no default template for --target-release. The template is picked by release family: the exact build, else the newest of the same major.minor, else the nearest older (untested), else the nearest newer; one downloaded from an Orchestrator goes to the work folder. --target-ecos sets the ECOS release of the target appliances, and the summary states which one was used; since 1.3.2 it no longer changes routes. --compare and --variables are refused together, because compare writes a fresh sheet.

Capture(folder)

Opens the capture index. data(id) returns the live copy of an endpoint, falling back to the cached one, so mappers never handle both.

build(cap, ledger)

Writes applianceInfo (hostname, group, site, cluster profile, network role, region, location), templateGroups, businessIntentOverlays (overlay ids resolved to names) and deploymentInfo (mode, bandwidths, interfaces, DHCP, EdgeHA). Then it runs every mapper in MAPPERS and applies template ownership. It stops with a clear message if the capture has no appliance or deployment data, as with an offline appliance and no cache.

selected_templates() · template_fields() · drop_template_fields()

A section provided by a selected template is not written. For the routes, bgp and vrrp templates, only the fields the template sets are removed, per segment; a route section left with nothing of its own is dropped. Template settings that do not apply (route targets, a VXLAN VTEP) are still written. When the groups' templates cannot be read, every section a template could provide is withheld.

local_firewall_rules()

Firewall rules Orchestrator did not push are named in the ledger, since preconfig has no firewall section.

allow list (target release's default template)

Since 1.3.0 the preconfig keeps only key paths the target release's default template has, plus a short list of known template omissions. Each path left out is one outside-preconfig ledger line, so a 10.0-only field is not sent to a 9.7 Orchestrator. This fixed ECOS 9.5.x /validate errors and mapper crashes.

flat_paths()

Lists key paths of the result that the target's default template does not show, as context: valid optional keys or unverified for that release.

tag_unmapped(cap, ledger)

Walks every captured endpoint against the endpoint catalogue. Each one is accounted for: mapped, template-group, empty, holds only the ECOS default (DEFAULT_ONLY), has no section (outside-preconfig), or has a section with no mapper yet (unresolved). NO_GAP_WITHOUT_EVIDENCE reports PoE and USB-LTE only when the running config has matching lines.

scope_by_template(ledger, sections)

An unresolved item whose target names no section of the target release's format becomes outside-preconfig: the format cannot hold it, so it is not a gap.

include_from_default · ordering · --compare

Sections the owner asks for are copied from the default template's examples, every leaf a column. Sections are put in the default template's order. Other captures given with --compare are built the same way, so fields that differ between sites become variables.

write: reference.yaml · ledger.json · summary.md

The ledger carries the toolkit version, the target release and the source. summary_md() groups entries with REPORT_GROUPS and ends with verdict(); an unknown disposition counts as a gap.

variables sheet → generate()

Writes or reads variables.csv (an earlier sheet is kept as variables.previous.csv), then generate.py builds the template and CSV. The command prints the sections, column count, ledger counts by group, toolkit version and the verdict.

mappers.py

Rules every mapper follows

Ctx

Built once per capture. Resolves interface label, segment, zone and role ids to names, so the YAML carries names that exist on the target Orchestrator, never ids. note() deduplicates ledger entries; unmapped() records any source key the mapper did not use as unmapped-source-key.

Return value

A mapper returns the section, or None when the appliance does not use the feature, with a ledger line saying why. Returning None instead of an empty list matters: many sections replace on apply. A read that failed or came back malformed is ledgered not-readable and nothing is written from it, never an empty list or a false default. A list mapper skips and ledgers a single bad item; a name map with a bad item is unreadable as a whole.

Orchestrator's own objects

managed() is true for gms_marked or gmsMarked objects. Every mapper skips them and records them as orchestrator-managed.

Empty strings and secrets

nul() turns empty strings into null. Secrets arrive as <SECRET:path>, stay so in reference.yaml and become empty CSV cells.

The 34 section mappers, grouped

Routing localRoutes · segmentLocalRoutes · bgpSystemConfig · segmentBgpSystems · ospfSystemConfig · segmentOspfConfig · segmentBfdConfigs · managementRoutes

configured_route() reads routes from the configured table, because the state table reports advertise flags as false and has no comment. per_segment() puts routes in segmentLocalRoutes when a non-Default segment has routes or subnet-sharing settings of its own. Routes with no next hop are left out and ledgered; routes with next hop 0.0.0.0 are read from their config, which keeps it. When a non-Default segment runs OSPF, Default-segment OSPF moves to segmentOspfConfig, because Orchestrator ignores ospfSystemConfig when both are present. bgp_value() skips Orchestrator-managed neighbours, with a ledger line, and leaves out the empty route target 0:0. Since 1.3.2 a route with next hop 0.0.0.0 or :: and a named interface is written without the interface, for every ECOS release: 9.7 and later reject it with the interface, and the interface has no effect (the appliance shows the zone as none). Since 1.3.0: OSPF is written only on interfaces the preconfig deploys; route labels are carried by name on routes and IP SLA, and the summary lists the labels the target Orchestrator must already have.

Interfaces and L2 loopbackInterface · linkAggregation · bridgeGroups · vxlan · virtualTunnelInterface · pppoe · interfaceConfig · managementIp

Loopbacks Orchestrator creates for cloud services are skipped as managed. linkAggregation omits isForceDelete, which has no source on the appliance. passthrough_max_bandwidth() reads the pass-through shaping cap from the stored running configuration, since no API read holds it; cli_lines() notes that the backup can be older than the live configuration. Interfaces the preconfig does not create, dormant cluster interfaces and an admin-down mgmt0 each get a ledger line. An inline-router deployment without both a LAN and a WAN side is written with a loud "Warning: apply will fail".

Tunnels, NAT and forwarding tunnelConfiguration · branchNatMapsConfig · natPools · inboundPortForwarding · flowRedirection · thirdPartyServicesAssociation

m_tunnelConfiguration maps user passthrough tunnels, skips overlay tunnels, and writes no section when no tunnel maps; a tunnel it cannot read is a toolkit-error. m_branchNatMapsConfig reads the live NAT maps first, because the cache lags after an apply; a map listed by name only has no rules and is ledgered default-omitted with its name. EdgeHA port-forward rules are Orchestrator-managed.

Services and security ipSlaRule · idsIpsConfig · nac · ipAllowList · secureWebServicesConfig · vrrp · peerPriority · appExpressGroups · customApplianceTags · multicast · dhcpRemoteAddressPoolConfig · ecLicensing

m_idsIpsConfig takes the mode from Orchestrator's IDS state; an appliance missing from that state is a gap and the section is not written. probe_tunnel() links an IP SLA rule to the one user tunnel on its interface; vrrp_prio() reads the priority change as an increase or decrease. System_Rule IP SLA rules are Orchestrator-managed. _nac_fix() fills what the validator requires (a DA server name, a secret placeholder for the RADIUS key Orchestrator never returns) and turns a RADIUS source interface into its label. Since 1.3.2, NAC switched off with only factory-default objects (server 0.0.0.1, no key) is left out, and an empty NAC key cell is refused before /validate with "fill it in the CSV". secureWebServicesConfig is written whenever a value differs from the default, because the URL reputation threshold is kept with every feature off. Since 1.3.0: the toolkit never writes segment: null (on apply it turned BFD on in the Default segment); remote DHCP pool option codes come from the stored backup; single-object multicast (ECOS before 9.7) is written as the Default segment; NAC under a merge template is handled.

The ledger

Every disposition and how a report reads it

DispositionReport groupMeaning
mappedquietCarried into the YAML. A note containing "assumption" is listed as mapped on an assumption, for the owner to confirm.
default-omittedquietHolds only the ECOS default, so there is nothing to carry.
runtime · empty-or-absent · context · from-default-templatequietRuntime state, empty on this appliance, background facts, or a section the owner chose to start from the default template.
unresolved · unmapped-source-keygapThe format has a place for it and the value was not carried. The only real defect.
toolkit-errortoolkit errorA mapper could not read the data. A bug to report, never a limit of preconfig.
not-readablecheck by handThe format has a place for it, but a GET cannot read it: business hours (POST only), an endpoint the API key's roles refused (HTTP 403), or a read that failed or came back malformed (nothing is written from it), listed with a note to check those sections by hand or widen the key's read roles.
template-group · orchestrator-managedowned elsewhereProvided by a template group, or created by Orchestrator itself.
outside-preconfig · release-gatedoutside preconfigNo section or field for it in the target release.
Verdict: Complete for preconfig.
Verdict: Incomplete for preconfig: N gap(s), M toolkit error(s).

The first line of summary.md names the toolkit version, commit and date, and flags local edits. An agent using the skill reports from this file, never edits the toolkit to make a gap disappear, and says to refresh the toolkit if the version is old.

Capture

What one capture holds

About 110 GET calls

Driven by references/endpoint-catalogue.yaml: each endpoint has a path, the preconfig sections it feeds, and notes. Appliance endpoints are read twice, live through Orchestrator and from Orchestrator's cache, so cache_check.py can show a stale cache.

Files written

  • capture/<id>.live.json, .cached.json
  • capture-index.json: status, HTTP code, empty flag
  • requests.jsonl: every call, method and status
  • run.json: Orchestrator release, appliance model and ECOS version

Refused reads

A read the API key's roles refuse (HTTP 403) is recorded and reported, not fatal; the verdict then counts the items to check by hand. A refused routes read (/subnets) stops the capture, because the preconfig would lose its routes. An offline appliance with no cached copy stops with one line and leaves no folder.

Redaction

Keys that hold passwords, PSKs, community strings and similar become <SECRET:path> before the file is written. Since 1.3.0, credentials in free text (banners, notes, JSON text in CLI lines) are redacted too, with linear-time patterns that keep JSON valid. Prose beyond the documented phrasings may not be caught.

Default templates

The release's default preconfig template is cached once per release. Release 10.0 sends it as JSON with the YAML base64-encoded; capture decodes it and checks it parses before caching.

Testing methodology

Thirteen phases, each answering a different question

PhaseQuestionVolumeResult
1 · Validator probesWhat does /validate really check?20 probes20 / 20 behaviours characterised, 0 writes
2 · Option and mutation suiteDoes every documented option behave as documented?473 cases452 as expected; 21 template comments name keys the validator rejects
3 · CorpusDoes every real appliance translate, mutate and validate?65 appliances65 / 65, on 4 Orchestrators and 3 Orchestrator releases
4 · Closed-loop batches 0–9Does each section apply and read back unchanged?10 batches, 31 sections10 / 10, 0 mismatched, 0 missing values
5 · Cohort 1Do real designs survive apply? Hubs, EdgeHA, branches25 applies2,778 values matched, 0 mismatched, 0 missing
6 · Cohort 2Older and newer ECOS, on a 9.7.1 lab appliance15 applies1,747 values matched, 0 mismatched, 0 missing
7 · Unit testsDo the fixed behaviours stay fixed?738 testsIn this repository, at 1.5.1 (340 at 1.3.2); CI green on Python 3.9 and 3.13, Linux, macOS and Windows (WSL), plus the GUI in three browsers
8 · Independent auditWhat did the first author miss?every script32 defects fixed, each with a regression test
9 · Full-corpus checkDoes a change alter only the YAML it means to?913–987 capturesRun on every change; YAML changed only where intended (1.3.2: only the interface routes and factory-default NAC)
10 · FuzzCan a malformed read make a run fail as a whole?3,160 cases, 40 seedsNever fails as a whole
11 · Guard mutation testingWould a test notice if a new guard line broke?every new guard44 / 44 caught in the 1.3.0 round; every new 1.3.2 check mutation-tested; independent reviews before pushes
12 · Live closed loop (1.3.0)Do real sites survive convert, apply and compare?37 sources, 53 compares231,352 differences classified; final run 10 appliances, 9 clean, 0 unexplained
13 · Live closed loop (1.3.2)Do upload --yaml files apply on both ECOS releases?10 appliances, 2 batches10 / 10 applied, every step passing (routes on 9.7 too); 0 unexplained differences
Batches 0–9 on the KVM lab
BatchWhat it provedValues matched
0Baseline idempotency: appliance info, template groups, overlays, deployment, IDS/IPS46
115 sections: dual WAN, DHCP server and relay, static routes, BGP, OSPF, VRRP, peer priority, port forwarding, loopbacks, tags, BFD, NAT pools191
212 sections: IP SLA, GRE and IPsec tunnels, VTI, branch NAT, NAC, secure web services, allow list202
3Three segments on a hub: per-segment routes, BGP, OSPF, BFD154
4Zero-touch onboarding of two unapproved appliances53 each
5A full EdgeHA pair with cluster profile and HA interface order75 each
6–7Retail and small-office designs from two other Orchestrators, adapted by CSV62 · 127
8Bridge groups45
9ECOS 9.7.1 sections: remote DHCP pools, multicast, VXLAN, flow redirection, link aggregation115
Lab topology

Five virtual EdgeConnect appliances on one KVM host, on ECOS 9.6.2.1 and 9.7.1.0. Each has a trunked NIC carrying management (DHCP), a DHCP internet WAN at 100 Mbps both ways and several LAN VLANs; a second NIC on an isolated MPLS bridge with static addresses; a third on an isolated EdgeHA bridge, also used for bonds and bridge groups. Every test leaves management and the DHCP WAN untouched, and test objects are removed and verified by read-back.

Live apply and diff

The loop behind the lab runs

render + /validate

The site's YAML is rendered from the template and its CSV row, then validated on the lab Orchestrator.

store + apply

Stored as a preconfig and applied to a lab appliance, or to an unapproved one for zero-touch tests. Every apply step is polled to completion.

capture again

The appliance is read back with the same capture code used for real appliances.

translate again

The read-back is translated, so both sides are in preconfig terms.

compare every value

Leaf by leaf: matched, mismatched, or missing. The report is apply-diff.json.

triage

Each difference becomes a converter fix with a test, an ECOS read-back quirk documented in the lessons, or a field proven outside preconfig.

Across all 290 runs, 49,010 values were compared: 46,841 matched, 616 mismatched and 1,553 missing. Every non-matching value was triaged: the runs include early converter versions, negative tests and the raw round trips that found gaps since fixed. The final batches and cohorts show 0 mismatched and 0 missing.

For 1.3.0 the loop was run again on 37 source appliances (ECOS 9.3.7 to 9.7.2) from the Test Lab and field-reference Orchestrators: 10 batches, applied through the Orchestrator API and compared leaf by leaf in the API endpoints and the CLI running-config. 53 clone-vs-source comparisons gave 231,352 differences, all classified, and management access stayed intact after every apply. A gap-fix batch proved the BFD, 9.7 route and OSPF fixes live. The final run on the release: 10 appliances, 9 clean, all 10 with 0 unexplained differences; the one failure was caused by the lab itself.

For 1.3.2: 10 appliances in 2 batches on ECOS 9.6.2.1 and 9.7.1.0, each restored, uploaded with upload --yaml, applied, re-captured and compared. All 10 applied with every step passing, including the routes step on 9.7, with 0 unexplained differences: 563 were the intended 1.3.2 changes, the rest known or lab-side. Where the YAML had no NAC section, each appliance's own NAC was the same before and after.

Rules learned

Findings that are now code

YAML 1.2 everywhere

YAML 1.1 read 1:1 as 61, yes as true and crashed on 08034. A strict YAML 1.2 parser is used throughout, and strings render through tojson.

Release schemas differ

A 9.6.4 default template fails on 9.7.1 (nac.server[].address became host); 10.0 adds post-quantum IKE fields that 9.7.1 rejects. Hence prune() against the target release's template.

Older ECOS omits fields

9.3 and 9.5 appliances omit roles and inbound bandwidth; missing inbound takes the outbound value.

Companion constraints

Some options require siblings: GCM ciphers need a null auth algorithm, ICMP port forwards need port 0, OSPF text auth needs a key. Recorded in known-constraints.yaml.

Static route flags

The route state table always says not advertised and has no comment. Flags and comments are read from the configured table; a raw round trip found every cloned route had lost them.

Template groups win

Two template groups setting the same thing with no priority: whichever Orchestrator applies last wins, so a clone can differ with an identical preconfig.

Bonds are not deleted by preconfig

An empty link-aggregation list, with or without force delete, leaves the bond. Remove it on the appliance once no interface uses it.

Read-back quirks

A cloned tunnel's IKEv2 exchange mode can read back differently although the preconfig carries the source value. Documented, not a converter gap.

A null segment is not neutral

A live apply with segment: null turned BFD on in the Default segment. The toolkit never writes it.

ECOS 9.7 interface routes

ECOS 9.7 and later reject a route with next hop 0.0.0.0 or :: that names an interface, and the whole routes step fails. The interface has no effect, so since 1.3.2 it is never written, whatever --target-ecos says.

Switched-off NAC is not a setting

NAC that is off with only the default server 0.0.0.1 and no key failed with "NAC - server key can not be empty". Found on 16 of 75 captured appliances (ECOS 9.5 to 9.7); it is now left out.

A failed read is not an empty list

A failed template-association read once could write an empty template-group list, which would detach every group on apply. Failed reads are now ledgered and nothing is written from them.

Inline router needs both sides

An inline-router deployment without both a LAN and a WAN side fails at apply. It is written with a loud warning so a person sees it first.

How we counted

Every number on the overview, and where it came from

Counted on 2026-10-23 from the work folders and repositories, not estimated; the 1.3.0 and 1.3.2 rows come from the releases' test reports of 2026-10-28. Figures in the testing report that are not repeated here were not recounted.

FigureValueCounted as
Distinct appliances69Distinct appliance id per Orchestrator across all capture folders: 56 Test Lab, 5 KVM lab, 4 field reference, 4 Virtual Lab
Captures890run.json files with an appliance block
API reads98,376Lines in every requests.jsonl: Test Lab 18,867, field reference 840, lab Orchestrators 78,669; every one a GET
Writes to read-only Orchestrators0Non-GET lines in the 19,707 logged calls to the Test Lab and field-reference Orchestrators
ECOS releases · models10 · 9Distinct softwareVersion and model in captured appliance records, 9.3.1 to 9.7.2
Orchestrator releases39.6.4, 9.7.1 and 10.0 (two builds) in run.json
Translate runs1,161ledger.json files
Rendered preconfigs3,633rendered/*.yml files
/validate verdicts3,590Result objects with an accepted flag in reports and checks: 3,310 accepted, 280 rejected
Live apply-and-diff runs290apply-diff.json reports; 271 completed every apply step
Values compared49,010Sum of matched, mismatched and missing in those reports
Lab campaigns35Folders under test-runs
Unit tests738Offline tests in this repository at 1.5.1 (3 skipped); CI on Python 3.9 and 3.13
Source appliances cloned live (1.3.0)37ECOS 9.3.7 to 9.7.2, in 10 batches on the KVM lab
Clone-vs-source comparisons53Leaf-by-leaf compares of API endpoints and CLI running-config
Differences classified231,352All differences from those comparisons; 0 unexplained in the final run
Fuzz cases3,160Mutated captures from 40 seeds
Full-corpus comparison (1.3.2)987Captures translated before and after; only the interface routes and factory-default NAC sections changed
Live applies (1.3.2)10 / 102 batches on the KVM lab, every step passing; 563 intended changes, 0 unexplained
Factory-default NAC found16 / 75Captured appliances with NAC off and only default objects, ECOS 9.5 to 9.7
Guard-line mutants caught44 / 44Mutation testing on every new guard line, last round
Commits · releases · CI runs162 · 32 · 96GitHub history of the three public repositories on main on 2026-10-23 (43 / 89 / 30 commits); releases 9 / 14 / 9; CI runs of the preconfig and MCP repositories
Code4,823wc -l over the 16 scripts at 1.2.3

Not counted, so not claimed: repeated test runs by other agents before the public repository existed, and manual checks in the Orchestrator UI. They happened; their logs were not kept in a countable form.

Limits

What is not proven yet

Live apply on one Orchestrator release

All live applies ran through the KVM Lab Orchestrator to appliances on ECOS 9.6.2.1 and 9.7.1. No preconfig was ever applied through an Orchestrator on 9.6.4 or 10.0.

Hardware-only sections

PoE and USB-LTE were validated from the default template, never captured from an appliance using them.

Business hours

Readable only with a POST, so capture never reads them. They are reported as not readable, to set per site.

BGP template neighbour fields

Whether the bgp template pushes keepalive, hold time and similar to every neighbour is unverified; they are written per neighbour and flagged.

Proven offline only

Remote DHCP pool option codes and single-object multicast were proven offline, not yet in a live apply.

Fuzz finds 51 quiet cases

In 51 synthetic malformed-read cases an item disappears without a new visible ledger line. Next phase.

Free-text redaction

Credentials in banners and notes are caught in the documented phrasings only; other prose may not be.