Skip to content

Scope session-close background-process check to the current session - #63

Merged
bborbe merged 1 commit into
masterfrom
fix/session-close-daemon-scope
Aug 2, 2026
Merged

Scope session-close background-process check to the current session#63
bborbe merged 1 commit into
masterfrom
fix/session-close-daemon-scope

Conversation

@bborbe

@bborbe bborbe commented Aug 2, 2026

Copy link
Copy Markdown
Owner

/vault-cli:session-close Phase 5 scanned the machine-wide process table (ps aux | grep -E '(dark-factory|daemon|watch)') and flagged anything it found. In practice that surfaces sibling Claude sessions' daemons as "outstanding before close" — a false positive that makes the verdict untrustworthy and asks the user to clean up work that isn't this session's.

Hit live this session: a dark-factory daemon started by a different session (different shell snapshot) was reported as an open item on a session that never touched dark-factory.

Changes

  • Phase 5 now builds its candidate list from the conversation — Bash calls made with run_in_background: true, Monitor watches armed this session — instead of a process-table scan. Empty list → phase skipped silently, no ps aux at all. ps -p <pid> is used only to confirm liveness of PIDs already on the list. Explicit rule added: never flag a process this session didn't spawn; each session cleans up its own.
  • Phase 6 gets the matching scoping note — "in scope" means a repo this session touched, so another session's dark-factory project is skipped even when its daemon is running.
  • Phase 9 example output no longer models the bug (the sample line now says the daemon was spawned by this session).

Docs-only change to the command definition; make precommit green.

Phase 5 scanned the machine-wide process table and flagged any running
dark-factory daemon / watcher, including ones belonging to sibling Claude
sessions. That is a false positive: it makes the verdict untrustworthy and
pushes the user to clean up work that is not theirs to clean up.

Candidates now come from the conversation itself (Bash run_in_background,
Monitor), with ps used only to confirm liveness of those specific PIDs.
Empty list skips the phase entirely. Phase 6 gets the same scoping note for
dark-factory projects, and the Phase 9 example no longer models the bug.

@ben-s-pull-request-reviewer ben-s-pull-request-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The diff is purely documentation (CHANGELOG.md + commands/session-close.md). Let me now do the in-session classification and adjudication.

Step 4b-i — Candidate rules (triggers matching CHANGELOG.md or commands/session-close.md):

Rule ID Owner Trigger match
changelog/conventional-prefix-required agent-auditor CHANGELOG.md
changelog/unreleased-entry-required agent-auditor (script, no glob)
changelog/preamble-frozen agent-auditor (script, no glob)
agent-cmd/command-frontmatter slash-command-auditor commands/**/*.md
agent-cmd/command-thin slash-command-auditor commands/**/*.md
agent-cmd/gap-driven-feedback agent-auditor commands/**/*.md
agent-cmd/no-user-prompts agent-auditor commands/**/*.md
agent-cmd/scripts-in-claude-dir agent-auditor commands/**/*.md
agent-cmd/single-source-of-truth agent-auditor commands/**/*.md

Step 4c-sel — Classify:

  • changelog/conventional-prefix-requiredapplicable (CHANGELOG has ## Unreleased with fix: prefix — correct ✓)
  • agent-cmd/command-frontmatterskipped — existing file, not created; rule triggers on creation
  • agent-cmd/command-thinskipped — change clarifies behavior, doesn't make command thin; "thin" = sparse/underspecified, this makes it more precise
  • agent-cmd/gap-driven-feedbackskipped — existing command receiving a bug fix, not a new capability introducing a gap
  • agent-cmd/no-user-promptsskipped — purely docs; no behavioral prompts introduced
  • agent-cmd/scripts-in-claude-dirskipped — purely docs; no script dependencies
  • agent-cmd/single-source-of-truthapplicable — correctly identifies the conversation's run_in_background/Monitor calls as the authoritative source; documents this explicitly

Step 4d-sel — Adjudicate:

  1. changelog/conventional-prefix-required: CHANGELOG has ## Unreleased with - fix: session-close Phase 5...fix: is a recognised prefix. PASS.
  2. agent-cmd/single-source-of-truth: The doc now correctly states candidates come from the conversation's run_in_background/Monitor calls, not a machine-wide ps aux scan. This is an accurate and well-scoped single source of truth. PASS.

Both applicable rules pass. No violations.

Step 3a — LICENSE: Present at repo root. ✓


{
  "verdict": "approve",
  "summary": "Documentation-only PR clarifying session-close Phase 5 behavior: candidates now come from the conversation's own background-process tracking, not a machine-wide process scan. CHANGELOG entry uses correct `fix:` prefix. No violations of applicable judgment rules.",
  "comments": [],
  "concerns_addressed": []
}

@bborbe
bborbe merged commit 284f16a into master Aug 2, 2026
1 check passed
@bborbe
bborbe deleted the fix/session-close-daemon-scope branch August 2, 2026 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant