Skip to content
This repository was archived by the owner on Aug 12, 2026. It is now read-only.

feat(api)!: expose reported Metropolis transitions - #153

Merged
acgetchell merged 4 commits into
mainfrom
fix/114-doxygen-site-validation
Aug 8, 2026
Merged

acgetchell merged 4 commits into
mainfrom
fix/114-doxygen-site-validation

Conversation

@acgetchell

@acgetchell acgetchell commented Aug 8, 2026 •

Copy link
Copy Markdown
Owner
  • return typed reports that distinguish candidate success from acceptance
  • add a compiled ten-proposal quickstart with replayable provenance
  • pin and validate the self-contained archival Doxygen site

BREAKING CHANGE: attempt_transition(manifold, move, trial) now returns MetropolisTransition instead of bool; use .accepted() for the previous result.

Closes #114

Summary by CodeRabbit

  • New Features

    • Added a runnable C++23 API quickstart covering triangulation, transitions, validation, and persistence.
    • Added structured transition results distinguishing successful, accepted, rejected, and failed moves.
    • Added configured-attempt counts to reproducibility metadata.
    • Added stable move-type formatting.
    • Integrated the quickstart into builds and automated tests.
  • Documentation

    • Expanded API references, quickstarts, persistence guidance, and generated-site validation requirements.
  • Bug Fixes

    • Improved generated documentation checks for assets, links, warnings, and references.
    • Added validation to reject invalid persistence metadata.

- return typed reports that distinguish candidate success from acceptance
- add a compiled ten-proposal quickstart with replayable provenance
- pin and validate the self-contained archival Doxygen site

BREAKING CHANGE: attempt_transition(manifold, move, trial) now returns
MetropolisTransition instead of bool; use .accepted() for the previous result.

Closes #114
@acgetchell acgetchell self-assigned this Aug 8, 2026
@acgetchell
acgetchell enabled auto-merge August 8, 2026 16:02
@coderabbitai

coderabbitai Bot commented Aug 8, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 3dcfdf09-f382-4440-9589-c40065fe5f9b

📥 Commits

Reviewing files that changed from the base of the PR and between f183f07 and 70ab238.

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

Walkthrough

The pull request adds a compiled C++ API quickstart, structured Metropolis transition results, reproducibility metadata, public API documentation, and generated-site validation with pinned Doxygen and Python tooling.

Changes

Public API and archival documentation

Layer / File(s) Summary
Structured transitions and persistence
include/Metropolis.hpp, include/Move_outcome.hpp, include/Move_tracker.hpp, include/Utilities.hpp, tests/*
Adds structured transition results, sampled transition overloads, stable move formatting, and optional configured_attempts persistence metadata with validation and tests.
Compiled API quickstart
CMakeLists.txt, examples/*, cmake/RunCppApiQuickstartTest.cmake, docs/cpp-api-quickstart.md
Builds and tests a C++23 quickstart that performs ten transitions, validates counters, persists metadata, reloads the triangulation, and checks simplex counts.
Generated-site validation
scripts/validate_generated_site.py, scripts/tests/test_validate_generated_site.py, scripts/doxygen.sh, Justfile, docs/Doxyfile, pyproject.toml
Validates generated pages, fragments, links, assets, markup, Graphviz output, duplicate identifiers, warning classes, and obsolete Mermaid dependencies.
Public API contract documentation
include/*.hpp, docs/api-boundary.md, docs/reproducibility.md
Documents ownership, lifetimes, validation, exceptions, concurrency, move execution, random streams, geometry, and persistence contracts.
Repository references
README.md, REFERENCES.md, docs/*.md
Updates quickstart references, test counts, pinned tooling, citation metadata, issue tracking, and external links.

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

Sequence Diagram(s)

sequenceDiagram
  participant CTest
  participant Quickstart
  participant Metropolis
  participant Persistence
  CTest->>Quickstart: Run compiled example
  Quickstart->>Metropolis: Execute ten transitions
  Metropolis-->>Quickstart: Return transition reports and counters
  Quickstart->>Persistence: Write and reload triangulation
  Persistence-->>Quickstart: Return validated persisted state
  Quickstart-->>CTest: Return validation status
Loading

Possibly related PRs

Poem

Ten transitions trace their course,
Reports return with counted force.
Files are saved, then read anew,
Docs and warnings now align.
The quickstart marks the line.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The MetropolisTransition API change, runtime behavior tests, and reproducibility metadata changes exceed #114's archival documentation scope. Split the API and runtime changes into a separate PR, or link an issue that explicitly defines this additional scope.
Docstring Coverage ⚠️ Warning Docstring coverage is 72.55% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the primary breaking API change: exposing reported Metropolis transitions.
Linked Issues check ✅ Passed The PR addresses #114 with pinned Doxygen, generated-site validation, documentation fixes, warning policy, and explicit public API boundary documentation.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/114-doxygen-site-validation

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

@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: 8

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
include/Metropolis.hpp (1)

490-501: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Validate unsupported MoveType values before counter indexing.

Line 491 indexes MoveTracker before propose_candidate() can return UNKNOWN_MOVE. An invalid enum value can therefore fail in gsl::at instead of returning the documented structured outcome.

Reject unsupported values before any statistics mutation, or add an explicit unknown-move accounting bucket. Add a public-transition test for this contract.

As per path instructions, focus on interfaces and encapsulation in include/**/*.hpp.

🤖 Prompt for 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.

In `@include/Metropolis.hpp` around lines 490 - 501, Update the public transition
flow around propose_candidate and MoveTracker counter accesses so unsupported
MoveType values are validated before indexing or mutating statistics, returning
the documented UNKNOWN_MOVE outcome instead of triggering gsl::at. Preserve
normal accounting for supported moves, and add a public-transition test covering
an invalid enum value.

Source: Path instructions

🤖 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 `@cmake/RunCppApiQuickstartTest.cmake`:
- Around line 9-10: Before execute_process in RunCppApiQuickstartTest, remove
both the ${TEST_OUTPUT} artifact and its sidecar file, then run the existing
test command so validation cannot use stale outputs from a prior invocation.

In `@docs/metropolis-hastings.md`:
- Line 133: Update the protocol fixture link in the Metropolis-Hastings
documentation to reference the immutable v1.0.0 tag or a specific commit instead
of the mutable main branch, preserving the existing fixture path and link
purpose.

In `@include/Ergodic_moves_3.hpp`:
- Around line 1404-1408: Update the documentation for propose_62_move() so the
generator description says it is advanced by site sampling and ordering
incident-edge flip paths, removing the incorrect reference to replacement-point
construction.

In `@include/Move_outcome.hpp`:
- Around line 117-122: Update Move_outcome.hpp lines 117-122 in successful() to
return true for MoveOutcome::SUCCEEDED, preserving the existing accepted and
rejected cases; add a compile-time assertion covering the selected SUCCEEDED
contract in tests/Move_outcome_test.cpp lines 106-115.

In `@REFERENCES.md`:
- Line 6: Pin the repository-owned links to the archival revision: update the
CITATION.cff link in REFERENCES.md (line 6), the tests/cgal_no_gmp_probe link in
docs/arithmetic-backend-evaluation.md (line 108), and the schema link in
docs/comparison-harness.md (line 13) to the exact release tag or commit SHA used
by the archival site, keeping the schema aligned with DEFAULT_RESULT_SCHEMA.

In `@scripts/tests/test_validate_generated_site.py`:
- Around line 51-121: Add tests in the existing validator test suite for the
uncovered enforcement branches: delete a required page and asset, remove
dark-mode styling, remove the generated Graphviz SVG, and add a local reference
escaping the site root. Each test should call validate_generated_site.validate
and assert GeneratedSiteError with the corresponding diagnostics: “missing
required page,” “missing required asset,” “missing automatic dark-mode styling,”
“no generated Graphviz SVG was found,” and “local reference escapes the site.”

In `@scripts/validate_generated_site.py`:
- Around line 376-388: Cache each generated file’s decoded text once and reuse
it across validation checks. Update the document parsing and the relevant
feature, Mermaid, and CSS validation paths around _parse_document,
_validate_required_features, _validate_css, and the Mermaid scan to consume
cached content instead of rereading files; preserve all existing validation
behavior.
- Line 20: Update the INTERNAL_SYMBOL regex in
scripts/validate_generated_site.py so the detail alternative matches only
namespace-qualified forms anchored to the :: scope separator, never a standalone
“detail” preceded by a word boundary; preserve matching for namespace
cdt::detail is not documented and the existing cdt::experimental:: form. Re-run
scripts/tests/test_validate_generated_site.py.

---

Outside diff comments:
In `@include/Metropolis.hpp`:
- Around line 490-501: Update the public transition flow around
propose_candidate and MoveTracker counter accesses so unsupported MoveType
values are validated before indexing or mutating statistics, returning the
documented UNKNOWN_MOVE outcome instead of triggering gsl::at. Preserve normal
accounting for supported moves, and add a public-transition test covering an
invalid enum value.
🪄 Autofix

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: de7fa04d-eaee-447d-abe2-3b82a8e825f9

📥 Commits

Reviewing files that changed from the base of the PR and between 162e7ff and 16d1c76.

📒 Files selected for processing (41)
  • CMakeLists.txt
  • Justfile
  • README.md
  • REFERENCES.md
  • cmake/RunCppApiQuickstartTest.cmake
  • docs/Doxyfile
  • docs/api-boundary.md
  • docs/arithmetic-backend-evaluation.md
  • docs/comparison-harness.md
  • docs/cpp-api-quickstart.md
  • docs/metropolis-hastings.md
  • docs/reproducibility.md
  • examples/CMakeLists.txt
  • examples/cpp_api_quickstart.cpp
  • include/Ergodic_moves_3.hpp
  • include/Foliated_triangulation.hpp
  • include/Formatters.hpp
  • include/Geometry.hpp
  • include/Manifold.hpp
  • include/Metropolis.hpp
  • include/Move_always.hpp
  • include/Move_command.hpp
  • include/Move_outcome.hpp
  • include/Move_run.hpp
  • include/Move_strategy.hpp
  • include/Move_tracker.hpp
  • include/Mpfr_value.hpp
  • include/Random.hpp
  • include/Runtime_config.hpp
  • include/S3Action.hpp
  • include/Settings.hpp
  • include/Utilities.hpp
  • pyproject.toml
  • scripts/doxygen.sh
  • scripts/tests/test_validate_generated_site.py
  • scripts/validate_generated_site.py
  • tests/Metropolis_test.cpp
  • tests/Move_outcome_test.cpp
  • tests/Move_tracker_test.cpp
  • tests/Public_api_consumer.cpp
  • tests/Utilities_test.cpp

Comment thread cmake/RunCppApiQuickstartTest.cmake
Comment thread docs/metropolis-hastings.md Outdated
Comment thread include/Ergodic_moves_3.hpp
Comment thread include/Move_outcome.hpp
Comment thread REFERENCES.md Outdated
Comment thread scripts/tests/test_validate_generated_site.py
Comment thread scripts/validate_generated_site.py Outdated
Comment thread scripts/validate_generated_site.py Outdated
- Reject unknown move kinds before counter access and recognize completed transitions as successful.
- Prevent stale quickstart artifacts and strengthen generated-site contract enforcement.
- Pin scientific fixtures and metadata to the reviewed immutable revision.

@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/Metropolis_test.cpp`:
- Around line 738-765: Extend the unsupported-move test around
Metropolis_3::attempt_transition by capturing strategy.transition_trace() before
the call and asserting it remains equal afterward. Keep the existing state,
accounting, and transition_count checks unchanged.
🪄 Autofix

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: 4f9af388-6c05-410c-ac17-1d15e8349976

📥 Commits

Reviewing files that changed from the base of the PR and between 16d1c76 and e955ee6.

📒 Files selected for processing (12)
  • REFERENCES.md
  • cmake/RunCppApiQuickstartTest.cmake
  • docs/arithmetic-backend-evaluation.md
  • docs/comparison-harness.md
  • docs/metropolis-hastings.md
  • include/Ergodic_moves_3.hpp
  • include/Metropolis.hpp
  • include/Move_outcome.hpp
  • scripts/tests/test_validate_generated_site.py
  • scripts/validate_generated_site.py
  • tests/Metropolis_test.cpp
  • tests/Move_outcome_test.cpp

Comment thread tests/Metropolis_test.cpp
@acgetchell

Copy link
Copy Markdown
Owner Author

@CodeRabbit review

@coderabbitai

coderabbitai Bot commented Aug 8, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@acgetchell
acgetchell merged commit 0b46bd8 into main Aug 8, 2026
14 checks passed
@acgetchell
acgetchell deleted the fix/114-doxygen-site-validation branch August 8, 2026 19:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Validate and finalize the archival documentation site

1 participant