Skip to content

Event Schema Freeze (Indexers-Friendly) - #567#689

Open
Aj-Kayvee wants to merge 1 commit into
Pulsefy:mainfrom
Aj-Kayvee:567-event-schema-freeze
Open

Event Schema Freeze (Indexers-Friendly) - #567#689
Aj-Kayvee wants to merge 1 commit into
Pulsefy:mainfrom
Aj-Kayvee:567-event-schema-freeze

Conversation

@Aj-Kayvee

Copy link
Copy Markdown

Summary

Stabilizes event topics and payload shapes so indexers and backend correlation remain stable across releases. Closes #567.

Changes

On-Chain Contract (Rust)

  • ExtendedEvent.idpackage_id: Renamed for indexer consistency so all package-scoped events use the same field name
  • New tests in tests/events.rs:
    • test_batch_created_event — validates ids, admin, total_amount
    • test_surplus_withdrawn_event — validates to, token, amount
    • test_contract_paused_event / test_contract_unpaused_event
    • test_action_paused_event / test_action_unpaused_event
    • test_all_package_events_include_package_id — verifies every package lifecycle event carries package_id in its payload
  • Removed 9 orphaned snapshot files from removed tests
  • Updated README with complete event schema table (all 12 events documented)

Backend (NestJS/TypeScript)

  • claim.events.spec.ts — new test suite validating:
    • ClaimCancelledEvent and ClaimReissuedEvent required fields and types
    • Optional reason field correctly omitted
    • Type constant invariants

AI Service (Python/FastAPI)

  • Evidence upload events — added claim_id field via optional X-Claim-Id header to evidence_upload_session_created and evidence_upload_finalized
  • Artifact access events — added claim_id from artifact metadata to artifact_access_granted and artifact_downloaded_with_signed_url; added artifact_id to artifact_access_denied error logs

Verification

  • All on-chain events tested with field-level assertions in cargo test
  • Backend claim event shapes verified via Jest
  • AI service event payloads include claim_id where available

- Rename ExtendedEvent.id → package_id for indexer consistency
- Add comprehensive on-chain event tests for BatchCreated, SurplusWithdrawn,
  ContractPaused/Unpaused, ActionPaused/Unpaused events
- Add test_all_package_events_include_package_id to validate all package
  events carry the package_id field
- Add backend claim.events.spec.ts to validate ClaimCancelledEvent and
  ClaimReissuedEvent payload shapes
- Add claim_id to AI service evidence upload and artifact access events
- Add artifact_id to artifact_access_denied error events
- Remove orphaned snapshot files from removed tests
- Update contract README with complete event schema documentation

Closes Pulsefy#567
@vercel

vercel Bot commented Jun 29, 2026

Copy link
Copy Markdown

@Aj-Kayvee is attempting to deploy a commit to the Cedarich's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Jun 29, 2026

Copy link
Copy Markdown

@Aj-Kayvee Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Cedarich

Copy link
Copy Markdown
Contributor

@Aj-Kayvee please fix workflow

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.

Event Schema Freeze (Indexers-Friendly)

2 participants