## _qa_findings_dir
[<T>/control/harness/state/qa-findings/T-7-1] [] [] [<T>/control/harness/state/qa-findings/odd-id--2]
## capture: a QA-rejected task in a lane
artefact paths:
harness/stories/STORY-7/bugs/BUG-002.md
harness/stories/STORY-7/review/T-7-1-review.md
harness/stories/STORY-7/testing/T-7-1-qa.md
lane events:
lanes/1/harness/state/inbox/enqueue-bug-BUG-001.yaml
lanes/1/harness/state/inbox/enqueue-bug-BUG-002.yaml
lanes/1/harness/state/inbox/no-ref.yaml
LOG   Preserved T-7-1's QA findings (3 file(s), 3 event(s)) -> control/harness/state/qa-findings/T-7-1
METRIC {"event":"qa_findings_captured","task_id":"T-7-1","verdict":"QA_FAILED","files":3,"events":3,"at":"2026-10-17T00:00:00+00:00"}
-- capture:
=== T-7-1/README.md
# Preserved QA findings — T-7-1

**Task:** harness/stories/STORY-7/tasks/T-7-1.md#t-7-1
**Captured:** 2026-10-17 00:00:00 UTC
**QA verdict:** QA_FAILED
**Work root:** <T>/lanes/1
**Contents:** 3 gate artefact(s), 3 inbox event(s)

The QA gate runs before the commit, and a QA-FAILED task never commits. Its
verdict, review report and filed bugs were therefore uncommitted in a lane whose
tree is quarantined and then reset, so they are copied here first.

- `files/`    — the artefacts, under their repo-relative paths.
- `files.txt` — the same list, one path per line.
- `inbox/`    — enqueue-bug events the QA agent wrote lane-side.
- `record`    — what qa_findings_publish reads.

The orchestrator publishes this directory automatically: the artefacts are
committed into the control checkout, and only then are the events moved into the
inbox for the next sweep to enqueue. This copy is retired under
`harness/state/stashed/` once that succeeds.

**The verdict is usually the artefact worth reading.** It is what shows whether
the FAIL was about this task's own acceptance criteria or about something the
task never touched.
=== T-7-1/files.txt
harness/stories/STORY-7/bugs/BUG-002.md
harness/stories/STORY-7/review/T-7-1-review.md
harness/stories/STORY-7/testing/T-7-1-qa.md
=== T-7-1/files/harness/stories/STORY-7/bugs/BUG-002.md
new bug
=== T-7-1/files/harness/stories/STORY-7/review/T-7-1-review.md
review report
=== T-7-1/files/harness/stories/STORY-7/testing/T-7-1-qa.md
new verdict: FAIL
=== T-7-1/inbox/T-7-1-enqueue-bug-BUG-001.yaml
type: enqueue-bug
spec_ref: harness/stories/STORY-7/bugs/BUG-001.md#bug-001
=== T-7-1/inbox/T-7-1-enqueue-bug-BUG-002.yaml
type: enqueue-bug
spec_ref: harness/stories/STORY-7/bugs/BUG-002.md#bug-002
=== T-7-1/inbox/T-7-1-no-ref.yaml
type: enqueue-bug
bug_id: BUG-9
=== T-7-1/record
task_id: T-7-1
spec: harness/stories/STORY-7/tasks/T-7-1.md#t-7-1
verdict: QA_FAILED
work_root: <T>/lanes/1
captured_at: 2026-10-17T00:00:00+00:00
-- lane inbox after capture:
.gitkeep
## capture: nothing to preserve
rc=0 dir=[T-7-1]
## publish: full — commit fails, rolled back, capture kept
CALL integration_lock_acquire 600
ERR   ! Could not acquire integration.lock within 600s to publish T-7-1's QA findings
ERR   ! Could not commit T-7-1's QA findings — rolling back and keeping the capture
METRIC {"event":"qa_findings_publish_failed","task_id":"T-7-1","files":3,"at":"2026-10-17T00:00:00+00:00"}
control status:
capture still there: yes
## publish: full — commits, releases the committed bug's events, retires
CALL integration_lock_acquire 600
CALL lane_record_base
CALL integration_lock_release
LOG   + Published T-7-1's QA findings (full): 3 artefact(s) committed, 3 event(s) queued for the sweep
METRIC {"event":"qa_findings_published","task_id":"T-7-1","mode":"full","files":3,"committed":true,"events":3,"held":0,"at":"2026-10-17T00:00:00+00:00"}
-- last commit:
chore(qa): preserve T-7-1's QA findings

The QA gate runs before the commit and a QA-rejected task never commits, so its
verdict, review report and filed bugs were uncommitted in a lane whose tree is
quarantined and then reset. Rescued from harness/state/qa-findings/ by the
scheduler. Gate EVIDENCE only — no source from the rejected attempt.

Committed rather than left untracked because a bug file only reaches the lane
that must fix it by being on the base branch, and an untracked copy makes the
integrator's merge --ff-only refuse.

 harness/stories/STORY-7/bugs/BUG-002.md        
 harness/stories/STORY-7/review/T-7-1-review.md 
 harness/stories/STORY-7/testing/T-7-1-qa.md    
 3 files changed, 3 insertions(+), 1 deletion(-)
-- control inbox:
=== T-7-1-enqueue-bug-BUG-001.yaml
type: enqueue-bug
spec_ref: harness/stories/STORY-7/bugs/BUG-001.md#bug-001
=== T-7-1-enqueue-bug-BUG-002.yaml
type: enqueue-bug
spec_ref: harness/stories/STORY-7/bugs/BUG-002.md#bug-002
=== T-7-1-no-ref.yaml
type: enqueue-bug
bug_id: BUG-9
-- qa-findings:
-- stashed:
./20261017-000000-T-7-1-qa-findings/README.md
./20261017-000000-T-7-1-qa-findings/files.txt
./20261017-000000-T-7-1-qa-findings/files/harness/stories/STORY-7/bugs/BUG-002.md
./20261017-000000-T-7-1-qa-findings/files/harness/stories/STORY-7/review/T-7-1-review.md
./20261017-000000-T-7-1-qa-findings/files/harness/stories/STORY-7/testing/T-7-1-qa.md
./20261017-000000-T-7-1-qa-findings/record
## publish: events mode holds an event whose bug is not committed
LOG   + Published T-7-3's QA findings (events): 0 artefact(s) committed, 1 event(s) queued for the sweep
METRIC {"event":"qa_findings_published","task_id":"T-7-3","mode":"events","files":0,"committed":false,"events":1,"held":1,"at":"2026-10-17T00:00:00+00:00"}
LOG     1 event(s) held back — the bug file each names is not committed yet; the capture is kept at control/harness/state/qa-findings/T-7-3 and retried at the next startup
-- control inbox:
T-7-3-b.yaml
-- held:
=== files.txt
harness/stories/STORY-7/bugs/BUG-005.md
=== inbox/T-7-3-a.yaml
type: enqueue-bug
spec_ref: harness/stories/STORY-7/bugs/BUG-404.md#bug-404
=== record
task_id: T-7-3
## publish_orphans: retries the held capture
LOG   Publishing a QA findings capture left by an earlier run: T-7-3
LOG   + Published T-7-3's QA findings (full): 0 artefact(s) committed, 0 event(s) queued for the sweep
METRIC {"event":"qa_findings_published","task_id":"T-7-3","mode":"full","files":0,"committed":false,"events":0,"held":1,"at":"2026-10-17T00:00:00+00:00"}
LOG     1 event(s) held back — the bug file each names is not committed yet; the capture is kept at control/harness/state/qa-findings/T-7-3 and retried at the next startup
METRIC {"event":"qa_findings_orphans_published","count":1,"at":"2026-10-17T00:00:00+00:00"}
-- capture now:
./T-7-3/files.txt
./T-7-3/inbox/T-7-3-a.yaml
./T-7-3/record
## publish_orphans: nothing left that has a record
rc=0
## sweep_lane: publish mode merges into a capture
LOG   Swept 1 stranded inbox event(s) out of lanes/1 -> control/harness/state/qa-findings/T-7-1 (record)
METRIC {"event":"qa_findings_lane_swept","key":"T-7-1","events":1,"mode":"publish","at":"2026-10-17T00:00:00+00:00"}
-- capture:
./T-7-1/files.txt
./T-7-1/files/harness/stories/STORY-7/bugs/BUG-002.md
./T-7-1/files/harness/stories/STORY-7/review/T-7-1-review.md
./T-7-1/files/harness/stories/STORY-7/testing/T-7-1-qa.md
./T-7-1/inbox/T-7-1-late.yaml
./T-7-1/record
task_id: T-7-1
spec: (swept from <T>/lanes/1)
verdict: swept
work_root: <T>/lanes/1
captured_at: 2026-10-17T00:00:00+00:00
-- sweep of an empty lane inbox:
rc=0
-- bad args:
rc=0
## sweep_lanes: startup pass holds, then the opt-in releases
LOG   Swept 1 stranded inbox event(s) out of lanes/1 -> control/harness/state/qa-findings/orphan-lane-1 (record.held)
METRIC {"event":"qa_findings_lane_swept","key":"orphan-lane-1","events":1,"mode":"hold","at":"2026-10-17T00:00:00+00:00"}
LOG   Swept 1 stranded inbox event(s) out of lanes/2 -> control/harness/state/qa-findings/orphan-lane-2 (record.held)
METRIC {"event":"qa_findings_lane_swept","key":"orphan-lane-2","events":1,"mode":"hold","at":"2026-10-17T00:00:00+00:00"}
LOG   2 swept lane capture(s) are HELD, not enqueued. Review them, then release with:
LOG     ORCHESTRATOR_RELEASE_LANE_ORPHANS=true bash <orchestrate.sh>
METRIC {"event":"qa_findings_lane_orphans_held","captures":2,"at":"2026-10-17T00:00:00+00:00"}
-- held captures:
./orphan-lane-1/files.txt
./orphan-lane-1/files/harness/stories/STORY-7/bugs/BUG-002.md
./orphan-lane-1/files/harness/stories/STORY-7/review/T-7-1-review.md
./orphan-lane-1/files/harness/stories/STORY-7/testing/T-7-1-qa.md
./orphan-lane-1/inbox/orphan-lane-1-stranded1.yaml
./orphan-lane-1/record.held
./orphan-lane-2/inbox/orphan-lane-2-stranded.yaml
./orphan-lane-2/record.held
LOG   2 swept lane capture(s) are HELD, not enqueued. Review them, then release with:
LOG     ORCHESTRATOR_RELEASE_LANE_ORPHANS=true bash <orchestrate.sh>
METRIC {"event":"qa_findings_lane_orphans_held","captures":2,"at":"2026-10-17T00:00:00+00:00"}
LOG   Released held capture control/harness/state/qa-findings/orphan-lane-1 for this run's orphan publish
LOG   Released held capture control/harness/state/qa-findings/orphan-lane-2 for this run's orphan publish
-- after release:
./orphan-lane-1/files.txt
./orphan-lane-1/files/harness/stories/STORY-7/bugs/BUG-002.md
./orphan-lane-1/files/harness/stories/STORY-7/review/T-7-1-review.md
./orphan-lane-1/files/harness/stories/STORY-7/testing/T-7-1-qa.md
./orphan-lane-1/inbox/orphan-lane-1-stranded1.yaml
./orphan-lane-1/record
./orphan-lane-2/inbox/orphan-lane-2-stranded.yaml
./orphan-lane-2/record
-- no lanes dir:
rc=0
