From 096a2f6745b8de022a5ad4338752721320db4cfb Mon Sep 17 00:00:00 2001 From: Eric Rakestraw Date: Tue, 1 Dec 2026 04:10:52 +0000 Subject: [PATCH] Record subprocess shutdown ownership decision --- docs/roadmap/audit/catalog.md | 27 +++++++++++++---------- docs/roadmap/audit/discussion.md | 38 ++++++++++++++------------------ 2 files changed, 32 insertions(+), 33 deletions(-) diff --git a/docs/roadmap/audit/catalog.md b/docs/roadmap/audit/catalog.md index 8041514..8de1e17 100644 --- a/docs/roadmap/audit/catalog.md +++ b/docs/roadmap/audit/catalog.md @@ -46,15 +46,15 @@ that the roadmap implements the entire finding. Findings close only after their relevant behavior or code removal is verified. Original audit reports, finding identities, priorities, and source links remain unchanged. -CAT-02's direction follows the agreed import model; CAT-04's direction follows -the accepted audio-acquisition behavior. Other direction paragraphs retain the -audit's candidate remedies; subsequent agreed choices and roadmap ownership are -identified by the disposition notes. +Directions for CAT-02, CAT-04, and CAT-05 reflect subsequent agreed choices. +Other direction paragraphs retain the audit's candidate remedies; agreed +choices and roadmap ownership are identified by the disposition notes. Audio generation/size handling is [agreed in topic 4](discussion.md#4-keep-downloaded-audio-and-its-source-identity-together), +and subprocess completion is [agreed in topic 5](discussion.md#5-finish-subprocess-shutdown-before-releasing-its-files), with implementation pending. Continue the remaining decisions in -[discussion topics 5–7](discussion.md#5-finish-subprocess-shutdown-before-releasing-its-files): -subprocess completion, publication source lifetimes, and audio eligibility. +[discussion topics 6–7](discussion.md#6-open-publication-sources-as-they-are-needed): +publication source lifetimes and audio eligibility. Topic 1 also retains the smaller choice about waiting versus reporting a busy workspace. Remote checkpoint timing and failure handling are deferred, not decisions blocking publication import. @@ -186,7 +186,9 @@ Related: [CAT-06](#cat-06--p2-stop-known-size-downloads-before-oversized-bodies- Status: Open **Disposition / owner.** Independent subprocess remediation — [discussion topic 5](discussion.md#5-finish-subprocess-shutdown-before-releasing-its-files) -remains open. Publication import does not remove downstream process ownership. +selects joining process/output completion after bounded termination escalation, +before releasing resources. Implementation and verification remain pending; +publication import does not remove downstream process ownership. Original findings: [CN-03](04-concurrency.md#cn-03--p2-the-exceptional-subprocess-reap-timeout-releases-ownership-too-early), [TE-05](08-testing.md#te-05--p2-subprocess-lifecycle-tests-do-not-exercise-a-delayed-reap-after-escalation). @@ -197,11 +199,12 @@ caller-owned result-file closure can then overlap a still-active waiter or strea copier. Current tests exercise ordinary shutdown or pre-populated completion, not delayed completion beyond escalation. -**Direction.** Keep one supervisor responsible until completion and I/O ownership -are joined; distinguish escalation deadlines from resource completion. Add a -controlled delayed-wait/stream test that observes release ordering and preserved -error causes. Preserve bounded escalation without claiming an absolute kernel-I/O -termination deadline. +**Direction.** Retain bounded graceful-to-forceful escalation, then join process +and output completion before reading process state, flushing/closing diagnostics, +or returning resource ownership to callers. Add a controlled delayed-wait/stream +test for release ordering and preserved error causes. Exceptional I/O delays can +outlast escalation timers; no absolute return-time guarantee or early-return +ownership handoff is required. ### CAT-06 — P2: Stop known-size downloads before oversized bodies exhaust staging space diff --git a/docs/roadmap/audit/discussion.md b/docs/roadmap/audit/discussion.md index 6e7bb5b..5256f97 100644 --- a/docs/roadmap/audit/discussion.md +++ b/docs/roadmap/audit/discussion.md @@ -13,8 +13,8 @@ own the detailed evidence. This document records decisions, explains consequence and distinguishes recommendations from approved scope. No remediation has been implemented by this document. -The operator has settled the main direction for topics 1, 2, 3, and 4. Topics 5, -6, and 7 need discussion. Each open topic ends with a question and space for a +The operator has settled the main direction for topics 1 through 5. Topics 6 +and 7 need discussion. Each open topic ends with a question and space for a response. Implementation details can be settled during planning after the operator-facing behavior is clear. @@ -301,7 +301,7 @@ implementation and verification._ ## 5. Finish subprocess shutdown before releasing its files -Status: Open +Status: Decision agreed; implementation pending Finding: [CAT-05](catalog.md#cat-05--p2-retain-subprocess-and-stream-ownership-through-delayed-completion). @@ -319,34 +319,30 @@ as observing completion of every resource user. The audit established this ordering from source. It did not reproduce a dynamic race. Normal cancellation and subprocess tests passed. -### Recommendation +### Agreed direction Keep the bounded graceful-to-forceful escalation, then join process/output completion before releasing the associated resources or returning their ownership -to callers. Exercise the delayed-completion branch with a controlled test. +to callers. Read process state and flush/close diagnostics after completion is +joined. Preserve the original timeout or cancellation cause. Exercise the +delayed-completion branch with a controlled test of resource-release ordering. Ordinary cancellation should still terminate promptly. In an exceptional blocked filesystem write or kernel operation, resource completion can take longer than -the escalation windows. There is no straightforward absolute return-time -guarantee for arbitrary blocked I/O. +the escalation windows. The invocation may remain in shutdown and continue +holding its workspace lock while resource ownership completes. -### Viable alternative - -Return before completion using an explicit ownership handoff. A remaining -supervisor would have to own every resource still in use, including output -destinations normally owned by the caller. This is more complex than starting a -background waiter and is justified only if returning promptly despite unfinished -I/O is an actual operational requirement. - -### Question for discussion - -Is it acceptable to wait for safe resource completion after forceful termination, -even when exceptional blocked I/O outlasts the escalation timers? I recommend yes, -with accurately scoped timeout documentation. +Document the timeout as starting command shutdown, not guaranteeing that every +resource is released at that instant. Retain bounded escalation without an +absolute return-time guarantee for arbitrary blocked I/O. Use the existing +supervisor and standard process-waiting mechanisms; an early-return ownership +handoff or background cleanup service is unnecessary for this fix. Operator response: -_Pending discussion._ +_Approved: retain bounded termination escalation, then wait for process and output +completion before releasing resources, even when exceptional I/O delays outlast +the escalation timers. CAT-05 remains open pending implementation and verification._ ## 6. Open publication sources as they are needed