b7s/catraca
Catraca is a Laravel package for simple, flexible access control. It helps define permissions and roles, check abilities, and protect routes, controllers, and UI actions with less boilerplate, making authorization easier to manage in small and growing applications.
Architecture fit
require-dev, executed in CI and locally via a Composer script. Runtime footprint on the Laravel application is zero, so it does not touch the request lifecycle, container bindings, or deployment artifacts.Integration feasibility
composer require --dev line, a config file committed at repo root, one CI step. Realistically a half-day spike to prove exit-code behaviour and metric capture on a real application.composer.lock; if it consumes their reports, the report format becomes the contract. This distinction must be confirmed before commitment — it determines both CI cost and failure surface.Technical risk
Key questions
Stack fit
require-dev. Catraca sits as the last quality step before merge, after lint and static analysis, so cheaper failures surface first.composer quality script that chains the analysers and Catraca, mirrored 1:1 by the CI job, so local and CI results agree. Divergence between the two is the fastest way to make a gate hated.Migration path
Compatibility considerations
composer.lock and use the same PHP image locally and in CI; version skew between a developer's PHP and the CI runner is a common source of phantom regressions..gitattributes merge strategy guidance, or accept occasional manual conflict resolution in busy repos.Sequencing
CONTRIBUTING.md.Maintenance
Support
Scaling
--no-verify.Failure modes to design for
| Failure | Impact | Mitigation |
|---|---|---|
| Analyser version bump shifts metric | False red on untouched code | Pin versions; re-baseline in a dedicated PR alongside upgrades |
| Developer edits watermark to pass | Gate silently defeated | CODEOWNERS on watermark file; require justification in PR |
| Merge conflicts on baseline file | Developer friction | Small, ordered file; documented merge procedure |
| Whole-repo-only enforcement | Unusable on legacy code | Scope per directory/module; enforce delta on changed paths |
| Tool crash / non-zero exit | Blocks hotfixes | Distinct exit codes; documented bypass with post-merge audit ticket |
| Metric gaming (e.g. getter coverage) | False confidence | Pair the ratchet with review; never rely on a single metric |
Ramp-up
Bottom line for a TPM: adopt as a low-cost, advisory-first gate with a documented exit plan, not as untouchable release infrastructure. The integration cost is trivial and the ratchet concept addresses a real, recurring problem; the risk is concentrated entirely in the package's maturity and in organisational discipline around the watermark file.
How can I help you explore Laravel packages today?