Search by

script-development / laravel-retention

Goosterhof

Retention kernel for Laravel territories: a prune for append-only, hash-chained audit tables that keeps the remaining chain verifiable.

Package info

github.com/script-development/laravel-retention

pkg:composer/script-development/laravel-retention

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 4

v0.1.0 2026-11-20 15:07 UTC

This package is auto-updated.

Last update: 2026-11-20 15:08:14 UTC


README

Retention and erasure kernel for Script Development and Back to code Laravel territories.

  • Audit retention (released in 0.1.0): a prune for append-only, hash-chained audit tables that keeps the remaining chain verifiable. Extracted from entreezuil (EZ-0037, WR-2926).
  • Erasure on a retention clock (not here yet): anonymisation in place, with coverage gates that refuse a table or column the erasure route does not place. To be extracted from lokalekeuze.

Status: 0.1.0, released 2026-11-20. Every behaviour here came from a production territory, with one exception ruled by the Commander on 2026-11-20: the prune refuses at a chain row with no creation time, where entreezuil's schema made such a row impossible.

Audit retention

The package owns the algorithm; the territory keeps its recipes.

Package Territory
PruneAuditChains: prefix-only, chunked, verify-before-delete, anchor move and prune record in one transaction, three attempts implements Audit\Contracts\HashChains: its chains, recompute(), its writer's chain lock, where a prune is recorded
ChainStartResolver: where a chain starts (anchor or seed), with the anchor's MAC checked and reported its writer and verifier read the chain start through it
AuditChainAnchor (table audit_chain_anchors) and AnchorMac its artisan command, schedule and config

Config read: audit.hash_seed and audit.retention_months (at least 1).

Adopting

  1. composer require script-development/laravel-retention.
  2. Set audit.hash_seed (the seed your writer starts a chain from) and audit.retention_months (at least 1) in your config. The package ships no defaults: without both, the container cannot build PruneAuditChains.
  3. A territory without audit_chain_anchors: php artisan vendor:publish --tag=retention-audit-migrations, then migrate. A territory that already has the table does not publish it; the package never loads the migration itself, so that territory is untouched.
  4. Bind your implementation: $this->app->bind(HashChains::class, YourChains::class);. Every chain's model and audit_chain_anchors must be on the prune's own (default) connection; the prune refuses to run otherwise.
  5. Point your writer's empty-table path and your verifier's walk at ChainStartResolver, so all three agree where a chain starts.
  6. Call PruneAuditChains::execute() from a scheduled command; exit with the result's exitCode().

License

MIT