SmartInventory 3.0 — Customer Forks Analysis
Purpose: Characterize what the per-customer forks of the legacy product actually contain, and distill the configurability requirements the new Lepton Infrastructure Cloud must ship so that no customer ever needs a code fork again.
Method: A branch-taxonomy scout over all ~1,626 branches produced a customer roster; seven read-only deep-dive agents then profiled the live, materially-diverged forks via git diff/git show against origin/develop (no checkouts). The BharatNet/NCC/HFCL set was analyzed as one family (they are one trunk + per-state snapshots). Companion docs: SmartInventory_Legacy_Architecture_Study.md, SmartInventory_Product_Specification.md, SmartInventory_Gaps_and_Improvement_Analysis.md.
Date: 2026-06-16. Caveat: Real domain logic lives in PostgreSQL fn_* procs whose bodies are not in the repo; migration scripts are partial (deployed via an out-of-repo “Deployment Manager”). Branch state is the source of truth only for application code, not the live DB.
1. Headline findings
-
The branch count is a mirage. Of ~1,626 branches, >85% are generic feature/personal/release branches. There are ~19 real customers, and only ~11 live + materially diverged. The rest are abandoned (often 0–2 commits genuinely ahead of
develop). -
“Branch-per-customer” massively overstates the real fork surface. The biggest “family” — BharatNet + NCC (MP/UK/Uttarakhand/NER2) + HFCL Punjab — is effectively ONE fork (
develop-bharatnettrunk) plus near-identical per-state release snapshots that each add only 3–50 unique commits. So six “customer branches” ≈ one customer codebase. -
Forks fall on a spectrum from pure-config to deep-domain, but almost all of it is config-shaped: every deep-dive concluded the fork would collapse to runtime configuration on a properly designed multi-tenant platform — with only a handful of genuinely custom pieces (railtrack-corridor routing, an FTP storage pipeline, some OFN planning maths).
-
Two platform primitives would eliminate the overwhelming majority of all forking:
- (A) A runtime custom-entity / dynamic-form / attribute-schema builder. Every substantial fork adds entity types (ACT: CX/GX; Airtel: HUB/SubBox/EndBox/CSA/DSA/SubArea; RailTel: railway POP model; Dialog: PEP + Tower→Site; BharatNet: Depth/RedLine + FDC/FPOI/GP roles). ACT went so far as to rebuild the dynamic-form engine themselves — proof customers will pay enormous cost to get this if the platform lacks it.
- (B) A declarative integration/connector framework. Airtel’s ZTE+Huawei+ESB+OID+OPSWAT (~46k lines), RailTel’s OSS/NMS sync + dual IdP, Dialog’s MIFE+SAP+Azure+FCM are all “configure a provider,” yet today are bespoke forked code.
-
Most fork volume isn’t customization at all — it’s (a) generic bugfixes staged on customer branches instead of
develop(Syokinet), (b) removal of half-finished generic POCs (IshaniTech, Airtel both delete the old PM-Tools integration), and (c) carried-along trunk churn from stale merge-bases. The process is as much the problem as the architecture. -
Recurring, serious security leakage across forks (see §5): committed cloud service-account keys (Dialog FCM, NCC_MP GCS), plaintext DB/SFTP creds in every branch’s config, an
[AllowAnonymous]splicing dashboard (Dialog), commented-out[Authorize](Airtel ESB) — on top of the mainline backdoors/hardcoded-AES found in the gaps analysis. -
Three candidate vertical accelerators emerge from the forks: a BharatNet government survey/HOTO/acceptance vertical, an OFN/backbone planning capability (Dialog), and a vendor-EMS reconciliation capability (Airtel ZTE/Huawei).
2. Customer roster & coverage
| Customer | Identity | Canonical ref | Divergence (files / +ins) | Ahead/Behind | Deep-dived? |
|---|---|---|---|---|---|
| BharatNet | Govt of India rural broadband | develop-bharatnet | 1052 / +157k | 1378 / 166 | ✅ (family) |
| NCC (MP/UK/Uttarakhand/NER2) | NCC Ltd — BharatNet state EPC | hotfix-NCC_MP-Prod-8.28.2_1 etc. | up to 1113 / +164k | up to 1428 / 166 | ✅ (family) |
| HFCL Punjab | HFCL — BharatNet Punjab EPC | hotfix-HFCL_Punjab-Prod-8.27.2 | 993 / +145k | 1250 / 166 | ✅ (family) |
| Dialog | Dialog Axiata — Sri Lanka telco | develop-dailog-new | 1590 / +257k | 1131 / 866 | ✅ |
| ACT | ACT Fibernet — Bengaluru ISP | develop-ACT | 451 / +98k | 648 / 4 | ✅ |
| RailTel | RailTel — Indian Railways PSU | develop-Railtel | 348 / +45k | 294 / 40 | ✅ |
| Airtel (Africa) | Bharti Airtel — Nigeria FTTH/FWA | develop-airtel | 319 / +46k | 150 / 44 | ✅ |
| IshaniTech | Integrator partner, India | develop-IshaniTech | 110 / +4k | 53 / 40 | ✅ |
| Syokinet/Yyoki | FTTH ISP, Kenya | develop-syokinet-new | 38 / +1.7k | 45 / 4 | ✅ |
| TeraSoft | Integrator | TeraSoft-Prod-8.18.2-hotfix | 512 / +15k | 210 / 166 | ⏸ frozen mid-2025 |
| RVNL UPE/UPW | Rail Vikas Nigam — railway PSU | RVNL_UPE-Prod-8.18.4-hotfix | ~530 / +30k | ~300 / 166 | ⏸ frozen mid-2025 |
| Wefolg | OSS-integration, Africa | Wefolg_8.13.7.2_Drop2 | 485 / +26k | 30 / 310 | ❌ abandoned Jan-2025 |
| Safaricom | Kenya telco | develop-safaricom | 1879 / +165k | 172 / 1656 | ❌ abandoned Mar-2024 |
| Vodafone Idea (Vi) | India telco | release-vi-v8.8.9 | 1346 / +66k | 2 / 1461 | ❌ abandoned May-2024 |
| Bahon | ISP, Bangladesh | bahon_issues_develop_prod | 568 / +33k | 0 / 411 | ❌ superseded |
| VGG / AsiaFibernet / Airlink / Onitel | Misc ISPs | various | small | ~0–2 ahead | ❌ trivial/dead |
| SpaceWorld / Microscan / Jhansi-Railway | ISP / integrator / railway POC | various | recent commits on old base | far behind | ❌ borderline, low-value |
Deep-dived: the 7 live forks above. Abandoned/frozen customers were intentionally skipped (no silent omission) — their forks predate large develop evolution and carry little unique live value; revisit only if a specific customer re-activates.
3. Per-customer fork profiles (condensed)
3.1 Syokinet / Yyoki (Kenya) — minimum viable customization
- Adds: nothing structural. 4 layers hidden (
layer_details.isvisible=false), 2 ROW report-column labels, one action disabled, a DB name + map path inWeb.config, an integration toggle re-enabled, and ROW-authority reference data (Indian municipality names — likely copy-paste cruft). - The rest of its +1.7k lines are genuine bugfixes (splicing port status, microduct
no_of_wayspersistence, PDF null-guards) that belong ondevelop. - Config verdict: tenant-distinguishing surface is 100% config. The fork exists mainly as a bugfix staging branch.
3.2 IshaniTech (India integrator) — light, mostly re-use + removal
- Adds: re-mounts the existing additional-attributes/dynamic-form tab onto more entities; cable bulk-update with an “acquire-from” rule; a per-request serviceability
buffer/entity_type; a 2FA ticket approval (already gated by aglobal_settingsflag). Most line-delta is deleting the generic PM-Tools POC + whitespace churn. - Only genuinely custom code: an FTP dual-storage file pipeline (~850 lines) with a hardcoded SHAPE/TAB/DXF/KML folder taxonomy.
- Config verdict: ~all config except the storage pipeline → storage backend must be a config-selectable provider (local/FTP/S3).
3.3 Syokinet & IshaniTech together establish the floor: a well-designed platform reduces a customer to config + upstreamed bugfixes.
3.4 RailTel (Indian Railways PSU) — deep domain + OSS/NMS
- Custom model: railway POP attribute set (~40 cols: zone/division/circle/station, DG/battery/AC power inventory, rack & equipment counts) via an
IRailtelAttributemixin; railtrack-following fiber routing (fn_get_nearest_railtrackroute, pgRouting along track ROW, buffer setting); a project/work-order traceability layer (activity_id/project_id/planning_id/workorder_id) threaded through 9 asset tables; a built-out FiberLink circuit layer (dark fiber/bandwidth/DWDM). - Integrations: two IdPs — Authentik (OIDC) for app/mobile login, Keycloak for machine-to-machine; an OSS/NMS sync ETL (
NelLocationToTempPod, ~2,900 lines) pulling from RailTel NOC APIs intooss_*staging then merging;NMSIntegrationControllerexposing topology to RailTel’s NMS. reCAPTCHA (present, commented out). - Config verdict: ~90% absorbable (custom-attribute builder, FiberLink-as-core, pluggable OIDC, OSS-connector framework, report builder, managed migrations). Genuinely custom: railtrack-corridor routing — which generalizes to a pluggable “snap-to-linear-reference” routing strategy (rail/road/utility corridor).
3.5 ACT (Bengaluru ISP) — the customer rebuilt the platform’s missing primitive
- Custom model: two new entity types CX/GX (full
att_details_*/item_template_*/views/BL/DA scaffold);layer_detailsextended withis_dynamic_attribute_enable/dynamic_attribute_table. - Centerpiece: ACT replaced the hardcoded per-entity Razor forms with a runtime EAV dynamic-form platform — a 5-table attribute stack (
osp_attribute_def/_value/_section_config/_dependency+ equipment parallel), a 5,591-lineBLOSPDynamicFormengine, a generic_AddOSPDynamic.cshtmlrenderer for ~20 entity types, and two new Admin config UIs (OSP-CFG/EQP-CFGmodule trees) to add/hide fields at runtime. Plus a naming-nomenclature engine (configurable patterns, geometry-driven region resolution, auto-ID generation) and auto-generated wide report views (trigger rebuilds view on attribute-def change). - Also: a 9,186-line
MobileFormController+ 5,687-line POP room/rack visual editor — a full webview mobile field-ops app (GPS/QR/photo/offline cache). - Config verdict: ACT’s 648-commit divergence is overwhelmingly what a configurable platform absorbs natively. Lesson: ship the custom-entity/dynamic-form builder as a first-class primitive, or customers rebuild it at huge cost.
3.6 BharatNet / NCC / HFCL family — one fork + per-state snapshots = a vertical
- Structure: a linear chain off the
develop-bharatnettrunk; per-state members (UK/NER2/Uttarakhand/MP/Punjab) add only 3–50 unique commits. The 100k+ shared delta is the real artifact. - Shared delta = a BharatNet government survey/acceptance vertical: an ~8,800-line
SurveyReportController(Survey/HOTO/Optical-HOTO/Route-HOTO/L14/SLD/BOQ/DGPS/MB-Sheet acceptance reports with government fields), offline field-survey APIs, newDepth/RedLineentities, BharatNet domain roles (FDC/FPOI/RI/GP/CPE) overlaid on generic tables, region-templated reports (_MP/_UK/_UPEmethod proliferation +Excel-UK/L14-PDF-UKmodule flags), per-circle DB connections, pgRouting auto-planning. - Per-member unique (tiny): Uttarakhand = central-SSO token format; HFCL = RTK-GPS base-station pooling; NCC_MP = a pluggable storage abstraction (GCS/NAS/FTP/Local — with a committed GCS key); NER2 = the RedLine entity.
- Config verdict: collapses to zero forks with (1) custom-entity builder, (2) report-template builder with per-region definitions as data, (3) per-tenant config (DB/endpoints/storage/auth/flags). The survey/HOTO delta is a strong packaged “BharatNet accelerator” candidate.
3.7 Dialog (Sri Lanka telco) — core refactor + OFN planning, deep proc logic
- Custom model: Tower→Site/CO refactor (
att_details_podextended with SL telco/admin columns: province/district/depot/ds_division/tx_type/technology/ring/solution_type…); new PEP entity; many domain tables (backbone_plan_*,site_award_details,core_planner_*,ring_details,top_routes). - Features: BackBone Planning, Core Planner, Common Path Finder, Ring Topology/SLD, Site Awarding + item-vendor costing, an
[AllowAnonymous]Splicing Monitoring Dashboard. Pervasive province/region row-level access. - Integrations: Dialog MIFE OSS gateway (OAuth2), SAP ERP (hardcoded
notification_source_system="SAP"), Azure AD/Entra SSO, Firebase FCM push (committed key,receiver_fcm_key="test"bug). - Hardest to absorb: 595
CREATE FUNCTIONdefinitions — the planning/rules logic lives almost entirely in opaque DB procs. ⚠️ 22-month rebase debt; in-place edits to shared controllers → merge conflicts. - Config verdict: entity refactor → custom-entity builder; planning subsystems → feature-flagged platform features + a configurable planning/rules engine (the genuinely hard part); costing → connector; geo-access → configurable geo-hierarchy + RLS; integrations → connector framework + secret store; terminology → runtime i18n override.
3.8 Airtel (Africa / Nigeria) — new entity hierarchy + connector suite
- Custom model: a 7-type access hierarchy — HUB / SubBox / EndBox (point boxes) + CSA / DSA / SubArea (polygon service areas with home-pass counts, nested
Area→SubArea→DSA→CSA), SubArea = the FTTx POP boundary with OLT binding + deployment-status lifecycle. Full forked table/BL/DA/view/uploader stack per type. - Integrations (the headline, ~46k lines):
- ZTE & Huawei EMS ingestion — two modern (DI/async/Serilog) console schedulers, identical pattern: watch source (folder/FTP ZIP) → validate → stage (
*_staging_*) → DB-validate → migrate to entities → auto-splice → archive → track run. - ESB OSS/BSS API —
/serviceability,/portreservation,/changeport,/portutilization(nearest splitter/ODF within buffers, FTTH/FWA feasibility, road distance via Google Directions, atomic port reserve/release);PortReleaseSchedulerfrees expired reservations. - Airtel-OID OIDC SSO (AUUID claim mapping); OPSWAT MetaDefender upload scanning (blocks infected files before storage); Africa egress proxy + TLS-1.2 hardening.
- ZTE & Huawei EMS ingestion — two modern (DI/async/Serilog) console schedulers, identical pattern: watch source (folder/FTP ZIP) → validate → stage (
- Config verdict: the single strongest argument for the PRD’s two flagship primitives — runtime entity builder (the box/area hierarchy) + declarative connector framework (ZTE/Huawei/ESB/OID/OPSWAT are all “configure a provider”). Serviceability/port-reservation should be platform-native capabilities (the PRD’s graph + spatial core subsumes
fn_get_nearby_*).
4. Cross-cutting customization taxonomy → required platform primitives
Every customization observed across all 7 forks, mapped to the platform capability that makes it config instead of code:
| # | Customization dimension | Seen in | Required platform primitive |
|---|---|---|---|
| 1 | New entity types & attributes (CX/GX, HUB/Box/CSA/DSA, PEP, Depth/RedLine, railway POP, FDC/FPOI/GP) | ACT, Airtel, Dialog, RailTel, BharatNet | Runtime custom-entity / attribute-schema builder (typed attrs, point/line/polygon geometry, parent-child topology rules, roll-ups, map layer + icon) — no enum/class/.map/migration edits |
| 2 | Dynamic forms (field show/hide/require, sections, conditional dependencies, autofill) | ACT (rebuilt it), IshaniTech, BharatNet | Config-driven form builder with a dependency/rules engine, auto-rendered for every entity from metadata |
| 3 | Naming / numbering schemes (per-region patterns, auto-IDs) | ACT, BharatNet | Per-tenant naming-rule engine (mask grammar, geometry-driven region resolution, ID generation, uniqueness validation) |
| 4 | Reports (HOTO/L14/SLD/BOQ/survey; per-region variants; wide views) | BharatNet (heavy), RailTel, Dialog, all | Report/template builder — report definitions (columns, scope, format Excel/KML/Shp/PDF/SLD) as data, region = a row not a _MP method |
| 5 | OSS/BSS, EMS & ERP integrations (ZTE/Huawei ingest, ESB, MIFE, SAP, NMS sync) | Airtel, RailTel, Dialog | Declarative integration/connector framework (source, format/column mapping, target entity mapping, schedule, post-process, auth) — providers as config profiles + an ETL/staging→validate→merge pipeline |
| 6 | Identity / SSO (Airtel-OID, Authentik, Keycloak, Azure AD, central-token) | Airtel, RailTel, Dialog, BharatNet | Pluggable IdP/OIDC connector (URLs + client creds + external-id claim mapping as config) |
| 7 | Push / notification / messaging (FCM, SMS gateways) | Dialog, BharatNet | Notification connector (provider-pluggable) + secret store |
| 8 | File storage backends (GCS/NAS/FTP/Local, FTP dual-store) | NCC_MP, IshaniTech | Config-selectable storage provider (local/FTP/S3/GCS/blob) as platform middleware |
| 9 | Upload security scanning (OPSWAT) | Airtel | Configurable upload-pipeline hook (AV/CDR provider-pluggable) |
| 10 | Serviceability / feasibility / port reservation | Airtel, RailTel, BharatNet | Platform-native spatial+graph capability (nearest-element, buffers, FTTH/FWA coverage, atomic port reserve/release as background jobs) |
| 11 | Network/OFN planning (backbone, core planner, ring, auto-plan, snap-to-track routing) | Dialog, RailTel, BharatNet | Configurable planning/rules engine + pluggable routing strategies (incl. snap-to-linear-reference) — hardest to generalize |
| 12 | Feature on/off (layers, modules, menu items, 2FA, encrypted-query) | every fork | Per-tenant feature-flag + module registry (not schema columns toggled by migration) |
| 13 | Geo hierarchy & row-level access (province/region/circle scoping) | Dialog, RailTel, BharatNet | Configurable geo-hierarchy + row-level security |
| 14 | Branding / white-label (logo, client name, terminology) | every fork (already mostly config) | Theming + runtime i18n/terminology override (already partly solved via global_settings) |
| 15 | Per-tenant DB / endpoints / schema (per-circle DBs, per-region hosts) | BharatNet, RailTel, Airtel, all | Per-tenant config + schema isolation + managed versioned migrations |
| 16 | Mobile field-ops (dynamic forms on mobile, rack/room visualizer, offline) | ACT (heavy), BharatNet | Shared mobile module driven by the same entity/form config (not re-forked per customer) |
Bottom line: primitives #1, #2, #4, #5, #12, #15 together would absorb the vast majority of every fork analyzed. #11 (planning/rules) is the residual genuinely-hard frontier.
5. Recurring security findings across forks
These compound the mainline issues in SmartInventory_Gaps_and_Improvement_Analysis.md (auth backdoors, hardcoded AES key, SQLi). Per-fork:
- Committed cloud service-account keys:
FCMCredentials.json(Dialog), GCS service-account JSON (NCC_MP). These are live credential leaks in git history across many branches. - Plaintext DB / SFTP / API credentials in every fork’s
Web.config/App.config/appsettings.json/datashare.inc. [AllowAnonymous]Splicing Monitoring Dashboard (DialogSpxI49FtzController) — unauthenticated network data exposure.[Authorize]commented out on Airtel’sESBController(OSS/BSS provisioning API).- Shared dev DBs across tenants (IshaniTech’s
datashare.incpoints atSafaricom_Dev) — tenant data-isolation smell.
Recommendation: treat the committed service-account keys and backdoors as an incident to remediate in the live product now (rotate keys, purge from history, close backdoors), independent of the rewrite. The new platform must mandate a secret manager and forbid credentials in source.
6. Process & branching findings
- No re-baselining discipline: merge-bases span 2024–2026; Safaricom is 1,656 commits behind
develop, Dialog 866 behind (22-month debt). Forks rot. - Bugfixes are staged on customer branches (Syokinet) instead of
develop, so fixes don’t propagate to other tenants and inflate fork size. - Convention erosion: the canonical mainline is often a
*-Prod-<ver>hotfix branch, notdevelop-<customer>; thedevelop-prefix is also misused for env-variants and personal branches. Customer identity must be parsed from suffix/region, not prefix. - Migrations are hand-applied dated SQL (no framework), per-tenant, partial-in-repo — the highest-risk fork driver and migration blocker.
Implication: even with a perfect multi-tenant architecture, the org needs single-codebase discipline (config-not-fork), a managed migration system, and CI that forbids secrets — otherwise the same sprawl recurs.
7. Candidate vertical accelerators (productize, don’t fork)
- BharatNet Government Survey/HOTO/Acceptance — the BharatNet family’s ~8,800-line survey-report suite + offline survey + DGPS/depth + L14/SLD/BOQ acceptance is a repeatable government-FTTx vertical. Package as a configurable accelerator (report templates + survey workflow + acceptance schema).
- OFN / Backbone Planning — Dialog’s backbone/core-planner/ring-topology subsystems generalize to a carrier OFN planning module.
- Vendor-EMS Reconciliation — Airtel’s ZTE/Huawei ingestion is a reusable “sync inventory from OLT/ODN vendor EMS” connector pattern (valuable to any large FTTH operator).
8. Open questions / needs the live DB
- The bodies of the new
fn_*procs across all forks (Dialog alone adds 595) — the actual planning/migration/serviceability logic is in the DB, not the repo. This is the #1 blocker for specifying primitives #5, #10, #11 precisely. - Exact
layer_detailsflag values anditem_template_*columns for the new entity types (CREATE rows partially in-repo). - Whether per-region DBs (
airtelafrica_si_dev/_qa, per-circle BharatNet conn strings) reflect distinct multi-country deployments. - The precise auto-splicing / port-allocation rules embedded in Airtel/BharatNet migration SQL.
- For frozen customers (TeraSoft, RVNL): whether they re-activate and need profiling.
Compiled 2026-06-16 from seven read-only branch deep-dives. This characterizes the per-customer divergence; pair with the architecture study (what the generic product is), the product specification (modules/features), and the gaps analysis (what to improve) to scope the new platform’s configurability requirements.