Skip to content

docs: add task state machine and lifecycle documentation (#120)#135

Merged
ayomideadeniran merged 1 commit intoSoroLabs:mainfrom
Sendi0011:docs/task-state-machine
Mar 29, 2026
Merged

docs: add task state machine and lifecycle documentation (#120)#135
ayomideadeniran merged 1 commit intoSoroLabs:mainfrom
Sendi0011:docs/task-state-machine

Conversation

@Sendi0011
Copy link
Copy Markdown
Contributor


Summary

Adds a formal state machine document for the Task lifecycle in SoroTask. Covers all possible states, the conditions that trigger each transition, and which layer (on-chain Soroban contract vs. off-chain keeper) is responsible for each one. Grounded directly in the contract (lib.rs) and keeper source (poller.js, executor.js, registry.js).

Related Issue

Closes #120

Type of Change

  • Feature
  • Bug fix
  • Refactor
  • Documentation

Changes Made

  • Added docs/task-state-machine.md with:
    • Definitions for all 10 task states: Registered, Pending, Due, Executing, Executed, Skipped, Paused, Resumed, Cancelled, InsufficientGas
    • ASCII state diagram showing every transition, direction, and condition
    • Full transition table (trigger, layer, exact function/action)
    • On-chain section detailing each contract function's role, including Soroban atomicity guarantees
    • Off-chain section covering keeper components (registry.js, poller.js, executor.js, queue.js)
    • Complete events reference table
    • Gas mechanics and InsufficientGas recovery path

Validation

  • Manual verification completed — all states and transitions verified against contract/src/lib.rs and keeper/src/

Screenshots (if UI changes)

N/A — documentation only

Checklist

  • Scope is focused and avoids unrelated changes
  • Commit messages are clear
  • Documentation updated when needed
  • ETA was provided when requesting assignment for the linked issue

Formally documents the full lifecycle of a Task in SoroTask, covering:

- All states: Registered, Pending, Due, Executing, Executed, Skipped,
  Paused, Resumed, Cancelled, InsufficientGas
- ASCII state diagram showing every transition and its direction
- Full transition table with trigger, layer (on-chain vs off-chain),
  and the exact function or keeper action responsible
- Detailed breakdown of on-chain contract responsibilities (register,
  execute, pause_task, resume_task, cancel_task, deposit_gas,
  withdraw_gas) including the atomicity guarantee from Soroban
- Off-chain keeper responsibilities (registry.js event discovery,
  poller.js due detection, executor.js submission, queue.js concurrency)
- Complete events reference table
- Gas balance mechanics and the InsufficientGas recovery path

Closes SoroLabs#120
@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 29, 2026

@Sendi0011 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

@ayomideadeniran
Copy link
Copy Markdown
Contributor

Pr under review.

@ayomideadeniran ayomideadeniran merged commit 193a199 into SoroLabs:main Mar 29, 2026
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.

[Architecture] Document Task State Machine and Transitions

2 participants