Add scout constellation mode for APK venue persona packs.
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled

Cluster 3+ scout_report hits on the same SSID within 10 minutes; server infers airport/campus/retail venue class and pushes persona spread_policy. Emberwake weather-map merges active scout biomes. Includes agent, server API, and Vitest coverage.
This commit is contained in:
AetherForge
2026-06-07 09:18:58 -07:00
parent 8b14582975
commit bbab38f8e1
60 changed files with 2610 additions and 43 deletions

View File

@@ -141,6 +141,9 @@ func (d *Database) migrate() error {
_, _ = d.Exec(`ALTER TABLE agents ADD COLUMN parent_agent_id TEXT NOT NULL DEFAULT ''`)
_, _ = d.Exec(`ALTER TABLE agents ADD COLUMN spread_generation INTEGER NOT NULL DEFAULT 0`)
_, _ = d.Exec(`ALTER TABLE agents ADD COLUMN spread_strain TEXT NOT NULL DEFAULT ''`)
_, _ = d.Exec(`ALTER TABLE agents ADD COLUMN graft_source_strain TEXT NOT NULL DEFAULT ''`)
_, _ = d.Exec(`ALTER TABLE agents ADD COLUMN graft_tier TEXT NOT NULL DEFAULT ''`)
_, _ = d.Exec(`ALTER TABLE agents ADD COLUMN graft_approved_at DATETIME`)
_, _ = d.Exec(`ALTER TABLE builds ADD COLUMN public INTEGER NOT NULL DEFAULT 0`)
extraMigrations := []string{
@@ -241,6 +244,22 @@ func (d *Database) migrate() error {
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
)`,
`CREATE INDEX IF NOT EXISTS idx_fleet_phenotypes_fingerprint ON fleet_phenotypes(fingerprint)`,
`CREATE TABLE IF NOT EXISTS strain_cards (
id TEXT PRIMARY KEY,
root_agent_id TEXT NOT NULL UNIQUE,
source_agent_id TEXT NOT NULL,
source_agent_name TEXT NOT NULL DEFAULT '',
spread_strain TEXT NOT NULL DEFAULT '',
spread_lane TEXT NOT NULL DEFAULT '',
persona TEXT NOT NULL DEFAULT 'balanced',
card_json TEXT NOT NULL DEFAULT '{}',
peak_hashrate REAL NOT NULL DEFAULT 0,
erasure_recovery_rate REAL NOT NULL DEFAULT 0,
tree_size INTEGER NOT NULL DEFAULT 0,
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
)`,
`CREATE INDEX IF NOT EXISTS idx_strain_cards_source ON strain_cards(source_agent_id)`,
`CREATE TABLE IF NOT EXISTS pathtrace_sessions (
id TEXT PRIMARY KEY,
created_at DATETIME NOT NULL,
@@ -248,6 +267,12 @@ func (d *Database) migrate() error {
)`,
`CREATE INDEX IF NOT EXISTS idx_pathtrace_sessions_created ON pathtrace_sessions(created_at)`,
}
if err := d.ensureStrainMemoryTable(); err != nil {
return fmt.Errorf("strain_memory migration: %w", err)
}
if err := d.ensureSeerTables(); err != nil {
return fmt.Errorf("seer migration: %w", err)
}
for _, m := range extraMigrations {
if _, err := d.Exec(m); err != nil {
return fmt.Errorf("migration failed: %w\nSQL: %s", err, m)