## get_next_spec / list_pending_specs
[next] [docs/tasks/b.md#t-b-002]
-- pending:
docs/tasks/b.md#t-b-002
docs/tasks/c.md#t-c-003
  docs/tasks/a.md#t-a-001
[empty next] [] rc=1
[empty list] [] rc=1
## mark_queue_state
CALL queue_commit_write
bare rc=0
CALL queue_commit_write
running rc=0
CALL queue_commit_write
impl-done rc=0
CALL queue_commit_write
already terminal rc=0
CALL queue_commit_write
absent rc=0
CALL queue_commit_write
prefix only rc=0
-- queue:
# [DONE] docs/tasks/a.md#t-a-001
# [DONE] docs/tasks/b.md#t-b-002
# [FAILED] docs/tasks/c.md#t-c-003
docs/tasks/b.md#t-b-002
# [QA-FAILED] docs/tasks/d.md#t-d-004
docs/tasks/a.md#t-a-001x
CALL queue_commit_write (refusing)
writer refuses rc=1
-- leftover temp files: 0
## reactivate_queue_state
CALL queue_commit_write
impl-done rc=0
CALL queue_commit_write
running rc=0
CALL queue_commit_write
terminal rc=0
CALL queue_commit_write
absent rc=0
-- queue:
docs/tasks/a.md#t-a-001
docs/tasks/b.md#t-b-002
# [DONE] docs/tasks/c.md#t-c-003
# [RUNNING] docs/tasks/b.md#t-b-002
docs/tasks/a.md#t-a-001
## spec identity
story_of_path [harness/stories/STORY-7/tasks/T-7-001.md#t-7-001] -> [STORY-7] rc=0
story_of_path [./harness/stories/STORY-7/x.md] -> [STORY-7] rc=0
story_of_path [harness/stories/STORY-7] -> [] rc=2
story_of_path [harness/stories/] -> [] rc=2
story_of_path [docs/tasks/a.md#t-a-001] -> [] rc=1
story_of_path [harness/storiesX/S-1/a.md] -> [] rc=1
story_of_path unset root rc=2
is_bug_spec [harness/stories/STORY-7/bugs/BUG-001.md#bug-001] rc=0
is_bug_spec [harness/stories/STORY-7/bugs/BUG-001.md] rc=0
is_bug_spec [harness/stories/STORY-7/bugs/bug-001.md] rc=1
is_bug_spec [harness/stories/STORY-7/tasks/BUG-001.md] rc=1
is_bug_spec [docs/bugs/BUG-1.md#bug-1] rc=1
is_bug_spec [harness/stories/S/sub/bugs/BUG-2.md] rc=0
is_bug_spec unset root rc=1
bug_id_of_spec [harness/stories/STORY-7/bugs/BUG-001.md#bug-001] -> [BUG-001]
bug_id_of_spec [x/BUG-9.md] -> [BUG-9]
bug_id_of_spec [BUG-3] -> [BUG-3]
spec_task_id [docs/tasks/backend/wave-2.md#t-be-041] -> [T-BE-041]
spec_task_id [harness/stories/STORY-275/bugs/BUG-002.md#bug-002] -> [STORY-275__BUG-002]
spec_task_id [harness/stories/STORY-278/bugs/BUG-007.md] -> [STORY-278__BUG-007]
spec_task_id [harness/stories/STORY-9/tasks/T-PB-351d.md#t-pb-351d] -> [T-PB-351D]
spec_task_id [docs/tasks/a.md] -> [A]
spec_task_id [harness/stories/bugs/BUG-1.md#bug-1] -> [BUG-1]
spec_task_id [x#y#z] -> [Z]
## failure_class_for_spec
[no metrics] [] rc=0
[docs/tasks/a.md#t-a-001] [env-missing] rc=0
[docs/tasks/b.md#t-b-002] [] rc=0
[docs/tasks/c.md#t-c-003] [] rc=0
[harness/stories/STORY-7/bugs/BUG-001.md#bug-001] [test-failure] rc=0
[docs/none.md#t-n-1] [] rc=0
## restore_filter_skipped_tasks
CALL queue_commit_write
LOG Restored 2 [SKIPPED-FILTER] line(s) to pending (a run filter is a selection, not an outcome).
rc=0
-- queue:
docs/tasks/a.md#t-a-001
docs/tasks/b.md#t-b-002
# [SKIPPED-FILTER]docs/tasks/c.md#t-c-003
# [DONE] docs/tasks/c.md#t-c-003
none left rc=0
no queue file rc=0
## restore_retryable_tasks (all)
CALL queue_commit_write
LOG --retry-failed: restored 6 task(s) to the queue.
rc=0
-- queue:
docs/tasks/a.md#t-a-001
docs/tasks/b.md#t-b-002
docs/tasks/c.md#t-c-003 (rejected twice)
docs/tasks/d.md#t-d-004
docs/tasks/e.md#t-e-005
# [DONE] docs/tasks/f.md#t-f-006
# [IMPL-DONE] docs/tasks/g.md#t-g-007
# [SKIPPED-FILTER] docs/tasks/h.md#t-h-008
docs/tasks/i.md#t-i-009
docs/tasks/j.md#t-j-010
LOG --retry-failed: no [FAILED]/[SKIPPED-DEPS]/[QA-FAILED]/[INVALIDATED]/[MERGE-CONFLICT] tasks to restore.
nothing to restore rc=0
## restore_retryable_tasks (class)
CALL queue_commit_write
LOG --retry-failed --class timeout: restored 0 task(s) to the queue.
timeout rc=0
-- queue:
# [FAILED] docs/tasks/a.md#t-a-001
# [SKIPPED-DEPS] docs/tasks/b.md#t-b-002
# [QA-FAILED] docs/tasks/c.md#t-c-003
# [FAILED] harness/stories/STORY-7/bugs/BUG-001.md#bug-001
# [DONE] docs/tasks/f.md#t-f-006
plain line

last line without newline
CALL queue_commit_write
LOG --retry-failed --class test-failure: restored 1 task(s) to the queue.
test-failure rc=0
-- queue:
# [FAILED] docs/tasks/a.md#t-a-001
# [SKIPPED-DEPS] docs/tasks/b.md#t-b-002
# [QA-FAILED] docs/tasks/c.md#t-c-003
harness/stories/STORY-7/bugs/BUG-001.md#bug-001
# [DONE] docs/tasks/f.md#t-f-006
plain line

last line without newline
CALL queue_commit_write
LOG --retry-failed --class no-such-class: restored 0 task(s) to the queue.
no match rc=0
## sync_task_line
[T-S-001/done] # [DONE] harness/stories/STORY-1/tasks/T-S-001.md#t-s-001 (committed abc; 12 green)
[T-S-001/failed] # [FAILED] harness/stories/STORY-1/tasks/T-S-001.md#t-s-001
[T-S-001/pending] harness/stories/STORY-1/tasks/T-S-001.md#t-s-001
[T-S-001/in-progress] harness/stories/STORY-1/tasks/T-S-001.md#t-s-001
[T-S-001/] harness/stories/STORY-1/tasks/T-S-001.md#t-s-001
[T-S-001/qa-failed] # [QA-FAILED] harness/stories/STORY-1/tasks/T-S-001.md#t-s-001
[T-S-002/done] # [DONE] harness/stories/STORY-1/tasks/T-S-002.md#t-s-002
[T-S-002/failed] # [FAILED] harness/stories/STORY-1/tasks/T-S-002.md#t-s-002 (timeout)
[T-S-002/pending] harness/stories/STORY-1/tasks/T-S-002.md#t-s-002
[T-S-002/in-progress] harness/stories/STORY-1/tasks/T-S-002.md#t-s-002
[T-S-002/] harness/stories/STORY-1/tasks/T-S-002.md#t-s-002
[T-S-002/qa-failed] # [QA-FAILED] harness/stories/STORY-1/tasks/T-S-002.md#t-s-002
[T-S-001b/done] # [DONE] harness/stories/STORY-1/tasks/T-S-001b.md#t-s-001b
[T-S-001b/failed] # [FAILED] harness/stories/STORY-1/tasks/T-S-001b.md#t-s-001b
[T-S-001b/pending] harness/stories/STORY-1/tasks/T-S-001b.md#t-s-001b
[T-S-001b/in-progress] harness/stories/STORY-1/tasks/T-S-001b.md#t-s-001b
[T-S-001b/] harness/stories/STORY-1/tasks/T-S-001b.md#t-s-001b
[T-S-001b/qa-failed] # [QA-FAILED] harness/stories/STORY-1/tasks/T-S-001b.md#t-s-001b
[T-S-004/done] # [DONE] harness/stories/STORY-1/tasks/T-S-004.md#t-s-004
[T-S-004/failed] # [FAILED] harness/stories/STORY-1/tasks/T-S-004.md#t-s-004
[T-S-004/pending] harness/stories/STORY-1/tasks/T-S-004.md#t-s-004
[T-S-004/in-progress] harness/stories/STORY-1/tasks/T-S-004.md#t-s-004
[T-S-004/] harness/stories/STORY-1/tasks/T-S-004.md#t-s-004
[T-S-004/qa-failed] # [QA-FAILED] harness/stories/STORY-1/tasks/T-S-004.md#t-s-004
[no snapshot] # [DONE] harness/stories/STORY-1/tasks/T-S-001.md#t-s-001
## sync_preserve_story_lines / sync_orphan_story_ids / sync_orphan_story_section
-- preserve STORY-1:
harness/stories/STORY-1/bugs/BUG-001.md#bug-001
# [DONE] harness/stories/STORY-1/bugs/BUG-002.md#bug-002 (fixed)
#[QA-FAILED]  harness/stories/STORY-1/notes/extra.md#x
-- preserve STORY-10:
harness/stories/STORY-10/bugs/BUG-001.md#bug-001
-- preserve NONE-1:
rc=0
-- orphans (STORY-1 emitted):
STORY-10
GONE-3
PROJ-12
-- orphans (none emitted):
STORY-1
STORY-10
GONE-3
PROJ-12
-- orphan section GONE-3:
#
# ----- GONE-3 — no manifest on disk; lines below carried verbatim by --sync -----
# [FAILED] harness/stories/GONE-3/tasks/T-G-001.md#t-g-001
harness/stories/GONE-3/bugs/BUG-004.md#bug-004
-- no snapshot:
#
# ----- GONE-3 — no manifest on disk; lines below carried verbatim by --sync -----
rc=0
## sync_story_section
manifest generate rc=0
#
# ----- STORY-20 — Ordering fixture (status: in-progress) -----
# [DONE] harness/stories/STORY-20/tasks/T-SQ-002.md#t-sq-002 (landed)
harness/stories/STORY-20/tasks/T-SQ-003.md#t-sq-003
harness/stories/STORY-20/tasks/T-SQ-001.md#t-sq-001
harness/stories/STORY-20/tasks/T-SQ-004.md#t-sq-004
harness/stories/STORY-20/tasks/T-SQ-005.md#t-sq-005
harness/stories/STORY-20/bugs/BUG-001.md#bug-001
manifest generate (no tasks) rc=0
#
# ----- STORY-21 — Empty fixture (status: draft) -----
# (no tasks)
-- unknown story:
#
# ----- STORY-99 — STORY-99 (status: unknown) -----
# (no tasks)
## sync_queue
ERR queue-sync: no '# ACTIVE QUEUE' marker line in work/harness/state/queue.txt — refusing to touch the file.
no marker rc=1
-- queue:
# no marker here
docs/tasks/a.md#t-a-001
LOG queue-sync: backup written to work/harness/state/queue.txt.bak-20261018-000000
WARN queue-sync: 1 queue-referenced story/stories have no manifest on disk: GONE-4 — their lines were CARRIED OVER VERBATIM, not regenerated. Restore the story directory to resume regenerating them, or delete those lines from <T>/work/harness/state/queue.txt to retire the story. This notice repeats on every sync until one of the two happens.
CALL queue_commit_write
LOG queue-sync: active section regenerated from 4 story manifest(s), 1 story/stories carried verbatim (no manifest); history preserved through line 4.
rc=0
-- queue:
# history line one — never regenerated
# [DONE] old/history.md#t-h-1 (narrative)
# ACTIVE QUEUE — generated
# ============
#
# ----- STORY-20 — Ordering fixture (status: planned) -----
harness/stories/STORY-20/tasks/T-SQ-002.md#t-sq-002
harness/stories/STORY-20/tasks/T-SQ-003.md#t-sq-003
harness/stories/STORY-20/tasks/T-SQ-001.md#t-sq-001
harness/stories/STORY-20/tasks/T-SQ-004.md#t-sq-004
harness/stories/STORY-20/tasks/T-SQ-005.md#t-sq-005
#
# ----- STORY-21 — Empty fixture (status: draft) -----
# (no tasks)
#
# ----- STORY-30 — Sync fixture (status: in-progress) -----
# [DONE] harness/stories/STORY-30/tasks/T-SY-001.md#t-sy-001 (committed abc; reconciled)
harness/stories/STORY-30/tasks/T-SY-002.md#t-sy-002
harness/stories/STORY-30/tasks/T-SY-003.md#t-sy-003
# [FAILED] harness/stories/STORY-30/bugs/BUG-001.md#bug-001 (gate:lint)
#
# ----- STORY-31 — STORY-31 (status: draft) -----
# (no tasks)
#
# ----- GONE-4 — no manifest on disk; lines below carried verbatim by --sync -----
# [DONE] harness/stories/GONE-4/tasks/T-G-001.md#t-g-001
harness/stories/GONE-4/bugs/BUG-001.md#bug-001
-- backups:
queue.txt.bak-20261018-000000
-- backup content equals pre-sync queue: present
-- SYNC_PREV_ACTIVE after: []
-- manifests:
./STORY-20/story.yaml
./STORY-21/story.yaml
./STORY-30/story.yaml
./STORY-31/story.yaml
./lower-case/story.yaml
# Generated by: bash harness/engine/core/workflow/story.sh manifest generate STORY-30
# Schema: harness/stories/README.md (## story.yaml manifest).
# status fields are orchestrator-owned (refreshed from queue.txt on regen);
# acs / supersedes / requirements_version are authored and preserved.
id: STORY-30
title: "Sync fixture"
status: in-progress
requirements_version: 1
tasks:
  - id: T-SY-001
    status: done
    requirements_version: 1
    acs: []
    supersedes: null
  - id: T-SY-002
    status: pending
    requirements_version: 1
    acs: []
    supersedes: null
  - id: T-SY-003
    status: pending
    requirements_version: 1
    acs: []
    supersedes: null
LOG queue-sync: backup written to work/harness/state/queue.txt.bak-20261018-000000
WARN queue-sync: 1 queue-referenced story/stories have no manifest on disk: GONE-4 — their lines were CARRIED OVER VERBATIM, not regenerated. Restore the story directory to resume regenerating them, or delete those lines from <T>/work/harness/state/queue.txt to retire the story. This notice repeats on every sync until one of the two happens.
CALL queue_commit_write
LOG queue-sync: active section regenerated from 4 story manifest(s), 1 story/stories carried verbatim (no manifest); history preserved through line 4.
second sync rc=0
-- second sync identical: yes
LOG queue-sync: backup written to work/harness/state/queue.txt.bak-20261018-000000
CALL queue_commit_write
LOG queue-sync: active section regenerated from 4 story manifest(s), 0 story/stories carried verbatim (no manifest); history preserved through line 1.
marker last line, no rule rc=0
-- queue:
# ACTIVE QUEUE
#
# ----- STORY-20 — Ordering fixture (status: planned) -----
harness/stories/STORY-20/tasks/T-SQ-002.md#t-sq-002
harness/stories/STORY-20/tasks/T-SQ-003.md#t-sq-003
harness/stories/STORY-20/tasks/T-SQ-001.md#t-sq-001
harness/stories/STORY-20/tasks/T-SQ-004.md#t-sq-004
harness/stories/STORY-20/tasks/T-SQ-005.md#t-sq-005
#
# ----- STORY-21 — Empty fixture (status: draft) -----
# (no tasks)
#
# ----- STORY-30 — Sync fixture (status: planned) -----
harness/stories/STORY-30/tasks/T-SY-001.md#t-sy-001
harness/stories/STORY-30/tasks/T-SY-002.md#t-sy-002
harness/stories/STORY-30/tasks/T-SY-003.md#t-sy-003
#
# ----- STORY-31 — STORY-31 (status: draft) -----
# (no tasks)
