Skip to content

feat: add typed task status view - #97

Merged
Bosun-Josh121 merged 1 commit into
clevercon-protocol:mainfrom
chigozzdevv:feat/task-status-view
Jul 29, 2026
Merged

feat: add typed task status view#97
Bosun-Josh121 merged 1 commit into
clevercon-protocol:mainfrom
chigozzdevv:feat/task-status-view

Conversation

@chigozzdevv

@chigozzdevv chigozzdevv commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Add an authoritative typed on-chain lifecycle status for vault tasks so clients do not need to duplicate the contract's completion and staleness rules.

Related issue

Closes #85

Changes

  • add the TaskStatus contract enum with Active, Stale, and Completed
  • add get_task_status(task_id) with None for unknown tasks
  • share the live stale-threshold predicate with force_complete_stale_task
  • preserve the exact elapsed > threshold boundary and finalized-task precedence
  • bump CONTRACT_VERSION from 2 to 3 for the public interface change
  • cover unknown, boundary, transition, completion, cancellation, force-completion, and threshold-update cases

Testing

  • cargo fmt --all -- --check
  • cargo clippy --all-targets -- -D warnings
  • cargo test (102 passed)
  • git diff --check

Checklist

  • Contract formatting, strict Clippy, and tests pass
  • The new public API is documented in the contract source
  • CONTRACT_VERSION was bumped for the public interface change

Summary by CodeRabbit

  • New Features

    • Added task status reporting through the new get_task_status view.
    • Tasks are now categorized as Active, Stale, or Completed.
    • Status reflects the current stale-time threshold and ledger time.
    • Completed and cancelled tasks are reported as Completed.
  • Bug Fixes

    • Improved consistency in determining when tasks become stale.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: eefed461-8761-4e29-852c-2828f564a4e9

📥 Commits

Reviewing files that changed from the base of the PR and between a02baea and 1265314.

📒 Files selected for processing (2)
  • contracts/agent-vault/src/lib.rs
  • contracts/agent-vault/src/tests.rs

📝 Walkthrough

Walkthrough

The agent-vault contract adds typed task lifecycle status reporting, shares stale evaluation with force completion, increments its contract version, and adds tests for status boundaries, completion precedence, cancelled tasks, and threshold changes.

Changes

Task status lifecycle

Layer / File(s) Summary
Status contract and stale evaluation
contracts/agent-vault/src/lib.rs
Adds TaskStatus, centralizes stale detection for force completion and status reporting, adds get_task_status, and updates the contract version from 2 to 3.
Status lifecycle validation
contracts/agent-vault/src/tests.rs
Tests unknown IDs, active/stale threshold boundaries, completed and cancelled tasks, threshold updates, and the new version value.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested reviewers: dopezapha, naninu123, yerimahoftimes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely describes the main change: adding a typed task status view.
Linked Issues check ✅ Passed The PR appears to satisfy #85 by adding TaskStatus, get_task_status, shared staleness logic, and tests for boundaries and finalized tasks.
Out of Scope Changes check ✅ Passed The changes stay within the task-status API work, including the required version bump and test coverage.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@Bosun-Josh121
Bosun-Josh121 merged commit 5715da1 into clevercon-protocol:main Jul 29, 2026
4 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.

[Task]: Add get_task_status(task_id) returning a typed lifecycle status

2 participants