Skip to content

test(runtime-host): pin the settlement coverage window to the usage window - #6023

Merged
Astro-Han merged 1 commit into
apache:mainfrom
ggbdpq:fix/coverage-window-assertion
Oct 9, 2026
Merged

Astro-Han merged 1 commit into
apache:mainfrom
ggbdpq:fix/coverage-window-assertion

Conversation

@ggbdpq

@ggbdpq ggbdpq commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

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, 200 with the harness clock). Swapping the runner's arguments turns the assertion red.

Verification

Check Result
Mutation: swap coverage args in the runner assertion red (1 fail, target test)
Restored head: hosted-execution-runner suite 9/9 pass
npx biome check on the touched file clean
npm run check:asf-headers pass

Not run: the full workspace suite (test-only change, single suite covers the seam).

AI use

  • Generative tooling made a substantive contribution

Tool(s) and scope: GLM-5.3-Flash (ZCode) authored the assertion and this description; all verification ran locally with outputs reported above. Generated-by trailer on the commit.

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes
  • No

@github-actions github-actions Bot added the effort/S Under 100 readable lines label Oct 9, 2026
…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 Astro-Han left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Astro-Han left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Astro-Han
Astro-Han merged commit 6f8fd70 into apache:main Oct 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/S Under 100 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants