v0.5.0 — audit envelope settles, durability lands
Theme: the audit evidence envelope settles, and durability lands underneath it. v0.5.0 bundles four issues from the milestone — #21 SwarmRunner decomposition, #30 actor envelope unification + schema_version bump, #23 laravel/ai wrap behind Swarm\Contracts, and #20 audit outbox + queue/dead-letter failure policies.
Highlights
Added
- Audit outbox + queue/dead-letter failure policies (#20). Sink failures can now be persisted to a new
swarm_audit_outboxtable and retried viaswarm:relay --type=audit. The relay drains both durable and audit lanes in a single pass.SinkFailureDecisiongainsQueueandDeadLettercases.ConfiguredSinkFailureHandlerrecognizesqueueanddead_letterin addition to v0.4'sswallow/log/halt. Dead-letter transitions emitLog::errorfor monitoring. Payload andlast_errorcolumns are sealed whenswarm.persistence.encrypt_at_restis enabled. - Opt-in audit outbox retention via
swarm.audit.outbox.dead_letter_retention_days(defaultnull— preserve indefinitely for regulated callers). - Audit outbox health checks.
swarm:healthruns staleness and dead-letter checks by default. Newswarm:health --auditflag for focused investigation. Swarm\Contracts\AgentandSwarm\Contracts\HasStructuredOutputmarker interfaces (#23) wraplaravel/ai's pre-1.0 contracts so swarm has its own stability story. Migration required for custom agent classes — one-lineusechange documented inUPGRADING.md.
Changed (BREAKING)
swarm.audit.failure_policydefaults toqueue(wasswallowin v0.4). Runphp artisan migrateon database persistence to create the outbox table. Cache persistence falls back to log-and-swallow automatically. SetSWARM_AUDIT_FAILURE_POLICY=swallowto restore v0.4 behavior.EvidenceEnvelope::SCHEMA_VERSIONbumps from\"1\"to\"2\"(#30). Shape change oncommand.*evidence only: legacy top-level'actor' => 'artisan'literal removed; actor identity now inmetadata.actoras anActorvalue object array, matching every other category.SwarmRunnerdecomposed intoRunAuditEmitter,DispatchValidator,LeaseManager(#21). Internal refactor; public API unchanged.
Upgrade path
See `UPGRADING.md` v0.5.0 for the full migration checklist:
- `composer update builtbyberry/laravel-swarm`
- `php artisan migrate` (creates `swarm_audit_outbox`; required for the new default failure policy on database persistence)
- If you ignore `schema_version` in sinks: no action. If you pin a single value: update to accept `"2"` (and tolerate both during rolling deploys).
- If you have custom agent classes: switch `use Laravel\Ai\Contracts\Agent;` to `use BuiltByBerry\LaravelSwarm\Contracts\Agent;`. The swarm marker extends the vendor interface so existing methods continue to work unchanged.
- If you have a custom `SinkFailureHandler` with an exhaustive `match` on `SinkFailureDecision`: add cases for `Queue` and `DeadLetter` to avoid `UnhandledMatchError`.
Compatibility
- PHP ^8.5
- Laravel ^13.0
- laravel/ai ^0.6
Full changelog
See `CHANGELOG.md` for the complete entry.