Skip to content

impl(801): Rust types: ParametricRealizationMemento + RealizationPlanMemento#830

Merged
TSavo merged 1 commit into
mainfrom
impl/801-parametric-realization
May 13, 2026
Merged

impl(801): Rust types: ParametricRealizationMemento + RealizationPlanMemento#830
TSavo merged 1 commit into
mainfrom
impl/801-parametric-realization

Conversation

@TSavo
Copy link
Copy Markdown
Owner

@TSavo TSavo commented May 13, 2026

Closes part of #801 implementation.

Substrate-only Rust type per the merged spec. Adds memento struct(s) to provekit-ir-types + JCS canonicalization + BLAKE3-512 CID derivation + structural validation methods where applicable + serde round-trip + CID-recompute tests.

Strict substrate/kit split (per architect direction):

  • This PR: Rust substrate. Types, serialization, CIDs, structural validation. No language syntax knowledge.
  • Per-language kit work (native annotation extraction, sugar emission, target-syntax wrappers) is a separate wave per language under implementations/<lang>/. Kits consume these types through the plugin protocol.

Rule of thumb: if the change requires knowing JML / attribute / Python decorators / Java exceptions / C setjmp, it does NOT belong in this PR. If it only knows CIDs, memento schemas, effect occurrence sets, policies, loss records, or protocol envelopes, it does.

Codex draft (medium-effort + file-first); cargo test -p provekit-ir-types passes.

🤖 Generated with Claude Code

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 13, 2026

Warning

Rate limit exceeded

@TSavo has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 39 minutes and 17 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 854d02ad-b1c1-4f9a-8e18-431477b11907

📥 Commits

Reviewing files that changed from the base of the PR and between 7c04063 and ae8641b.

⛔ Files ignored due to path filters (1)
  • implementations/rust/Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (8)
  • implementations/rust/provekit-ir-types/Cargo.toml
  • implementations/rust/provekit-ir-types/src/lib.rs
  • implementations/rust/provekit-ir-types/tests/abstraction_layer_serde.rs
  • implementations/rust/provekit-ir-types/tests/compound_contract_serde.rs
  • implementations/rust/provekit-ir-types/tests/concept_site_serde.rs
  • implementations/rust/provekit-ir-types/tests/domain_claim_serde.rs
  • implementations/rust/provekit-ir-types/tests/parametric_realization_serde.rs
  • implementations/rust/provekit-ir-types/tests/transport_gap_serde.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch impl/801-parametric-realization

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 and usage tips.

…izationPlanMemento

Substrate-only Rust type for spec #801. Type + JCS canonicalization +
BLAKE3-512 CID derivation + serde round-trip + CID-recompute tests.

NO language-specific code. Native evidence extraction, sugar emission,
target-syntax wrappers, source locators, etc. live in per-language kits
under implementations/<lang>/ and consume this type via the plugin
protocol.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@TSavo TSavo force-pushed the impl/801-parametric-realization branch from 3cebc1f to ae8641b Compare May 13, 2026 19:35
@TSavo
Copy link
Copy Markdown
Owner Author

TSavo commented May 13, 2026

Force-pushed ae8641b6 with validate() implementations.

ParametricRealizationMemento::validate() enforces three §1.1 invariants:

  1. type_variables non-empty (CDDL [+ tstr])
  2. required_sort_morphism_slots non-empty (CDDL [+ slot-descriptor])
  3. every slot's source_type_variable and target_type_variable appears in type_variables

RealizationPlanMemento::validate_against(&realization) enforces the §1.2 slot-count invariant: plan.sort_morphism_cids.len() == realization.required_sort_morphism_slots.len(). New error types ParametricRealizationError + RealizationPlanError.

Five new tests cover success + each of the four failure paths. Closes the gap that #836 named.

@TSavo TSavo merged commit 3df38fa into main May 13, 2026
5 of 6 checks passed
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