mirror of
https://github.com/multica-ai/multica.git
synced 2026-07-06 22:09:44 +02:00
* feat: add daemon skill bundle refs Co-authored-by: multica-agent <github@multica.ai> * fix: tighten skill bundle resolve safeguards Co-authored-by: multica-agent <github@multica.ai> * feat: add task prepare lease Co-authored-by: multica-agent <github@multica.ai> * fix: isolate prepare lease concurrent index migration Co-authored-by: multica-agent <github@multica.ai> * fix: keep prepare lease active through start Co-authored-by: multica-agent <github@multica.ai> --------- Co-authored-by: J <j@multica.ai> Co-authored-by: multica-agent <github@multica.ai>
38 lines
962 B
Go
38 lines
962 B
Go
package skillbundle
|
|
|
|
import "testing"
|
|
|
|
func TestBuildManifestStableAcrossFileOrder(t *testing.T) {
|
|
a := BuildManifest(Skill{
|
|
ID: "skill-1",
|
|
Source: SourceWorkspace,
|
|
Name: "deploy",
|
|
Content: "main",
|
|
Files: []File{
|
|
{Path: "b.md", Content: "b"},
|
|
{Path: "a.md", Content: "a"},
|
|
},
|
|
})
|
|
b := BuildManifest(Skill{
|
|
ID: "skill-1",
|
|
Source: SourceWorkspace,
|
|
Name: "deploy",
|
|
Content: "main",
|
|
Files: []File{
|
|
{Path: "a.md", Content: "a"},
|
|
{Path: "b.md", Content: "b"},
|
|
},
|
|
})
|
|
if a.Hash != b.Hash {
|
|
t.Fatalf("hash depends on file order: %s != %s", a.Hash, b.Hash)
|
|
}
|
|
}
|
|
|
|
func TestBuildManifestChangesWhenContentChanges(t *testing.T) {
|
|
a := BuildManifest(Skill{ID: "skill-1", Source: SourceWorkspace, Name: "deploy", Content: "main"})
|
|
b := BuildManifest(Skill{ID: "skill-1", Source: SourceWorkspace, Name: "deploy", Content: "changed"})
|
|
if a.Hash == b.Hash {
|
|
t.Fatal("hash did not change when content changed")
|
|
}
|
|
}
|