Skip to content

D235 — the tests hold the engine's clock at the day the run started - #431

Merged
napkinstack-agent[bot] merged 1 commit into
mainfrom
d235-tests-hold-the-day
Nov 18, 2026
Merged

napkinstack-agent[bot] merged 1 commit into
mainfrom
d235-tests-hold-the-day

Conversation

@napkinstack-agent

Copy link
Copy Markdown
Contributor

Why

D228's oracle started on 2026-11-17 and finished on 2026-11-18. Seven tests of test_plan.py failed because of the date, not because of any rule; run again, they passed.

test_plan.py computes TODAY once, when the module loads, and builds parametrize arguments from it. The engine reads the clock at each call. A run that crosses midnight therefore puts the two a day apart.

What

  • platform/tests/conftest.py: an autouse fixture holds the engine's clock at the day the run started, RUN_DAY.
    • It covers the modules that read the clock: fitness/plan, fitness/manifests and pull_request.
    • Only date.today() is held; datetime.datetime stays real.
  • Not taken: computing each test's dates at call time. The parameters are built at import, and the engine's own today would still move under them.
  • Register row D235.

Tests

  • Reproduced first. A pytest plugin set the engine one day ahead of the tests, as a midnight crossing does. It gave exactly the seven failures seen:
    • test_the_accepted_cycle_says_its_progress_in_one_line;
    • test_a_dropped_deliverable_counts_in_nothing_and_a_state_absent_is_not_said;
    • test_a_cycle_past_its_end_says_the_circuit_breaker;
    • test_a_cycle_not_started_says_when_it_starts;
    • test_the_end_date_is_the_first_day_over[last day];
    • test_one_day_is_said_in_the_singular ×2.
  • With the fix, the same plugin gives 641 passed across the four test files that read dates.
  • Oracle: platform tests OK. Fitness compliant.

🤖 Generated with Claude Code

Agent-Session: nstack-os-d235

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@napkinstack-agent
napkinstack-agent Bot requested a review from a team as a code owner November 18, 2026 09:56
@napkinstack-agent
napkinstack-agent Bot merged commit 4033b06 into main Nov 18, 2026
3 checks passed
@napkinstack-agent
napkinstack-agent Bot deleted the d235-tests-hold-the-day branch November 18, 2026 10:10
napkinstack-agent Bot added a commit that referenced this pull request Nov 18, 2026
… refusals said (#436)

D234–D239 (#425, #426, #431–#435).

Agent-Session: nstack-os-v0320

Co-authored-by: napkinstack-agent[bot] <330339777+napkinstack-agent[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant