Skip to content

Capture lifecycle: define and stop work that continues after plugin cleanup #211

Closed

Description

@WhollyMindless

Proposed classification: bug, capture, test-integrity, severity:medium. Labels require maintainer permissions; these are suggestions for your triage.

For maintainer triage and approval of scope. Reviewed main at bf9f4d2, still current when these proposals were prepared. Review probes use synthetic temporary stores; this is not a report of a production incident. No implementation or assignment is implied by this issue.

LIFE-1: Auto-capture work in flight at plugin cleanup keeps running the write gate after dispose

Reproduction: Temporary test (deleted afterwards) using test/harness.ts: loadPlugin(autoCapture:true), park capture.generate, fire the compaction hook, wait for the generate call, await p.cleanup(), release the park, then read evidence with ts > disposal time.

Observed: After cleanup the following evidence was written: gate_start, graph_current, ref_stale_scan, dedup_clean, write_blocked(ambiguous_memory), auto_capture_compaction_blocked, capture_lag. The full write gate ran after dispose. A passing candidate, or GATE-2 drift/canonical supersession, would mutate the store. The same gap produces the 'hook failed (ignored): ENOENT ... evidence/2026-10-31.logfmt' trace in the baseline suite log: test/security-capture-crop.test.ts waits only for the generate call (line 68), and afterEach deletes the store while capture is still finishing.

Effect: A disposed or reloaded plugin instance can still write evidence and rows. The test noise could become cross-test pollution if a later test re-points OPENCODE_MEMORY_DIR before the straggler writes (same class as #146).

Preconditions: autoCapture enabled (experimental, default off) and a dispose or reload during the model call.

Proposed scope / decision requested

Review the cleanup contract, then cancel/check work after generation and before new gate work. Track or drain in-flight operations only under a bounded, explicit contract; a gate already mutating cannot be casually cancelled halfway through. Strengthen capture-crop teardown to await completion. Coordinate after #202 to avoid overlapping capture edits. This is delegate-reproduced evidence; parent has source-reviewed it but has not independently rerun the disposal probe. Auto-capture is experimental/default-off; no live-host occurrence claimed.

Please accept, narrow, defer, or decline this independently of the other review findings. We will wait for your direction before taking implementation. Happy to supply a checked-in regression reproducer with an accepted fix; the review report and probe artifacts are preserved locally.

Activity

  1. added
    bug
    capture
    test-integrity
    severity:medium
    agent:ready
    on Nov 1, 2026
  2. ocsi-triager commented on Nov 3, 2026

    @ocsi-triager

    osi-spec-hash: 7030b55736a71665 2026-11-03T23:52:47Z - acceptance criteria frozen at this text. A later edit to the body changes this hash, and the reviewer will withhold approval until a maintainer replies spec ok.

  3. ocsi-fixer commented on Nov 4, 2026

    @ocsi-fixer

    Not buildable as written: the body itself asks the maintainer to "accept, narrow, defer, or decline" and states "No implementation or assignment is implied" and "We will wait for your direction before taking implementation." The contract has no mechanically checkable acceptance criterion — the scope decision is the maintainer's authority. Adding fix:blocked pending that decision.

  4. added
    fix:blocked
    on Nov 4, 2026
  5. added
    spec:incomplete
    on Nov 4, 2026
  6. abogartz commented on Nov 8, 2026

    @abogartz
    Owner

    Scope APPROVED (maintainer, 2026-11-08). LIFE-1 is a real lifecycle bug: post-dispose capture writes are unowned work. Proceed with the proposed scope — track in-flight capture work in a disposable registry, abort or drain at cleanup, and pin it with the harness test described (park generate, dispose, release, assert no evidence lines after disposal). fix:blocked removed.

  7. removed
    fix:blocked
    on Nov 8, 2026
  8. abogartz-opencode-self-improvement commented on Nov 9, 2026

    @abogartz-opencode-self-improvement

    🎉 This issue has been resolved in version 0.21.0 🎉

    The release is available on:

    Your semantic-release bot 📦🚀

  9. abogartz commented on Nov 9, 2026

    @abogartz
    Owner

    Landed on main in 295dc06 (PR #367, approved at 64b6d37).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent:readybugcapturereleasedseverity:mediumspec:incompletetest-integrity

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions