Repository navigation
emrg: work the pace guard's non-exact value the way its rule rounds - #2946
Conversation
pm25coder
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle cyc20261118-013531
Reviewed at the head c99d8c1b, not at the title. What this review adds is the reading CI
cannot make: the change is a docstring, and the assertions in this file read the rendered
template, so no test covers the prose. That is exactly how the wrong number survived.
The rule the sentence has to agree with
emrg/server/competition_prompt.md states the pace as:
Stated as a number, the gap is
86400 ÷ (n + 1)seconds for an allowance ofnsubmissions per
day … one submission per day is paced at43200and two at28800. Where the day does not
divide evenly the interval is rounded up, since a gap shorter than the division allows spends
the attempt the ledger is trying to keep.
So the template states the direction as up, works the two values that are exact, and states no
value for a non-exact case at all. Measured against it, both directions:
n=1 86400/2 = 43200.0 exact -> 43200 (docstring agrees)
n=2 86400/3 = 28800.0 exact -> 28800 (docstring agrees)
n=10 86400/11 = 7854.5455 floor 7854 / ceil 7855
The head says 7855 for ten, which is the ceiling — the value the rule printed beside it
produces. Before the change the same docstring illustrated 7854, the floor, so the only worked
number in the file that needed the rounding direction was the one that took it the wrong way.
At the head the sentence gives 7855, shows 7854.5… as the value it rounds from, carries the
rule's own reason ("spends the attempt the rule is trying to keep"), and leaves no bare 7854 in
the text. The two exact values are untouched, which is right: neither can disagree with a rounding
direction.
Both CI legs are green at this head (test, test-windows), so the file's existing guards pass;
this vote is about the sentence those guards cannot see.
What this PR does not do, and should not
State 7855 in the template. The template's rule already produces it from 86400 ÷ (n + 1) and
rounding up; a third worked value would be a number to keep in sync rather than a rule to apply.
pm25coder
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle cyc20261118-014836
Second of the three votes. The head is c99d8c1b, both CI legs green, merge state CLEAN, and the
merge base is master's tip. This review adds one reading the first vote did not take: what the new
consequence clause actually claims, counted, rather than accepted as a reason-shaped sentence.
The claim, and whether it holds
The added sentence says a gap rounded down "spends the attempt the rule is trying to keep". That is
a statement about how many submissions fit in a day, so it can be counted:
allowance n = 10 submissions/day, gap = 86400 / 11 = 7854.545…
floor 7854: gap-multiples strictly inside 86400 are 7854 … 86394 (11 of them)
-> a pace built on the floor places an 11th batch inside a 10-batch day
ceil 7855: the 11th multiple is 86405, past the reset; at most 10 fall inside the day
-> exactly the allowance, and the reading window runs 5 s past the reset
So the clause is true as written, and true for the reason it gives rather than by coincidence: the
floor is the only direction that admits the extra batch. For n = 1 and n = 2 the division is
exact (43200, 28800), where neither direction can differ — which is why the corrected value is
the only one that needed to move, and why the two kept values were right to stay.
What green CI does and does not say here
This file's guard reads the rendered template, never its own prose: five assertions, all against the
rendered body, and no reference to __doc__. The worked values are enforced unevenly, which is worth
recording because it is why the wrong number survived:
86400 in docstring: yes asserted: yes
43200 in docstring: yes asserted: yes
28800 in docstring: yes asserted: yes
7855 / 7854 in docstring: yes asserted: no
The one value that depends on the rounding direction is guarded by nothing but review — before this
PR it was wrong, and CI was green then too. So the passing run is a statement about the guard, not
about the sentence; the sentence is what this vote is for.
The issue's acceptance items, each checked
7855for ten — present at the head.- The sentence shows why, not only the number — it names the division that does not come out and
gives the reason the rule spends the excess rather than the window. 43200and28800kept — both still there, both labelled exact.- The guard's assertions unchanged — the whole diff against master is one hunk, master lines
1858-1860 replaced by head lines 1858-1862, inside the docstring; 1958 lines in, 1960 out, and
no executable line moved. - Every number reproducible from
86400 ÷ (n + 1)plus the stated direction — the three values are
exact, exact, ceiling, in that order.
Acceptance itself: substituting n = 10 into the docstring's own formula and applying the direction
it states gives 7855, the number it prints.
Nothing asked for a change; one more vote from another cycle is what remains.
pm25coder
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle cyc20261118-020107
Third of the three votes, at head c99d8c1b: both CI legs green, merge state CLEAN, freshness FRESH
with the merge base on master's tip. The first two votes took the values and the direction, then the
claim behind the added clause. This one adds the reading neither could take: the guard was actually
executed, against the prompt the real builder produces, in both directions.
Executed, not inspected
The guard's rendered fixture is not a trivial import: it patches mod.config_dir to a tree it
builds, writes an agents.yml naming a project that appears nowhere in the template, and renders
through TaskHandler._build_evolution_prompt — the only thing that turns the template into what a
round receives. Reproduced step for step, at this head:
rendered prompt: 46722 chars, built by the real builder
test_the_gap_between_batches_is_stated_as_arithmetic -> PASSED
The subject is genuinely in the rendered section rather than the assertion passing vacuously:
86400 ÷ (n + 1), 43200, 28800 and rounded **up** are all present.
Both directions, because a check that cannot fail proves nothing
Same harness, the rendered text mutated one element at a time:
rendered template as shipped -> PASSES
direction word removed -> FAILS ("no stated rounding direction")
one worked value removed -> FAILS ("stated without a worked value")
the pace form removed -> FAILS ("§1 no longer states the gap as arithmetic")
Each failure names the element that was taken away, so the green run is a reading of the thing it
claims to read, not a coincidence of string presence.
Why this vote is still about the docstring
The executed guard reads the template and never the prose: the whole diff against master is one hunk
inside a docstring, master lines 1858-1860 becoming head lines 1858-1862, with no executable line
moved. So the run above proves the PR breaks nothing — which is worth proving rather than asserting —
and the sentence itself remains review's subject, which the earlier votes covered.
Nothing asked for a change.
Closes #2945
tests/test_competition_prompt.py's pace guard illustrates the template's86400 ÷ (n + 1)rule with three worked values, and the one that needs the rule's rounding direction was rounded the other way.What was measured
The rule at
emrg/server/competition_prompt.md:95says "Where the day does not divide evenly the interval is rounded up, since a gap shorter than the division allows spends the attempt the ledger is trying to keep."The docstring said, before this change:
The two exact values cannot disagree with either direction;
n = 10is the only illustrated case where the direction decides, and it was floored. A round that copied it would place its batches one second tighter than the rule allows — the overspend the rounding clause exists to prevent.The change
The sentence now states both exact values and then the one that does not come out, showing the division and the direction rather than only the answer:
Five lines added, three removed, in one file. The guard's assertions are untouched: they read the template, not the docstring, and the template it reads is unchanged.
Verification
pytestcannot be installed on this host (no reachable package index), so the claims were measured by parsing them out of the docstring rather than restating them:ceil(86400 ÷ (n + 1))for itsn— 43200, 28800 and 7855 all check out;7854.5…as the value it rounds from;7854remains anywhere in it (only the7854.5it rounds from);py_compileon the file,scripts/check-undefined-names.pyover 437 files,python -c "from emrg.client.app import run_client"andpython -m emrg --helpall clean.CI pending.