IW-620: Shutdown-safe GitAdapter read, stage and commit #624

Merged
claude merged 14 commits from IW-620 into main 2026-09-26 11:12:23 +00:00
Member

Summary

GitAdapter.dirtyState, stageAll, commit and getFullHeadSha now take destroyOnExit: Boolean = true as their last parameter and pass it to ProcessAdapter.run (added by #616). A caller can now read the dirty state, stage, commit and read the new SHA from inside a JVM shutdown hook. kanon's LiveWorkingTree can delegate to core and stop repeating these methods.

Changes

  • core/adapters/Git.scala: the flag goes through the full call chain of each public method, including commit → getFullHeadSha and the private porcelainStatus. The default keeps all current callers unchanged.
  • core/test/GitTest.scala, core/test/ShutdownSpawnProbe.scala, core/test/ProcessTest.scala: forked-JVM tests run dirtyState, stageAll and commit inside a shutdown hook. The probe harness is shared with the ProcessAdapter shutdown test.
  • docs/api/Git.md: documents the new parameter.

Testing

  • Unit tests in core.test pass, including two forked-JVM shutdown tests (see review-packet.md).
  • Phase PR #621 passed CI.

Follow-ups filed

Release notes

Bezpečnější čtení stavu gitu, příprava a commit při ukončování procesu. Zjištění rozpracovaných změn, jejich příprava ke commitu a vytvoření commitu mohou proběhnout i v kroku spuštěném těsně před ukončením procesu, se stejným chováním a chybovými hláškami jako za běžného provozu. Bez výslovného vyžádání se nic nemění. Podrobnosti: project-management/issues/IW-620/release-notes.md.

🤖 Generated with Claude Code

Closes #620

## Summary `GitAdapter.dirtyState`, `stageAll`, `commit` and `getFullHeadSha` now take `destroyOnExit: Boolean = true` as their last parameter and pass it to `ProcessAdapter.run` (added by #616). A caller can now read the dirty state, stage, commit and read the new SHA from inside a JVM shutdown hook. kanon's `LiveWorkingTree` can delegate to core and stop repeating these methods. ## Changes - `core/adapters/Git.scala`: the flag goes through the full call chain of each public method, including `commit` → `getFullHeadSha` and the private `porcelainStatus`. The default keeps all current callers unchanged. - `core/test/GitTest.scala`, `core/test/ShutdownSpawnProbe.scala`, `core/test/ProcessTest.scala`: forked-JVM tests run `dirtyState`, `stageAll` and `commit` inside a shutdown hook. The probe harness is shared with the `ProcessAdapter` shutdown test. - `docs/api/Git.md`: documents the new parameter. ## Testing - Unit tests in `core.test` pass, including two forked-JVM shutdown tests (see `review-packet.md`). - Phase PR #621 passed CI. ## Follow-ups filed - #622, #623 ## Release notes Bezpečnější čtení stavu gitu, příprava a commit při ukončování procesu. Zjištění rozpracovaných změn, jejich příprava ke commitu a vytvoření commitu mohou proběhnout i v kroku spuštěném těsně před ukončením procesu, se stejným chováním a chybovými hláškami jako za běžného provozu. Bez výslovného vyžádání se nic nemění. Podrobnosti: `project-management/issues/IW-620/release-notes.md`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Closes #620
GitAdapter dirtyState, stageAll and commit cannot take destroyOnExit, so a shutdown-safe caller must repeat them

Artifacts:
- analysis.md
- issue.md

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GitAdapter dirtyState, stageAll and commit cannot take destroyOnExit, so a shutdown-safe caller must repeat them

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Issue: IW-620
Phase: 1 - Shutdown-safe GitAdapter read, stage and commit

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

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Shutdown-safe GitAdapter read, stage and commit

Artifacts:
- phase-01-tasks.md

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs(IW-620): add review packet for the feature branch
Some checks failed
CI / changes (pull_request) Successful in 4s
CI / contract (pull_request) Has been skipped
CI / format (pull_request) Successful in 10s
CI / lint (pull_request) Successful in 12s
CI / test (pull_request) Has been cancelled
CI / dashboard-build (pull_request) Has been cancelled
CI / compile (pull_request) Has been cancelled
a7516946cd
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
chore(IW-620): update review-state to all_complete
All checks were successful
CI / dashboard-build (pull_request) Successful in 1m14s
CI / test (pull_request) Successful in 15m41s
CI / contract (pull_request) Has been skipped
CI / changes (pull_request) Successful in 4s
CI / format (pull_request) Successful in 10s
CI / lint (pull_request) Successful in 11s
CI / compile (pull_request) Successful in 1m33s
720a130e64
claude merged commit 82f267d712 into main 2026-09-26 11:12:23 +00:00
Sign in to join this conversation.
No description provided.