feat: Scope clear-pause-point resume to pause-point-owned pauses

Merged
HA
3mo ago
+187-26

Summary

Round-6 pause-point improvements, PR-1 of 5. Base branch: feature/round6-pause-point-improvements (the Round-6 integration branch), not v3-beta.

clear-pause-point (both --id and --all) previously called ResumeEditorPause() unconditionally. Clearing a marker therefore also resumed a manual pause the user had set outside the pause-point workflow (control-play-mode --action Pause, or the Editor pause button), discarding their run state.

This scopes the resume so a clear only ever resumes a pause-point-owned pause.

Changes

  • UloopPausePointRegistry: Clear/ClearAll now resume only while a pause window is open (_pauseWindowStartUtc.HasValue) — i.e. only when a pause-point hit is what is holding the Editor paused. A manual pause leaves no open window and is left untouched. New private helper ResumeEditorPauseIfOwnedByPausePoint() centralizes the decision and reports whether it resumed.
  • Client-disconnect and expiry paths are unchanged: ApplyPendingClientDisconnectResume and ApplyCaptureWindowExpirations still resume unconditionally, because they must guarantee release of the Editor even when the pause was manual.
  • Resume propagation (no out/ref, per repo convention): Clear returns a tuple (UloopPausePointSnapshot Snapshot, bool ResumedFromPause); UloopPausePointClearAllResult gains a ResumedFromPause field.
  • Warning: the clear-pause-point tool response sets a new SourcePausePointConstants.ClearResumedPlayModeWarning when the clear actually resumed Play Mode.
  • Rewrote the stale "Why always Resume: Option B ..." comments and the UnityEditorPausePointPauseController.Resume() comment to match the new design.

Tests

Added EditMode coverage in PausePointTests (via the pure-C# FakePauseController, new PauseExternally() seam):

  • Clear / ClearAll resume and report ResumedFromPause=true when a hit owns the pause.
  • Clear / ClearAll leave a manual pause untouched (ResumeCount==0) and report ResumedFromPause=false.
  • clear-pause-point / --all tool responses carry the resume warning when they resume, and no warning when a manual pause is preserved.

Existing disconnect/expiry tests are unchanged and still assert unconditional resume.

Validation

  • uloop compile: 0 errors, 0 warnings.
  • uloop run-tests (EditMode, .*PausePoint.*): 222 passed, 0 failed.

Skill files, version fields, changelogs, and protocolVersion are intentionally untouched (skill wording is handled separately in PR-5).