[PR #2311] [MERGED] fix(process): keep provider deadlines independent of wall-clock changes #5156

Closed
opened 2026-10-31 01:04:25 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/2311
Author: @jcamargos
Created: 10/12/2026
Status: ✅ Merged
Merged: 10/13/2026
Merged by: @morluto

Base: main ← Head: codex/reliability-fault-coverage


📝 Commits (6)

  • 2f311ab fix(process): keep provider deadlines independent of wall-clock changes
  • dc5db9e fix(process): preserve deadline regressions while merging main
  • 2ae8655 fix(process): retain monotonic targets after early timers
  • 5be3793 chore: merge main into PR #2311
  • aea0dc6 Merge commit '8fef2aa64e' into codex/ci-wave3-2311
  • eb75036 Merge branch 'main' into codex/reliability-fault-coverage

📊 Changes

1 file changed (+100 additions, -1 deletions)

View changed files

📝 src/process/ProviderDeadline.test.ts (+100 -1)

📄 Description

Summary

Use monotonic elapsed time for the shared provider startup deadline. A wall-clock correction currently changes the remaining budget and can turn caller cancellation into a timeout. Found through deterministic fault injection; no related issue was identified.

Problem and expected behavior

With a 1-second deadline, after 250 ms a one-hour backward wall-clock correction reports 3,600,750 ms remaining; a forward correction reports zero and incorrectly classifies a later caller abort as a timeout. Moving the wall clock backward after expiry also revives the reported remaining budget. Startup duration and cancellation classification must be independent of civil time.

Change and scope

Replace Date.now() with performance.now() at the deadline's producing boundary, including elapsed-deadline checks before the timer callback runs. Round remaining fractional milliseconds upward to preserve integral downstream request budgets. Existing timer and abort-listener ownership remain unchanged. Add six deterministic regressions for forward/backward corrections, expiry, cancellation, delayed timer callbacks, and fractional elapsed time.

Contract and boundary impact

  • Semantic owner: src/process/ProviderDeadline.ts, shared by provider startup and owned-command consumers.
  • Scope: routine reliability fix within existing authority; no new provider or target execution capability.
  • CLI/MCP schemas, default timeout values, provider selection, Evidence, package metadata: unchanged.
  • Expected effects: internal deadline accounting only; no additional target interaction.

Evidence and regression coverage

On base bb26622670, all five initial clock-fault regressions fail. With the fix, all six tests pass. The sixth verifies whole-millisecond compatibility with a high-resolution clock.

Validation performed

Windows x64, pinned Node 24.18.0 / npm 11.16.0:

  • npm run test:local -- src/process/ProviderDeadline.test.ts: 6 passed.
  • Existing providerProcess.test.ts deadline/lifecycle selection: 4 passed, 20 unrelated tests deselected.
  • GhidraProvider.behavior.test.ts startup-setting propagation selection: 1 passed, 48 unrelated tests deselected; uses a provider factory fixture, not a real Ghidra engine.
  • npm run check: passed; lint 0 errors / 932 warnings in the repository; two existing bundle warnings.
  • npm run verify:test-discovery: 963 files discovered exactly once.
  • npm run docs:check: passed, including 2 README consistency tests. The generated managed-evidence ledger remains complete:false; this is not full provider conformance.
  • git diff --check: passed.

Compatibility, safety, and release

No breaking change, migration, new dependency or change to cleanup authority. This is a wall-clock fault reproduction, not a fix or reproduction of macOS issue #2290. No real Ghidra/Hopper/IDA or macOS/Linux run is claimed. No end-to-end speedup is claimed.

Before merge

  • Reproducible failure with a regression that fails on the base.
  • Fix resides in the shared owner rather than compensating in consumers.
  • Existing deadline lifecycle and configuration propagation checked.
  • Diff reviewed for unrelated changes and unsupported claims.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/2311 **Author:** [@jcamargos](https://github.com/jcamargos) **Created:** 10/12/2026 **Status:** ✅ Merged **Merged:** 10/13/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `codex/reliability-fault-coverage` --- ### 📝 Commits (6) - [`2f311ab`](https://github.com/morluto/rea/commit/2f311abf8ec0be819a915f6cdecb197e5991eb20) fix(process): keep provider deadlines independent of wall-clock changes - [`dc5db9e`](https://github.com/morluto/rea/commit/dc5db9e70c1e1ed2e9df9e0a81d2c05f5c2da9ad) fix(process): preserve deadline regressions while merging main - [`2ae8655`](https://github.com/morluto/rea/commit/2ae86554437e27d32ac2bb421ceaa68cab4f333f) fix(process): retain monotonic targets after early timers - [`5be3793`](https://github.com/morluto/rea/commit/5be37934ff0c62f34f6ed9a94985ac46ff98910e) chore: merge main into PR #2311 - [`aea0dc6`](https://github.com/morluto/rea/commit/aea0dc636c70b0e5290f5404b01ea7afdb509eec) Merge commit '8fef2aa64ec1ee742e8b70b825938d30a0ea7319' into codex/ci-wave3-2311 - [`eb75036`](https://github.com/morluto/rea/commit/eb750361c93552613abd057a93dbd598a76d015a) Merge branch 'main' into codex/reliability-fault-coverage ### 📊 Changes **1 file changed** (+100 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/process/ProviderDeadline.test.ts` (+100 -1) </details> ### 📄 Description ## Summary Use monotonic elapsed time for the shared provider startup deadline. A wall-clock correction currently changes the remaining budget and can turn caller cancellation into a timeout. Found through deterministic fault injection; no related issue was identified. ## Problem and expected behavior With a 1-second deadline, after 250 ms a one-hour backward wall-clock correction reports 3,600,750 ms remaining; a forward correction reports zero and incorrectly classifies a later caller abort as a timeout. Moving the wall clock backward after expiry also revives the reported remaining budget. Startup duration and cancellation classification must be independent of civil time. ## Change and scope Replace Date.now() with performance.now() at the deadline's producing boundary, including elapsed-deadline checks before the timer callback runs. Round remaining fractional milliseconds upward to preserve integral downstream request budgets. Existing timer and abort-listener ownership remain unchanged. Add six deterministic regressions for forward/backward corrections, expiry, cancellation, delayed timer callbacks, and fractional elapsed time. ## Contract and boundary impact - Semantic owner: src/process/ProviderDeadline.ts, shared by provider startup and owned-command consumers. - Scope: routine reliability fix within existing authority; no new provider or target execution capability. - CLI/MCP schemas, default timeout values, provider selection, Evidence, package metadata: unchanged. - Expected effects: internal deadline accounting only; no additional target interaction. ## Evidence and regression coverage On base bb266226707135ad9f181e6c3afd6af0ef62fb22, all five initial clock-fault regressions fail. With the fix, all six tests pass. The sixth verifies whole-millisecond compatibility with a high-resolution clock. ## Validation performed Windows x64, pinned Node 24.18.0 / npm 11.16.0: - npm run test:local -- src/process/ProviderDeadline.test.ts: 6 passed. - Existing providerProcess.test.ts deadline/lifecycle selection: 4 passed, 20 unrelated tests deselected. - GhidraProvider.behavior.test.ts startup-setting propagation selection: 1 passed, 48 unrelated tests deselected; uses a provider factory fixture, not a real Ghidra engine. - npm run check: passed; lint 0 errors / 932 warnings in the repository; two existing bundle warnings. - npm run verify:test-discovery: 963 files discovered exactly once. - npm run docs:check: passed, including 2 README consistency tests. The generated managed-evidence ledger remains complete:false; this is not full provider conformance. - git diff --check: passed. ## Compatibility, safety, and release No breaking change, migration, new dependency or change to cleanup authority. This is a wall-clock fault reproduction, not a fix or reproduction of macOS issue #2290. No real Ghidra/Hopper/IDA or macOS/Linux run is claimed. No end-to-end speedup is claimed. ## Before merge - [x] Reproducible failure with a regression that fails on the base. - [x] Fix resides in the shared owner rather than compensating in consumers. - [x] Existing deadline lifecycle and configuration propagation checked. - [x] Diff reviewed for unrelated changes and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:04:25 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#5156
No description provided.