Final Report — April 2026

FiberCAD

Automated fiber network planning engine. From a bounding box to a permit-ready design in seconds — with cryptographic integrity, Lumos V6 compliance, and zero manual CAD work.

58Python Files
12,668Lines of Code
393Tests Passing
58Commits
460Buildings Planned

1. Executive Summary

What FiberCAD is, what it does, and what the demo proves.

FiberCAD is a Python engine that takes a geographic bounding box and produces a complete fiber-to-the-home (FTTH) network design: boundary groups, splitter trees, conduit routing, equipment placement, compliance validation, DXF drawings, interactive HTML reports, and BOM workbooks.


Every output layer is cryptographically signed with Ed25519 and chained — a standalone verifier with zero FiberCAD dependencies can validate the entire provenance chain from input through compliance.

Demo Pipeline Result

Bounding Box
460 Buildings
36 Roads
14 Boundary Groups
70 Splitters
7,886 ft Conduit
35 Handholes
PASS
18 rules checked

Input: -79.835, 36.068, -79.825, 36.075 (Hampton Heights, Greensboro NC). Output: 6 artifacts including permit-ready DXF, interactive map, and 5-sheet BOM workbook.

2. System Architecture

Microkernel design with layered data architecture and tools-first LLM integration.

Module Map

fibercad/
  cli.py              CLI entry point — bbox to artifacts
  kernel/             Microkernel: config, project container, errors
  model/              Domain model: dataclasses for equipment, conduit, splitters
  ingest/             OSM/Overpass, CSV, GeoJSON, Shapefile import
  planning/
    boundary.py       Geographic clustering into boundary groups
    splitters.py      1x8 / 1x4 two-stage splitter hierarchy
    routing.py        MST conduit routing along road network
    optimizer.py      Pass-through elimination, conduit dedup
    fiber_assign.py   LLD strand assignment (tube/fiber colors)
    service.py        Full L0 → L4 orchestration pipeline
  rules/
    profiles/         Pluggable standards (Lumos V6, generic)
    client_rules.py   13 source-tagged rules with phase builders
    registry.py       Profile registration and lookup
  output/
    fiberjson.py      Layered schema + integrity signing
    dxf_writer.py     AutoCAD DXF with 33 real Lumos blocks
    html_report.py    Leaflet map with layer controls
    workbook.py       5-sheet BOM Excel workbook
    validation_report.py   Human-readable compliance report
  tools/              7 MCP-compatible baremetal tools
  llm/                Claude agent + multi-round QA
  verify/             Standalone integrity chain verifier
  assets/blocks/      33 DXF block definitions from Lumos template
  

Layered Data Architecture

LayerNameContentAlgorithm
L0InputBounding box / address list
L1GIS460 buildings, 36 roads from OSMOverpass QL
L2Topology14 boundary groups, 70 splittersdistributed_split/1.0.0
L3Physical35 handholes, 23 conduit, 14 splicesMST routing + optimizer
L4Compliance18 rules, PASS (0 errors, 19 warnings)Lumos V6 profile
L5ArtifactsDXF, HTML, BOM, validation reportRendering pipeline

Key Design Decisions

Microkernel Architecture

Config, errors, and project container live in kernel/. Every other module depends only on the kernel and model — never on each other. This keeps the dependency graph acyclic and each module independently testable.

Tools-First LLM Integration

The LLM never processes raw geometry. 7 baremetal tools expose pre-computed summaries — reducing tokens by 94% compared to sending GeoJSON. LLM suggestions are ephemeral and never written to signed layers.

Integrity Chain

Every layer is SHA-256 hashed and Ed25519 signed. Each layer’s provenance points to the previous layer’s hash. A standalone verifier (zero FiberCAD dependencies) can validate the full chain.

Pluggable Standards

Rules are defined in profile classes (LumosV6Profile, GenericProfile). New ISPs can register custom profiles via register_profile(). Rules are executed per-phase, not monolithically.

3. What Was Built

Complete feature inventory — every capability in the engine.

Planning Engine
Full L0→L4 pipeline: ingest, cluster, place, route, validate. One function call from bbox to compliance report.
Rules Engine (18 rules)
Lumos V6 standards: max drops, run length, spare ports, splitter separation, bend rule, handhole sizing, centralized placement, cul-de-sac routing.
Integrity Chain
Ed25519 signatures, SHA-256 content hashes, provenance links between layers, standalone verifier with zero dependencies.
MCP Tools (7)
project_summary, design_stats, validate_design, validate_element, measure_distance, count_in_area, verify_chain.
LLM Agent
Claude tool_use integration with fallback mode. Never sees raw geometry — works through 7 baremetal tools for 94% token reduction.
Design Optimizer
Pass-through handhole elimination, conduit deduplication, footage reduction. Runs automatically after physical layout.
Fiber Assignment (LLD)
Tube/fiber color assignment, numbering from back of cable, cable naming per Lumos convention.
DXF Output
AutoCAD-compatible DXF with 33 real Lumos blocks, 81 layers, 23 text styles. Paper space layout with title block and viewport.
HTML Map Report
Interactive Leaflet map with 3 basemaps (street, satellite, dark), layer controls, building popups, BOM table, network graph.
BOM Workbook
5-sheet Excel: Summary, Equipment, Conduit, Boundary Groups, Addresses. Styled with openpyxl.
Spatial Index
STRtree wrapper for O(log n) nearest-neighbor and bounding box queries. Used by splitter placement and routing.
Circuit Breaker
Closed/Open/HalfOpen states per endpoint with registry. Protects OSM/Overpass calls from cascade failure.
Security Module
Path sanitization, prompt injection defense, secret redaction for all LLM-facing content.
Client Rules (13)
Source-tagged rules from Lumos V6 docs, training videos, and mattganzak/cad. Phase-based builders for LLM prompt injection.
Multi-Round QA
4-round themed review: coverage, annotation, design, sheet. Each round uses focused rule bundles.
Pluggable Profiles
BaseProfile ABC, LumosV6Profile, GenericProfile. register_profile() API for ISP-specific rule sets.
GeoJSON/Shapefile Import
--geojson CLI flag. Fiona fallback for Shapefile. Auto-detects coordinate reference system.
Cul-de-sac Detection
Dead-end identification in road graph + routing sanity check. Prevents orphaned conduit runs.

4. Rules Engine

18 structural rules from Lumos V6 standards + 13 client rules for LLM guidance.

Structural Validation Rules (Profile-Based)

Rule IDDescriptionSourceSeverity
LUMOS-18-MAX-DROPSNo conduit segment may have more than 6 dropsLumos V6 Drafting Standardserror
LUMOS-18-MAX-RUN-LENGTHConduit run ≤ 650 ft absolute maximumLumos V6 Drafting Standardserror
LUMOS-18-MAX-RUN-LENGTH-SOFTConduit run ≤ 500 ft preferred maximumLumos V6 Drafting Standardswarning
LUMOS-13.1-SPARE-PORTS1x8 splitter must retain ≥ 2 spare portsLumos V6 §13.1error
LUMOS-13.2-SPLITTER-SEPARATIONSplitters in same group ≥ 50 ft apartLumos V6 §13.2warning
LUMOS-18-BEND-RULEAt bends: at least one adjacent segment ≤ 150 ftTraining Video Corpuswarning
LUMOS-13.2-CENTRALIZEDSplitter placement must be distributed, not centralizedLumos V6 §13.2warning
LUMOS-13.2-MAX-PER-HHNo more than 2 splitters per handholeLumos V6 §13.2error
LUMOS-12-HH-SIZINGHandhole type matches splice/splitter loadLumos V6 §12warning
LUMOS-12-HH-SIZING-3WAYThree-way splices require SM or MED handholeLumos V6 §12warning

Client Rules (LLM Prompt Injection)

Rule IDSectionPhase TagsSource
LUMOS_EXPAND_WORKFLOWOSP sequenceexpandPermit Design Steps
LUMOS_JSON_TOPOLOGYTopology / coveragejsonDrafting V6
LUMOS_JSON_HARD_RULESCivil / conduitjsonDrafting V6
LUMOS_JSON_TEXTText / annotationjsonDrafting V6
LUMOS_JSON_FIBERFiber / splices / TO COjsonDrafting V6
LUMOS_JSON_SPLITTERSBoundary groups / calloutsjsonDrafting V6
LUMOS_JSON_MATCH_TITLEMatchlines / projectjsonDrafting V6
LUMOS_JSON_REFERENCEGIS / KMZjsonV5
LUMOS_JSON_SELF_CHECKPre-output checklistjsonQC Process
LUMOS_QA_COVERAGE_STREETSStreet vs conduitqa_coverageQC Permit
LUMOS_QA_ANNOTATION_PDFAnnotation / PDF-styleqa_annotationDrafting V6
LUMOS_QA_DESIGN_RULESConstructabilityqa_designDrafting V6
LUMOS_QA_SHEET_PROJECTMatchlines & project blockqa_sheetDrafting V6

5. Prior Art Integration

What was adopted from mattganzak/cad and training video analysis.

Lumos Permit Digest

Structured prompts from the mattganzak/cad permit pipeline injected into LLM review context. Provides ISP-specific framing for Claude’s design review.

Client Rules Registry

13 source-tagged rules extracted from drafting standards and QC process. Phase-tagged for selective injection into expand, JSON, and QA phases.

JSON Validator

LLM output normalization adapted from mattganzak/cad. Strips markdown fences, repairs trailing commas, validates JSON structure before processing.

Multi-Round Themed QA

4-pass review sequence (coverage → annotation → design → sheet) inspired by mattganzak/cad QC workflow. Each pass uses focused rule bundles.

Training Video Corpus

Domain knowledge base extracted from Lumos training videos: OSP workflow sequence, drafting conventions, common QC failure patterns.

6. Output Artifacts

Every file the engine produces, from CAD drawings to compliance reports.

FileFormatDescriptionSize
L0_input.fiberjsonJSONSigned input layer: bounding box, project metadata
L1_gis.fiberjsonJSONGIS enrichment: 460 buildings, 36 roads from OSM
L2_topology.fiberjsonJSONNetwork topology: 14 boundary groups, 70 splitters
L3_physical.fiberjsonJSONPhysical design: 35 handholes, 23 conduit, 14 splices
L4_compliance.fiberjsonJSONValidation result: PASS, 0 errors, 19 warnings
design.dxfDXFAutoCAD drawing with 33 Lumos blocks, paper space layout275 KB
design_simple.dxfDXFSimplified DXF (no blocks) for compatibility251 KB
report.htmlHTMLInteractive Leaflet map + BOM + network graph216 KB
bom.xlsxXLSX5-sheet BOM workbook: Summary, Equipment, Conduit, BGs, Addresses25 KB
validation.txtTextHuman-readable compliance report with rule citations4 KB
dxf_viewer.htmlHTMLSVG-based DXF preview with pan/zoom and layer list5.7 MB

7. Test Coverage

393 tests across 26 test files, all passing in 2.16 seconds.

Test FileModule Covered
test_boundary_groups.pyGeographic clustering algorithm
test_circuit_breaker.pyCircuit breaker state machine
test_client_rules.pyClient rule registry and builders
test_elements.pyDomain model dataclasses
test_fiber_assignment.pyLLD fiber strand assignment
test_fiberjson.pyLayered schema serialization
test_geojson_import.pyGeoJSON/Shapefile import
test_geometry.pyHaversine, snap, centroid, bbox
test_ingest.pyOSM/Overpass/CSV ingest
test_integration.pyEnd-to-end pipeline integration
test_integrity.pyEd25519 signing and verification
test_json_validator.pyLLM output normalization
test_kernel.pyKernel config and project container
test_llm.pyLLM agent and tool dispatch
test_network.pyRoad network graph and Dijkstra
test_optimizer.pyDesign optimizer passes
test_plan_utils.pyPlanning utility functions
test_profiles.pyPluggable standards profiles
test_resilience.pyRate limiter and checkpoint/resume
test_routing.pyMST conduit routing
test_rules.pyValidation rule execution
test_security.pyPath sanitization, prompt injection
test_spatial_index.pySTRtree spatial queries
test_splitter_placement.py1x8/1x4 splitter hierarchy
test_tools.pyMCP tool registry and dispatch
test_workbook.pyBOM Excel workbook generation

8. Timeline

What was built and when — from scaffold to production-ready engine.

Day 1 — Foundation
Design spec, scaffold, kernel, model, geometry
Project structure, domain model dataclasses, haversine/snap/centroid utilities, road network graph with Dijkstra.
Day 2 — Core Pipeline
FiberJSON, boundary groups, OSM ingest, splitters, routing
Layered schema with integrity hashes, boundary group clustering, OSM/CSV import, 1x8/1x4 splitter placement, MST conduit routing.
Day 3 — MVP Complete
Rules engine, planning service, DXF, HTML report, CLI
Lumos V6 rules profile, full L0→L4 orchestration, AutoCAD DXF output, Leaflet HTML report, CLI entry point, end-to-end integration tests.
Week 1 — Hardening
Additional rules, security, Ed25519, BOM, MCP tools
Splitter separation, bend rule, handhole sizing. Security module. Ed25519 integrity chain with standalone verifier. BOM workbook. 7 MCP-compatible baremetal tools.
Week 1 — LLM Layer
LLM agent, resilience, enhanced HTML, real DXF blocks
Claude tool_use agent with fallback. Token bucket rate limiter. Tabbed HTML report with satellite basemap. 33 real Lumos blocks extracted from template DWG.
Week 2 — Production
Prior art, client rules, optimizer, fiber assignment, spatial index
mattganzak/cad adoption (permit digest, client rules, JSON validator, themed QA). Design optimizer. LLD fiber strand assignment. STRtree spatial index. Pluggable standards profiles.
FiberCAD — Built April 2026 — 60+ files, 12,668 lines, 393 tests