Skip to content

Implement navigation-based workflow engine with server-side enforcement #34

@m2ux

Description

@m2ux

Summary

Replace the current agent-interpreted workflow execution model with a server-driven navigation engine that enforces workflow fidelity deterministically.

Problem

Currently, agents interpret workflow schemas (.toon files) and are responsible for:

  • Parsing and understanding workflow structure
  • Maintaining execution state
  • Enforcing checkpoints and loop semantics
  • Following step sequences

This leads to workflow fidelity issues where agents:

  • Batch operations instead of executing step-by-step
  • Skip checkpoints or assume responses
  • Optimize for speed over process compliance
  • Interpret semantics inconsistently across invocations

Proposed Solution

Implement a navigation-based workflow engine where:

  1. Engine owns semantics - Server-side enforcement of checkpoints, loops, and transitions
  2. Agent traverses landscape - Agent receives valid actions, chooses from options, reports completion
  3. Opaque state tokens - State is encoded/compressed so agents cannot interpret or be biased by it
  4. Stateless engine - State passed in/out on each call; agent stores for resumption

Key API Changes

  • start_workflow(workflow_id) → returns position, available actions, opaque state
  • get_position(workflow_id, state) → returns current position
  • get_available_actions(workflow_id, state) → returns required/optional/blocked actions
  • complete_step(workflow_id, state, step_id, summary) → validates and advances state
  • respond_to_checkpoint(workflow_id, state, checkpoint_id, option_id) → records response, advances

Benefits

  • Deterministic workflow execution
  • Checkpoints cannot be skipped
  • Loops cannot be batched
  • State is tamper-resistant
  • Resumption is reliable

Acceptance Criteria

  • Navigation API implemented with position-aware responses
  • State tokens are opaque (compressed/encoded)
  • Checkpoints block progression until responded
  • Loop iterations enforced sequentially
  • Invalid transitions rejected with clear errors
  • Existing workflows continue to function
  • Documentation updated

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions