IW-616: Shutdown-safe ProcessAdapter.run #618

Merged
mph merged 12 commits from IW-616 into main 2026-09-25 05:19:22 +00:00
Member

Summary

ProcessAdapter.run gets a destroyOnExit: Boolean = true parameter, passed to os.proc(...).call. With destroyOnExit = false, a caller (for example a shutdown hook) can spawn a process while the JVM shuts down. The default stays true, so no current caller changes behavior.

Changes

  • core/adapters/Process.scala — new destroyOnExit parameter and Scaladoc.
  • core/test/ShutdownSpawnProbe.scala — probe main that spawns git from a shutdown hook.
  • core/test/ProcessTest.scala — two forked-JVM tests: default path throws during shutdown; destroyOnExit = false succeeds.
  • docs/api/Process.md — documents the parameter.

Testing

  • Phase 1 PR #617 passed CI (full suite).
  • Unit: the two forked-JVM tests in ProcessTest; the existing run tests are unchanged.
  • No CLI command changed, so no BATS change.

Review packet: project-management/issues/IW-616/review-packet.md

Release notes

Bezpečnější spouštění příkazů při ukončování procesu — nástroje postavené na iw-cli teď mohou spustit příkaz i ve chvíli, kdy jejich proces končí, pokud si to vyžádají (destroyOnExit = false). Výchozí chování se nemění. Viz project-management/issues/IW-616/release-notes.md.

🤖 Generated with Claude Code

Closes #616

## Summary `ProcessAdapter.run` gets a `destroyOnExit: Boolean = true` parameter, passed to `os.proc(...).call`. With `destroyOnExit = false`, a caller (for example a shutdown hook) can spawn a process while the JVM shuts down. The default stays `true`, so no current caller changes behavior. ## Changes - `core/adapters/Process.scala` — new `destroyOnExit` parameter and Scaladoc. - `core/test/ShutdownSpawnProbe.scala` — probe main that spawns `git` from a shutdown hook. - `core/test/ProcessTest.scala` — two forked-JVM tests: default path throws during shutdown; `destroyOnExit = false` succeeds. - `docs/api/Process.md` — documents the parameter. ## Testing - Phase 1 PR #617 passed CI (full suite). - Unit: the two forked-JVM tests in `ProcessTest`; the existing `run` tests are unchanged. - No CLI command changed, so no BATS change. Review packet: `project-management/issues/IW-616/review-packet.md` ## Release notes Bezpečnější spouštění příkazů při ukončování procesu — nástroje postavené na iw-cli teď mohou spustit příkaz i ve chvíli, kdy jejich proces končí, pokud si to vyžádají (`destroyOnExit = false`). Výchozí chování se nemění. Viz `project-management/issues/IW-616/release-notes.md`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Closes #616
ProcessAdapter.run cannot spawn during JVM shutdown, so no recovery step can reach git

Artifacts:
- analysis.md
- issue.md

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ProcessAdapter.run cannot spawn during JVM shutdown, so no recovery step can reach git

Artifacts:
- tasks.md
- review-state.json (tasks_ready)

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Issue: IW-616
Phase: 1 - Shutdown-safe ProcessAdapter.run

This commit marks the checkpoint for phase 1 context generation.
Use wf-implement IW-616 to return to this point.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Shutdown-safe ProcessAdapter.run

Artifacts:
- phase-01-tasks.md

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs(IW-616): add review packet for final PR
Some checks failed
CI / changes (pull_request) Successful in 4s
CI / format (pull_request) Successful in 10s
CI / lint (pull_request) Successful in 11s
CI / contract (pull_request) Has been skipped
CI / test (pull_request) Has been cancelled
CI / dashboard-build (pull_request) Has been cancelled
CI / compile (pull_request) Has been cancelled
8a598d2a3c
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
chore(IW-616): update review-state to all_complete
All checks were successful
CI / changes (pull_request) Successful in 4s
CI / contract (pull_request) Has been skipped
CI / format (pull_request) Successful in 9s
CI / compile (pull_request) Successful in 1m38s
CI / lint (pull_request) Successful in 11s
CI / dashboard-build (pull_request) Successful in 1m17s
CI / test (pull_request) Successful in 15m38s
69f98518cb
mph merged commit 151e305d96 into main 2026-09-25 05:19:22 +00:00
Sign in to join this conversation.
No description provided.