whiteducksoftware / whiteducksoftware/flock

[1.0] Preserve terminal run outcomes across cleanup and failure paths

Open
#433 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
120
Forks
14
Avg merge
19h 32m
Merged PRs (30d)
8

Description

Collector cleanup can overwrite an error with completed. Failures during context construction or persistence also need the same truthful outcome contract as engine failures.

Scope

  • Use the existing task/run identity and records to define consistent running, successful, failed, cancellation-requested and confirmed-cancelled outcomes.
  • Ensure cleanup cannot overwrite failure or confirmed cancellation with success.
  • Bring context construction, engine execution, output persistence and consumption persistence into the same outcome handling; keep run_until_idle as an idle wait rather than an implicit success result.

Acceptance criteria

  • Controlled success, exception and cooperative cancellation retain their correct states after all cleanup hooks.
  • Failures before engine execution and during output/consumption persistence are associated with the run and do not report success.
  • Python, collector events and API-visible records agree; interruption recovery is handled by the dedicated history ticket.

Boundaries

No automatic retry/DLQ or complete workflow lifecycle implementation.

References

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the referenced flow in src/flock/core/agent.py and src/flock/core/orchestrator.py, then trace how src/flock/api/collector.py records task/run outcomes. Exercise success, exceptions, cooperative cancellation, context-construction failures, and persistence failures. Done means cleanup preserves terminal outcomes and Python, collector events, and API-visible records agree without making run_until_idle imply success.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend, distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.