baks-dev/users-profile-balance
baks-dev/users-profile-balance provides user profile balance management for PHP/Symfony apps. Install via Composer, run baks:assets:install, apply Doctrine migrations, and test with the users-profile-balance PHPUnit group. Requires PHP 8.4+.
Architecture fit
php bin/console baks:assets:install, doctrine:migrations:diff, "symfony-cmd" script type) is Symfony Console + Doctrine. Prior assessments in this thread describing it as "Laravel-native" are incorrect and should not be circulated to engineering. In a Laravel codebase this is not a drop-in; it would require an adapter layer, a bridge (Doctrine in Laravel), or a fork-and-port of MIT source. That is a build project, not an install.Integration feasibility
composer require, register bundle, run baks:assets:install, generate and review a Doctrine migration, migrate.v7.4.6 contains the text "v7.4.6"). Integration effort is therefore dominated by reverse-engineering vendor/baks-dev/users-profile-balance/src, not by writing glue code.auto-scripts, post-install-cmd, post-update-cmd) must be reconciled with our existing pipeline; baks:cache:clear in a post-install hook is a build-time side effect we should not accept blindly in CI.Technical risk
| Risk | Severity | Note |
|---|---|---|
| Wrong framework for our stack | High | Laravel framing in prior docs is false |
| Zero adoption (0 stars, 0 dependents) | High | No field validation; we are the first serious integrator |
| PHP 8.4 floor | Medium–High | Constrains runtime/hosting/CI; blocks upgrade path if host lags |
| No changelog discipline across 7.4.x | Medium | Patch-level breaking changes plausible; pin and diff |
| Concurrency / double-spend semantics undocumented | High | Balance mutation without documented locking is a correctness risk |
| No documented audit trail | High | Regulated or finance-adjacent use needs an immutable ledger |
| Release metadata anomaly (2026-05-21 date) | Low–Medium | Signals process immaturity; verify provenance |
| MIT license, no hidden deps observed | Low | Permissive; still audit composer.lock post-install |
| Single-maintainer bus factor | Medium | Fork-and-own contingency required |
Key questions (owner: TPM, answered before any commitment)
--group=users-profile-balance phpunit run, and does it cover concurrency and boundary values?UPGRADE.md?Stack fit — decision gate first
Run a single gate before any engineering time is booked: confirm the target service's framework. The two outcomes are asymmetric and should be presented that way.
Migration path (assumes Symfony go)
user_id + value tables. Run doctrine:migrations:diff and inspect the generated SQL before applying. Never let the package author our migration unattended.Compatibility work
doctrine/migrations versions; a major-version skew will silently change migration generation behaviour.auto-scripts into our existing Composer script block rather than replacing it; explicitly decide whether baks:cache:clear belongs in post-install-cmd for CI images.composer.lock; add a Renovate/Dependabot rule requiring manual review of every 7.4.x bump with a vendor-source diff.Sequencing (TPM-owned plan)
| Phase | Duration | Exit criteria | Kill criterion |
|---|---|---|---|
| 0. Framework + risk gate | 1 day | Framework confirmed; go/no-go recorded | Laravel with no port owner |
| 1. Technical spike | 2–3 eng-days | Install, migrate on a scratch DB, exercise debit/credit, read the source for locking and audit behaviour | No transaction/locking story, no audit trail |
| 2. Fit review | 1 day | Answers to questions 2–8 documented | Missing audit trail or negative-balance control for a finance-adjacent use case |
| 3. Shadow integration | 1 sprint | Reconciliation clean for 5 consecutive days | Any unresolved drift |
| 4. Flagged pilot | 1 sprint | Success metric met on the pilot segment | Regression in credit-spend success rate |
| 5. GA + fork contingency | Ongoing | Internal runbook and patch policy live | Upstream abandonment |
Maintenance
Support
Scaling
(profile_id, balance_type); transactions with row-level locking or optimistic versioning around every mutation; and a hot-row contention plan for high-traffic profiles (queue-and-serialize debits, or an append-only journal with a materialized balance).Failure modes
| Failure | Impact | Mitigation |
|---|---|---|
| Concurrent debits double-spend | User gets value twice; revenue loss | Transactional/locked mutations; concurrency test in spike |
| Migration collides with existing schema | Deploy failure | Dry-run diff, staging rehearsal, backup |
| Composer post-install hook fails in CI | Build break on unrelated services | Remove package hooks from global CI scripts |
| Silent breaking change in a 7.4.x patch | Runtime error in production | Pinned lockfile, manual review, vendor diff |
| PHP 8.4 requirement blocks host upgrade | Cannot patch dependencies | Confirm runtime support before Phase 1 |
| No audit trail surfaces in finance review | Retrofit or re-platform | Answer question 4 before pilot |
| Upstream abandonment | No fixes for new CVE or PHP version | Fork with internal tests from day one |
Ramp-up
How can I help you explore Laravel packages today?