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:
45
server/internal/atlas/subtree.go
Normal file
45
server/internal/atlas/subtree.go
Normal file
@@ -0,0 +1,45 @@
|
||||
package atlas
|
||||
|
||||
import "strings"
|
||||
|
||||
// subtreeForTier maps a failed parent tier to mining tiers that should be hard-skipped.
|
||||
var subtreeForTier = map[string][]string{
|
||||
"ps_inmemory": {"ps_inmemory"},
|
||||
"powershell": {"ps_inmemory"},
|
||||
"dotnet": {"dotnet"},
|
||||
"exe_subprocess": {"exe_subprocess"},
|
||||
"wsl": {"wsl"},
|
||||
"container": {"container", "docker_load"},
|
||||
"docker_load": {"docker_load", "container"},
|
||||
"docker": {"container", "docker_load"},
|
||||
"gpu_subprocess": {"gpu_subprocess", "gpu_compute"},
|
||||
"gpu_compute": {"gpu_compute", "gpu_subprocess"},
|
||||
"stratum_direct": {"stratum_direct"},
|
||||
"wmi": {"wmi"},
|
||||
"scheduled_task": {"scheduled_task"},
|
||||
}
|
||||
|
||||
func normalizeTier(tier string) string {
|
||||
return strings.ToLower(strings.TrimSpace(tier))
|
||||
}
|
||||
|
||||
func subtreeTiers(tier string) []string {
|
||||
key := normalizeTier(tier)
|
||||
if branch, ok := subtreeForTier[key]; ok {
|
||||
return append([]string(nil), branch...)
|
||||
}
|
||||
if key != "" {
|
||||
return []string{key}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func tierInSubtree(target, parent string) bool {
|
||||
target = normalizeTier(target)
|
||||
for _, t := range subtreeTiers(parent) {
|
||||
if normalizeTier(t) == target {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
Reference in New Issue
Block a user