Skip to content

module: adopt canonical github.com/Wombat-Foundation/gomatrixcrypto path - #3

Open
gamesguru wants to merge 70 commits into
mainfrom
dev
Open

module: adopt canonical github.com/Wombat-Foundation/gomatrixcrypto path#3
gamesguru wants to merge 70 commits into
mainfrom
dev

Conversation

@gamesguru

@gamesguru gamesguru commented Jul 24, 2026

Copy link
Copy Markdown
Member

Summary by cubic

Switches the module to github.com/Wombat-Foundation/gomatrixcrypto and finalizes profile‑bound fndsa512 server‑key minting with Cuckatoo PoW, base64url short key IDs, and the production profile tk.nutra.msc45xx.serverkey.v1. Also fixes reconcile validation/fallback paths and makes tools/coverfilter safe when input and output paths match.

  • Migration

    • Use github.com/Wombat-Foundation/gomatrixcrypto/...; algorithm is fndsa512; key IDs use base64url short form (fndsa512:<short-id>); verifiers MUST ensure server_key.key_name matches the minted key ID.
    • Centralize production profile as tk.nutra.msc45xx.serverkey.v1; production keys MUST omit claims and fips_206_revision; docs/examples updated; new SHA3 co‑gen production vector and server‑key response fixtures added.
    • Bind minting and key IDs to registered profiles; use serverkey.GraphSeed(pub, server, profile, nonce) and serverkey.VerifyMintedFNDSAServerKey; include verify_keys[key].profile; export serverkey.RegisterProfile and serverkey.IsRegisteredProfile.
    • Keep PoW {nonce, solution} with minting nonce as uint64 in [0, 2^32−1]; adopt Cuckatoo; add cmd/minting-vectors and merkle-vectors -output; cmd/serverkey-demo defaults to demo and adds -keygen-seed and -valid-until-ts; Make targets build production artifacts/vectors and parameterize outputs; add MSC0500/MSC0501 reconcile helpers (reconcile/*) with algebraic sketches, estimators, triage/client APIs, and full coverage tests.
  • Bug Fixes

    • Fix edge‑nonce off‑by‑one and add nonce range checks; add cuckoo.Config.Validate and stricter Cuckatoo validation (cycle checks, edge index bounds).
    • Enforce production keygen entropy; validate uint64 minting‑nonce bounds; require registered profiles; enforce profile immutability and short‑ID constraints with mutex protection.
    • Pin base64url key‑ID encoding and propagate canonical JSON errors; reject unregistered demo profiles; improve tests and stable vectors/fixtures; complete reconcile test coverage.
    • Repair reconcile validation and fallback paths, remove dead code; make tools/coverfilter robust when input and output paths are the same.

Written for commit 51f1186. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • New Features
    • Added a minting-vectors CLI to generate deterministic production minting vectors as JSON.
    • Added merkle-vectors --output to write structured JSON vectors to a file.
    • Added Makefile targets and enhanced the server-key demo with seeded key generation (non-production only), valid-until-ts, and PoW graph-nonce range controls.
  • Bug Fixes
    • Tightened production profile-bound server-key/proof validation, including stricter nonce/graph-nonce/edge/cycle checks.
  • Maintenance
    • Updated project naming/docs and refreshed server-key/MSC documentation and fixtures.
  • Tests
    • Expanded coverage for profile registration, nonce-range validation, and proof verification edge cases.

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

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

Walkthrough

The module path changed to github.com/Wombat-Foundation/gomatrixcrypto. Cuckoo validation gained stricter bounds and cycle checks, server-key minting became profile-aware, deterministic vector tooling and fixtures were added, and related protocol documentation and examples were updated.

Changes

Module Identity and Supporting Tooling

Layer / File(s) Summary
Module identity, imports, documentation, and tooling
go.mod, cmd/*, merkle/*, cuckoo/meanminer/*, serverkey/privatekey*, .editorconfig, Makefile
Repository imports, package documentation, build targets, test fixtures, Merkle vector output, and editor settings now use the gomatrixcrypto module identity.

Cuckoo Proof Validation

Layer / File(s) Summary
Cuckoo proof validation
cuckoo/cuckoo.go, cuckoo/cuckoo_prover.go, cuckoo/cuckoo_test.go
Proof verification checks edge-index bounds and cycle structure, with updated prover controls and expanded validation tests.

Profile-Aware Minting and Artifacts

Layer / File(s) Summary
Profile-aware server-key minting
serverkey/serverkey.go, serverkey/*_test.go, serverkey/testdata/*
Server-key objects use registered profile domains, uint32 proof nonces, minimal PoW fields, and separate self-signature and minted-key verification paths.
Deterministic minting and demo tooling
cmd/minting-vectors/*, cmd/serverkey-demo/*, Makefile, README.rst
CLI tools validate nonce ranges, derive deterministic keys and profile graph seeds, mine and verify proofs, and emit production response or vector artifacts.
Protocol documentation and examples
res/00E4-*, res/4499-key-caching.md, res/00E2-*, res/00E5-*, res/00EA-*, res/sample-bundle-nutra.tk.json
Protocol text and examples describe profile-bound identifiers, proof validation, short-key derivation, key handling, notary behavior, caching rules, and normalized document references.

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

Sequence Diagram(s)

sequenceDiagram
  participant CLI
  participant Serverkey
  participant Meanminer
  participant Cuckoo
  participant Output
  CLI->>Serverkey: derive deterministic FNDSA key and profile graph seed
  CLI->>Meanminer: solve profile-bound Cuckoo proof
  Meanminer-->>CLI: return candidate solution
  CLI->>Cuckoo: verify solution
  CLI->>Output: write server-key or minting vector artifact
Loading

Possibly related PRs

Poem

A rabbit hops through graphs of light,
Profiles bind each proof just right.
Seeds and vectors bloom anew,
Cuckoo checks the cycle through.
Crypto carrots! What a sight.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 58.22% 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
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the primary change: adopting the canonical gomatrixcrypto module path.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@cubic-dev-ai cubic-dev-ai 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.

No issues found across 16 files

Re-trigger cubic

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

Actionable comments posted: 5

🤖 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 `@cmd/minting-vectors/main.go`:
- Around line 85-134: Validate the nonce range before the mining loop so every
iterated nonce fits in uint32, rejecting startNonce or maxNonce values beyond
the uint32 limit with an error. Keep the existing loop and ensure the validated
nonce is used consistently by serverkey.GraphSeed, FNDSAMintingProof.Nonce, and
vectorPoW.Nonce without silent narrowing.

In `@cmd/serverkey-demo/main.go`:
- Line 193: Validate maxMintingNonce before the solveMintingPoW flow so values
outside the uint32 range are rejected rather than truncated or wrapped when used
by GraphSeed and FNDSAMintingProof.Nonce. Keep valid uint32-range values flowing
unchanged into solveMintingPoW, and report the invalid flag value to the caller.

In `@cuckoo/cuckoo_test.go`:
- Around line 12-21: Update the nonzero-XOR test case covering verifyCycle to
use cycle indices whose XOR is nonzero, rather than []uint64{0, 1, 2, 3}, so
execution reaches the xor != 0 validation branch instead of the missing-partner
path. Keep the expected ErrInvalidProof assertion unchanged.

In `@serverkey/serverkey.go`:
- Around line 186-189: Update ShortKeyID to accept the profile name, look up
that profile’s shortBytes instead of ProductionProfile’s, and return an error
when the profile is unknown or the lookup is invalid. Propagate the new argument
and error through NewUnsignedFNDSA via proof.Algorithm and verifyFNDSASignature
using its extracted profileName, preserving key-name equality validation.

In `@serverkey/testdata/msc00e4-nutra.tk-sha3-256-cogen-42-29-v1.json`:
- Around line 1-7: Regenerate the fixture using the current serverkey tooling so
the output matches the active schema: add the required top-level profile field,
remove pow.algorithm, and retain only nonce and solution under pow. Update the
complete generated JSON rather than manually changing unrelated cryptographic
values.
🪄 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: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: c490da0f-7c04-49b7-a5c4-54b9f4f1b0e8

📥 Commits

Reviewing files that changed from the base of the PR and between 97b1b1a and 81a3d3b.

📒 Files selected for processing (13)
  • Makefile
  • cmd/minting-vectors/main.go
  • cmd/serverkey-demo/main.go
  • cmd/serverkey-demo/main_test.go
  • cuckoo/cuckoo.go
  • cuckoo/cuckoo_prover.go
  • cuckoo/cuckoo_test.go
  • cuckoo/meanminer/csrc/solve_main.cpp
  • cuckoo/meanminer/meanminer.go
  • serverkey/serverkey.go
  • serverkey/serverkey_errors_test.go
  • serverkey/serverkey_test.go
  • serverkey/testdata/msc00e4-nutra.tk-sha3-256-cogen-42-29-v1.json

Comment thread cmd/minting-vectors/main.go
Comment thread cmd/serverkey-demo/main.go
Comment thread cuckoo/cuckoo_test.go
Comment thread serverkey/serverkey.go Outdated
Comment thread serverkey/testdata/msc00e4-nutra.tk-sha3-256-cogen-42-29-v1.json Outdated

@cubic-dev-ai cubic-dev-ai 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.

All reported issues were addressed across 13 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread serverkey/serverkey.go
Comment thread serverkey/serverkey.go Outdated
Comment thread serverkey/testdata/msc00e4-nutra.tk-sha3-256-cogen-42-29-v1.json Outdated
Comment thread cmd/minting-vectors/main.go
Comment thread cmd/serverkey-demo/main.go
Comment thread cmd/minting-vectors/main.go
Comment thread Makefile Outdated

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

Actionable comments posted: 2

Caution

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

⚠️ Outside diff range comments (1)
serverkey/serverkey_test.go (1)

136-146: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Exercise the signature-only path with an invalid proof.

This test signs an object containing a valid proof, so it would still pass if VerifyFNDSASelfSignature accidentally enforced minting/profile validation. Sign an object after injecting an unknown or malformed profile, then assert signature-only verification succeeds while VerifyMintedFNDSAServerKey rejects it.

🤖 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 `@serverkey/serverkey_test.go` around lines 136 - 146, Update
TestVerifyFNDSASelfSignatureDoesNotClaimProtocolValidation to construct the
signed object with an unknown or malformed profile/proof, then assert
VerifyFNDSASelfSignature still succeeds while VerifyMintedFNDSAServerKey rejects
the same object. Keep the signature-only key result assertion and use the
existing test helpers for creating the invalid proof or profile.
🤖 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 `@serverkey/serverkey_test.go`:
- Around line 47-53: Update the cache-miss path constructing FNDSAMintingProof
so it clones the proof Solution slice before storing and returning the result,
matching the cache-hit behavior and preventing downstream mutations from
affecting testMintingProofs.

In `@serverkey/testkeys_test.go`:
- Line 44: Update the server key fixture accessor around serverKeyTestPairs to
return independent copies of both private and public byte slices rather than
exposing the cached slices directly. Clone each slice before returning it so
mutations by one consumer cannot affect subsequent tests.

---

Outside diff comments:
In `@serverkey/serverkey_test.go`:
- Around line 136-146: Update
TestVerifyFNDSASelfSignatureDoesNotClaimProtocolValidation to construct the
signed object with an unknown or malformed profile/proof, then assert
VerifyFNDSASelfSignature still succeeds while VerifyMintedFNDSAServerKey rejects
the same object. Keep the signature-only key result assertion and use the
existing test helpers for creating the invalid proof or profile.
🪄 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: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 30caff5b-f344-47e9-84e8-8673d2ad3fd2

📥 Commits

Reviewing files that changed from the base of the PR and between 81a3d3b and 72fdd6a.

📒 Files selected for processing (3)
  • serverkey/serverkey_errors_test.go
  • serverkey/serverkey_test.go
  • serverkey/testkeys_test.go

Comment thread serverkey/serverkey_test.go
Comment thread serverkey/testkeys_test.go Outdated

@cubic-dev-ai cubic-dev-ai 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.

All reported issues were addressed across 14 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread serverkey/serverkey.go Outdated
Comment thread serverkey/serverkey.go Outdated
Comment thread cmd/minting-vectors/main.go
Comment thread cmd/minting-vectors/main.go
Comment thread serverkey/serverkey.go
Comment thread serverkey/serverkey_test.go
Comment thread cuckoo/cuckoo_test.go
Comment thread cuckoo/cuckoo_test.go
Comment thread serverkey/testkeys_test.go Outdated
gamesguru and others added 2 commits July 24, 2026 07:27
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

@cubic-dev-ai cubic-dev-ai 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.

All reported issues were addressed across 10 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread cmd/minting-vectors/main_test.go Outdated

@cubic-dev-ai cubic-dev-ai 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.

All reported issues were addressed across 1 file (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread cmd/minting-vectors/main_test.go Outdated

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

Actionable comments posted: 3

🤖 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 `@cmd/minting-vectors/main.go`:
- Around line 158-165: Update validateMintingNonceRange to reject inverted
ranges by returning an input-validation error when startNonce exceeds maxNonce,
before the existing protocol-limit checks or generation flow can run.

In `@cmd/serverkey-demo/main.go`:
- Around line 211-214: Update the demo/custom profile handling around GraphSeed
and NewSignedFNDSA so every profile offered to server-key construction has a
registered verification profile and parameters recognized by serverkey. Ensure
unsupported algorithms are rejected before mining, or register the supported
demo profiles, preventing proof generation from reaching NewSignedFNDSA with an
unknown profile.

In `@serverkey/serverkey_test.go`:
- Line 52: Remove the redundant uint32 conversion from the GraphSeed call in the
test, passing the already-uint32 nonce directly while preserving the existing
arguments and error handling.
🪄 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: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: e2966eb3-c65a-44ae-830c-a9d3a8391562

📥 Commits

Reviewing files that changed from the base of the PR and between 72fdd6a and f536914.

📒 Files selected for processing (10)
  • Makefile
  • cmd/minting-vectors/main.go
  • cmd/minting-vectors/main_test.go
  • cmd/serverkey-demo/main.go
  • cmd/serverkey-demo/main_test.go
  • cuckoo/cuckoo_test.go
  • serverkey/serverkey.go
  • serverkey/serverkey_errors_test.go
  • serverkey/serverkey_test.go
  • serverkey/testkeys_test.go

Comment thread cmd/minting-vectors/main.go
Comment thread cmd/serverkey-demo/main.go Outdated
Comment thread serverkey/serverkey_test.go Outdated
gamesguru and others added 2 commits July 24, 2026 10:47
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@gamesguru
gamesguru requested a review from Copilot July 25, 2026 00:59
gamesguru and others added 2 commits July 26, 2026 03:14
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@gamesguru

Copy link
Copy Markdown
Member Author

@cubic-dev-ai review

@cubic-dev-ai

cubic-dev-ai Bot commented Jul 26, 2026

Copy link
Copy Markdown

@cubic-dev-ai review

@gamesguru I have started the AI code review. It will take a few minutes to complete.

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

Actionable comments posted: 1

Caution

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

⚠️ Outside diff range comments (3)
cuckoo/cuckoo_test.go (2)

145-155: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Retain a fixed proof vector alongside the generated round-trip test.

Replacing hard-coded nonce/edge assertions with FindProof followed by Verify can allow a shared prover/verifier regression to pass. Keep the known vector checks and add this generated-proof test separately.

🤖 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 `@cuckoo/cuckoo_test.go` around lines 145 - 155, The TestReducedWorkVector test
currently validates only a proof generated by FindProof and verified by Verify,
so shared regressions can go undetected. Restore the fixed proof vector with its
hard-coded nonce/edge assertions, and retain the generated FindProof/Verify
round-trip as a separate test.

13-32: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Do not use a seed selected for a different profile to prove ErrNoSolution.

testSeed now selects the first seed with a proof for Config{EdgeBits: 12, ProofSize: 4}, while TestFindProofNoSolution reuses it with EdgeBits: 8 and assumes no proof exists. That property is not enforced by the helper, so the test can fail when the selected seed changes. Use a fixed no-solution fixture or explicitly enforce both conditions with a bounded search.

🤖 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 `@cuckoo/cuckoo_test.go` around lines 13 - 32, The testSeed helper selects a
seed for a different configuration than TestFindProofNoSolution uses, so its
no-solution assumption is unverified. Update testSeed and the no-solution test
to use a fixed fixture known to lack a proof for Config{EdgeBits: 8, ProofSize:
4}, or perform a bounded search that explicitly verifies both the required proof
and no-proof conditions before returning the seed.
Makefile (1)

17-26: 🩺 Stability & Availability | 🟠 Major

Keep the production expiry dynamic.

If SERVERKEY_VALID_UNTIL_TS still defaults to the fixed July 15, 2027 timestamp, this target will eventually generate expired production responses. Derive it from SERVERKEY_VALID_DAYS at invocation time or require callers to provide it explicitly.

Also applies to: 74-74

🤖 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 `@Makefile` around lines 17 - 26, Update the SERVERKEY_VALID_UNTIL_TS default
used by the Makefile targets so it is computed dynamically from
SERVERKEY_VALID_DAYS at invocation time, or require callers to provide it
explicitly; remove any fixed July 15, 2027 fallback while preserving explicit
overrides.
🤖 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 `@cmd/merkle-vectors/main_test.go`:
- Around line 64-69: Update the test around the MerkleVectors unmarshal and
schema assertion to compare the complete unmarshaled vecs value against the
expected deterministic MerkleVectors vector, including all root hashes and event
IDs. Replace the schema-only validation while preserving the existing unmarshal
failure handling.

---

Outside diff comments:
In `@cuckoo/cuckoo_test.go`:
- Around line 145-155: The TestReducedWorkVector test currently validates only a
proof generated by FindProof and verified by Verify, so shared regressions can
go undetected. Restore the fixed proof vector with its hard-coded nonce/edge
assertions, and retain the generated FindProof/Verify round-trip as a separate
test.
- Around line 13-32: The testSeed helper selects a seed for a different
configuration than TestFindProofNoSolution uses, so its no-solution assumption
is unverified. Update testSeed and the no-solution test to use a fixed fixture
known to lack a proof for Config{EdgeBits: 8, ProofSize: 4}, or perform a
bounded search that explicitly verifies both the required proof and no-proof
conditions before returning the seed.

In `@Makefile`:
- Around line 17-26: Update the SERVERKEY_VALID_UNTIL_TS default used by the
Makefile targets so it is computed dynamically from SERVERKEY_VALID_DAYS at
invocation time, or require callers to provide it explicitly; remove any fixed
July 15, 2027 fallback while preserving explicit overrides.
🪄 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: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 49c29406-0ad3-40c5-8e27-91a5de80b888

📥 Commits

Reviewing files that changed from the base of the PR and between d1610bb and cb54557.

📒 Files selected for processing (19)
  • Makefile
  • cmd/cuckoo-scan/main.go
  • cmd/merkle-vectors/main.go
  • cmd/merkle-vectors/main_test.go
  • cmd/minting-vectors/main.go
  • cmd/serverkey-demo/main.go
  • cmd/serverkey-keytool/main.go
  • cuckoo/cuckoo.go
  • cuckoo/cuckoo_test.go
  • cuckoo/meanminer/csrc/solve_main.cpp
  • cuckoo/meanminer/meanminer.go
  • fndsa512/fndsa512.go
  • lthash/lthash.go
  • matrixjson/canonical.go
  • merkle/merkle.go
  • res/00E4-quantum-sigs-minting-server-keys.md
  • serverkey/privatekey.go
  • serverkey/serverkey.go
  • serverkey/serverkey_test.go

Comment thread cmd/merkle-vectors/main_test.go Outdated

@cubic-dev-ai cubic-dev-ai 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.

0 issues found across 12 files (changes from recent commits).

Re-trigger cubic

@cubic-dev-ai cubic-dev-ai 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.

All reported issues were addressed across 1 file (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread cmd/merkle-vectors/main_test.go Outdated

Copilot AI 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.

Pull request overview

Copilot reviewed 37 out of 38 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (2)

serverkey/serverkey.go:153

  • NewUnsignedFNDSA currently ignores the provided FNDSAMetadata (parameter name is _) and always builds the verify_keys entry with an empty metadata struct. This makes it impossible for non-production/demo profiles to include fips_206_revision / claims even when callers supply them, and silently changes behavior for existing callers.

This issue also appears on line 175 of the same file.
serverkey/serverkey.go:179

  • FNDSAKeyObject ignores the FNDSAMetadata argument entirely, so metadata fields like fips_206_revision / claims are never serialized even for non-production profiles. If metadata is intentionally disallowed only for the production profile, this function should conditionally include it for other profiles.

Comment thread serverkey/testdata/msc00e4-server-key-response-v1.json Outdated
Comment thread merkle/testdata/msc4511-merkle-vectors-v1.json Outdated

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

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 `@merkle/testdata/msc4511-merkle-vectors-v1.json`:
- Around line 2-11: Remove the duplicated JSON property block from the
MerkleVectors fixture so it contains exactly one complete object. Preserve a
single occurrence of auth_events_hash_hex, content_hash_hex,
other_signed_fields_hash_hex, event_root_hex, and event_id, ensuring the file
remains valid unambiguous JSON for json.Unmarshal.
🪄 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: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 7167b55a-9a39-4e82-9d50-de51ca0193b8

📥 Commits

Reviewing files that changed from the base of the PR and between 71829b0 and 8dc3b38.

📒 Files selected for processing (1)
  • merkle/testdata/msc4511-merkle-vectors-v1.json

Comment thread merkle/testdata/msc4511-merkle-vectors-v1.json Outdated

@cubic-dev-ai cubic-dev-ai 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.

All reported issues were addressed across 1 file (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread merkle/testdata/msc4511-merkle-vectors-v1.json Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

@cubic-dev-ai cubic-dev-ai 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.

All reported issues were addressed across 8 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread reconcile/triage.go Outdated
Comment thread reconcile/pinsketch.go
Comment thread reconcile/client.go Outdated
Comment thread reconcile/client.go
Comment thread reconcile/algebraic.go Outdated
Comment thread reconcile/algebraic.go Outdated
Comment thread reconcile/coverage_test.go Outdated

@cubic-dev-ai cubic-dev-ai 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.

All reported issues were addressed across 5 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread reconcile/client.go
Comment thread tools/coverfilter/main.go Outdated

@cubic-dev-ai cubic-dev-ai 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.

3 issues found across 7 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="tools/coverfilter/main.go">

<violation number="1" location="tools/coverfilter/main.go:55">
P3: In-place filtering changes the profile's permissions to the temporary file mode (0600). Preserve the original input mode on `tmp` before the rename so a previously shared/readable coverage artifact remains usable.</violation>
</file>

<file name="reconcile/client.go">

<violation number="1" location="reconcile/client.go:31">
P2: Large positive round limits can wrap `gateThreshold` to a small value; e.g. `1<<52` becomes zero and prevents bucket reconciliation for any nonzero delta. Saturate the derived threshold before multiplying so a larger configured limit cannot make the gate stricter.</violation>
</file>

<file name="reconcile/algebraic.go">

<violation number="1" location="reconcile/algebraic.go:216">
P3: DecodeSyndromeSketch still uses `capacity == 0` while the two sibling functions were updated to `capacity <= 0` in this diff. A negative capacity bypasses the guard and yields a misleading error. Align to `<= 0` for consistency.</violation>
</file>

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread reconcile/client.go
c.maxRounds = maxRounds
var threshold uint64
if maxRounds > 0 {
threshold = uint64(maxRounds) * MaxBucketedSketchCapacity

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: Large positive round limits can wrap gateThreshold to a small value; e.g. 1<<52 becomes zero and prevents bucket reconciliation for any nonzero delta. Saturate the derived threshold before multiplying so a larger configured limit cannot make the gate stricter.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At reconcile/client.go, line 31:

<comment>Large positive round limits can wrap `gateThreshold` to a small value; e.g. `1<<52` becomes zero and prevents bucket reconciliation for any nonzero delta. Saturate the derived threshold before multiplying so a larger configured limit cannot make the gate stricter.</comment>

<file context>
@@ -26,7 +26,10 @@ func NewReconciliationClient(maxSketchCapacity int) (*ReconciliationClient, erro
-	threshold := uint64(maxRounds * MaxBucketedSketchCapacity)
+	var threshold uint64
+	if maxRounds > 0 {
+		threshold = uint64(maxRounds) * MaxBucketedSketchCapacity
+	}
 	c.gateThreshold = &threshold
</file context>
Suggested change
threshold = uint64(maxRounds) * MaxBucketedSketchCapacity
rounds := uint64(maxRounds)
if rounds > ^uint64(0)/MaxBucketedSketchCapacity {
threshold = ^uint64(0)
} else {
threshold = rounds * MaxBucketedSketchCapacity
}

Comment thread tools/coverfilter/main.go

if filepath.Clean(inPath) == filepath.Clean(outPath) {
dir := filepath.Dir(outPath)
tmp, err := os.CreateTemp(dir, "coverfilter-*.out")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: In-place filtering changes the profile's permissions to the temporary file mode (0600). Preserve the original input mode on tmp before the rename so a previously shared/readable coverage artifact remains usable.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At tools/coverfilter/main.go, line 55:

<comment>In-place filtering changes the profile's permissions to the temporary file mode (0600). Preserve the original input mode on `tmp` before the rename so a previously shared/readable coverage artifact remains usable.</comment>

<file context>
@@ -19,39 +19,71 @@ func main() {
-		must(err)
+	if filepath.Clean(inPath) == filepath.Clean(outPath) {
+		dir := filepath.Dir(outPath)
+		tmp, err := os.CreateTemp(dir, "coverfilter-*.out")
+		if err != nil {
+			return err
</file context>

Comment thread reconcile/algebraic.go

// NewSyndromeSketch allocates an empty sketch with the requested capacity.
func NewSyndromeSketch(capacity int) (*SyndromeSketch, error) {
if capacity <= 0 || capacity > MaxSketchCapacity {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: DecodeSyndromeSketch still uses capacity == 0 while the two sibling functions were updated to capacity <= 0 in this diff. A negative capacity bypasses the guard and yields a misleading error. Align to <= 0 for consistency.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At reconcile/algebraic.go, line 216:

<comment>DecodeSyndromeSketch still uses `capacity == 0` while the two sibling functions were updated to `capacity <= 0` in this diff. A negative capacity bypasses the guard and yields a misleading error. Align to `<= 0` for consistency.</comment>

<file context>
@@ -213,7 +213,7 @@ type SyndromeSketch struct {
 // NewSyndromeSketch allocates an empty sketch with the requested capacity.
 func NewSyndromeSketch(capacity int) (*SyndromeSketch, error) {
-	if capacity == 0 || capacity > MaxSketchCapacity {
+	if capacity <= 0 || capacity > MaxSketchCapacity {
 		return nil, ErrInvalidSketchCapacity
 	}
</file context>

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.

2 participants