Skip to content

WorkflowContext: add reset() method #3

@practicalmind-dev

Description

@practicalmind-dev

Currently, there is no way to reset a WorkflowContext to its initial state without creating a new instance. A reset() method would make it easier to reuse a context across multiple runs in tests or long-running processes.

ctx = WorkflowContext(workflow_id="run-001")
ctx.update(some_result)

ctx.reset()

assert ctx.confidence == 1.0
assert ctx.step_count == 0

What needs to change:
Add a reset() method to WorkflowContext in gateframe/core/context.py that restores confidence, _history, and related state to their initial values.
A test in tests/core/test_context.py should cover the basic reset behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions