Skip to content

Have the model count elapsed days from listed dates, so it stops slipping by a year - #242

Merged
danielchalmers merged 1 commit into
mainfrom
c/elapsed-time-anchors
Nov 9, 2026
Merged

danielchalmers merged 1 commit into
mainfrom
c/elapsed-time-anchors

Conversation

@danielchalmers

Copy link
Copy Markdown
Owner

Why

On Haiku, the bot marked MudBlazor feature requests stale before they had been idle for the policy's 1096 days. Its summaries show two kinds of date mistake:

  • A whole year off. On MudBlazor 8274 it wrote "about 1341 days" for a gap of 978.
  • No count, or a count that isn't compared. On 7418 it wrote that the gap "far exceeds" 1096 days at 1094.6. On 8185 it counted "about 995 days" and still called that over 1096.

Haiku does this subtraction in its head, and Claude's Chat Completions endpoint ignores reasoning_effort, so asking it to think harder isn't an option.

What

Two additions to the prompt. No new input, no schema change, no tool.

  • Dated anchors in the runtime context. Under the current time, one line lists the run's date in each of the last six years with the exact days since each:

    The same date in earlier years, for counting days from: 2025-11-09 was 365 days ago, 2024-11-09 was 730 days ago, 2023-11-09 was 1096 days ago, 2022-11-09 was 1461 days ago, 2021-11-09 was 1826 days ago, 2020-11-09 was 2191 days ago.

  • One harness rule, after "Use the current UTC timestamp only for policy rules that depend on time":

    For a rule that depends on elapsed time, count the time exactly instead of estimating it. The run context lists the same date in earlier years with the exact days since each: start from the listed date nearest to the earlier moment and add or subtract the days between the two. Then compare the result with the rule's limit as two numbers and put both in the summary, such as "365 days plus 70 days is 435 days, and 435 is less than 500, so the limit isn't reached". Only plan an operation that depends on elapsed time when the comparison shows its limit is reached.

Summaries then read like this one, on MudBlazor 8274: "983 days before the current UTC timestamp of 2026-11-09 (730 days plus 253 days, and 983 is less than the 1096-day feature threshold)".

  • Still generic. The anchors are calendar facts. Every threshold stays in the repository's own policy.
  • Both pieces are needed. The anchors alone changed nothing, and a counting rule without anchors made things worse (see "Other wordings").

Measurements

These are dry replays on claude-haiku-5-5, about 3,850 calls, with nothing written to GitHub. Each item goes through the action's own prompts, schema and client, with a GitHub client that can only replay a frozen snapshot. Runs are scored against MudBlazor's Inactivity Rules written as code, which give the stale, unstale or close action each item is due.

180 open MudBlazor items at the real time: 100 within 45 days of a stale or close threshold, and 80 feature requests idle for 650 to 1050 days. 837 runs of main and 743 of this branch.

main This PR
Wrong stale marks, where nothing was due 12 of 729 (1.6%) 2 of 644 (0.3%)
Those that were date mistakes 11 1
Day counts a whole year or two off 8 of 497 1 of 447
Due closes made 57 of 57 55 of 55
Due stale marks made 21 of 23 16 of 20
Unearned stale labels removed 4 of 15 6 of 12
Cost per 1,000 items $2.92 $3.05
  • The 11 date mistakes on main: five were a year off, such as "about 1461 days" for 1094 on 3125 and "about 1,410 days" for 1045 on 7974. Six had no count or a wrong comparison, such as 9158: "about 25 months before the current date, so the feature-issue stale threshold of 1096 days of inactivity is met".
  • The one on this branch: 9136, where "365 plus 199 days" was written for a gap of 365 plus 170, which put a bug at 564 days against a limit of 548.
  • The other wrong mark, on both sides, is 1692. The model overlooked a maintainer's 2024 comment in a long timeline and measured from 2021. Its count from 2021 was right.
  • Left out of the table: 6510, a docs issue with neither bug nor enhancement. Every run on both sides closed it 85 days after its stale label, and my scoring rules don't say which threshold covers it.

120 time-shifted cases: 120 quiet MudBlazor issues, each replayed at a "current time" set 2 to 366 days before, or 2 to 60 days after, its 548-day or 1096-day threshold. 240 runs a side.

main This PR
Wrong stale marks 0 of 150 0 of 150
Due stale marks made 84 of 90 89 of 90
Day counts a whole year or two off 7 of 240 0 of 240

Other decisions don't move. On the 180 real items, the labels, comments and titles planned apart from stale ones were the same on 179 items between main and this branch. Two runs of main against each other agree on 178 to 180.

Other wordings, on the 120 time-shifted cases:

Runs Wrong stale Due stale made Cost per 1,000 items
main 240 0 84 of 90 $2.91
A counting method (years, then months, then days), no anchors 120 2 42 of 45 $3.05
Anchors, no rule 120 0 41 of 45 $2.93
The counting method with anchors 240 1 87 of 90 $3.08
Anchors with a rule to count from them (this PR) 240 0 89 of 90 $3.02
A typed time_checks field in the response 240 0 88 of 90 $3.18
Anchors with the typed field 240 1 90 of 90 $3.23
A time_between function tool the model can call 120 0 44 of 45 $5.17

The tool is the yardstick, not part of this PR. On the 180 real items it made no wrong stale mark in 312 runs, but Haiku called it on only 59% of items, and each call sends the whole prompt again, so it costs $5.01 per 1,000 items against $3.05.

Verification

  • npm run verify passes, with 334 tests.
  • Three new tests: the rule's text, the anchor line for an ordinary date, and a run on February 29.
  • The prompts this branch builds are byte-identical to the measured ones on all 300 eval inputs.

Risk

  • Small numbers. The headline is 12 wrong stale marks against 2. A gap that size would come up by chance about once in 70 tries.
  • Due stale marks: 16 of 20 against 21 of 23. Every miss on both sides is on 9979 or 10336, where the model counted correctly and then declined to re-add a label the bot had removed earlier. 10336 was missed in 3 of 4 runs here and 1 of 5 on main, which may be chance.
  • It only fixes date mistakes. 10416 still keeps its stale label in every run, because the model reads an enhancement-labelled issue as a bug and applies the 548-day limit. That and the two items above are policy questions.
  • "Its limit is reached" fits "at least N days" rules. A rule that needs less than N days wasn't measured. MudBlazor's policy and the example prompt have none.
  • Longer summaries. Output tokens rise 18%, which is the whole 4.5% cost increase.
  • Haiku only. Gemini and OpenAI models get the same two additions, unmeasured.

…ping by a year

Haiku subtracted dates that are years apart in its head and slipped by a whole year, or skipped the count and called 990 days more than 1096, which marked items stale early.
The runtime context now lists the run's date in each of the last six years with the exact days since each.
One harness rule tells the model to count from the nearest of those dates, and to write the comparison with the rule's limit in the summary before planning anything that depends on it.
@github-actions github-actions Bot added the bug Something isn't working label Nov 9, 2026
@danielchalmers
danielchalmers merged commit 2c7ae52 into main Nov 9, 2026
5 checks passed
@danielchalmers
danielchalmers deleted the c/elapsed-time-anchors branch November 9, 2026 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant