Files
weichen 908fb253d7
ci / vet-and-test (pull_request) Successful in 45s
Keep tool-result dumps out of the deliverable gate and cards
Why: The live after-run (golden minutes-pm-tool) showed the truncation spill
artifact tool-run_shell-<call>.txt entering CheckArtifacts as a .txt
deliverable; its non-UTF-8 payload failed the scorer four times in a row.
These files exist to keep oversized tool output reachable - they are context
relief, not deliverables, and must not occupy delivery cards either.

Evidence: SELF - TestLatestDeliverablesKeepsLastPerName extended with a
tool-dump ref and asserts exclusion; go test ./internal/... passes; single-task
live rerun recorded on the phase02 task card.

Impact: latestDeliverables (gate input, verifier refs, reply deliverable list,
final artifact_ref cards) skips kind=data tool- prefixed refs. The spill files
remain artifacts for context backfill.
2026-10-09 14:56:34 +00:00

38 lines
1.1 KiB
Go

package runtime
import (
"testing"
core "agent-system-core"
)
// 修订(同名再登记)后,终轮检查与交付清单只看最新版本;
// 无名工件互不合并。
func TestLatestDeliverablesKeepsLastPerName(t *testing.T) {
st := &directRun{deliverables: []*core.ArtifactRef{
{ArtifactID: "art_aaa1", Name: "方案.docx"},
{ArtifactID: "art_bbb2", Name: "纪要.docx"},
{ArtifactID: "art_ccc3", Name: "方案.docx"},
{ArtifactID: "art_ddd4", Name: ""},
{ArtifactID: "art_eee5", Name: "tool-run_shell-call_x1.txt", Kind: "data"},
}}
got := st.latestDeliverables()
if len(got) != 3 {
t.Fatalf("want 3 deliverables, got %d: %+v", len(got), got)
}
for _, ref := range got {
if isToolDumpArtifact(ref) {
t.Fatalf("tool result dumps are not deliverables: %+v", ref)
}
}
if got[0].ArtifactID != "art_ccc3" || got[0].Name != "方案.docx" {
t.Fatalf("方案.docx should resolve to latest: %+v", got[0])
}
if got[1].ArtifactID != "art_bbb2" {
t.Fatalf("纪要.docx should be untouched: %+v", got[1])
}
if got[2].ArtifactID != "art_ddd4" {
t.Fatalf("unnamed artifact must be kept as-is: %+v", got[2])
}
}