Skip to content

fix(rust): resolve scalar maps and recursion - #282

Open
Ani07-05 wants to merge 1 commit into
accordproject:mainfrom
Ani07-05:anirudh/i264/rust-verification
Open

Ani07-05 wants to merge 1 commit into
accordproject:mainfrom
Ani07-05:anirudh/i264/rust-verification

Conversation

@Ani07-05

@Ani07-05 Ani07-05 commented Oct 2, 2026 •

Copy link
Copy Markdown

Closes #264

Changes

  • Unwrap scalar map keys/values to their underlying primitive in pub type map aliases (HashMap<SSN, Employee> becomes HashMap<String, Employee>), matching how field sites already behave. Scalars are not emitted, so the alias previously referenced undefined types (bugs 1 and 2)
  • Emit non-array relationships as Box<T> (Option<Box<Manager>>) to break the infinite-size recursive type (bug 3)
  • Remove the Rust skip entries for hr_base and hr_integration in test/verification/cases.js so they are verified with cargo check
  • Add a unit test for scalar map unwrapping, update relationship unit tests and codegen snapshots

Flags

  • Relationships are boxed unconditionally, not only when recursive, so generated output changes for every non-array relationship (see snapshot diff)
  • Vec<T> relationships are left unboxed since Vec already provides indirection

Related Issues

Author Checklist

  • Ensure you provide a DCO sign-off for your commits using the --signoff option of git commit.
  • Vital features and changes captured in unit and/or integration tests
  • Commits messages follow AP format
  • Extend the documentation, if necessary

Unwrap scalar map key/value types in type aliases, box non-array relationships to break infinite-size recursion, and enable hr verification cases.

Closes accordproject#264

Signed-off-by: Anirudh <anirudh.ashrith2005@gmail.com>
Copilot AI balanced review requested due to automatic review settings October 2, 2026 07:09

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@apoorv7g

apoorv7g commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

@Ani07-05 Has this been well tested ?

@Ani07-05

Ani07-05 commented Oct 3, 2026 •

Copy link
Copy Markdown
Author

Yes, tested. I ran:

  • npm test: 686 passing, 0 failing
  • npm run lint: eslint, lockfile-lint, syncpack all pass
  • cargo check on all 8 Rust verification cases, including hr_base and hr_integration
  • Added a unit test for scalar map unwrapping, updated relationship tests and snapshots

@Jason-123-cyber Jason-123-cyber 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.

ok

@Jason-123-cyber Jason-123-cyber 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.

jk

This branch has not been deployed

No deployments
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.

bug: Rust verification - generated output fails cargo check

4 participants