## _inbox_event_type / _inbox_event_field
yaml type=[enqueue-bug] spec_ref=[] story_id=[] bug_id=[BUG-1]
flow type=[requeue] spec_ref=[docs/x.md#t-x-1] story_id=[] bug_id=[]
json type=[escalate-human] spec_ref=[] story_id=[STORY-9] bug_id=[]
none type=[] spec_ref=[] story_id=[] bug_id=[BUG-2]
json-late type=[escalate-human] spec_ref=[] story_id=[STORY-9] bug_id=[]
flow-late type=[requeue] spec_ref=[] story_id=[STORY-9] bug_id=[]
absent type=[] field=[] nofield=[]
## inbox_normalize_event
--- a.yaml
type: enqueue-bug
event: enqueue-bug
story: STORY-001
bug_id: BUG-001
bug_file: harness/stories/STORY-001/bugs/BUG-001.md
spec_ref: harness/stories/STORY-001/bugs/BUG-001.md#bug-001
[eof]
--- enqueue-bug-BUG-007.yaml
type: enqueue-bug
story_id: STORY-002
bug_id: BUG-007
spec_ref: harness/stories/STORY-002/bugs/BUG-007.md#bug-007
[eof]
--- c.yaml
type: requeue
event: requeue
task_id: t-1[eof]
--- d.json
{"event":"enqueue-bug","bug_id":"BUG-3"}
[eof]
--- e.yaml
type: enqueue-bug
spec_ref: keep/me.md#k
[eof]
--- f.yaml
note: nothing to infer
[eof]
absent rc=0
## inbox_write_event
write rc=0
empty-name rc=0
w1.json
{"type":"stale-task"}
## story_tasks_all_done
STORY-A all-done
STORY-B not-done
STORY-N not-done
## apply_inbox_event: unknown type
ERR   ! Inbox: unknown event type 'frobnicate' in 'u.yaml' — archiving without applying
METRIC {"event":"inbox_event_unknown","type":"frobnicate","file":"u.yaml","at":"2026-10-17T00:00:00+00:00"}
rc=1
## sweep_inbox: empty / absent inbox
absent rc=0
empty rc=0
## sweep_inbox: one of every event
LOG   Inbox: enqueue-bug event '01-enqueue.yaml' — inserting fix task by severity (T-QAG-005)
CALL handle_enqueue_bug 01-enqueue.yaml
METRIC {"event":"inbox_event_applied","type":"enqueue-bug","file":"01-enqueue.yaml","at":"2026-10-17T00:00:00+00:00"}
LOG   Inbox: archived '01-enqueue.yaml' (applied:enqueue-bug) -> state/inbox/processed/20261017-000000-01-enqueue.yaml
LOG   Inbox: enqueue-bug event '02-enqueue-dup.yaml' — inserting fix task by severity (T-QAG-005)
CALL handle_enqueue_bug 02-enqueue-dup.yaml
METRIC {"event":"inbox_event_applied","type":"enqueue-bug","file":"02-enqueue-dup.yaml","at":"2026-10-17T00:00:00+00:00"}
LOG   Inbox: archived '02-enqueue-dup.yaml' (rejected:already-active) -> state/inbox/processed/20261017-000000-02-enqueue-dup.yaml
LOG   Inbox: enqueue-bug event '03-handwritten.yaml' — inserting fix task by severity (T-QAG-005)
CALL handle_enqueue_bug 03-handwritten.yaml
METRIC {"event":"inbox_event_applied","type":"enqueue-bug","file":"03-handwritten.yaml","at":"2026-10-17T00:00:00+00:00"}
LOG   Inbox: archived '03-handwritten.yaml' (applied:enqueue-bug) -> state/inbox/processed/20261017-000000-03-handwritten.yaml
CALL requeue_spec_line docs/a.md#t-a-1
LOG   Inbox: requeue event '04-requeue-ref.yaml' — docs/a.md#t-a-1 restored to pending
METRIC {"event":"inbox_event_applied","type":"requeue","file":"04-requeue-ref.yaml","at":"2026-10-17T00:00:00+00:00"}
LOG   Inbox: archived '04-requeue-ref.yaml' (applied:requeue) -> state/inbox/processed/20261017-000000-04-requeue-ref.yaml
CALL requeue_spec_line t-missing-9
ERR   ! Inbox: requeue '05-requeue-missing.yaml' — no terminal queue line for 't-missing-9' (nothing restored)
METRIC {"event":"inbox_event_applied","type":"requeue","file":"05-requeue-missing.yaml","at":"2026-10-17T00:00:00+00:00"}
LOG   Inbox: archived '05-requeue-missing.yaml' (applied:requeue) -> state/inbox/processed/20261017-000000-05-requeue-missing.yaml
CALL escalate_story [STORY-E] [loop] [3] [BUG-4]
LOG   Inbox: escalate-human event '06-escalate.yaml' — STORY-E lane halted (loop)
METRIC {"event":"inbox_event_applied","type":"escalate-human","file":"06-escalate.yaml","at":"2026-10-17T00:00:00+00:00"}
LOG   Inbox: archived '06-escalate.yaml' (applied:escalate-human) -> state/inbox/processed/20261017-000000-06-escalate.yaml
ERR   ! Inbox: escalate-human '07-escalate-nostory.yaml' has no story_id — cannot halt a lane
METRIC {"event":"inbox_event_applied","type":"escalate-human","file":"07-escalate-nostory.yaml","at":"2026-10-17T00:00:00+00:00"}
LOG   Inbox: archived '07-escalate-nostory.yaml' (applied:escalate-human) -> state/inbox/processed/20261017-000000-07-escalate-nostory.yaml
CALL transition_story STORY-A qa [qa-story PASS (08-accept.yaml)]
CALL transition_story STORY-A done [qa-story PASS — qa/v.md]
LOG   Inbox: story-accepted '08-accept.yaml' — STORY-A → done
CALL promote_acceptance_pack STORY-A
METRIC {"event":"story_accepted","story_id":"STORY-A","verdict_ref":"qa/v.md","at":"2026-10-17T00:00:00+00:00"}
METRIC {"event":"inbox_event_applied","type":"story-accepted","file":"08-accept.yaml","at":"2026-10-17T00:00:00+00:00"}
LOG   Inbox: archived '08-accept.yaml' (applied:story-accepted) -> state/inbox/processed/20261017-000000-08-accept.yaml
ERR   ! Inbox: story-accepted '09-accept-premature.yaml' rejected — STORY-B has unfinished tasks (premature acceptance)
METRIC {"event":"story_accept_rejected","story_id":"STORY-B","reason":"tasks-incomplete","at":"2026-10-17T00:00:00+00:00"}
METRIC {"event":"inbox_event_applied","type":"story-accepted","file":"09-accept-premature.yaml","at":"2026-10-17T00:00:00+00:00"}
LOG   Inbox: archived '09-accept-premature.yaml' (applied:story-accepted) -> state/inbox/processed/20261017-000000-09-accept-premature.yaml
ERR   ! Inbox: story-accepted '10-accept-nostory.yaml' has no story_id — nothing transitioned
METRIC {"event":"inbox_event_applied","type":"story-accepted","file":"10-accept-nostory.yaml","at":"2026-10-17T00:00:00+00:00"}
LOG   Inbox: archived '10-accept-nostory.yaml' (applied:story-accepted) -> state/inbox/processed/20261017-000000-10-accept-nostory.yaml
CALL transition_story STORY-Q done [qa-story PASS]
LOG   Inbox: story-accepted '11-accept-promote-fails.yaml' — STORY-Q → done
CALL promote_acceptance_pack STORY-Q
ERR   ! Inbox: story-accepted — acceptance-pack promotion failed for STORY-Q (story is done; promote by hand: --promote-acceptance STORY-Q)
METRIC {"event":"story_accepted","story_id":"STORY-Q","verdict_ref":"","at":"2026-10-17T00:00:00+00:00"}
METRIC {"event":"inbox_event_applied","type":"story-accepted","file":"11-accept-promote-fails.yaml","at":"2026-10-17T00:00:00+00:00"}
LOG   Inbox: archived '11-accept-promote-fails.yaml' (applied:story-accepted) -> state/inbox/processed/20261017-000000-11-accept-promote-fails.yaml
CALL transition_story STORY-X done [qa-story PASS]
ERR   ! Inbox: story-accepted '12-accept-transition-fails.yaml' — STORY-X could not transition to done (status: qa)
METRIC {"event":"inbox_event_applied","type":"story-accepted","file":"12-accept-transition-fails.yaml","at":"2026-10-17T00:00:00+00:00"}
LOG   Inbox: archived '12-accept-transition-fails.yaml' (applied:story-accepted) -> state/inbox/processed/20261017-000000-12-accept-transition-fails.yaml
LOG   Inbox: stale-task '13-stale.json' — T-T-1 stamped v1, STORY-T now v2 (deferred, awaiting replan)
METRIC {"event":"inbox_event_applied","type":"stale-task","file":"13-stale.json","at":"2026-10-17T00:00:00+00:00"}
LOG   Inbox: archived '13-stale.json' (applied:stale-task) -> state/inbox/processed/20261017-000000-13-stale.json
ERR   ! Inbox: unknown event type 'frobnicate' in '14-unknown.yaml' — archiving without applying
METRIC {"event":"inbox_event_unknown","type":"frobnicate","file":"14-unknown.yaml","at":"2026-10-17T00:00:00+00:00"}
LOG   Inbox: archived '14-unknown.yaml' (unknown-type:frobnicate) -> state/inbox/processed/20261017-000000-14-unknown.yaml
ERR   ! Inbox: malformed event '15-malformed.yaml' (no 'type' field) — archiving without applying
METRIC {"event":"inbox_event_malformed","file":"15-malformed.yaml","at":"2026-10-17T00:00:00+00:00"}
LOG   Inbox: archived '15-malformed.yaml' (malformed) -> state/inbox/processed/20261017-000000-15-malformed.yaml
LOG   Inbox: applied 12 event(s) this sweep
sweep rc=0
-- left in inbox:
./.gitkeep
-- archived:
20261017-000000-01-enqueue.yaml
20261017-000000-02-enqueue-dup.yaml
20261017-000000-03-handwritten.yaml
20261017-000000-04-requeue-ref.yaml
20261017-000000-05-requeue-missing.yaml
20261017-000000-06-escalate.yaml
20261017-000000-07-escalate-nostory.yaml
20261017-000000-08-accept.yaml
20261017-000000-09-accept-premature.yaml
20261017-000000-10-accept-nostory.yaml
20261017-000000-11-accept-promote-fails.yaml
20261017-000000-12-accept-transition-fails.yaml
20261017-000000-13-stale.json
20261017-000000-14-unknown.yaml
20261017-000000-15-malformed.yaml
-- archived 03 body:
type: enqueue-bug
event: enqueue-bug
story: STORY-S
bug_id: BUG-3
spec_ref: harness/stories/STORY-S/bugs/BUG-3.md#bug-3
-- story.sh calls:
story.sh manifest get STORY-A task-statuses
story.sh manifest get STORY-B task-statuses
story.sh manifest get STORY-N task-statuses
story.sh manifest generate STORY-A
story.sh manifest get STORY-A task-statuses
story.sh manifest get STORY-A story-status
story.sh manifest generate STORY-B
story.sh manifest get STORY-B task-statuses
story.sh manifest generate STORY-Q
story.sh manifest get STORY-Q task-statuses
story.sh manifest get STORY-Q story-status
story.sh manifest generate STORY-X
story.sh manifest get STORY-X task-statuses
story.sh manifest get STORY-X story-status
