packet-tracer-skill 0.2.2 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/CHANGELOG.md +424 -42
  2. package/README.md +535 -250
  3. package/SKILL.md +337 -262
  4. package/bin/packet-tracer-skill.js +29 -2
  5. package/docs/automation-controller-proof.md +35 -0
  6. package/docs/curated-donor-registry.md +11 -0
  7. package/docs/generate-ready-pilot-design.md +30 -0
  8. package/docs/github-launch-ops-0.2.3.md +37 -0
  9. package/docs/github-metadata.md +6 -4
  10. package/docs/hero-demo-plan.md +1 -1
  11. package/docs/home-iot-donor-proof.md +4 -4
  12. package/docs/industrial-programming-proof.md +48 -0
  13. package/docs/ipv4-routing-management-proof.md +37 -0
  14. package/docs/l2-resiliency-bgp-proof.md +60 -0
  15. package/docs/l2-security-qos-proof.md +59 -0
  16. package/docs/packet-tracer-feature-gap-atlas.md +174 -17
  17. package/docs/post-launch-follow-up.md +9 -5
  18. package/docs/proof-readiness-dashboard.md +69 -0
  19. package/docs/publish-preview-roadmap.md +6 -5
  20. package/docs/release-checklist.md +27 -13
  21. package/docs/release-notes-0.2.2.md +1 -1
  22. package/docs/release-notes-0.2.3.md +59 -0
  23. package/docs/release-notes-0.2.4.md +20 -0
  24. package/docs/runtime-truth.md +33 -8
  25. package/docs/security-edge-deepening-proof.md +65 -0
  26. package/docs/voice-collaboration-proof.md +38 -0
  27. package/docs/wan-security-donor-proof.md +20 -3
  28. package/examples/README.md +98 -69
  29. package/examples/complex_campus_master_edit_v4.inventory.json +12 -2
  30. package/examples/gallery.md +94 -6
  31. package/examples/home_iot_cli_edit_v1.inventory.json +11 -2
  32. package/examples/index.json +932 -4
  33. package/examples/local-sample-evidence.json +24 -0
  34. package/examples/proof-cards.json +117 -0
  35. package/examples/service_heavy_cli_edit_v1.inventory.json +11 -2
  36. package/package.json +60 -44
  37. package/pytest.ini +9 -0
  38. package/references/packettracer-feature-atlas.json +67 -17
  39. package/references/packettracer-sample-catalog.json +45287 -4525
  40. package/references/packettracer-sample-catalog.md +599 -259
  41. package/references/proof-readiness-candidates.json +352 -0
  42. package/scripts/build_examples_index.py +228 -35
  43. package/scripts/build_sample_catalog.py +24 -44
  44. package/scripts/corpus_runner.py +430 -0
  45. package/scripts/coverage_matrix.py +1842 -1319
  46. package/scripts/donor_cache.py +354 -0
  47. package/scripts/donor_diagnostics.py +3 -1
  48. package/scripts/feature_atlas.py +65 -1
  49. package/scripts/generate_pkt.py +8762 -4070
  50. package/scripts/intent_parser.py +2242 -1138
  51. package/scripts/local_donors.py +340 -0
  52. package/scripts/packet_tracer_env.py +846 -391
  53. package/scripts/pkt_annotate.py +218 -0
  54. package/scripts/pkt_codec.py +420 -181
  55. package/scripts/pkt_editor.py +2405 -1226
  56. package/scripts/pkt_transformer.py +1072 -727
  57. package/scripts/pkt_verify.py +461 -0
  58. package/scripts/remote_search.py +197 -21
  59. package/scripts/runtime_doctor.py +80 -29
  60. package/scripts/sample_catalog.py +1372 -1195
  61. package/scripts/twofish_diagnostics.py +48 -31
  62. package/scripts/usage_ledger.py +218 -0
  63. package/scripts/vendor/README.md +44 -37
  64. package/scripts/vendor/twofish_pure.py +321 -0
  65. package/scripts/workspace_repair.py +548 -508
  66. package/templates/pt900/donors/README.md +15 -0
package/SKILL.md CHANGED
@@ -1,262 +1,337 @@
1
- ---
2
- name: pkt
3
- description: >
4
- Create and edit Cisco Packet Tracer 9.0 `.pkt` files from hybrid natural-language
5
- requests and explicit commands. Use this skill for topology generation, VLAN/router-on-a-stick,
6
- DHCP, management VLAN, Telnet, wireless/AP-client setup, server services, and existing `.pkt` edits.
7
- ---
8
-
9
- # Cisco Packet Tracer 9.0 `.pkt` Hybrid Generator/Editor
10
-
11
- This skill targets Packet Tracer `9.0.0.0810` and treats a `.pkt` file as a single
12
- binary blob, not a zip container or folder tree.
13
-
14
- The current builder/editor is Cisco-sample-centric:
15
-
16
- - installed Packet Tracer sample saves are the primary prototype source
17
- - bundled device templates are the secondary fallback for gaps such as missing
18
- device families in Cisco's own saves
19
- - imported external labs are reference-only by default
20
- - curated external donor roots can become donor-eligible after validation, but
21
- Cisco local donors still rank first
22
-
23
- That is intentional: it avoids the invalid synthetic XML approach that Packet
24
- Tracer rejects while still keeping the skill usable when Cisco's own sample set
25
- does not cover a device family directly.
26
-
27
- The prompt-first architecture now follows a planner/validator/autofix split:
28
-
29
- 1. intent extraction
30
- 2. topology/config planning
31
- 3. donor ranking
32
- 4. donor-prune mutation
33
- 5. compatibility validation
34
-
35
- Useful ideas from `MCP-Packet-Tracer` were adopted only at the architecture
36
- level. PTBuilder live deploy and external donor usage were intentionally not
37
- adopted.
38
-
39
- ## How `.pkt` Files Work
40
-
41
- For the modern format targeted by this skill, the pipeline is:
42
-
43
- 1. Build a Packet Tracer XML document rooted at `<PACKETTRACER5>`
44
- 2. qCompress the UTF-8 XML bytes using:
45
- - 4-byte big-endian uncompressed length
46
- - raw zlib payload
47
- 3. Apply Stage-2 XOR obfuscation
48
- 4. Encrypt with Twofish in EAX mode and append the 16-byte authentication tag
49
- 5. Apply Stage-1 reverse/XOR obfuscation
50
-
51
- The XML includes a `<VERSION>` value. Compatibility is not guaranteed across Packet
52
- Tracer releases, so this skill intentionally targets the 9.0 line.
53
-
54
- ## Workflow
55
-
56
- 1. Parse the request into a hybrid intent plan:
57
- - topology, device models, links, cable types, ports
58
- - natural Azerbaijani or mixed-language counts such as `3 dene switch ve 6 komputer`
59
- - department/campus prompts such as `6 sobeli kampus sebekesi`
60
- - VLAN/trunk/access/router-on-a-stick intent
61
- - router DHCP or server DHCP/DNS intent
62
- - management VLAN / Telnet intent
63
- - AP SSID/security and wireless client association intent
64
- - existing `.pkt` edit operations when a source file is provided
65
- 2. Build an intent-first topology/config plan:
66
- - topology archetype
67
- - device list
68
- - port map
69
- - VLAN/service/config plan
70
- - assumptions and blocking gaps
71
- 3. Rank Cisco local donor candidates with capability, topology, and donor-graph scoring
72
- 4. Optionally search/import remote labs, then rank imported labs as curated donors or reference patterns
73
- 5. Apply donor-prune mutations on one working Cisco 9.0 donor lab
74
- 6. Validate workspace/runtime/scenario compatibility
75
- 7. Encode XML into a `.pkt` blob with `scripts/pkt_codec.py`
76
- 8. Save generated or edited output locally
77
-
78
- Open-first rules remain strict:
79
-
80
- - multi-source search and scoring is allowed
81
- - final `.pkt` apply is still single-donor
82
- - when no safe donor exists, return `blocking_gaps` plus a `blueprint_plan`
83
-
84
- ## Files
85
-
86
- - `scripts/pkt_builder.py`
87
- Builds Packet Tracer XML from a blueprint
88
- - `scripts/pkt_codec.py`
89
- Encodes and decodes the modern `.pkt` format
90
- - `scripts/generate_pkt.py`
91
- CLI entrypoint for generate/edit/decode/inventory/explain-plan
92
- - `scripts/intent_parser.py`
93
- Hybrid natural-language and mini-DSL parser
94
- - `scripts/pkt_editor.py`
95
- Existing `.pkt` inventory and mutation engine
96
- - `scripts/sample_catalog.py`
97
- Capability-tagged sample index and reference-pattern loader
98
- - `scripts/sample_selector.py`
99
- Sample ranking by capability, topology, trust level, and prototype eligibility
100
- - `scripts/packet_tracer_env.py`
101
- Resolves Packet Tracer install, saves root, and executable paths
102
- - `scripts/runtime_doctor.py`
103
- Unified runtime diagnostics for host OS, donor, Packet Tracer paths, and Twofish readiness
104
- - `templates/pt900/base_empty.xml`
105
- Base Packet Tracer 9.0 skeleton
106
- - `templates/pt900/device_library/*.xml`
107
- Secondary fallback device XML templates for the first supported device set
108
-
109
- The runtime builder currently prefers the installed FTP sample from the local
110
- Packet Tracer `saves/` directory. The exact path is resolved at runtime from
111
- the local Packet Tracer installation or the `PACKET_TRACER_*` environment
112
- variables.
113
-
114
- Prompt-driven donor-prune generation prefers an explicit
115
- `PACKET_TRACER_COMPAT_DONOR`, but it can also auto-detect a working local
116
- Packet Tracer 9.0 donor from common local locations when the environment
117
- override is absent.
118
-
119
- Strict compatibility rules:
120
-
121
- - keep `PACKET_TRACER_TARGET_VERSION` on `9.0.0.0810`
122
- - do not downgrade prompt generation to `5.3.0.0011`
123
- - do not use a legacy `5.3` donor/template fallback to bypass strict 9.0 mode
124
- - if the donor is missing, undecodable, or version-mismatched, stop with a
125
- blocking error instead of switching versions
126
- - if `PACKET_TRACER_COMPAT_DONOR` is explicitly set and wrong, do not silently
127
- fall back to another donor
128
- - every host process must inherit the same `PACKET_TRACER_*` and
129
- `PKT_TWOFISH_LIBRARY` environment variables; this is not host-specific
130
-
131
- ## Supported First Iteration
132
-
133
- - `Router`, `Switch`, `PC`, `Server`
134
- - `LightWeightAccessPoint` / `WirelessRouter` where sample prototypes exist
135
- - natural prompt planning for device counts, VLAN IDs, `gig` uplinks, `fa` host links,
136
- department/campus prompts, and default `chain` / `core switch` topologies
137
- - structured `blocking_gaps`, `assumptions_used`, and `confidence_score` reporting
138
- - transparent `explain-plan` output with:
139
- - `intent_plan`
140
- - `topology_plan`
141
- - `config_plan`
142
- - `estimate_plan`
143
- - `preflight_validation`
144
- - `autofix_summary`
145
- - `cisco_sample_candidates`
146
- - `curated_external_donor_candidates`
147
- - `external_reference_patterns`
148
- - `validation_report`
149
- - explicit port-to-port and cable/media mapping
150
- - VLAN create, access port, trunk port, native VLAN
151
- - router subinterfaces and router-on-a-stick
152
- - named ACL create, permit/deny rule injection, and `ip access-group` interface binding
153
- - router DHCP pool
154
- - server DHCP pool, DNS enablement, and DNS records
155
- - HTTP / HTTPS / FTP / TFTP / NTP service enable state
156
- - end-device DNS client settings
157
- - management VLAN SVI + default gateway
158
- - Telnet enablement on switches/routers via config mutations
159
- - wireless SSID/security/channel mutations
160
- - wireless client association and DHCP/static mode where compatible prototypes exist
161
- - existing `.pkt` inventory and edit flow
162
-
163
- ## Defaults
164
-
165
- If the user does not specify details:
166
-
167
- - Packet Tracer version: `9.0.0.0810`
168
- - Subnet: `192.168.1.0/24`
169
- - Default gateway: `192.168.1.1`
170
- - PC addresses: `.10`, `.11`, `.12`, ...
171
- - Layout:
172
- - router around `(400, 140)`
173
- - switch around `(400, 280)`
174
- - PCs along the bottom row
175
-
176
- ## Constraints
177
-
178
- - This skill currently plans for Packet Tracer 9.0 only
179
- - The builder currently depends on a local Packet Tracer installation with the bundled
180
- sample saves present
181
- - The bundled template library is intentionally minimal in v1
182
- - Imported external sample roots are reference-only unless you explicitly promote them
183
- - Prompt generation in the default path is donor-prune based, not full synthetic rebuild
184
- - If VLANs are requested for end hosts but host-to-VLAN distribution is not provided,
185
- the skill returns `blocking_gaps` instead of guessing and generating an unsafe `.pkt`
186
- - Manual validation in Packet Tracer is still required before claiming a topology
187
- is fully compatible with the Cisco application
188
-
189
- ## CLI Examples
190
-
191
- Generate from a blueprint file:
192
-
193
- ```powershell
194
- python scripts/generate_pkt.py --blueprint examples/blueprint_minimal.json --output output\minimal.pkt
195
- ```
196
-
197
- Generate from a hybrid prompt:
198
-
199
- ```powershell
200
- python scripts/generate_pkt.py --prompt "6 şöbəli şəbəkə qur, VLAN 10 20 30 40 50 60 və management VLAN 99 yarat" --output output\campus.pkt
201
- ```
202
-
203
- Explain the parsed plan before generation:
204
-
205
- ```powershell
206
- python scripts/generate_pkt.py --explain-plan "set SW1 vlan 10 name Finance; enable telnet on SW1 username admin password 1234"
207
- ```
208
-
209
- Explain a natural Azerbaijani prompt before generation:
210
-
211
- ```powershell
212
- python scripts/generate_pkt.py --explain-plan "3 dene switch ve 6 komputer ve 1 router vlanlarda 10,20,30 switchlerin oz aralarinda ve routerle aralarinda gig portuna qosulsun komputerler ise fa portlarla qosulsun"
213
- ```
214
-
215
- Inspect curated donor candidates from a local imported lab root:
216
-
217
- ```powershell
218
- python scripts/generate_pkt.py --explain-plan "6 şöbəli şəbəkə qur, hər şöbədə 1 switch 1 AP 1 printer 2 PC 2 tablet olsun" --donor-root C:\labs\curated-pkt-donors --reference-root C:\labs\external-pkt-samples
219
- ```
220
-
221
- Only external `9.0.0.0810` labs are promoted into the curated donor pool when
222
- their workspace validation passes cleanly, or when they are `legacy_uuid_physical`
223
- donors whose only logical warnings are repeated `MEM_ADDR` mismatch records.
224
-
225
- Search GitHub first, then auto-import matching repos into a local cache:
226
-
227
- ```powershell
228
- python scripts/generate_pkt.py --explain-plan "6 department campus with vlan dhcp dns ap" --search-remote --remote-provider github --import-cache-root output\remote-cache
229
- ```
230
-
231
- Print the aggregated capability matrix:
232
-
233
- ```powershell
234
- python scripts/generate_pkt.py --coverage-report
235
- python scripts/generate_pkt.py --coverage-report --device-family "access points"
236
- ```
237
-
238
- Inspect an existing `.pkt` inventory:
239
-
240
- ```powershell
241
- python scripts/generate_pkt.py --inventory input\lab.pkt
242
- python scripts/generate_pkt.py --inventory input\lab.pkt --inventory-capabilities
243
- ```
244
-
245
- Edit an existing `.pkt` directly from a prompt:
246
-
247
- ```powershell
248
- python scripts/generate_pkt.py --edit input\lab.pkt --prompt "set Wireless Router0 ssid FIN_WIFI security wpa2-psk passphrase fin12345 channel 6 associate PC0 to Wireless Router0 ssid FIN_WIFI dhcp" --output output\edited_lab.pkt --xml-out output\edited_lab.xml
249
- python scripts/generate_pkt.py --edit input\lab.pkt --prompt "enable dns on Server0 set Server0 dns A www.example.local 192.168.10.20 set PC0 dns 192.168.10.20" --output output\edited_services.pkt
250
- ```
251
-
252
- Decode a `.pkt` back to XML for inspection:
253
-
254
- ```powershell
255
- python scripts/generate_pkt.py --decode output\minimal.pkt --xml-out output\minimal.xml
256
- ```
257
-
258
- Launch Packet Tracer for a smoke open test:
259
-
260
- ```powershell
261
- python scripts/generate_pkt.py --validate-open output\minimal.pkt
262
- ```
1
+ ---
2
+ name: pkt
3
+ description: >
4
+ Create and edit Cisco Packet Tracer 9.0 `.pkt` files from hybrid natural-language
5
+ requests and explicit commands. Use this skill for topology generation, VLAN/router-on-a-stick,
6
+ DHCP, management VLAN, Telnet, wireless/AP-client setup, server services, and existing `.pkt` edits.
7
+ ---
8
+
9
+ # Cisco Packet Tracer 9.0 `.pkt` Hybrid Generator/Editor
10
+
11
+ This skill targets whichever Packet Tracer release is installed (detected at runtime,
12
+ 9.0 by default) and treats a `.pkt` file as a single binary blob, not a zip
13
+ container or folder tree.
14
+
15
+ The current builder/editor is Cisco-sample-centric:
16
+
17
+ - installed Packet Tracer sample saves are the primary prototype source
18
+ - bundled device templates are the secondary fallback for gaps such as missing
19
+ device families in Cisco's own saves
20
+ - imported external labs are reference-only by default
21
+ - curated external donor roots can become donor-eligible after validation, but
22
+ Cisco local donors still rank first
23
+
24
+ That is intentional: it avoids the invalid synthetic XML approach that Packet
25
+ Tracer rejects while still keeping the skill usable when Cisco's own sample set
26
+ does not cover a device family directly.
27
+
28
+ The prompt-first architecture now follows a planner/validator/autofix split:
29
+
30
+ 1. intent extraction
31
+ 2. topology/config planning
32
+ 3. donor ranking
33
+ 4. donor-prune mutation
34
+ 5. compatibility validation
35
+
36
+ Useful ideas from `MCP-Packet-Tracer` were adopted only at the architecture
37
+ level. PTBuilder live deploy and external donor usage were intentionally not
38
+ adopted.
39
+
40
+ ## How `.pkt` Files Work
41
+
42
+ For the modern format targeted by this skill, the pipeline is:
43
+
44
+ 1. Build a Packet Tracer XML document rooted at `<PACKETTRACER5>`
45
+ 2. qCompress the UTF-8 XML bytes using:
46
+ - 4-byte big-endian uncompressed length
47
+ - raw zlib payload
48
+ 3. Apply Stage-2 XOR obfuscation
49
+ 4. Encrypt with Twofish in EAX mode and append the 16-byte authentication tag
50
+ 5. Apply Stage-1 reverse/XOR obfuscation
51
+
52
+ The XML includes a `<VERSION>` value such as `9.0.0.0810`. This skill targets the
53
+ 9.0 line.
54
+
55
+ Packet Tracer 5.x and 6.x wrote a simpler container: qCompress output XORed
56
+ byte-wise with `(length - index)`, with no cipher and no tag. 18 of the 292
57
+ bundled samples are still in that format. `decode_pkt_auto` reads both and
58
+ reports which one matched.
59
+
60
+ Packet Tracer also writes raw control bytes into element text — a Cisco banner
61
+ delimiter is literally `banner motd `, which XML 1.0 forbids. Use
62
+ `parse_pkt_xml` / `serialize_pkt_xml` rather than `ET.fromstring` / `ET.tostring`
63
+ so those bytes survive a round trip.
64
+
65
+ The Twofish step needs no compiled binary. `scripts/vendor/twofish_pure.py` is a
66
+ vendored pure-Python implementation verified against the official Twofish test
67
+ vectors, so decode/edit/generate work on a clean checkout with no environment
68
+ variables. A compiled `_twofish` bridge is optional: when `PKT_TWOFISH_LIBRARY`
69
+ or `PKT_TWOFISH_SEARCH_ROOTS` resolves one, it is used automatically as a ~12x
70
+ accelerator for large labs.
71
+
72
+ ### Donor Version Compatibility
73
+
74
+ The build field in a `<VERSION>` string is not a schema identifier — it changes
75
+ on every point release and re-save. None of the 292 sample saves bundled with
76
+ Packet Tracer 9.0.0 carry `9.0.0.0810`; 48 are `9.0.0.x` with other builds and
77
+ the rest span 5.x through 8.x. Donors are therefore classified into tiers:
78
+
79
+ | Tier | Meaning |
80
+ |---|---|
81
+ | `exact` | build strings identical |
82
+ | `same_minor` | same `major.minor`, e.g. any `9.0.0.x` |
83
+ | `same_major` | same major, different minor |
84
+ | `upgradeable` | 6.x–8.x; Packet Tracer upgrades these on open |
85
+ | `incompatible` | 5.x and older |
86
+
87
+ `PACKET_TRACER_DONOR_POLICY` names the loosest acceptable tier. The default is
88
+ `same_minor`. When several donors qualify, the strictest tier wins.
89
+
90
+ The target version is **detected**, not hardcoded. Resolution order:
91
+ `PACKET_TRACER_TARGET_VERSION` the installed Packet Tracer's directory name →
92
+ the compatibility donor's own `<VERSION>` → the built-in default. Installing
93
+ Packet Tracer 8.2 makes the skill target 8.2 and accept 8.2.x donors; no
94
+ configuration is needed to follow a different release.
95
+
96
+ ## Workflow
97
+
98
+ 1. Parse the request into a hybrid intent plan:
99
+ - topology, device models, links, cable types, ports
100
+ - natural Azerbaijani or mixed-language counts such as `3 dene switch ve 6 komputer`
101
+ - department/campus prompts such as `6 sobeli kampus sebekesi`
102
+ - VLAN/trunk/access/router-on-a-stick intent
103
+ - router DHCP or server DHCP/DNS intent
104
+ - management VLAN / Telnet intent
105
+ - AP SSID/security and wireless client association intent
106
+ - existing `.pkt` edit operations when a source file is provided
107
+ 2. Build an intent-first topology/config plan:
108
+ - topology archetype
109
+ - device list
110
+ - port map
111
+ - VLAN/service/config plan
112
+ - assumptions and blocking gaps
113
+ 3. Rank Cisco local donor candidates with capability, topology, and donor-graph scoring
114
+ 4. Optionally search/import remote labs, then rank imported labs as curated donors or reference patterns
115
+ 5. Apply donor-prune mutations on one working Cisco 9.0 donor lab
116
+ 6. Validate workspace/runtime/scenario compatibility
117
+ 7. Encode XML into a `.pkt` blob with `scripts/pkt_codec.py`
118
+ 8. Save generated or edited output locally
119
+
120
+ Open-first rules remain strict:
121
+
122
+ - multi-source search and scoring is allowed
123
+ - final `.pkt` apply is still single-donor
124
+ - when no safe donor exists, return `blocking_gaps` plus a `blueprint_plan`
125
+
126
+ ## Files
127
+
128
+ - `scripts/pkt_builder.py`
129
+ Thin entrypoint: selects a sample and delegates to `pkt_transformer`
130
+ - `scripts/pkt_codec.py`
131
+ Encodes and decodes the modern `.pkt` format
132
+ - `scripts/vendor/twofish_pure.py`
133
+ Vendored pure-Python Twofish; the repo-local baseline engine
134
+ - `scripts/pkt_verify.py`
135
+ Two-tier verification: headless structural checks, plus a real Packet Tracer
136
+ open test that watches for the file's window
137
+ - `scripts/usage_ledger.py`
138
+ Local, gitignored record of which donors actually worked, fed back into donor
139
+ ranking so the skill improves with use
140
+ - `scripts/generate_pkt.py`
141
+ CLI entrypoint for generate/edit/decode/inventory/explain-plan
142
+ - `scripts/intent_parser.py`
143
+ Hybrid natural-language and mini-DSL parser
144
+ - `scripts/pkt_editor.py`
145
+ Existing `.pkt` inventory and mutation engine
146
+ - `scripts/sample_catalog.py`
147
+ Capability-tagged sample index and reference-pattern loader
148
+ - `scripts/sample_selector.py`
149
+ Sample ranking by capability, topology, trust level, and prototype eligibility
150
+ - `scripts/packet_tracer_env.py`
151
+ Resolves Packet Tracer install, saves root, and executable paths
152
+ - `scripts/runtime_doctor.py`
153
+ Unified runtime diagnostics for host OS, donor, Packet Tracer paths, and Twofish readiness
154
+ - `templates/pt900/base_empty.xml`
155
+ Base Packet Tracer 9.0 skeleton
156
+ - `templates/pt900/device_library/*.xml`
157
+ Secondary fallback device XML templates for the first supported device set
158
+
159
+ The runtime builder currently prefers the installed FTP sample from the local
160
+ Packet Tracer `saves/` directory. The exact path is resolved at runtime from
161
+ the local Packet Tracer installation or the `PACKET_TRACER_*` environment
162
+ variables.
163
+
164
+ Prompt-driven donor-prune generation prefers an explicit
165
+ `PACKET_TRACER_COMPAT_DONOR`, but it can also auto-detect a working local
166
+ Packet Tracer 9.0 donor from common local locations when the environment
167
+ override is absent.
168
+
169
+ Strict compatibility rules:
170
+
171
+ - the target version is detected from the install; override with `PACKET_TRACER_TARGET_VERSION` only when you need to pin it
172
+ - never accept a `5.x` donor; Packet Tracer does not reliably upgrade those
173
+ - the donor tier that was accepted is recorded in `compatibility_tier` and
174
+ reported as an assumption, never hidden
175
+ - if the donor is missing, undecodable, or below the active policy tier, stop
176
+ with a blocking error that names the tier and the policy needed to accept it
177
+ - if `PACKET_TRACER_COMPAT_DONOR` is explicitly set and rejected, do not silently
178
+ fall back to another donor
179
+ - `PACKET_TRACER_*` variables must be inherited by every host process;
180
+ `PKT_TWOFISH_*` is optional and only selects the compiled accelerator
181
+
182
+ ## Supported First Iteration
183
+
184
+ - `Router`, `Switch`, `PC`, `Server`
185
+ - `LightWeightAccessPoint` / `WirelessRouter` where sample prototypes exist
186
+ - natural prompt planning for device counts, VLAN IDs, `gig` uplinks, `fa` host links,
187
+ department/campus prompts, and default `chain` / `core switch` topologies
188
+ - structured `blocking_gaps`, `assumptions_used`, and `confidence_score` reporting
189
+ - transparent `explain-plan` output with:
190
+ - `intent_plan`
191
+ - `topology_plan`
192
+ - `config_plan`
193
+ - `estimate_plan`
194
+ - `preflight_validation`
195
+ - `autofix_summary`
196
+ - `cisco_sample_candidates`
197
+ - `curated_external_donor_candidates`
198
+ - `external_reference_patterns`
199
+ - `validation_report`
200
+ - explicit port-to-port and cable/media mapping
201
+ - VLAN create, access port, trunk port, native VLAN
202
+ - router subinterfaces and router-on-a-stick
203
+ - named ACL create, permit/deny rule injection, and `ip access-group` interface binding
204
+ - router DHCP pool
205
+ - server DHCP pool, DNS enablement, and DNS records
206
+ - HTTP / HTTPS / FTP / TFTP / NTP service enable state
207
+ - end-device DNS client settings
208
+ - management VLAN SVI + default gateway
209
+ - Telnet enablement on switches/routers via config mutations
210
+ - wireless SSID/security/channel mutations
211
+ - wireless client association and DHCP/static mode where compatible prototypes exist
212
+ - existing `.pkt` inventory and edit flow
213
+
214
+ ## Defaults
215
+
216
+ If the user does not specify details:
217
+
218
+ - Packet Tracer version: `9.0.0.0810`
219
+ - Subnet: `192.168.1.0/24`
220
+ - Default gateway: `192.168.1.1`
221
+ - PC addresses: `.10`, `.11`, `.12`, ...
222
+ - Layout:
223
+ - router around `(400, 140)`
224
+ - switch around `(400, 280)`
225
+ - PCs along the bottom row
226
+
227
+ ## Constraints
228
+
229
+ - The builder depends on a local Packet Tracer installation with the bundled
230
+ sample saves present, on any of Windows, macOS or Linux
231
+ - Donor devices the plan does not need are deleted. `PACKET_TRACER_SPARE_STRATEGY=park`
232
+ restores the older behaviour of renaming them `UNUSED-*` / `*-SPARE-*` and
233
+ moving them offscreen, if a donor turns out to depend on one staying present
234
+ - `--validate-open` needs Packet Tracer installed. Everything else — decode,
235
+ inventory, edit, generate, structural verification — does not
236
+ - The bundled template library is intentionally minimal in v1
237
+ - Imported external sample roots are reference-only unless you explicitly promote them
238
+ - Prompt generation in the default path is donor-prune based, not full synthetic rebuild
239
+ - Host-to-VLAN distribution is defaulted to an even split when not given, and the
240
+ split is reported as an assumption. `PACKET_TRACER_STRICT_VLAN_ASSIGNMENT=1`
241
+ refuses instead
242
+ - Links the donor lacks are built rather than refused. `PACKET_TRACER_LINK_STRATEGY=reuse`
243
+ restricts generation to the donor's own topology
244
+ - Manual validation in Packet Tracer is still required before claiming a topology
245
+ is fully compatible with the Cisco application
246
+
247
+ ## CLI Examples
248
+
249
+ Generate from a blueprint file:
250
+
251
+ ```powershell
252
+ python scripts/generate_pkt.py --blueprint examples/blueprint_minimal.json --output output\minimal.pkt
253
+ ```
254
+
255
+ Generate from a hybrid prompt:
256
+
257
+ ```powershell
258
+ python scripts/generate_pkt.py --prompt "6 şöbəli şəbəkə qur, VLAN 10 20 30 40 50 60 və management VLAN 99 yarat" --output output\campus.pkt
259
+ ```
260
+
261
+ Explain the parsed plan before generation:
262
+
263
+ ```powershell
264
+ python scripts/generate_pkt.py --explain-plan "set SW1 vlan 10 name Finance; enable telnet on SW1 username admin password 1234"
265
+ ```
266
+
267
+ Explain a natural Azerbaijani prompt before generation:
268
+
269
+ ```powershell
270
+ python scripts/generate_pkt.py --explain-plan "3 dene switch ve 6 komputer ve 1 router vlanlarda 10,20,30 switchlerin oz aralarinda ve routerle aralarinda gig portuna qosulsun komputerler ise fa portlarla qosulsun"
271
+ ```
272
+
273
+ Inspect curated donor candidates from a local imported lab root:
274
+
275
+ ```powershell
276
+ python scripts/generate_pkt.py --explain-plan "6 şöbəli şəbəkə qur, hər şöbədə 1 switch 1 AP 1 printer 2 PC 2 tablet olsun" --donor-root C:\labs\curated-pkt-donors --reference-root C:\labs\external-pkt-samples
277
+ ```
278
+
279
+ Only external `9.0.0.0810` labs are promoted into the curated donor pool when
280
+ their workspace validation passes cleanly, or when they are `legacy_uuid_physical`
281
+ donors whose only logical warnings are repeated `MEM_ADDR` mismatch records.
282
+
283
+ Search GitHub first, then auto-import matching repos into a local cache:
284
+
285
+ ```powershell
286
+ python scripts/generate_pkt.py --explain-plan "6 department campus with vlan dhcp dns ap" --search-remote --remote-provider github --import-cache-root output\remote-cache
287
+ ```
288
+
289
+ Print the aggregated capability matrix:
290
+
291
+ ```powershell
292
+ python scripts/generate_pkt.py --coverage-report
293
+ python scripts/generate_pkt.py --coverage-report --device-family "access points"
294
+ ```
295
+
296
+ Inspect an existing `.pkt` inventory:
297
+
298
+ ```powershell
299
+ python scripts/generate_pkt.py --inventory input\lab.pkt
300
+ python scripts/generate_pkt.py --inventory input\lab.pkt --inventory-capabilities
301
+ ```
302
+
303
+ Edit an existing `.pkt` directly from a prompt:
304
+
305
+ ```powershell
306
+ python scripts/generate_pkt.py --edit input\lab.pkt --prompt "set Wireless Router0 ssid FIN_WIFI security wpa2-psk passphrase fin12345 channel 6 associate PC0 to Wireless Router0 ssid FIN_WIFI dhcp" --output output\edited_lab.pkt --xml-out output\edited_lab.xml
307
+ python scripts/generate_pkt.py --edit input\lab.pkt --prompt "enable dns on Server0 set Server0 dns A www.example.local 192.168.10.20 set PC0 dns 192.168.10.20" --output output\edited_services.pkt
308
+ ```
309
+
310
+ Decode a `.pkt` back to XML for inspection:
311
+
312
+ ```powershell
313
+ python scripts/generate_pkt.py --decode output\minimal.pkt --xml-out output\minimal.xml
314
+ ```
315
+
316
+ Verify a generated file. The structural tier is headless; `--open` launches
317
+ Packet Tracer and waits until the file's own window appears:
318
+
319
+ ```powershell
320
+ python scripts/pkt_verify.py output\minimal.pkt
321
+ python scripts/pkt_verify.py output\minimal.pkt --open
322
+ python scripts/generate_pkt.py --validate-open output\minimal.pkt
323
+ ```
324
+
325
+ A file that fails the structural tier is never handed to Packet Tracer.
326
+
327
+ Inspect what the skill has learned from previous runs:
328
+
329
+ ```powershell
330
+ python scripts/usage_ledger.py
331
+ ```
332
+
333
+ Learning is local and on by default. Prompts are stored only as a non-reversible
334
+ fingerprint, the ledger lives under gitignored `output/`, and it is never
335
+ committed or packaged. Set `PKT_USAGE_LEDGER=off` to disable it, or point it at
336
+ another path. Deleting the ledger changes results in no way except donor
337
+ ordering.