Skip to content

Bound worktree freshness fetch (#927)#929

Merged
chubes4 merged 1 commit into
mainfrom
fix/927-bounded-freshness-fetch
Jul 20, 2026
Merged

Bound worktree freshness fetch (#927)#929
chubes4 merged 1 commit into
mainfrom
fix/927-bounded-freshness-fetch

Conversation

@chubes4

@chubes4 chubes4 commented Jul 20, 2026

Copy link
Copy Markdown
Member

Closes #927

Summary

  • Give WorktreeStalenessProbe::fetch() the existing five-second bounded git-probe budget through GitRunner/ProcessRunner.
  • Classify git_command_timeout as unverified freshness, preserving the existing fail-closed worktree_freshness_unverified gate and allow_unverified_freshness bypass.
  • Surface timeout-specific diagnostics and response fields without producing stale-repository evidence.

Source Evidence

  • Source relationship: Bound remote fetch during worktree freshness checks #927 identifies the unbounded pre-create git fetch --quiet origin in WorktreeStalenessProbe; nearby lifecycle freshness probes already use the five-second generic git timeout contract.
  • Change kind: Narrow owning-layer timeout propagation and structured failure classification.
  • Why this is not broader: Only the freshness fetch receives a timeout. Successful fetches and ordinary fetch failures retain their existing paths; stale commit evidence remains omitted whenever freshness is unverified.

Verification

  1. composer install --no-interaction --prefer-dist
  2. php tests/process-runner-command-spec.php validates a controlled hanging child is terminated and returns the configured generic timeout envelope.
  3. php tests/worktree-staleness-fetch-timeout.php verifies the probe passes its five-second budget to its runner and returns actionable structured timeout data without network access.
  4. php tests/worktree-add-lifecycle.php verifies successful fetch and ordinary fetch-failure/allow_unverified_freshness lifecycle behavior.
  5. for test in tests/*.php; do php "$test" || exit 1; done was attempted: tests through workspace-safe-cleanup-orchestrator passed, then the unrelated tests/worktree-active-no-signal-scope.php failed because it does not require WorktreeCleanupCandidateClassifier.

Verification capability: Focused deterministic coverage and the lifecycle integration test pass. PHPStan is not installed by this repository lockfile (vendor/bin/phpstan is absent).

Compatibility

No input contract changes. Existing successful and ordinary fetch-failure behavior is retained. Callers opting into unverified freshness additionally receive optional fetch_timed_out and fetch_timeout_seconds fields when the bounded fetch expires.

AI Disclosure

Implemented with OpenAI gpt-5.6-terra through Homeboy/OpenCode.

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.

Bound remote fetch during worktree freshness checks

1 participant