liberu-genealogy/php-dna
PHP DNA toolkit for genealogy apps: import and manage raw DNA kits, parse SNP data, compare matches, and work with shared segments and relationships in Laravel or plain PHP. Compact utilities for building genetic genealogy features.
Architecture fit
liberu-genealogy/php-dna is a domain library in the Liberu genealogy ecosystem, responsible for DNA/SNP data handling (SNP parsing, CSV ingestion) inside Laravel applications. It is a Composer-installed dependency rather than an application, so architectural coupling is low — the main coupling points are the public class API (SNPs, CsvReader, and the recently removed kit-triangulation surface) and whatever service-provider bindings ship with the package. It fits as a library behind an application service layer, not as something to build directly against in controllers or jobs.
Integration feasibility
Feasible via a normal composer require major-version bump, but v4.0.0 is not a drop-in upgrade. Two changes drive the assessment:
triangulateKits is deleted, not deprecated. Any consumer calling it will fail at runtime (BadMethodCallException/undefined method), not at install time — the most expensive failure shape because CI can pass while production breaks.SNPs.php and CsvReader.php. Positive on its face, but it implies shipped v3.0.0 code had parse-level defects in core files. Duplicate method declarations and syntax errors are exactly what php -l and a test suite catch, so this is evidence of weak CI gating upstream, not just a one-off bug.@Copilot. AI-assisted fixes are acceptable, but combined with a major-version breaking removal released in the same two-PR window, it warrants a deeper review before adoption.Technical risk Overall: medium-high for v4 adoption, medium for staying on v3.
triangulateKits call sites, especially anything exercising DNA kit triangulation — a core genealogy workflow, so probability of use in a downstream genealogy app is meaningful.Key questions
triangulateKits, and what is the sanctioned replacement — a new package, an application-level implementation, or nothing?SNPs.php, or were those code paths unreachable? This determines whether v4 is a fix or a stabilization of dead code.php -l/static analysis in the pipeline?Stack fit
Standard Laravel/PHP + Composer consumption. Confirm the supported PHP/Laravel matrix before scheduling work — the release notes do not state constraint changes, and a major bump is the most common place for a silent composer.json requirement shift. Verify against our oldest supported PHP runtime, not just the developer's local version.
Migration path
triangulateKits, plus direct references to SNPs and CsvReader. Include dynamic calls (call_user_func, string-based method names) and any queued jobs or artisan commands that touch DNA kits.triangulateKits is unused: upgrade is low-risk; proceed on a branch and validate parsing paths.SNPs.php/CsvReader.php fixes as a vendored patch, or (b) implement triangulation in the application layer before bumping. Option (a) is the faster unblock if v3 parsing is actively failing; option (b) is the durable fix."liberu-genealogy/php-dna": "^4.0" or "^3.0") rather than floating, given the release cadence.Compatibility checks
php -l and static analysis (PHPStan/Psalm at our configured level) against the installed vendor tree immediately post-upgrade — v4's own history shows parse-level defects can ship.Sequencing Phase 1 — usage inventory and constraint verification (no code change). Phase 2 — branch upgrade with lint + static analysis + fixture regression. Phase 3 — staging canary against real DNA kit files, including at least one oversized file to exercise memory behavior. Phase 4 — production rollout behind the existing release mechanism; keep v3 revert path warm for one cycle. Explicitly exclude the visualization placeholder from scope and from any roadmap communication until it is functional.
Maintenance Small contributor base with ad hoc cadence; this release ships a breaking change, two reliability fixes, and a placeholder in a two-PR window. Budget recurring effort for reading upstream diffs rather than assuming semver discipline — commit-level review is justified here. If triangulation is business-critical, plan to own that logic in-application so future upstream removals cannot block us.
Support
No evidence of an LTS policy or a v3.x maintenance branch. Escalation path is the upstream issue tracker with limited leverage; mitigate by vendoring/patching critical files locally (which we can do under MIT-style licensing — verify the license) and documenting the patch so it is re-applied deliberately rather than silently lost on the next composer update.
Scaling
SNP and CSV ingestion is CPU- and memory-bound. Raw consumer DNA files run into the hundreds of megabytes; the relevant question is whether CsvReader streams or loads fully into memory. Given that CsvReader.php was just repaired, re-benchmark rather than assume inherited performance characteristics. Run parsing in queued jobs with memory limits set deliberately, not on web requests.
Failure modes
SNPs and CsvReader.triangulateKits — silent through CI, loud in production; mitigated by the usage inventory.Ramp-up
Low technical ramp-up: the package surface is a handful of classes and a PHP developer is productive in roughly one day. The real cost is domain QA — validating that parsed SNPs and ingested CSVs are genetically correct, not merely non-crashing. Budget one to two engineering days for integration plus a QA pass with real kit data, and add one day if triangulateKits turns out to be in use and must be reimplemented in-application.
How can I help you explore Laravel packages today?