Repository navigation
fix(infra): a zero graph TTL is stale even when the clock reads the mtime back (#692) - #950
Conversation
…time back (#692) #692 class 9, test_ttl_zero_everything_stale, Windows run 38008915302 (job 114084097957): `assert False is True`. graph_is_stale returned `age_hours > graph_ttl_hours()`; on Windows a just-written graph's age was 0, which is not older than 0 hours. A zero TTL now returns stale before the age is read, as claim_reanalysis_slot already does. The tests freeze time.time at the file's mtime, reproducing the Windows clock on every platform, and pin the boundary (exactly TTL old is fresh, one second more is stale). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018kyZYqpV8QEumVvQXENjQN
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018kyZYqpV8QEumVvQXENjQN
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Claude finished @cdeust's task in 1m 32s —— View job PR #950 review: done
There are no Blockers. The zero-TTL early return in I could not run pytest, ruff or Verdict: approve |
Review 1 of 3 (ADR-1119): PR #950I ran five reviews on this PR: code quality, documentation accuracy, performance, security and test coverage. None of them found a Blocker.
Notes, no action before merge
Verdict: approve |
|
Merci pour la revue 1. Je ne pousse pas pour les trois notes, car elles sont non bloquantes :
Generated by Claude Code |
Summary
A zero
CORTEX_PIPELINE_GRAPH_TTL_HOURSis documented to make every codebase graph stale ("A zero TTL bounds nothing, as it makes every graph stale").graph_is_staleencoded that asage_hours > ttl, which only holds when the clock has advanced past the file's mtime. On Windows it had not: run 38008915302, job 114084097957,tests_py/infrastructure/test_pipeline_graph_ttl.py:63 test_ttl_zero_everything_stale,assert False is True. A just-written graph had an age of 0, which is not older than 0 hours. A zero TTL now returns stale before the age is read, asclaim_reanalysis_slotalready does (ttl_seconds <= 0.0).Refs #692 (class 9, the "TTL on a coarse Windows clock" test; the issue tracks the remaining classes).
Type of change
Test plan
test_ttl_zero_is_stale_at_age_zerofreezestime.timeat the file's mtime, which reproduces the Windows clock on every platform. Without the fix it fails on Linux (1 failed, 10 passed); with it,11 passed.test_a_graph_exactly_ttl_old_is_not_stalepins the boundary: exactly TTL old is fresh, one second older is stale.graph_is_stale, with theci_mutation_diff.select_testsselection (test_session_start,test_pipeline_graph_ttl,test_reanalysis_slot_claim). The first run left 2 survivors (<= 1.0,/ 3601.0), and the boundary test now kills them; second run: 0 survivors.pyteston those 3 files: 98 passed.ruff check,ruff format --checkon the changed files andcheck_craftsmanship.py: OK.Audit notes
Coding-standards compliance
Reviewer checklist
Generated by Claude Code