BOHICA-LABS / BOHICA-LABS/vsdd-factory
adversarial-review axis proposal: "channel-lifecycle asymmetry" — divergent teardown sets across graceful vs exceptional paths leak resources
- Dominant language
- Rust
- Stars
- 2
- Forks
- 1
- Avg merge
- 6h 43m
- Merged PRs (30d)
- 29
Description
**Severity:** P2 (correctness / resource-leak class)
**Source:** F-PG-2 in adversary pass-4 for story S-3.02, surfaced during a downstream VSDD pipeline run (engine vsdd-factory 1.0.0-rc.22). Originally logged as reporter candidate issue #34.
## Summary
For any type that owns multiple resources (channels, files, goroutines, mutexes), the graceful teardown path and the exceptional teardown path MUST tear down the same set of resources in the same order. When they diverge, an exceptional-vs-graceful mismatch leaves resources dangling — and the divergence is invisible to per-method review because each method looks locally correct.
## Observed (S-3.02 pass-4)
- `ConsoleSet.Remove` (graceful path, called from `Detach`) closes only `entry.downstream`.
- `ConsoleSet.EvictStale` (crash/stale path, called from `Sweep`) closes BOTH `entry.downstream` AND `entry.upstream`.
- A caller draining `entry.upstream` directly (a documented test-harness pattern) leaks the goroutine on the graceful `Detach` path, because only the crash path closes `upstream`.
Each method reads as correct in isolation; the defect exists only in the *asymmetry between* them.
## Proposed adversarial-review axis: "channel-lifecycle asymmetry"
For each type, identify its owned resources (chan, file, goroutine, mutex). For each teardown method (Close/Remove/Evict/Detach/Stop/etc.), list which of those resources it tears down. Any divergence in the tear-down set (or order) across a type's teardown methods MUST be justified in a docstring; an unjustified divergence constitutes a defect.
Sibling proposal: see the "boundary-sentinel inputs" axis (filed separately) — both axes emerged from S-3.02 pass-4.
Contributor guide
Research direction
Examine the ConsoleSet type, specifically the Remove and EvictStale methods, to identify all owned resources (channels, goroutines). Compare the teardown sets and order between these methods. Look for existing tests related to Detach and Sweep to understand the graceful and exceptional paths. The goal is to align the resource cleanup so both paths close the same resources.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100