fix(rsi): read only completed retests in lesson extraction

The lateral join took the newest retest of a finding whatever its status.
A pending, running, failed, or stopped retest can carry a verdict the agent
staged before the run ended, and that verdict became positive or caution
evidence. The join now reads the newest retest with status='completed' and a
non-empty verdict, so an unfinished retest neither writes evidence nor hides
an earlier completed one.
This commit is contained in:
BaaRai
2026-11-21 08:50:37 +01:00
parent 8f3b0541ab
commit d638b047dc
3 changed files with 114 additions and 1 deletions
+4
View File
@@ -61,6 +61,10 @@ Rules:
Pending and in-progress findings produce nothing: there is no outcome yet.
Empty cue, action, or source is refused by the gate.
A retest counts only when it is `completed` with a verdict; extraction reads
the latest such retest. A verdict staged on a pending, running, failed, or
stopped retest produces nothing.
A task with more than one company in `task_scope` does not gain a new lesson.
Retraction still runs, so a lesson written while the task had one company can
be withdrawn after a second company is added. Per-finding company attribution