Skip to content

refactor(tests): share summarizer harness helpers - #1994

Merged
Sinity merged 1 commit into
masterfrom
feature/refactor/summarizer-harness-1981
Jun 20, 2026
Merged

Sinity merged 1 commit into
masterfrom
feature/refactor/summarizer-harness-1981

Conversation

@Sinity

@Sinity Sinity commented Jun 20, 2026

Copy link
Copy Markdown
Owner

Summary

Extracts the repeated daily/hourly summarizer test context and windowed processing flow into a small shared automata test helper while preserving every nextest-visible summarizer behavior test name.

Problem

#1981 asks to compress duplicated test harness code without weakening affected-test observability. The hourly and daily summarizer suites each carried their own AutomatonContext construction and identical accumulate-then-emit helper even though the behavior under test is the same Windowed contract shape.

Solution

  • Added tests/automata/summarizer_support.rs with summary_context::<Payload>() and generic process_windowed_input<W: Windowed>().
  • Routed daily_summarizer_test.rs and hourly_summarizer_test.rs through the helper.
  • Kept payload builders local to each suite because hourly and daily payload shapes are materially different.
  • Kept all existing named behavior tests intact for nextest and impact visibility.

#1981 acceptance matrix

  • Summarizer harness cleanup: satisfied for the daily/hourly duplicated context/process flow.
  • Named-case observability: satisfied; no behavior tests were collapsed.
  • Required-input-key, production-path, fixture, chaos, compile-fail runner, and gate-cadence slices: not claimed by this PR; existing prior PRs cover some of these, and refactor(verifiability): streamline xtask test patterns without losing affected-test evidence #1981 remains open until the remaining slices are handled or explicitly moved.

Verification

  • /var/cache/sinex/sinity/00dbba240e89/target/debug/xtask test --allow-contended-host -p sinexd -E 'test(hour_boundary_closes_summary_and_seeds_next_hour) or test(hourly_summary_aggregates_focus_time_and_top_sources) or test(timer_flush_emits_trailing_bucket_without_next_bucket_event) or test(flush_due_false_on_empty_state) or test(flush_due_false_when_pending_window_exists) or test(day_boundary_closes_summary_and_seeds_next_day) or test(daily_summary_aggregates_hourly_rollups)' --format human -> 7 passed, 0 failed, 0 ignored.
  • /var/cache/sinex/sinity/00dbba240e89/target/debug/xtask check --changed-strict origin/master --allow-contended-host --format human -> 4 changed Rust files, affected package sinexd, passed.

Ref #1981

Problem: #1981 keeps the affected-test architecture but calls out repeated summarizer harness setup as cleanup debt. The hourly and daily summarizer tests duplicated AutomatonContext construction and the same accumulate-then-emit flow.

What changed: add a small automata test support module for summary contexts and generic Windowed processing, then route the daily and hourly summarizer behavior tests through it while keeping their payload builders and named tests local.

Verification: xtask test --allow-contended-host -p sinexd -E 'test(hour_boundary_closes_summary_and_seeds_next_hour) or test(hourly_summary_aggregates_focus_time_and_top_sources) or test(timer_flush_emits_trailing_bucket_without_next_bucket_event) or test(flush_due_false_on_empty_state) or test(flush_due_false_when_pending_window_exists) or test(day_boundary_closes_summary_and_seeds_next_day) or test(daily_summary_aggregates_hourly_rollups)' --format human

Ref #1981
@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@Sinity, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 4 minutes and 14 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Free

Run ID: 8cfb37f1-d753-48b3-a967-1f05cc3e7a89

📥 Commits

Reviewing files that changed from the base of the PR and between 210d7e0 and 5377804.

📒 Files selected for processing (4)
  • crate/sinexd/tests/automata.rs
  • crate/sinexd/tests/automata/daily_summarizer_test.rs
  • crate/sinexd/tests/automata/hourly_summarizer_test.rs
  • crate/sinexd/tests/automata/summarizer_support.rs

Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

Comment @coderabbitai help to get the list of available commands and usage tips.

@Sinity
Sinity merged commit c83c774 into master Jun 20, 2026
2 checks passed
@Sinity
Sinity deleted the feature/refactor/summarizer-harness-1981 branch June 20, 2026 05:05
Sinity added a commit that referenced this pull request Jun 20, 2026
Summary

Finishes the two #1981 closure gaps found after the replay-harness PR: the last direct trybuild runner setup now uses a shared support helper, and the verification policy now names when sampled impact audits are required instead of only mentioning impact explain output.

Problem

The #1981 false-close pass found that prior work had compressed the primitives compile-fail runner and documented selected-test evidence, but sinex-macros still owned a one-off trybuild setup and the policy did not tell future agents when to run `xtask impact audit --sample-skips N`. That left the verification cleanup issue almost closed but not exhausted.

Solution

- Add `crate/sinex-macros/tests/support/trybuild.rs` and route the macros compile-fail test through it while keeping the individual fixtures and stderr outputs explicit.
- Extend `.github/ci-policy.md` with impact explain/audit cadence for disputed test-scope claims, impact-planner changes, verification-policy changes, and false-close audits.
- Extend `xtask/docs/verification.md` with an impact-plan coverage audit row and concrete command pattern.

Acceptance matrix

- Required-input-key suite compression: satisfied by #1983.
- Production-path source/common source-path laws: satisfied by #1988.
- Replay/chaos/summarizer harness compression: satisfied by #1992, #1994, #1998, and #2000.
- Compile-fail runner compression: satisfied by #1997 for `sinex-primitives` and by this PR for `sinex-macros`.
- Gate visibility/cadence: satisfied by #1988 for changed-strict guidance and by this PR for impact explain/audit cadence.

Verification

- `env -u SINEX_ROOT nix develop /realm/tmp/worktrees/sinex-1981-final --command xtask test --debug --heavy --include-ignored -p sinex-macros -E 'test(compile_fail_tests)' --format human`  
  Passed: 1, Ignored: 0.
- `env -u SINEX_ROOT nix develop /realm/tmp/worktrees/sinex-1981-final --command xtask check --changed-strict origin/master --allow-contended-host --format human`  
  Passed locally.
- Pre-push `xtask check --changed-strict origin/master --allow-contended-host`  
  Passed: changed-strict checked `sinex-macros`.

Closes #1981
Sinity added a commit that referenced this pull request Jul 13, 2026
Summary

Extracts the repeated daily/hourly summarizer test context and windowed processing flow into a small shared automata test helper while preserving every nextest-visible summarizer behavior test name.

Problem

#1981 asks to compress duplicated test harness code without weakening affected-test observability. The hourly and daily summarizer suites each carried their own `AutomatonContext` construction and identical accumulate-then-emit helper even though the behavior under test is the same Windowed contract shape.

Solution

- Added `tests/automata/summarizer_support.rs` with `summary_context::<Payload>()` and generic `process_windowed_input<W: Windowed>()`.
- Routed `daily_summarizer_test.rs` and `hourly_summarizer_test.rs` through the helper.
- Kept payload builders local to each suite because hourly and daily payload shapes are materially different.
- Kept all existing named behavior tests intact for nextest and impact visibility.

#1981 acceptance matrix

- Summarizer harness cleanup: satisfied for the daily/hourly duplicated context/process flow.
- Named-case observability: satisfied; no behavior tests were collapsed.
- Required-input-key, production-path, fixture, chaos, compile-fail runner, and gate-cadence slices: not claimed by this PR; existing prior PRs cover some of these, and #1981 remains open until the remaining slices are handled or explicitly moved.

Verification

- `/var/cache/sinex/sinity/00dbba240e89/target/debug/xtask test --allow-contended-host -p sinexd -E 'test(hour_boundary_closes_summary_and_seeds_next_hour) or test(hourly_summary_aggregates_focus_time_and_top_sources) or test(timer_flush_emits_trailing_bucket_without_next_bucket_event) or test(flush_due_false_on_empty_state) or test(flush_due_false_when_pending_window_exists) or test(day_boundary_closes_summary_and_seeds_next_day) or test(daily_summary_aggregates_hourly_rollups)' --format human` -> 7 passed, 0 failed, 0 ignored.
- `/var/cache/sinex/sinity/00dbba240e89/target/debug/xtask check --changed-strict origin/master --allow-contended-host --format human` -> 4 changed Rust files, affected package `sinexd`, passed.

Ref #1981
Sinity added a commit that referenced this pull request Jul 13, 2026
Summary

Finishes the two #1981 closure gaps found after the replay-harness PR: the last direct trybuild runner setup now uses a shared support helper, and the verification policy now names when sampled impact audits are required instead of only mentioning impact explain output.

Problem

The #1981 false-close pass found that prior work had compressed the primitives compile-fail runner and documented selected-test evidence, but sinex-macros still owned a one-off trybuild setup and the policy did not tell future agents when to run `xtask impact audit --sample-skips N`. That left the verification cleanup issue almost closed but not exhausted.

Solution

- Add `crate/sinex-macros/tests/support/trybuild.rs` and route the macros compile-fail test through it while keeping the individual fixtures and stderr outputs explicit.
- Extend `.github/ci-policy.md` with impact explain/audit cadence for disputed test-scope claims, impact-planner changes, verification-policy changes, and false-close audits.
- Extend `xtask/docs/verification.md` with an impact-plan coverage audit row and concrete command pattern.

Acceptance matrix

- Required-input-key suite compression: satisfied by #1983.
- Production-path source/common source-path laws: satisfied by #1988.
- Replay/chaos/summarizer harness compression: satisfied by #1992, #1994, #1998, and #2000.
- Compile-fail runner compression: satisfied by #1997 for `sinex-primitives` and by this PR for `sinex-macros`.
- Gate visibility/cadence: satisfied by #1988 for changed-strict guidance and by this PR for impact explain/audit cadence.

Verification

- `env -u SINEX_ROOT nix develop /realm/tmp/worktrees/sinex-1981-final --command xtask test --debug --heavy --include-ignored -p sinex-macros -E 'test(compile_fail_tests)' --format human`  
  Passed: 1, Ignored: 0.
- `env -u SINEX_ROOT nix develop /realm/tmp/worktrees/sinex-1981-final --command xtask check --changed-strict origin/master --allow-contended-host --format human`  
  Passed locally.
- Pre-push `xtask check --changed-strict origin/master --allow-contended-host`  
  Passed: changed-strict checked `sinex-macros`.

Closes #1981
Sinity added a commit that referenced this pull request Jul 16, 2026
Summary

Extracts the repeated daily/hourly summarizer test context and windowed processing flow into a small shared automata test helper while preserving every nextest-visible summarizer behavior test name.

Problem

#1981 asks to compress duplicated test harness code without weakening affected-test observability. The hourly and daily summarizer suites each carried their own `AutomatonContext` construction and identical accumulate-then-emit helper even though the behavior under test is the same Windowed contract shape.

Solution

- Added `tests/automata/summarizer_support.rs` with `summary_context::<Payload>()` and generic `process_windowed_input<W: Windowed>()`.
- Routed `daily_summarizer_test.rs` and `hourly_summarizer_test.rs` through the helper.
- Kept payload builders local to each suite because hourly and daily payload shapes are materially different.
- Kept all existing named behavior tests intact for nextest and impact visibility.

#1981 acceptance matrix

- Summarizer harness cleanup: satisfied for the daily/hourly duplicated context/process flow.
- Named-case observability: satisfied; no behavior tests were collapsed.
- Required-input-key, production-path, fixture, chaos, compile-fail runner, and gate-cadence slices: not claimed by this PR; existing prior PRs cover some of these, and #1981 remains open until the remaining slices are handled or explicitly moved.

Verification

- `/var/cache/sinex/sinity/00dbba240e89/target/debug/xtask test --allow-contended-host -p sinexd -E 'test(hour_boundary_closes_summary_and_seeds_next_hour) or test(hourly_summary_aggregates_focus_time_and_top_sources) or test(timer_flush_emits_trailing_bucket_without_next_bucket_event) or test(flush_due_false_on_empty_state) or test(flush_due_false_when_pending_window_exists) or test(day_boundary_closes_summary_and_seeds_next_day) or test(daily_summary_aggregates_hourly_rollups)' --format human` -> 7 passed, 0 failed, 0 ignored.
- `/var/cache/sinex/sinity/00dbba240e89/target/debug/xtask check --changed-strict origin/master --allow-contended-host --format human` -> 4 changed Rust files, affected package `sinexd`, passed.

Ref #1981
Sinity added a commit that referenced this pull request Jul 16, 2026
Summary

Finishes the two #1981 closure gaps found after the replay-harness PR: the last direct trybuild runner setup now uses a shared support helper, and the verification policy now names when sampled impact audits are required instead of only mentioning impact explain output.

Problem

The #1981 false-close pass found that prior work had compressed the primitives compile-fail runner and documented selected-test evidence, but sinex-macros still owned a one-off trybuild setup and the policy did not tell future agents when to run `xtask impact audit --sample-skips N`. That left the verification cleanup issue almost closed but not exhausted.

Solution

- Add `crate/sinex-macros/tests/support/trybuild.rs` and route the macros compile-fail test through it while keeping the individual fixtures and stderr outputs explicit.
- Extend `.github/ci-policy.md` with impact explain/audit cadence for disputed test-scope claims, impact-planner changes, verification-policy changes, and false-close audits.
- Extend `xtask/docs/verification.md` with an impact-plan coverage audit row and concrete command pattern.

Acceptance matrix

- Required-input-key suite compression: satisfied by #1983.
- Production-path source/common source-path laws: satisfied by #1988.
- Replay/chaos/summarizer harness compression: satisfied by #1992, #1994, #1998, and #2000.
- Compile-fail runner compression: satisfied by #1997 for `sinex-primitives` and by this PR for `sinex-macros`.
- Gate visibility/cadence: satisfied by #1988 for changed-strict guidance and by this PR for impact explain/audit cadence.

Verification

- `env -u SINEX_ROOT nix develop /realm/tmp/worktrees/sinex-1981-final --command xtask test --debug --heavy --include-ignored -p sinex-macros -E 'test(compile_fail_tests)' --format human`  
  Passed: 1, Ignored: 0.
- `env -u SINEX_ROOT nix develop /realm/tmp/worktrees/sinex-1981-final --command xtask check --changed-strict origin/master --allow-contended-host --format human`  
  Passed locally.
- Pre-push `xtask check --changed-strict origin/master --allow-contended-host`  
  Passed: changed-strict checked `sinex-macros`.

Closes #1981
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