Plan durable session cleanup

This commit is contained in:
2026-11-30 12:51:24 +00:00
parent 39ad49e09d
commit 95e297e917
2 changed files with 405 additions and 30 deletions

View File

@@ -68,30 +68,29 @@ partial cleanup can remove some diagnostics before failing. A retry must finish
the remaining work without requiring republishing. Missing run directories and
already-removed managed links are successful, idempotent conditions.
## Implementation Work
## Required Changes
1. **Establish durable reuse.** Audit stage reuse, artifact resolution, extraction
validation, publication, and recovery for dependencies on run-local paths.
Retain required semantic evidence in canonical products or manifest state.
Historical provenance may describe a removed attempt, but must not be treated
as a live file dependency. Missing diagnostics must not invalidate products.
2. **Simplify cleanup.** Replace published-run pruning and retained-bundle
exceptions with session-wide run deletion and managed-view removal. Remove
retention-only markers, traversal logic, and checks that are no longer needed.
Account for all run material, including attempts created after an earlier
successful cleanup, when deciding whether cleanup has work to do.
3. **Complete lifecycle handling.** Verify writer shutdown, cleanup retry,
cleanup-only invocation, and final reporting using the existing orchestration
paths. Use ordinary stage status and errors; avoid a second cleanup scheduler
or retention framework.
4. **Update documentation with implementation.** Update the
[operations guide](../operations.md), [configuration reference](../config.md),
affected internal documentation, and the
[architecture policy](../policy/architecture.md). In particular, replace the
policy's published-run target restriction with the selected session's run
history scope. Explain diagnostic loss and how to retain diagnostics by
disabling automatic cleanup. Record the changed retention behavior in release
documentation.
Stage reuse, artifact resolution, extraction validation, publication, and recovery
use canonical products and manifest-held semantic evidence. Historical provenance
can describe removed attempts. Missing diagnostics do not invalidate products.
Session-wide deletion and managed-view removal replace published-run pruning and
retained-bundle exceptions. Retention-only markers and protected-tree traversal
are removed. Cleanup's reuse decision accounts for all remaining run material
and managed views, including attempts created after an earlier cleanup.
The existing stage and invocation lifecycle coordinates writer completion,
manifest persistence, retry, and final reporting. Run-local directories are
created on demand for actual work. Cleanup-only and fully reused invocations can
leave an already-clean session without recreating `runs/`.
The operations guide, configuration reference, affected internal and integration
documentation, and architecture policy describe the resulting retention behavior.
Architecture policy reflects session-wide cleanup scope and diagnostic lifetime.
Release documentation explains diagnostic loss and retaining diagnostics by
disabling automatic cleanup.
The [implementation plan](implementation.md) owns sequencing and validation steps.
## Verification
@@ -113,10 +112,3 @@ path-safety and publication tests unnecessarily:
- New attempts after a successful cleanup are removed by the next authorized
cleanup. Cleanup and final reporting leave `runs/` absent and managed views
consistent.
## Open Decisions
None for the intended retention policy. During implementation planning, identify
any required product or reuse evidence currently available only in a run-local
bundle and specify its durable destination before enabling complete deletion.
This is a dependency audit, not a reason to retain run history by default.