Why: Allow consumers to download an immutable module revision without nested source checkouts or local path replacements. Evidence: SELF package tests and the prior canonical-path rejection are recorded in the Dev dependency-workspace task card; remote consumption is replayed against the committed candidate. Impact: Change the module identity and its Go imports while preserving API behavior. Existing historical submodule revisions remain buildable. Refs: Versioned dependencies U1/U3; feature/dependency-workspace
38 lines
1.2 KiB
Go
38 lines
1.2 KiB
Go
package runtime
|
|
|
|
import (
|
|
"testing"
|
|
|
|
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
|
|
)
|
|
|
|
// 修订(同名再登记)后,终轮检查与交付清单只看最新版本;
|
|
// 无名工件互不合并。
|
|
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])
|
|
}
|
|
}
|