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.
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).
| Script | Stage | Lines (1.2.3) | What it does |
|---|---|---|---|
cli.py | all | 693 | The 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.py | 0–1 | 211 | Read-only capture of one appliance, live and cached, plus Orchestrator-scope data and the release's default template. |
cache_check.py | 2 | 85 | Compares 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.py | 4–7 | 696 | Capture folder to reference preconfig, ledger, summary and verdict, variables sheet and site type. |
mappers.py | 4 | 1,021 | One mapper per preconfig section, from captured API data to section values. |
variables.py | 6 | 281 | One 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.py | 6 | 97 | The older per-section choice of which leaves become columns. |
generate.py | 7 | 220 | Reference YAML to a Jinja2 template, CSV header, example row and column metadata. |
cells.py | 8 | 153 | Offline check of each CSV cell against columns.json, by row and column, before rendering. |
render.py | 8 | 184 | One YAML per CSV row with pyedgeconnect's Jinja settings plus StrictUndefined. |
check.py | 8 | 159 | Checks one site folder: renders, parses, mutation-tests each column, optional /validate. |
validate.py | 9 | 114 | Sends rendered YAML to Orchestrator's /validate, counted as a read, only on nicknames listed exactly in EC_VALIDATORS. |
upload.py | 9–10 | 273 | Row-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.py | test | 138 | Swaps object names so a configuration from one Orchestrator can be validated on another. |
options.py | test | 76 | Reads 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.py | all | 422 | HTTP 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. |
What happens when you run translate
In the order main() calls them. Each step adds to one ledger list; nothing is removed from it.
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.
Opens the capture index. data(id) returns the live copy of an endpoint, falling back to the cached one, so mappers never handle both.
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.
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.
Firewall rules Orchestrator did not push are named in the ledger, since preconfig has no firewall section.
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.
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.
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.
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.
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.
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.
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.
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.
Every disposition and how a report reads it
| Disposition | Report group | Meaning |
|---|---|---|
mapped | quiet | Carried into the YAML. A note containing "assumption" is listed as mapped on an assumption, for the owner to confirm. |
default-omitted | quiet | Holds only the ECOS default, so there is nothing to carry. |
runtime · empty-or-absent · context · from-default-template | quiet | Runtime state, empty on this appliance, background facts, or a section the owner chose to start from the default template. |
unresolved · unmapped-source-key | gap | The format has a place for it and the value was not carried. The only real defect. |
toolkit-error | toolkit error | A mapper could not read the data. A bug to report, never a limit of preconfig. |
not-readable | check by hand | The 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-managed | owned elsewhere | Provided by a template group, or created by Orchestrator itself. |
outside-preconfig · release-gated | outside preconfig | No 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.
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.jsoncapture-index.json: status, HTTP code, empty flagrequests.jsonl: every call, method and statusrun.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.
Thirteen phases, each answering a different question
| Phase | Question | Volume | Result |
|---|---|---|---|
| 1 · Validator probes | What does /validate really check? | 20 probes | 20 / 20 behaviours characterised, 0 writes |
| 2 · Option and mutation suite | Does every documented option behave as documented? | 473 cases | 452 as expected; 21 template comments name keys the validator rejects |
| 3 · Corpus | Does every real appliance translate, mutate and validate? | 65 appliances | 65 / 65, on 4 Orchestrators and 3 Orchestrator releases |
| 4 · Closed-loop batches 0–9 | Does each section apply and read back unchanged? | 10 batches, 31 sections | 10 / 10, 0 mismatched, 0 missing values |
| 5 · Cohort 1 | Do real designs survive apply? Hubs, EdgeHA, branches | 25 applies | 2,778 values matched, 0 mismatched, 0 missing |
| 6 · Cohort 2 | Older and newer ECOS, on a 9.7.1 lab appliance | 15 applies | 1,747 values matched, 0 mismatched, 0 missing |
| 7 · Unit tests | Do the fixed behaviours stay fixed? | 738 tests | In 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 audit | What did the first author miss? | every script | 32 defects fixed, each with a regression test |
| 9 · Full-corpus check | Does a change alter only the YAML it means to? | 913–987 captures | Run on every change; YAML changed only where intended (1.3.2: only the interface routes and factory-default NAC) |
| 10 · Fuzz | Can a malformed read make a run fail as a whole? | 3,160 cases, 40 seeds | Never fails as a whole |
| 11 · Guard mutation testing | Would a test notice if a new guard line broke? | every new guard | 44 / 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 compares | 231,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 batches | 10 / 10 applied, every step passing (routes on 9.7 too); 0 unexplained differences |
Batches 0–9 on the KVM lab
| Batch | What it proved | Values matched |
|---|---|---|
| 0 | Baseline idempotency: appliance info, template groups, overlays, deployment, IDS/IPS | 46 |
| 1 | 15 sections: dual WAN, DHCP server and relay, static routes, BGP, OSPF, VRRP, peer priority, port forwarding, loopbacks, tags, BFD, NAT pools | 191 |
| 2 | 12 sections: IP SLA, GRE and IPsec tunnels, VTI, branch NAT, NAC, secure web services, allow list | 202 |
| 3 | Three segments on a hub: per-segment routes, BGP, OSPF, BFD | 154 |
| 4 | Zero-touch onboarding of two unapproved appliances | 53 each |
| 5 | A full EdgeHA pair with cluster profile and HA interface order | 75 each |
| 6–7 | Retail and small-office designs from two other Orchestrators, adapted by CSV | 62 · 127 |
| 8 | Bridge groups | 45 |
| 9 | ECOS 9.7.1 sections: remote DHCP pools, multicast, VXLAN, flow redirection, link aggregation | 115 |
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.
The loop behind the lab runs
The site's YAML is rendered from the template and its CSV row, then validated on the lab Orchestrator.
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.
The appliance is read back with the same capture code used for real appliances.
The read-back is translated, so both sides are in preconfig terms.
Leaf by leaf: matched, mismatched, or missing. The report is apply-diff.json.
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.
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.
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.
| Figure | Value | Counted as |
|---|---|---|
| Distinct appliances | 69 | Distinct appliance id per Orchestrator across all capture folders: 56 Test Lab, 5 KVM lab, 4 field reference, 4 Virtual Lab |
| Captures | 890 | run.json files with an appliance block |
| API reads | 98,376 | Lines in every requests.jsonl: Test Lab 18,867, field reference 840, lab Orchestrators 78,669; every one a GET |
| Writes to read-only Orchestrators | 0 | Non-GET lines in the 19,707 logged calls to the Test Lab and field-reference Orchestrators |
| ECOS releases · models | 10 · 9 | Distinct softwareVersion and model in captured appliance records, 9.3.1 to 9.7.2 |
| Orchestrator releases | 3 | 9.6.4, 9.7.1 and 10.0 (two builds) in run.json |
| Translate runs | 1,161 | ledger.json files |
| Rendered preconfigs | 3,633 | rendered/*.yml files |
| /validate verdicts | 3,590 | Result objects with an accepted flag in reports and checks: 3,310 accepted, 280 rejected |
| Live apply-and-diff runs | 290 | apply-diff.json reports; 271 completed every apply step |
| Values compared | 49,010 | Sum of matched, mismatched and missing in those reports |
| Lab campaigns | 35 | Folders under test-runs |
| Unit tests | 738 | Offline 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) | 37 | ECOS 9.3.7 to 9.7.2, in 10 batches on the KVM lab |
| Clone-vs-source comparisons | 53 | Leaf-by-leaf compares of API endpoints and CLI running-config |
| Differences classified | 231,352 | All differences from those comparisons; 0 unexplained in the final run |
| Fuzz cases | 3,160 | Mutated captures from 40 seeds |
| Full-corpus comparison (1.3.2) | 987 | Captures translated before and after; only the interface routes and factory-default NAC sections changed |
| Live applies (1.3.2) | 10 / 10 | 2 batches on the KVM lab, every step passing; 563 intended changes, 0 unexplained |
| Factory-default NAC found | 16 / 75 | Captured appliances with NAC off and only default objects, ECOS 9.5 to 9.7 |
| Guard-line mutants caught | 44 / 44 | Mutation testing on every new guard line, last round |
| Commits · releases · CI runs | 162 · 32 · 96 | GitHub 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 |
| Code | 4,823 | wc -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.
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.