release 1.22.0: modular ladder withdraw + pay max-search

Split pay into ladder/lib_pay.sh; force-select extract in
ladder/extract_rpubs.py. check_goa_ladder.sh is only a compat shim.

max-ladder now hunts highest withdrawable and highest payable
(never above wallet available), using public free-amount template
goa-free on hacktivism. Classic remains default 23-rung wd+pay.

Pay phase always runs when LADDER_PAY=1 (visible SKIP_BALANCE when
no spendable coins). Report includes best_pay / alt names.
This commit is contained in:
Hernâni Marques 2026-07-19 14:25:24 +02:00
parent 6185f89fa6
commit 3550221b30
No known key found for this signature in database
9 changed files with 449 additions and 274 deletions

25
ladder/README.md Normal file
View file

@ -0,0 +1,25 @@
# Amount ladder modules
Glued by `../check_amount_ladder.sh` (phase entry: `ladder` / `max-ladder`).
| Path | Role |
|------|------|
| `extract_rpubs.py` | Force-select: scrape `reservePub` from wallet dumps (no bash heredoc) |
| `lib_pay.sh` | **Payment** ladder: free-amount template orders, classic pay list, max-search highest **payable** ≤ available |
| *(withdraw stays in `check_amount_ladder.sh`)* | **Withdraw** ladder: classic 23-rung plan + max-search highest **withdrawable** |
`check_goa_ladder.sh` at repo root is only a **compat shim** (`exec``check_amount_ladder.sh`). Not required for new scripts; phase alias `goa-ladder` already uses the amount ladder.
## Modes
- **classic** (default): withdraw plan 0→mids→max-1→max, then matching pay plan (never overspend).
- **max** (`max-ladder`): adaptive max withdraw, then adaptive max pay via public free template (hacktivism: `goa-free`).
## Env (pay)
| Variable | Default | Meaning |
|----------|---------|---------|
| `LADDER_PAY` | `1` | `0` = skip all pays |
| `LADDER_USE_FREE_TEMPLATE` | `1` | public POST template with `{"amount":…}` |
| `LADDER_FREE_TEMPLATE` | `goa-free` | template id (hacktivism) |
| `LADDER_FREE_TEMPLATE_INSTANCE` | merchant instance | e.g. `goa-demo-cp4zqk` |