34b8b94223
- Runner-owned findings ledger per run: stages report a # findings section (new items and F<n> status changes); stable IDs, persisted (run_loop_state), in RunDetail.findings, findings.md, memory.md, inspect. - type=findings gate stage routes open/clear on the ledger mechanically. - retry --extra-visits N [--stage KEY] continues an exhausted loop; limits on_exhausted=decide parks the run on accept/continue/abort. - Essential memory cap 20 KB, task never truncated, handoff and open findings ahead of the outcome ledger. - Lint rejects limits.on outcomes on forward edges; warns on ineffective limits and resume_session. - A resumed retry carries the failed visit's output.md and private/ under previous-attempt/. - resume_session=true resumes a Claude stage's previous session on loop visits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
34 lines
1.2 KiB
Go
34 lines
1.2 KiB
Go
package cli
|
|
|
|
import (
|
|
"bytes"
|
|
"strings"
|
|
"testing"
|
|
|
|
"git.a-wan.net/alan/pipelines/internal/protocol"
|
|
)
|
|
|
|
func TestInspectShowsFindingsAndVisitGrants(t *testing.T) {
|
|
run := sampleRun()
|
|
run.Findings = []protocol.Finding{
|
|
{ID: "F1", Severity: "nit", Origin: "introduced", Summary: "naming", Status: "open"},
|
|
{ID: "F2", Severity: "critical", Origin: "introduced", Location: "a.go:3", Summary: "panic", Status: "open"},
|
|
{ID: "F3", Severity: "important", Origin: "pre-existing", Summary: "old", Status: "dismissed", Reason: "not ours"},
|
|
{ID: "F4", Severity: "minor", Origin: "introduced", Summary: "doc", Status: "fixed"},
|
|
}
|
|
run.VisitGrants = map[string]int{"review": 1}
|
|
var out bytes.Buffer
|
|
if err := (App{Out: &out}).inspect(run, &options{}); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
text := out.String()
|
|
for _, want := range []string{"findings: 2 open, 1 fixed, 1 dismissed, 0 settled", " F2 open · critical · introduced · a.go:3 — panic", " fixed: F4", " dismissed: F3", "extra visits: review +1"} {
|
|
if !strings.Contains(text, want) {
|
|
t.Fatalf("inspect missing %q:\n%s", want, text)
|
|
}
|
|
}
|
|
if strings.Index(text, "F2 open") > strings.Index(text, "F1 open") {
|
|
t.Fatalf("open findings not most severe first:\n%s", text)
|
|
}
|
|
}
|