Repository navigation
test(runtime-host): pin the settlement coverage window to the usage window - #6023
Conversation
…indow Follow-up to apache#5890 (merged): the runner passes the same startedAt/settledAt window to the completeness check and to the usage summary, and nothing asserted it - the review noted a later edit could quietly separate the two and re-open the delegated-Session undercount. The coverage stub now records its calls and the residencies test asserts it received exactly the window the usage summary read (100, 200 with the harness clock). Swapping the arguments in the runner turns the assertion red. Implements the non-blocking suggestion from the apache#5890 review. Generated-by: GLM-5.3-Flash (ZCode)
Astro-Han
left a comment
There was a problem hiding this comment.
Automated review notice: This comment was posted by an automated review agent. It is not an independent human review and does not replace one.
Review of 253f506e (+20/-7, test only). This follows up the optional P3 from our #5890 review: the runner test's coverage stub ignored its (from, to) arguments, so nothing pinned the completeness check to the usage window.
The stub now records each call, and the "reads usage only after execution residencies settle" test asserts coverage.calls equals [[100, 200]]. That matches the test's now: sequence(100, 200) clock, which supplies startedAt and settledAt. It is the same pair HostHostedExecutionRunner passes to runSettlementCoverage(startedAt, settledAt) (hosted-execution-runner.ts:96). If a later edit gave the check a different window from the totals, this assertion would fail. The other callers of settlementCoverage(overrides) still work, because Object.assign keeps the stub callable with the same return shape.
Findings: None at P0-P3. CI label and test pass. No protocol files.
Astro-Han
left a comment
There was a problem hiding this comment.
Approved at @Astro-Han's explicit request: a small, focused change with no blocking findings in our automated review of this exact head, and CI is green.
Summary
Follow-up to #5890 (merged). The review's non-blocking suggestion: the runner passes the same startedAt/settledAt window to the settlement-completeness check and to the usage summary, and nothing asserted it — a later edit could quietly separate the two and re-open the delegated-Session undercount that window scoping closed.
The coverage stub now records its calls, and the residencies test asserts it received exactly the window the usage summary read (
100, 200with the harness clock). Swapping the runner's arguments turns the assertion red.Verification
hosted-execution-runnersuitenpx biome checkon the touched filenpm run check:asf-headersNot run: the full workspace suite (test-only change, single suite covers the seam).
AI use
Tool(s) and scope: GLM-5.3-Flash (ZCode) authored the assertion and this description; all verification ran locally with outputs reported above.
Generated-bytrailer on the commit.Checklist
Does this PR entail a change in behavior?