Skip to content

Batch Submission ​

Audience: Users — Operators submitting a directory of task plans through the daemon.

hpilot submit --path <dir> submits ready, top-level .md files through the daemon one at a time. Each file's content becomes a separate task prompt. The active batch rescans after every successful task, so plans published while another task is running can join the same invocation.

bash
# Process ready .md files in prompts/ one at a time
hpilot submit --path prompts/

# With explicit task ID prefix (generates batch_1, batch_2, ...)
hpilot submit --path prompts/ --task-id batch

# Resume only the first pending plan at Implement
hpilot submit --path prompts/ --config custom.yaml --start-from Implement --resume

Behavior:

  • Only top-level .md files are processed. Other file types and nested files are ignored.
  • The initial group is sorted lexicographically by filename. Each group found later is sorted and appended after plans already queued. Use zero-padded names such as 01-task.md and 02-task.md for predictable ordering.
  • Before queueing a newly observed plan, Harness Pilot checks that its size and modification time remain unchanged for about 0.5 seconds. A changing or disappearing file is deferred and remains eligible for a later scan.
  • Publish plans atomically when possible:
    1. Write the complete content to a temporary non-.md file.
    2. Rename it to its final .md name.
  • An invocation needs at least one ready plan initially. An empty directory, an initial set containing only unstable plans, or a nonexistent directory produces an actionable error.
  • On success, the processed file moves to <path>/completed/. The directory is created automatically, and a same-named destination is replaced.
  • If a successful task already deleted, renamed, or relocated its source plan, Harness Pilot logs that the source was already absent, skips the move to completed/, and continues the batch.
  • On failure, processing stops immediately. The failing plan and all queued or unstable plans remain at the top level.
  • Files already in completed/ are never re-processed.
  • A resolved source path is accepted at most once per invocation. Reusing the same source name after it was processed waits for a later invocation.
  • When the queue empties, Harness Pilot performs one final bounded readiness scan. If that scan finds no ready plan, it logs No pending plans remain and exits. This is finite batch behavior, not persistent watching. Plans published after exit wait for the next command.
  • --path and the positional prompt argument are mutually exclusive. When --path is provided, stdin is not read.
  • When --task-id is provided, submissions get a monotonic _N suffix across initial and later discoveries, such as batch_1, batch_2, and batch_3. Without it, each file gets an auto-generated ID.
  • --start-from and --resume apply only to the first file submitted in the current invocation.
    • Every later file starts at the first configured pipeline stage.
    • Every later file starts with a fresh agent session.
  • Pipeline boundaries such as --end-after and --end-before continue to apply to every file in the batch until cleared.
  • --end-after and --end-before are mutually exclusive (this applies to all submit commands, not just --path).
  • Reaching either a submit-time boundary or an operator-updated hpilot end --after <stage> / hpilot end --before <stage> boundary stops the whole batch, leaves the halted plan in the source directory, does not submit later plans, and exits 0.
  • If an operator sets a boundary for a stage the active task has already passed, the active task completes normally, its plan moves to completed/, and the boundary carries into the next submitted task. For example, hpilot end --before Plan during Commit finishes that Commit task, submits the next plan, then halts task 2 before its Plan stage executes; task 2 remains in the source directory and the batch exits 0.
  • hpilot end --clear removes both stop-after and stop-before boundaries from the current task and drops the active batch process's effective boundary, so the current task can finish normally and every later plan is submitted without a boundary. This batch-wide effect is process-local; a new batch invocation uses its own command-line flags.
  • For a single-task submit, hpilot end --clear changes only that task; there are no later plans to inherit the cleared boundary.

Partial failure recovery:

  • Re-running the same --path command skips files already moved to completed/.
  • The "first" file is the first remaining file discovered in the new invocation.
  • Use --start-from and, when needed, --resume to continue that file. Later files still run the full pipeline with fresh sessions.

See the runtime guide for daemon endpoints and single-task commands.