Point it at a repo. It finds optimization targets. Workers compete to improve them. Verified results flow back as pull requests.
# Scan a Go repo for optimization candidates
bounty-factory scan https://github.com/lightningnetwork/lnd
# Generate eval scripts + target configs from the scan
bounty-factory generate scan-report.json -o lnd-targets/
# Deploy targets to the satwork coordinator
bounty-factory deploy lnd-targets/ --coordinator https://satwork.ai
# After workers find improvements, generate a PR
bounty-factory pr lnd-ban-management --repo https://github.com/lightningnetwork/lnd
| Language | What it scans | Tested on |
|---|---|---|
| Go | Named constants (Default*, Min*, Max*), duration constants, TODO:tune comments, channel buffers, retry loops, benchmarks |
lightningnetwork/lnd — 244 candidates, 40 benchmarks |
| Python | Module constants (UPPER_SNAKE), class defaults, function parameter defaults, config files, TODO:tune, pytest-benchmark |
psf/requests — 5 candidates, 339 tests |
| Rust | const/static declarations, Default trait implementations, TODO:tune, criterion benchmarks, #[bench] |
tokio-rs/tokio — 32 candidates, 44 benchmarks |
| JavaScript / TypeScript | const declarations, config objects, .env.example defaults, TODO:tune, benchmark suites |
webpack/webpack — 4 candidates, 3,395 tests |
bounty-factory scan <github-url> clones the repo, detects the language, and runs two passes:
const blocks, Default* prefixed values, duration constants, TODO:tune commentsEach candidate is semantically classified (timeout? buffer? probability? threshold?) and grouped into logical optimization targets. Output: scan-report.json.
bounty-factory generate <report> creates a complete satwork target for each group:
bounty-factory deploy <targets-dir> pushes targets to the coordinator and hot-reloads. Workers discover new targets automatically via /api/discover.
bounty-factory pr <target-id> --repo <url> fetches the winning parameters, maps them back to source code, and generates a PR with annotated diffs, benchmark comparisons, and verification instructions.
The scanner classifies each parameter by its variable name and surrounding context:
| Category | Detected by | Bounds strategy |
|---|---|---|
| timeout | timeout, deadline, expiry, ttl | 0.1x to 10x current value |
| buffer_size | buffer, page_size, batch_size, pool | 0.25x to 4x |
| probability | prob, weight, factor, ratio, decay | [0, 1] |
| retry | retry, retries, max_attempts, backoff | ±50% |
| concurrency | workers, threads, conns, goroutines | 0.25x to 4x |
| interval | interval, period, tick, flush, rotation | 0.1x to 10x |
| cache | cache_size, evict, lru, prealloc | 0.25x to 4x |
| threshold | threshold, limit, max_, min_, cap | ±50% |
| fee | fee, cost, price, rate_ppm, budget | ±50% |
Generated eval scripts use domain-specific simulation templates:
| Domain | Triggered by | Simulates |
|---|---|---|
| routing | routing/, htlcswitch/, autopilot/ | Synthetic LN graph, payment routing, success rate + fees |
| database | channeldb/, sqldb/, graph/db/ | Query patterns, batch commits, cache hit rates |
| gossip | discovery/ | Message propagation, bandwidth, peer banning |
| connection | peer/, server, watchtower/ | Peer connections, reconnection, keepalive |
| cache | cache/ | Hit rates, eviction, memory efficiency |
| sweep | sweep/, contractcourt/ | Fee environment, UTXO batching, deadline management |
| generic | everything else | Multi-metric sensitivity analysis |
Live on the coordinator right now
Evaluated by distributed workers
Verified, reproducible, ready for PRs
$ bounty-factory scan https://github.com/lightningnetwork/lnd
Cloning https://github.com/lightningnetwork/lnd...
Language: go
Commit: db765a752b63
Found 308 candidates, 40 benchmarks, 1733 tests
After confidence filter (>=0.3): 244 candidates
Grouped into 107 targets
============================================================
SCAN SUMMARY: https://github.com/lightningnetwork/lnd
============================================================
Candidates: 244
Benchmarks: 40
Tests: 1733
Target groups: 107
lnd-lncfg-timeout 10 params timeout
lnd-htlcswitch-timeout 7 params timeout
lnd-sqldb-buffer_size 6 params buffer_size
lnd-routing-probability 5 params probability
lnd-discovery-threshold 7 params threshold [TODO:tune x3]
lnd-graph-db-cache 3 params cache
...
$ bounty-factory pr lnd-ban-management --repo https://github.com/lightningnetwork/lnd
PR GENERATED: perf: optimize LND Gossip Ban Management (TODO: tune) (+19.8%)
Branch: bounty-factory/optimize-lnd-ban-management
Changes: 4 parameters across 1 files
--- a/discovery/ban.go
+++ b/discovery/ban.go
- DefaultBanThreshold = 100
+ DefaultBanThreshold = 57
- maxBannedPeers = 10_000
+ maxBannedPeers = 1_000
- banTime = time.Hour * 48
+ banTime = time.Hour * 149
- resetDelta = time.Hour * 48
+ resetDelta = time.Hour * 57