Skip to content

[Quality][High] KYC and participant identity policy: state-transition invariants — QE-2026-08 #2473

Description

@Baskarayelu

Objective

enforce participant eligibility and identity transitions consistently at every entry point and during policy changes. Specifically, implement and verify state-transition invariants so the repository provides a deterministic, reviewable guarantee under normal, invalid, repeated, concurrent, and failure conditions.

Why this matters

The current behavior or coverage needs a production-grade guarantee here: a single unguarded path can bypass eligibility controls or invalidate an active position. Without this work, an invalid lifecycle transition leaving an object permanently inconsistent could survive review or deployment.

This is a substantive engineering change. It is not a typo fix, formatting-only change, documentation-only change, or trivial dependency update.

Priority

High

Scope

Area: security / compliance correctness

Starting points:

  • src/kyc_policy.rs
  • Add or update the closest focused unit, integration, property, or contract test beside the implementation.

Verify the existing implementation before changing it. Keep the change focused on this issue and preserve existing public behavior unless the acceptance criteria require a documented compatibility change.

Acceptance criteria

  • define the legal transition matrix, enforce it at the entry point, and preserve all invariants across success and failure paths.
  • Preserve compatible public behavior and make any required migration, error, or response-shape change explicit.
  • Ensure rejected, stale, repeated, and failed operations leave no unauthorized or partial state.
  • Add focused regression coverage that proves the invariant at the actual integration boundary.

Required validation

  • cover every legal edge plus stale, repeated, skipped, and out-of-order transitions with invariant checks.
  • Run formatter, lint, type/build checks, and the complete repository test suite.
  • Run applicable security, contract, migration, gas/resource, or accessibility checks and record commands and results.
  • Confirm generated artifacts, secrets, disabled checks, and unrelated refactors are absent from the change.

Documentation requirements

Document the design and invariants, failure behavior and compatibility impact, migration or rollback considerations, operational limitations, and security assumptions where applicable.

Out of scope

No unrelated refactors, typo or formatting-only changes, docs-only changes, broad dependency upgrades, disabled CI, generated noise, or secrets.

Contributor deliverables

Wait for maintainer assignment. Open a focused branch and reference this issue with Closes #<issue-number> or Fixes #<issue-number>. Check off every criterion, link the implementation and tests, include commands and results, and include a short security/correctness note.

Maintainer quality bar

The PR must change real behavior, address every criterion, include meaningful success and failure-path tests, cover relevant edge cases, remain focused, document compatibility, and provide complete validation evidence. Issue creation does not guarantee reward eligibility; PR quality is evaluated independently.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions