# Line-count ceiling for core/orchestrator/orchestrate.sh (STORY-339 T-PB-339d, PB-1).
# Enforced by check-orchestrate-size.sh. This number only ever moves DOWN: lower it
# in the same commit as any change that shrinks the file. Raising it needs a reason
# written here, reviewed like any other diff.
#
# +4 (8948 -> 8952), STORY-329 port: three CALL SITES and nothing else. All the
# new logic is in lib/ (baseline_refresh_if_moved in lib/baseline.sh;
# unlanded_requeued / preserve_unlanded_work / rebase_conflict_requeue in
# lib/resume.sh). What stays here is the one pre-dispatch call and one
# `elif …; then <release>` arm at each of the two [MERGE-CONFLICT] sites, which
# have to live where the scheduler decides a task's terminal state.
#
# -538 (8952 -> 8414), STORY-351 T-PB-351d sub-seam 4a: the queue helpers, queue
# sync (T-LSM-006) and spec identity moved verbatim into lib/queue.sh.
#
# -471 (8414 -> 7943), STORY-351 T-PB-351d sub-seam 4b: the task-record section
# scan, the dependency check, the staleness gate, the memoised manifest reads and
# the priority scheduler moved verbatim into lib/deps.sh.
#
# -431 (7943 -> 7512), STORY-351 T-PB-351d sub-seam 4c: the story state machine
# and CR apply + replan dispatch moved verbatim into lib/story-lifecycle.sh.
#
# -291 (7512 -> 7221), STORY-351 T-PB-351e sub-seam 5a: the task-lease policy moved
# verbatim into lib/task-leases.sh and the semaphore gates into
# lib/semaphore-gates.sh.
#
# -309 (7221 -> 6912), STORY-351 T-PB-351e sub-seam 5b: admission control and the
# selection scan moved verbatim into lib/admission.sh.
#
# -453 (6912 -> 6459), STORY-351 T-PB-351e sub-seam 5c: lane scheduling moved
# verbatim into lib/lane-scheduling.sh and the lane journal into
# lib/lane-journal.sh.
#
# -729 (6459 -> 5730), STORY-351 T-PB-351e sub-seam 5d: the concurrent scheduler
# (slot bookkeeping, fork, reap, park, the tick loop) moved verbatim into
# lib/concurrent-scheduler.sh.
#
# -555 (5730 -> 5175), STORY-351 T-PB-351e sub-seam 5e: the per-task pipeline moved
# verbatim into lib/task-pipeline.sh and count_remaining into lib/queue.sh.
#
# -514 (5175 -> 4661), STORY-351 CR-001 (the code outside ADR-050's five seams),
# verification gates part 1: the scoped-first test gate (run_tests, scoped test
# selection, flake quarantine, blast-radius classification, run_gated_tests)
# moved verbatim into lib/test-gate.sh.
#
# -690 (4661 -> 3971), STORY-351 CR-001, verification gates part 2: the per-task
# Verification block, the verification fence (run_fence and what a fence may
# assume about the machine) and run_task_verification moved verbatim into
# lib/fence.sh.
#
# -651 (3971 -> 3320), STORY-351 CR-001, verification gates part 3: the arch-check
# gate, the fresh-context review gate and its repair dispatch moved verbatim into
# lib/review-gate.sh, and the fresh-context QA gate into lib/qa-gate.sh.
#
# -493 (3320 -> 2827), STORY-351 CR-001: scope-guarded staging and the task commit
# (the declared-output parsers, the partition, the commit loop) moved verbatim
# into lib/scope-staging.sh.
#
# -454 (2827 -> 2373), STORY-351 CR-001: the runner lifecycle (run_agent_cli, the
# exit classification, runner exhaustion and the backoff-probe recovery) moved
# verbatim into lib/runner-lifecycle.sh.
#
# -241 (2373 -> 2132), STORY-351 CR-001: the bodies of the --promote-acceptance and
# --nightly verbs moved verbatim into lib/acceptance-pack.sh and lib/nightly.sh
# (their dispatch blocks stay here).
#
# -20 (2132 -> 2112), STORY-351 CR-001: the logging helpers (log, log_section,
# error, warn) moved verbatim into lib/log.sh, sourced directly at the same point.
#
# -535 (2112 -> 1577), STORY-351 CR-001: the run configuration (the roots and
# paths, lane / lease policy, bounded concurrency, verb defaults, runner binaries,
# gate commands, exhaustion knobs) became one resolve_run_config step in
# lib/run-config.sh, called at the same point; its body is the old block verbatim.
#
# -197 (1577 -> 1380), STORY-351 (ADR-050's last mile): the failure taxonomy and
# the blockers ledger (classify_failure, note_consecutive_fail_streak,
# write_blocker) moved verbatim into lib/failure.sh, sourced at the same point.
#
# -37 (1380 -> 1343), STORY-351 (ADR-050's last mile): the runner-exhaustion
# sentinel (exhaustion_sentinel_*) moved verbatim into lib/exhaustion-sentinel.sh,
# sourced at the same point — --replan still dispatches before it is defined.
#
# -72 (1343 -> 1271), STORY-351 (ADR-050's last mile): tracker_enabled moved
# verbatim into lib/deps.sh (beside its one reader), run_prune_abandoned into
# lib/lanes.sh (beside lane_prune_abandoned) and preflight_workspace_paths into
# lib/run-config.sh (beside the step that resolves the paths it checks); the
# --prune-abandoned dispatch and the preflight call stay where they were.
#
# -45 (1271 -> 1226), STORY-351 (ADR-050's last mile), comments only: the
# per-extraction "moved verbatim to lib/x.sh" pointers became one module map at
# the top, and the file reads as the run lifecycle in nine numbered steps. Every
# non-comment line is byte-identical and in the same order.
1226
