Skip to content

[33] Add dispute / appeal mechanism for quest review decisions #33

Description

@merlik787-droi

Problem Statement

quest-engine::review_submission allows approve-or-reject by the employer with no appeal. A learner who believes they were rebuffed unfairly has no on-chain recourse. There's no timeline or window for escalation.

Why It Matters

  • Without a dispute path, off-chain governance or DAO has no way to override unfair reviews.
  • Reputation dynamics: a fair protocol needs conflict resolution.

Expected Outcome

  • New dispute_submission(env, learner, quest_id, reason) callable by the learner within DISPUTE_WINDOW_SECONDS (e.g., 7 days) of SubmissionReviewed event.
  • resolve_dispute(env, admin, dispute_id, override_approve: bool) admin-only.
  • Storage for DataKey::Dispute(dispute_id) -> Dispute { quest_id, learner, reason, opened_at, resolved }.
  • Integrates with the governance contract: optional resolve_dispute_via_governance(env, dispute_id) if votes_for > votes_against.

Acceptance Criteria

  • Cannot dispute past the window.
  • Resolution emits DisputeResolved event.
  • Tests for happy path, late dispute, governance escalation.

Implementation Notes

  • Tight coupling with the dispute_id counter.
  • Reference Compound/Aave dispute patterns.

Files / Modules Affected

  • contracts/quest-engine/src/lib.rs
  • contracts/quest-engine/src/types.rs
  • contracts/quest-engine/src/test.rs

Dependencies

None.

Difficulty

Hard.

Estimated Effort

1 week.

Suggested Labels

feature, governance, P2, quest-engine


Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions