Skip to content

fix(deps): prevent stale vcpkg - #142

Merged
acgetchell merged 6 commits into
mainfrom
fix/vcpkg-cooldown-exception
Aug 1, 2026
Merged

fix(deps): prevent stale vcpkg#142
acgetchell merged 6 commits into
mainfrom
fix/vcpkg-cooldown-exception

Conversation

@acgetchell

@acgetchell acgetchell commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • New Features

    • Added just sync-vcpkg-tool-pins to synchronize and validate vcpkg tool release metadata and Windows integrity pins.
    • Failed or invalid updates leave existing configuration unchanged.
  • Bug Fixes

    • Improved persistence of causal metadata for coincident vertices and cells.
    • Serialization now preserves indexed metadata and rejects missing, duplicate, or invalid records.
    • Rejected unsupported legacy causal-data trailers.
  • Documentation

    • Expanded vcpkg update and reproducibility guidance.
  • Chores

    • vcpkg updates are now applied without cooldown delays.

@acgetchell acgetchell self-assigned this Aug 1, 2026
@acgetchell
acgetchell enabled auto-merge August 1, 2026 14:02
@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

The change adds incidence-based causal metadata persistence for coincident vertices. It also adds an exact-baseline vcpkg tool-pin synchronizer, workflow integration, tests, documentation, and Dependabot configuration.

Changes

Causal metadata persistence

Layer / File(s) Summary
Incidence-based topology fingerprints
include/Utilities.hpp, tests/Utilities_test.cpp
Topology fingerprints now use refined vertex-cell incidence when vertices share coordinates. Tests verify canonical ordering, input validation, and connectivity-sensitive fingerprints.
Indexed metadata serialization and loading
include/Utilities.hpp, tests/Utilities_test.cpp, docs/reproducibility.md
Metadata preserves container indices. Parsing rejects invalid indices and restores vertex and cell metadata by serialized order. Tests cover coincident vertices and changed causal labels.

vcpkg tool-pin synchronization

Layer / File(s) Summary
Synchronize and atomically update tool pins
scripts/sync_vcpkg_tool_pins.py
The synchronizer reads the exact manifest baseline, validates official metadata and Windows assets, computes SHA-256 hashes, and atomically updates bootstrap assignments.
Workflow and validation integration
Justfile, scripts/tests/test_sync_vcpkg_tool_pins.py
A public Just target and entry-point smoke test were added. Unit tests cover successful updates, download failures, malformed metadata, line-ending preservation, and preservation of existing content.
vcpkg update policy
.github/dependabot.yml, README.md
vcpkg updates are excluded from cooldown delays. Maintenance instructions describe the synchronization command and validation behavior.

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

Sequence Diagram(s)

sequenceDiagram
  participant Mesh
  participant Serializer
  participant IndexedParser
  Mesh->>Serializer: serialize indexed causal metadata
  Serializer->>IndexedParser: provide versioned payload
  IndexedParser->>IndexedParser: validate indices
  IndexedParser->>Mesh: restore metadata in container order
Loading
sequenceDiagram
  participant CLI
  participant VcpkgMetadata
  participant Bootstrap
  CLI->>VcpkgMetadata: read exact manifest baseline
  VcpkgMetadata->>CLI: return release metadata and Windows assets
  CLI->>CLI: validate and hash assets
  CLI->>Bootstrap: atomically write tool pins
Loading

Possibly related PRs

Poem

Incidence records define the shape,
Indexed metadata keeps its place.
Baselines set the pins in line,
Validated hashes guard the sign.
Atomic updates leave bytes in place.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ 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 clearly identifies the primary dependency change: preventing stale vcpkg updates.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ 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/vcpkg-cooldown-exception

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

acgetchell and others added 2 commits August 1, 2026 07:31
Add a Just command that derives the vcpkg tool release from the exact manifest baseline and refreshes trusted Windows asset hashes atomically.\n\nKeep existing pins unchanged when metadata or asset downloads cannot be completed and validated.\n\nCo-Authored-By: Oz <oz-agent@warp.dev>
Persist vertex and cell metadata by payload index instead of coordinate-derived
keys. Make topology fingerprints incidence-aware when distinct vertices share
coordinates, and reject invalid v2 metadata indices.

BREAKING CHANGE: v1 causal-data trailers are no longer readable; persisted
causal metadata now uses the v2 payload-indexed format.

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

Caution

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

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

427-443: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Document that the two branches produce non-comparable digests.

The coincident branch fingerprints refined incidence signatures. The default branch fingerprints point-keyed vertex and cell records. The two record sets share no format, so the same abstract triangulation yields a completely different digest depending on which branch runs.

The round-trip paths stay self-consistent, because the payload is written with max_digits10 precision at Line 1438 and point_key formats with {:.17g}, so coordinates round-trip exactly and has_coincident_vertices returns the same answer for the original and the parsed triangulation. validate_serialized_payload and validate_persistence_metadata therefore compare like with like.

The risk is for a future reader or caller who assumes any two topology.fnv1a64 values are directly comparable. A short comment stating that the digest is branch-dependent, and that the branch is selected by coordinate coincidence, prevents that misreading.

📝 Proposed clarifying comment
     template <typename TriangulationType>
     [[nodiscard]] auto canonical_topology_fingerprint(
         TriangulationType const& triangulation) -> std::uint64_t
     {
+      // Two record formats, so two digest families. Coincident coordinates
+      // make point keys ambiguous, so those states are fingerprinted from
+      // refined vertex-cell incidence instead. Payloads round-trip
+      // coordinates exactly, so a given state always selects the same
+      // branch and validation compares matching formats. Digests from
+      // different branches are not comparable.
       if (has_coincident_vertices(triangulation))
🤖 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/Utilities.hpp` around lines 427 - 443, Add a concise comment
immediately before the coincident-vertex branch explaining that topology.fnv1a64
is branch-dependent: coincident coordinates use refined incidence signatures,
while the default path uses point-keyed vertex and cell records, so digests from
the two branches are not directly comparable.
🤖 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 `@docs/reproducibility.md`:
- Around line 98-101: Add a sentence to the trailer compatibility discussion in
docs/reproducibility.md stating that payloads using the older
cdt-plusplus-causal-info-v1 trailer are rejected entirely by read_causal_info,
rather than loaded with their causal metadata discarded. Keep the existing
behavior for streams with no trailer unchanged.

In `@include/Utilities.hpp`:
- Around line 765-778: Use checked access when assigning restored metadata in
the vertex and cell loops: replace unchecked indexing of vertex_info and
cell_info with the container’s bounds-checked accessor. Preserve the existing
index increments and trailing equality checks so malformed payloads throw
through the existing read_file/write_payload error path and leftover records
remain validated.
- Around line 350-393: Update both refined_signature call sites in the vertex
and cell refinement loops to use only the current color and sorted neighboring
colors, removing base from per-iteration signatures. After refinement completes,
retain the original vertex_bases and cell_bases in the final returned records by
prepending each base before the final sort, preserving distinctions between
different coordinates or info values.

In `@README.md`:
- Around line 359-365: Update the README description of the synchronization
workflow to state that it writes only when the rendered pin assignments differ,
rather than relying on the tool release matching. Correct the Windows invocation
to use python.exe scripts\sync_vcpkg_tool_pins.py, while preserving the existing
behavior description for fetching, validation, and atomic updates.

In `@scripts/sync_vcpkg_tool_pins.py`:
- Around line 118-133: Preserve the bootstrap file’s original line endings
throughout pin updates. Update the file-reading flow to disable newline
translation, then make _render_bootstrap detect the source line ending and use
it for both replacement assignments and rendered trailing lines; add a CRLF
fixture verifying unrelated bytes remain unchanged.

In `@tests/Utilities_test.cpp`:
- Around line 331-381: Harden the coincident-vertices scenario by requiring the
first vertex iterator to be valid before calling std::next or dereferencing it,
then directly assert that the modified vertices share the same point to ensure
the coincidence branch is exercised. Split the existing THEN assertions into
separate descriptively named blocks for topology fingerprint stability and
vertex/cell metadata preservation.

---

Outside diff comments:
In `@include/Utilities.hpp`:
- Around line 427-443: Add a concise comment immediately before the
coincident-vertex branch explaining that topology.fnv1a64 is branch-dependent:
coincident coordinates use refined incidence signatures, while the default path
uses point-keyed vertex and cell records, so digests from the two branches are
not directly comparable.
🪄 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: 8026e8c2-e256-4330-8aa6-15eb2c364ee0

📥 Commits

Reviewing files that changed from the base of the PR and between 9e8d033 and 3f72a16.

📒 Files selected for processing (7)
  • Justfile
  • README.md
  • docs/reproducibility.md
  • include/Utilities.hpp
  • scripts/sync_vcpkg_tool_pins.py
  • scripts/tests/test_sync_vcpkg_tool_pins.py
  • tests/Utilities_test.cpp

Comment thread docs/reproducibility.md
Comment thread include/Utilities.hpp Outdated
Comment thread include/Utilities.hpp
Comment thread README.md Outdated
Comment thread scripts/sync_vcpkg_tool_pins.py
Comment thread tests/Utilities_test.cpp
Keep vertex and cell attributes out of incidence-refinement cycles while
retaining them in final topology records, and use checked metadata restoration.

Preserve bootstrap line endings during vcpkg pin updates and clarify the
render-based update and Windows invocation contracts.

@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 `@include/Utilities.hpp`:
- Around line 393-405: Replace the records construction and sorting in the
incidence-graph validation path with a canonical bipartite-incidence encoding
that includes individual vertex-to-cell connectivity, not only
vertex_bases/vertex_signatures and cell_bases/cell_signatures. Ensure the
encoding is invariant under equivalent vertex/cell ordering while distinguishing
non-isomorphic degree-equivalent graphs, and add a regression case covering two
such incidence structures.
🪄 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: a102857b-19dd-44af-a9ed-32253bf172d5

📥 Commits

Reviewing files that changed from the base of the PR and between 3f72a16 and 3a66693.

📒 Files selected for processing (6)
  • README.md
  • docs/reproducibility.md
  • include/Utilities.hpp
  • scripts/sync_vcpkg_tool_pins.py
  • scripts/tests/test_sync_vcpkg_tool_pins.py
  • tests/Utilities_test.cpp

Comment thread include/Utilities.hpp Outdated
Encode individual vertex-to-cell connectivity for coincident triangulations so degree-equivalent, non-isomorphic topologies produce distinct fingerprints.

Preserve ordering invariance by resolving ambiguous incidence colors before selecting the canonical encoding.

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

Caution

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

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

516-538: 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Do not rely on undocumented CGAL ordering.

CGAL 6.2 does not guarantee that operator<< and operator>> preserve the order of finite_vertex_handles() or finite_cell_handles(). Replace positional metadata with stable identifiers, or add an explicit order-independent mapping and regression test.

🤖 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/Utilities.hpp` around lines 516 - 538, Replace the positional
vertex_index and cell_index metadata in the triangulation serialization logic
with stable identifiers or an explicit order-independent mapping that survives
CGAL stream round-trips. Update the corresponding deserialization path and add a
regression test verifying metadata remains associated with the correct vertices
and cells when finite handle iteration order changes.
🤖 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 `@include/Utilities.hpp`:
- Around line 323-353: Bound the recursive individualization work in
canonical_incidence_search by threading an explicit shared budget through every
recursive call and seeding it from canonical_bipartite_incidence_records.
Decrement the budget for each visited search node or refinement operation, and
when exhausted, stop the unbounded search using a diagnosable error or the
established cheap coarser-record fallback; ensure the coincident-vertex
fingerprint path has a predictable cost ceiling.
- Around line 288-297: Document the discrete-coloring precondition at the
incidence_records_for_coloring interface: colors must assign each color class to
exactly one node, making colors an inverse permutation with every color index
valid and unique. Add a brief precondition note or an Expects-style validation
near the function declaration, while preserving the existing .at()-based
behavior and caller logic.
- Around line 355-382: Update canonical_bipartite_incidence_records to validate
every vertex index in cell_vertices against vertex_bases.size() before building
adjacency, rejecting indices that do not identify a vertex rather than allowing
cell-node references. Move the bases.empty() early return before the adjacency
construction loop, while preserving the existing cell_bases/cell_vertices size
validation and canonicalization flow.

In `@tests/Utilities_test.cpp`:
- Around line 258-303: Extend the tests for
canonical_bipartite_incidence_records with separate scenarios covering
mismatched cell_bases and cell_vertices sizes, expecting std::invalid_argument,
and empty input, expecting an empty vector. Split the existing cycle equality
and component inequality checks into distinct THEN blocks with descriptive names
so each property is reported independently, while preserving the current
isomorphism and connectivity cases.

---

Outside diff comments:
In `@include/Utilities.hpp`:
- Around line 516-538: Replace the positional vertex_index and cell_index
metadata in the triangulation serialization logic with stable identifiers or an
explicit order-independent mapping that survives CGAL stream round-trips. Update
the corresponding deserialization path and add a regression test verifying
metadata remains associated with the correct vertices and cells when finite
handle iteration order changes.
🪄 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: 95378c7d-fe74-4178-8712-7eb7c4982c64

📥 Commits

Reviewing files that changed from the base of the PR and between 3a66693 and 52f9a58.

📒 Files selected for processing (2)
  • include/Utilities.hpp
  • tests/Utilities_test.cpp

Comment thread include/Utilities.hpp
Comment thread include/Utilities.hpp
Comment thread include/Utilities.hpp
Comment thread tests/Utilities_test.cpp
- Cap recursive individualization with a shared, diagnosable work budget.
- Reject malformed cell incidence indices before constructing adjacency.
- Handle empty incidence inputs explicitly.

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

Caution

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

⚠️ Outside diff range comments (2)
include/Utilities.hpp (2)

862-873: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Restore the trailing count check dropped from the checked-indexing fix.

vertex_info.at(vertex_index) and cell_info.at(cell_index) correctly convert an out-of-bounds write into a thrown exception, addressing the prior "use checked indexing" review. However, that fix only guards against finite_vertex_handles()/finite_cell_handles() yielding more elements than expected. If they yield fewer (a scenario the prior review already flagged as possible for triangulations whose dimension() is less than 3, and this function runs before tds().is_valid()), the loop ends early and the remaining entries in vertex_info/cell_info are silently dropped instead of raising an error.

Add the trailing equality check the prior review suggested, so a partially consumed index range is treated as malformed metadata.

🛡️ Proposed trailing validation
       std::size_t vertex_index{};
       for (auto const vertex : triangulation.finite_vertex_handles())
       {
         vertex->info() = vertex_info.at(vertex_index);
         ++vertex_index;
       }
+      if (vertex_index != vertex_info.size())
+      {
+        throw std::filesystem::filesystem_error(
+            "Causal vertex metadata count does not match triangulation", path,
+            std::make_error_code(std::errc::illegal_byte_sequence));
+      }
       std::size_t cell_index{};
       for (auto const cell : triangulation.finite_cell_handles())
       {
         cell->info() = cell_info.at(cell_index);
         ++cell_index;
       }
+      if (cell_index != cell_info.size())
+      {
+        throw std::filesystem::filesystem_error(
+            "Causal cell metadata count does not match triangulation", path,
+            std::make_error_code(std::errc::illegal_byte_sequence));
+      }
🤖 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/Utilities.hpp` around lines 862 - 873, After each finite handle loop
in the metadata assignment flow, validate that the consumed index count equals
the corresponding vector size: compare vertex_index with vertex_info.size() and
cell_index with cell_info.size(), and raise the existing malformed-metadata
error when either count differs. Keep the checked at() access and apply the
trailing equality checks separately to vertices and cells.

267-300: 🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift

Bound recursion depth, not only total work, in the individualization search.

The work budget in consume_canonical_incidence_work bounds the total number of refinement/search steps, but it does not bound how deep canonical_incidence_search can recurse. Each recursive level consumes at least a small constant amount of budget (one unit for the call itself, at least one more inside refine_incidence_colors), and the node count stays fixed across the whole recursion tree because individualizing one node only recolors that node. For a highly symmetric, moderately sized incidence graph, this lets the recursion go tens of thousands of frames deep before the budget is exhausted.

canonical_incidence_search runs on the read path, on a triangulation freshly parsed from a file, before the tds().is_valid() check. A crafted or corrupted checkpoint with many coincident vertices could drive deep recursion and crash the process with a stack overflow rather than raising the intended std::runtime_error.

Add an explicit recursion-depth cap alongside the work budget.

🛡️ Proposed depth cap
+    inline constexpr std::size_t CANONICAL_INCIDENCE_MAX_DEPTH{2'000};
+
     [[nodiscard]] inline auto canonical_incidence_search(
         std::vector<std::string> const&              bases,
         std::vector<std::vector<std::size_t>> const& adjacency,
-        std::vector<std::size_t> colors, std::size_t& budget)
+        std::vector<std::size_t> colors, std::size_t& budget,
+        std::size_t const depth = 0)
         -> std::vector<std::string>
     {
+      if (depth >= CANONICAL_INCIDENCE_MAX_DEPTH)
+      {
+        throw std::runtime_error{
+            "Canonical incidence search exceeded its recursion depth limit"};
+      }
       consume_canonical_incidence_work(budget);
       colors = refine_incidence_colors(adjacency, std::move(colors), budget);
       ...
-        auto candidate       = canonical_incidence_search(
-            bases, adjacency, std::move(individualized), budget);
+        auto candidate       = canonical_incidence_search(
+            bases, adjacency, std::move(individualized), budget, depth + 1);

Also applies to: 339-371

🤖 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/Utilities.hpp` around lines 267 - 300, Bound recursion depth in
canonical_incidence_search independently of the work budget by passing and
checking an explicit depth counter or remaining-depth limit at every recursive
call. Reject searches that exceed the cap with the existing intended
std::runtime_error path, while preserving the current budget accounting and
refinement behavior in refine_incidence_colors.
🤖 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.

Outside diff comments:
In `@include/Utilities.hpp`:
- Around line 862-873: After each finite handle loop in the metadata assignment
flow, validate that the consumed index count equals the corresponding vector
size: compare vertex_index with vertex_info.size() and cell_index with
cell_info.size(), and raise the existing malformed-metadata error when either
count differs. Keep the checked at() access and apply the trailing equality
checks separately to vertices and cells.
- Around line 267-300: Bound recursion depth in canonical_incidence_search
independently of the work budget by passing and checking an explicit depth
counter or remaining-depth limit at every recursive call. Reject searches that
exceed the cap with the existing intended std::runtime_error path, while
preserving the current budget accounting and refinement behavior in
refine_incidence_colors.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: ddce3d1d-3a7b-463a-9659-cc6d6538574b

📥 Commits

Reviewing files that changed from the base of the PR and between 52f9a58 and 307737c.

📒 Files selected for processing (2)
  • include/Utilities.hpp
  • tests/Utilities_test.cpp

@acgetchell
acgetchell merged commit 99630f1 into main Aug 1, 2026
14 checks passed
@acgetchell
acgetchell deleted the fix/vcpkg-cooldown-exception branch August 1, 2026 20:14
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