Repository navigation
Rust server: prune expired run history like published PHP - #595
Merged
Merged
Conversation
Native served 501 for the retention and activity-timeout status routes, and its worker heartbeat never pruned, so a bounded namespace kept every closed run forever. Native now serves admin-only GET /api/system/retention, POST /api/system/retention/pass and GET /api/system/activity-timeouts by the rules of published PHP 2.5.14, in the default or a named namespace. A pass deletes a closed run's details from PHP's twenty tables in one transaction and keeps the run row. Each worker heartbeat runs PHP's inline pass and reports it as `retention`. Native does not yet clean up external payload objects or message streams, so it skips such a run with a reason instead of deleting rows that point at storage it would leave behind. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
rmcdaniel
enabled auto-merge
October 21, 2026 15:46
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Part of #325.
What changed
Published dw 2.3.0's
system:retention-status,system:retention-passandsystem:activity-timeout-statusreceived native's 501. Native's worker heartbeat also never pruned, so a bounded namespace (the default keeps 30 days) kept every closed run.Native now serves these admin-only routes in the default or a named namespace, by the rules of published PHP 2.5.14's
SystemController,HistoryRetentionEnforcerandActivityTimeoutScanner:GET /api/system/retention: the policy, cutoff and the oldest expired runs.POST /api/system/retention/pass: prunes the given or expired runs.GET /api/system/activity-timeouts: open executions past a deadline, across namespaces as in PHP.retention.run_ids.0.Differences from PHP
external_payload_cleanup_unavailableormessage_stream_cleanup_unavailable, rather than delete rows that point at storage it would leave behind.POST /api/system/activity-timeouts/passis still open. Native enforces activity deadlines in its own loop.The checkpoint is in
docs/rust-server-port-checkpoints/2026-10-21-history-retention.md. Each new checkpoint is now its own file, so PRs stop conflicting at the top of the port log.Verification
history_retentionintegration tests pass on SQLite, PostgreSQL and MySQL. The full native suite passes on SQLite.timeline_entries_deleted. That count is 0 on native, which writes no timeline entries.capability_manifeston registration at protocol 1.19, and native does not. It is recorded as a known gap.This branch builds on #562. Until #562 merges, the diff includes it.
🤖 Generated with Claude Code