Skip to content

feat(moves): add value-oriented move-run orchestration - #122

Merged
acgetchell merged 4 commits into
mainfrom
feat/103-functional-move-runner
Jul 23, 2026
Merged

feat(moves): add value-oriented move-run orchestration#122
acgetchell merged 4 commits into
mainfrom
feat/103-functional-move-runner

Conversation

@acgetchell

@acgetchell acgetchell commented Jul 23, 2026

Copy link
Copy Markdown
Owner
  • Parse pass and checkpoint cadence into a proof-bearing domain value.
  • Return per-invocation accounting and checkpoint state from shared run logic.
  • Preserve RNG stream continuity when reusing move strategies.
  • Enforce parsed cadence, value-oriented accounting, and CRTP-free design.

Closes #103

Summary by CodeRabbit

  • New Features

    • Added shared cadence-based run orchestration for ergodic move strategies, producing aggregated per-run results (including validated cadence parsing).
    • Exposed checkpoint_events() and made result printing const.
    • Enhanced “Move Always” with replayable seed/stream support and an optional option to control checkpoint-file writing.
  • Bug Fixes

    • Fixed move accounting so repeated strategy invocations no longer accumulate statistics across runs.
    • Updated move/checkpoint/transition totals to reflect per-invocation execution.
  • Chores

    • Added new static analysis rules to enforce cadence parsing and per-run accounting invariants.
  • Tests

    • Added unit tests for cadence validation, result aggregation, checkpoint event counting, and replay behavior.

- Parse pass and checkpoint cadence into a proof-bearing domain value.
- Return per-invocation accounting and checkpoint state from shared run logic.
- Preserve RNG stream continuity when reusing move strategies.
- Enforce parsed cadence, value-oriented accounting, and CRTP-free design.
@acgetchell acgetchell self-assigned this Jul 23, 2026
@acgetchell
acgetchell enabled auto-merge July 23, 2026 04:43
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 3 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

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 reviews.

How do review limits work?

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

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, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 7f7f8148-3c8a-4150-9203-9f36bec182e0

📥 Commits

Reviewing files that changed from the base of the PR and between f59c06f and 3c322ee.

📒 Files selected for processing (2)
  • tests/Metropolis_test.cpp
  • tests/Move_always_test.cpp

Walkthrough

This change centralizes move-run cadence, command accounting, checkpointing, and result aggregation in Move_run.hpp, then integrates the shared lifecycle into Metropolis and MoveAlways with expanded tests and Semgrep maintenance rules.

Changes

Move-run centralization

Layer / File(s) Summary
Cadence and result contracts
include/Move_run.hpp, tests/Move_run_test.cpp, tests/Public_api_consumer.cpp
Validated cadence, value-oriented command results, run result carriers, counter consumption, checkpoint orchestration, and public API checks are added.
Metropolis run-state integration
include/Metropolis.hpp, tests/Metropolis_test.cpp
Metropolis uses shared execution, stores per-run statistics and command results, exposes checkpoint events, and preserves transition fingerprint replay checks.
MoveAlways run-state integration
include/Move_always.hpp, tests/Move_always_test.cpp
MoveAlways adopts shared execution, supports file-writing control and run metadata accessors, and validates repeated-run accounting and replay behavior.
Maintenance and build validation
semgrep.yaml, tests/semgrep/functional_boundaries.cpp, tests/CMakeLists.txt
Semgrep rules and fixtures enforce cadence and accounting boundaries, while the new header and tests are registered with the build.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Strategy
  participant execute_move_run
  participant MoveCommand
  participant CheckpointWriter
  Strategy->>execute_move_run: execute pass callback
  execute_move_run->>MoveCommand: consume and reset counters
  MoveCommand-->>execute_move_run: per-pass results
  execute_move_run->>Strategy: report accumulated results
  execute_move_run->>CheckpointWriter: write checkpoint at cadence interval
  execute_move_run-->>Strategy: final manifold and run results
Loading

Possibly related PRs

Poem

Cadence ticks and counters flow,
Through shared runs where results grow.
Checkpoints mark the measured trail,
Seeds replay each tested tale.
Two strategies now align—
One orchestration, neatly twined.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The Semgrep rules and functional-boundaries fixtures add broader invariant-enforcement work beyond #103's orchestration refactor. Move the Semgrep enforcement rules and their fixtures into a separate PR, keeping this change focused on shared run orchestration and counter accounting.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: value-oriented move-run orchestration.
Linked Issues check ✅ Passed The refactor centralizes shared move-run orchestration, preserves strategy-specific logic, and adds tests for reuse, counters, and checkpoints.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/103-functional-move-runner

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

Compare both seeded invocations and their move counters instead of assuming
that distinct RNG states must produce different triangulations.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/Move_always_test.cpp`:
- Around line 174-186: Update the test around replay(initial) to assert the
deterministic fixture’s exact attempted, succeeded, and failed totals for both
the first and second invocations, rather than only comparing each replay result
to its corresponding baseline. Also assert the exact checkpoint-event count for
both invocations using the existing accounting/checkpoint symbols, while
retaining the replay-equivalence checks and descriptive doctest coverage.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: b5f3d1c0-cb59-426b-a9d8-9bfce8a55d78

📥 Commits

Reviewing files that changed from the base of the PR and between abfa888 and d7fa637.

📒 Files selected for processing (1)
  • tests/Move_always_test.cpp

Comment thread tests/Move_always_test.cpp Outdated
- Give pass, report, and checkpoint callables explicit value ownership.
- Document MoveAlways cadence, RNG, and file-output contracts.
- Preserve exact accounting expectations across libc++, libstdc++, and MSVC STL.
- Verify MoveAlways stream continuation with an exact per-move oracle.
@acgetchell
acgetchell merged commit 1f98142 into main Jul 23, 2026
13 checks passed
@acgetchell
acgetchell deleted the feat/103-functional-move-runner branch July 23, 2026 08:48
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.

Centralize move-run orchestration and counter accounting

1 participant