Skip to main content

Module queue

Module queue 

Source
Expand description

Task queue persistence, validation, and pruning.

Responsibilities:

  • Load, save, and validate queue files in JSON format.
  • Provide operations for moving completed tasks and pruning history.
  • Own queue-level helpers such as ID generation and validation.

Not handled here:

  • Directory lock acquisition (see crate::lock).
  • CLI parsing or user interaction.
  • Runner integration or external command execution.

Invariants/assumptions:

  • Queue files conform to the schema in crate::contracts.
  • Callers hold locks when mutating queue state on disk.

Re-exports§

pub use prune::PruneOptions;
pub use prune::PruneReport;
pub use prune::prune_done_tasks;
pub use search::SearchOptions;
pub use search::filter_tasks;
pub use search::fuzzy_search_tasks;
pub use search::search_tasks;
pub use search::search_tasks_with_options;
pub use size_check::SizeCheckResult;
pub use size_check::check_queue_size;
pub use size_check::count_threshold_or_default;
pub use size_check::print_size_warning_if_needed;
pub use size_check::size_threshold_or_default;
pub use validation::ValidationWarning;
pub use validation::log_warnings;
pub use validation::validate_queue;
pub use validation::validate_queue_set;
pub use graph::*;
pub use operations::*;
pub use repair::*;

Modules§

graph
Dependency graph analysis for task queues.
hierarchy
Task hierarchy indexing and navigation based on parent_id.
operations
Task queue task-level operations.
prune
Queue pruning submodule.
repair
Queue repair and dependency traversal.
search
Task queue search and filtering.
size_check
Queue file size checking and warning generation.
validation
Queue validation submodule.

Functions§

acquire_queue_lock
attempt_json_repair
Attempt to repair common JSON errors induced by agents. Returns Some(repaired_json) if repairs were made, None if no repairs possible.
backup_queue
Create a backup of the queue file before modification. Returns the path to the backup file.
format_id
load_and_validate_queues
Load the active queue and optionally the done queue, validating both.
load_queue
Load queue from path with standard JSONC parsing.
load_queue_or_default
Load queue from path, returning default if file doesn’t exist.
load_queue_with_repair
Load queue with automatic repair for common JSON errors. Attempts to fix trailing commas and other common agent-induced mistakes.
load_queue_with_repair_and_validate
Load queue with repair and semantic validation.
next_id_across
normalize_prefix
save_queue