Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
142 commits
Select commit Hold shift + click to select a range
ad362cb
seller fee stage 2a: `maxplayer seller fees remit` pays the accrued p…
Sep 7, 2026
a11b5d8
seller fee stage 2a, addendum 1: the seller node remits the platform …
Sep 7, 2026
ec6c07e
seller fee stage 2a, addendum 2: a failed remittance RETRIES on the n…
Sep 7, 2026
cd6e896
wip: round 2 in progress (B/D/G/E/H/I partial) — cut mid-turn 14:57Z
Sep 7, 2026
69a376b
seller fee stage 2a, addendum 3 (round 2): the accrued gross is a har…
Sep 7, 2026
c90a384
wip: round 3 (addendum 4) — Spending state + compare-and-set fence in…
Sep 7, 2026
5bef43a
wip: round 3 — 2g tests (b)/(c)/(d) and fence-time test written; stor…
Sep 7, 2026
cb65772
wip: round 3 — B/D/G fence green in fee_remit, store and node tests; …
Sep 7, 2026
1043020
wip: round 3 — E: one line per attempt incl. first failure; boot floo…
Sep 7, 2026
7848287
wip: round 3 — H prose: module doc bound to the fence tests, stale me…
Sep 7, 2026
5d16787
round 3: rustfmt over this delivery's added lines only (7 hunks in fe…
Sep 7, 2026
ad964cb
round 3: the CLI read-out names a SPENDING row (the acp binary did no…
Sep 7, 2026
c6cbedc
wip: round 4 (addendum 5) — wallet_ops: melt split into quote step + …
Sep 7, 2026
ccd4752
wip: round 4 (addendum 5) — store: v13 spending_quote_id bound at the…
Sep 7, 2026
4c6a546
wip: round 4 (addendum 5) — store tests: fence binds the quote and re…
Sep 7, 2026
177bb2d
wip: round 4 (addendum 5) — fee_remit: effects trait split (melt_quot…
Sep 7, 2026
7f02de1
wip: round 4 (addendum 5) — remit path reordered: payment quote + cei…
Sep 7, 2026
4cd8fa3
wip: round 4 (addendum 5) — test Fake: shared mint quote registry (on…
Sep 7, 2026
2abc417
wip: round 4 (addendum 5) — pure decision tables updated: releases ca…
Sep 7, 2026
8330da4
wip: round 4 (addendum 5) — existing fee_remit tests updated to the b…
Sep 7, 2026
72ce7b8
wip: round 4 (addendum 5) — CLI: QuoteFailed exit code, read-out name…
Sep 7, 2026
78ca8d1
wip: round 4 (addendum 5) — 2g tests added, not yet compiled: (b1) bo…
Sep 8, 2026
f911b4b
wip: round 4 (addendum 5) — 2g (b1)/(b2)/(c)/(B2)/(d) each 1 passed -…
Sep 8, 2026
6758d77
wip: round 4 (addendum 5) — H prose: module doc names the bound quote…
Sep 8, 2026
2a167ca
fmt: rustfmt over the lines this delivery added in fee_remit.rs, stor…
Sep 8, 2026
038dec9
tests: PauseAt::{Plan,Quote,Admit} — clears clippy enum_variant_names…
Sep 8, 2026
29f6bc0
tests: the schema-version pin in the v6→v7 migration test reads 13 (v…
Sep 8, 2026
ecadcc0
tests(fake mint): pay_melt_quote in the CDK 0.17.2 shape — wallet hal…
Sep 8, 2026
2f074ab
fee_remit: a bound spending row is held on everything but PAID — no c…
Sep 8, 2026
0d228bc
tests: the two decision tables and the interrupted-attempt test now e…
Sep 8, 2026
e7a3c57
tests(2g b2, d): an expired bound quote is HELD, not released — B pla…
Sep 8, 2026
41abe67
tests(2b, 2g a): the collect-path recovery holds on FAILED with PAID …
Sep 8, 2026
1d04663
tests(2g, new): the delayed confirm — a payment prepared before its q…
Sep 8, 2026
936064a
cli(seller fees remit): exit_code_for(&RemitOutcome) extracted and pi…
Sep 8, 2026
a36ace6
cli(seller fees): drop the RemitOutcome import remit_live no longer u…
Sep 8, 2026
76f7ba0
fmt: rustfmt over the lines this round added in fee_remit.rs, seller_…
Sep 8, 2026
f655bd2
docs(remit): addendum 6 §4 prose — a bound spending row is held on no…
Sep 8, 2026
ecb2586
test(fee_remit): delayed-confirm case exercises the STORE's refusal, …
Sep 8, 2026
1fa858b
style(fee_remit): rustfmt the one over-long assert in the delayed-con…
Sep 8, 2026
12ef56c
fix(fee_remit): a bound spending row observed PENDING/UNKNOWN is HELD…
Sep 8, 2026
1008fa4
test(seller_fees): invoke `remit` dry-run and --confirm on a held spe…
Sep 8, 2026
4c6f296
style(seller_fees): rustfmt one tuple in the held-row invocation test
Sep 8, 2026
d850709
docs(remit): remove the struck release policy from changed source; na…
Sep 8, 2026
a03ec29
docs(remit): inspected CDK, per-test sharing scope, and both refusal …
Sep 8, 2026
d9d2176
fee remit: two-phase melt payment bound on the SDK's total debit (add…
Sep 8, 2026
cb8e5f5
fmt: rustfmt over the addendum 8 hunks in wallet_ops.rs only (fmt-min…
Sep 8, 2026
614c42d
fee remit: prepare → total bound → fence → confirm (addendum 8 §1.2, …
Sep 8, 2026
dc5393a
fmt: rustfmt over the addendum 8 hunk in fee_remit.rs only (fmt-mine.py)
Sep 8, 2026
47a049e
fee remit tests: fee-bearing fake wallet + the two addendum 8 §1.5 re…
Sep 8, 2026
5318547
fmt: rustfmt over the addendum 8 hunks in fee_remit.rs only (fmt-mine…
Sep 8, 2026
c62989e
fee remit: fee-aware planning — the expected proof fees come out of t…
Sep 8, 2026
db9bda4
fmt: rustfmt over the addendum 8 hunks in fee_remit.rs only (fmt-mine…
Sep 8, 2026
582981d
seller fees CLI test: the held-row invocations assert the ENTIRE stdo…
Sep 8, 2026
413b777
seller node: the drain-bound INCIDENT line separates a Planned row fr…
Sep 8, 2026
0c8f70e
fee remit / wallet_ops: source prose for the addendum 8 ceiling and t…
Sep 8, 2026
cf9cc0a
fee remit / wallet_ops: clear the five clippy diagnostics on this rou…
Sep 8, 2026
3dc16e2
docs: seller quickstart — the ceiling is the whole wallet debit; stat…
Sep 8, 2026
82b9adf
fee_remit fake: CDK-shaped confirm — swap output split, recomputed in…
Sep 8, 2026
fdac830
seller fee remit: confirmability before the fence (§1.1) + fake self-…
Sep 8, 2026
aef40db
seller fee remit: fee-aware planning chooses a genuinely confirmable …
Sep 8, 2026
c9b7f30
seller fee remit tests: §1.4 regressions on the CDK fee model
Sep 8, 2026
7c8293f
seller fee remit: count the SDK's inclusive fee_paid once; balance un…
Sep 8, 2026
a89f5d2
seller fee remit: cancellation, recovery and retired-call prose said …
Sep 8, 2026
987cad3
seller fee remit docs: fee model, §1.5 bound and owed recovery restat…
Sep 8, 2026
2137ef7
seller fee remit: round-8 lint — rustfmt on our added lines, constant…
Sep 8, 2026
41bf5e4
reports: round-8 evidence at executable head 1a5c7c5 (reports only)
Sep 8, 2026
f673bfc
reports: round-8 body sources, citation remap and read-back at 1a5c7c…
Sep 8, 2026
4783a13
reports: PR body pin at final head 4714623 (pin commit follows the fi…
Sep 8, 2026
a51ecc9
reports: round 9 plan (N1 one bound + same-attempt re-plan, N2 Planne…
Sep 8, 2026
fe021b8
fee: one actual-confirmability bound for the prepared-melt gate (adde…
Sep 8, 2026
5f13208
fee: planner and pre-fence check on confirm_bound; prepared-total ear…
Sep 8, 2026
5d23d85
fee: store.replan_remittance — re-point our planned unbound row at a …
Sep 8, 2026
38f47e8
reports: round 9 commit C test log at b7e3f34 (store replan test: 1 p…
Sep 8, 2026
6fc4d3e
WIP fee: re-plan once in the same attempt when the live reserve makes…
Sep 8, 2026
8f766ed
fee: re-plan once, in the same attempt, when the live reserve makes t…
Sep 8, 2026
a07be92
fee: test_support takes fee_for from wallet_ops (the non-test re-expo…
Sep 8, 2026
6780d3c
fee: re-plan only when the live reserve SHRANK; a grown reserve is re…
Sep 8, 2026
a1755cc
reports: round 9 commit D logs — fee_remit::tests at bcbc8b9: 37 pass…
Sep 8, 2026
eced131
fee tests: record 37 moves to the fee-metadata drift schedule (Fake.p…
Sep 8, 2026
19e1330
reports: fee_remit::tests at fa2b8af — 38 passed, 0 failed (record 37…
Sep 8, 2026
377ebee
WIP fee tests: §1.4(a) a_reserve_that_shrinks_between_estimate_and_pa…
Sep 8, 2026
3f40e00
reports: fee_remit::tests at e6f7b7a — 39 passed, 0 failed (§1.4(a) r…
Sep 8, 2026
8f96052
WIP fee tests: §1.3 a_fee_bearing_payment_at_a_19_sat_gross_the_prepa…
Sep 8, 2026
f5e39d3
reports: fee_remit::tests at 380f097 — 40 passed, 0 failed (§1.3 gros…
Sep 8, 2026
4bc65fe
WIP fee: N2 — refuse_before_fence writes nothing to the row (stays Pl…
Sep 8, 2026
dbe6c4f
WIP fee tests: N2 accrued (0, gross, 0) after a pre-fence refusal; re…
Sep 8, 2026
b2eabc2
reports: fee_remit::tests at 71b4971 — 40 passed, 0 failed (commit E …
Sep 8, 2026
6012cee
fee: N3 — the reserve bounds the LIGHTNING fee (addendum 10 §3, round…
Sep 8, 2026
bd900cb
reports: fee_remit::tests at 2521a44 — 40 passed, 0 failed (commit F;…
Sep 8, 2026
7ddc9d1
reports: round 9 gate 1 at exec head 2521a44 (HEAD b1ef099, no .rs di…
Sep 8, 2026
f6c89e8
reports: round 9 gate 2 at exec head 2521a44 — CLI default (cargo tes…
Sep 8, 2026
ad9a5e9
reports: round 9 gate 3 at exec head 2521a44 — CLI acp,wallet (cargo …
Sep 8, 2026
4a7716e
reports: round 9 gates 5–6 raw logs at exec head 2521a44 — cargo fmt …
Sep 8, 2026
e08ad25
fee: round 9 lint fix-up — rustfmt on the 8 round-9 test hunks in fee…
Sep 8, 2026
db95275
reports: round 9 lint-mapping scripts (r3 lineage) and the 44-record …
Sep 8, 2026
b1367b8
reports: round 9 gate runner for the second exec head 240240c (gates …
Sep 8, 2026
9205b22
reports: round 9 gates at the second exec head 240240c (HEAD d0be4a0,…
Sep 8, 2026
9b38a14
reports: round 9 money-path run 3 at 240240c — exit=0 (test result: o…
Sep 8, 2026
5fbf4e9
reports: round 9 exec2 progress log complete (STAGE3 money-path x3 do…
Sep 8, 2026
a13fea3
reports: round 9 lint mapping at exec head 240240c — clippy 125 total…
Sep 8, 2026
16711a8
reports: round 9 body draft seeded — body-r9.md = byte-identical copy…
Sep 8, 2026
54a2b6d
reports: round 9 body — N4 items 1–6 (verdict 4714623 §6): §5 line 15…
Sep 8, 2026
0da2239
reports: round 9 body — N4 items 7–8: the reserve bounds the Lightnin…
Sep 8, 2026
fbac610
reports: round 9 body — Gates block (lines 56–165) at exec head 24024…
Sep 8, 2026
2230c85
reports: round 9 body — Full suites (core 1427/0/2, CLI default, CLI …
Sep 8, 2026
f0541b4
reports: round 9 body — new 'Round 9 — what discharges N1–N4' section…
Sep 8, 2026
dacdbbc
reports r9: body citations remapped 1a5c7c5->240240c and self-checked…
Sep 8, 2026
0cd743c
reports r9: claims.md — the seven failed claim groups re-verified by …
Sep 8, 2026
046ae79
reports: round 9 pin prep (ruling 2026-09-08T18:32Z item 2) — the bod…
Sep 8, 2026
f0b3729
reports r9: body-r9-pin.md — the pinned PR body (62,505 characters, u…
Sep 8, 2026
537abd8
reports r9: body pin record for 1ee5cb2 — pinned 2026-09-08T18:54:03Z…
Sep 8, 2026
a500e6a
reports r9: CI at the pin appended to body-pin-1ee5cb2 record (r10 wa…
Sep 8, 2026
4eeaad1
reports r10: plan + read-back for addendum 11 (sha 489fc24a…, verdict…
Sep 8, 2026
2e9959c
fee_remit: drop the gross-probe fee veto; reserve-only precheck, exac…
Sep 8, 2026
9eae54c
fee_remit: rustfmt the 6 over-long assert_eq! lines in records 45/46 …
Sep 8, 2026
1c841fa
fee_remit: racing oracle accepts the held loser with row/owner/quote/…
Sep 8, 2026
f277abd
fee_remit docs: one spend model at every H1 site (verdict 1ee5cb2 §7.…
Sep 8, 2026
d569199
reports r10: §4 I gate runner + exact records (44 + 4 new) at exec he…
Sep 8, 2026
6bd4485
reports r10: step 5 body plan (H2 fee_paid 5, H3 record 37 vs 40, H4 …
Sep 8, 2026
403fcff
reports r10: gates-summary cites the evidence-location ruling (raw lo…
Sep 8, 2026
3a58437
reports r10: gates at exec head 31deed8 — suites 1431/143/180 all gre…
Sep 8, 2026
ee19c0d
reports r10: money-path run 2 row (credential_proxy flake only, 44/44…
Sep 8, 2026
ab69890
fee_remit: record 45 assert literal 3, not 1 + 0 + 1 + 1 (clippy iden…
Sep 8, 2026
c5df838
reports r10: money-path run 3 row (all three: credential_proxy flake …
Sep 8, 2026
d51df35
reports r10: gates-summary-08c476c skeleton (why two exec heads). No …
Sep 8, 2026
4ea017d
reports r10: gates at exec head 08c476c — suites green, 47/47 exact, …
Sep 8, 2026
cf1b3ff
reports(r10): gates-summary 08c476c §2 row 2 — money-path run 2, same…
Sep 8, 2026
0bef5ec
reports(r10): gates-summary 08c476c COMPLETE — money-path rows 2-3 (s…
Sep 8, 2026
d74d10f
reports(r10): step 5 start — body-r10.md seeded from body-r9-pin.md (…
Sep 8, 2026
70b6033
reports(r10): body-r10 B-table items 1-4 — H2 fee_paid 5 (fixture re-…
Sep 8, 2026
b0884ae
reports(r10): move round-9 N1-N4 verbatim into rounds-9-sections.md; …
Sep 8, 2026
59ccc43
reports(r10): pin the rounds-9-sections.md permalink to its own commit
Sep 8, 2026
c8b8703
reports(r10): greps at 08c476c for records 45-48 (witness arithmetic,…
Sep 8, 2026
8ea1d8e
reports(r10): body-r10 round-10 sections — N1/B (gross probe dropped,…
Sep 8, 2026
3aaa8c5
reports(r10): body-r10 gates sections at 08c476c — suites, fmt/clippy…
Sep 8, 2026
043ab02
reports(r10): Gates section re-run at 08c476c — gate 1 (8 mint_allowe…
Sep 8, 2026
6434d9a
reports(r10): body-r10 heads + gate-provenance + evidence sections at…
Sep 8, 2026
f19e68c
reports(r10): citation remap 240240c -> 08c476c on inherited body tex…
Sep 8, 2026
6a0e1a9
reports(r10): known defects at 08c476c — three r9 stale-comment defec…
Sep 8, 2026
d56cc16
reports(r10): pin record — body pinned on PR #979 at 6047891, 60,969 …
Sep 8, 2026
c53705a
test(credential-proxy): drive the over-cap refusal on a raw socket, n…
Sep 8, 2026
a0aafe8
reports: remove agent working notes from the branch before merge
Sep 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 57 additions & 17 deletions crates/maxplayer-core/src/credential_proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3495,8 +3495,16 @@ mod tests {
// reproduce.
#[tokio::test]
async fn a_declared_over_cap_body_is_refused_before_the_upstream_sees_it() {
let (stub_addr, stub) = spawn_stub("UPSTREAM_OK").await;
let upstream = format!("http://{stub_addr}");
use tokio::io::{AsyncReadExt, AsyncWriteExt};

// The upstream here is a listener nothing ever accepts from, which witnesses "never dialled"
// more strictly than a stub that reports what it served: a connection that IS dialled completes
// in the kernel's backlog whether or not anything accepts it, so an accept that finds nothing
// waiting is proof no connection was opened at all — not merely proof none was answered.
let upstream_listener = tokio::net::TcpListener::bind(("127.0.0.1", 0))
.await
.unwrap();
let upstream = format!("http://{}", upstream_listener.local_addr().unwrap());
let engine = Arc::new(ProxyEngine::new([authority_of(&upstream).unwrap()]));
let placeholder = mint_anthropic_placeholder();
engine
Expand All @@ -3509,27 +3517,59 @@ mod tests {
let proxy = start(Arc::clone(&engine), None).await.unwrap();
let port = proxy.local_addr().port();

// One byte over the cap, declared up front: `reqwest` sets `content-length` for a sized body.
let over = vec![b'z'; MAX_REQUEST_BODY_BYTES + 1];
let response = reqwest::Client::new()
.post(format!("http://127.0.0.1:{port}/v1/messages"))
.header("x-api-key", &placeholder)
.body(over)
.send()
// The HEADERS ALONE, on a socket this test drives itself. Handing `reqwest` a sized 32 MiB + 1
// body made the client race its own upload against the answer: the proxy refuses from the
// header and closes, so the write failed before the response was read and the test saw a
// transport error instead of the `413`. Declaring the over-cap length and sending no body byte
// asks exactly the question the cap answers, with nothing to race.
let mut sock = tokio::net::TcpStream::connect(("127.0.0.1", port))
.await
.unwrap();
assert_eq!(
response.status(),
413,
"a declared over-cap body keeps the buffered path's refusal"
let declared = MAX_REQUEST_BODY_BYTES + 1;
sock.write_all(
format!(
"POST /v1/messages HTTP/1.1\r\nhost: 127.0.0.1:{port}\r\n\
x-api-key: {placeholder}\r\ncontent-length: {declared}\r\n\r\n"
)
.as_bytes(),
)
.await
.unwrap();
sock.flush().await.unwrap();

// Bounded: on a proxy that waited for the declared body before deciding, this test must fail
// on the deadline rather than hang forever.
let mut head = Vec::new();
let mut tmp = [0u8; 1024];
tokio::time::timeout(Duration::from_secs(10), async {
loop {
let n = sock.read(&mut tmp).await.unwrap();
if n == 0 {
break;
}
head.extend_from_slice(&tmp[..n]);
if find_subslice(&head, b"\r\n\r\n").is_some() {
break;
}
}
})
.await
.expect("the proxy must refuse a declared over-cap length from the headers alone");

let text = String::from_utf8_lossy(&head).to_string();
let status_line = text.lines().next().unwrap_or_default().to_owned();
assert!(
status_line.starts_with("HTTP/1.1 413"),
"a declared over-cap body keeps the buffered path's refusal; got {status_line:?}"
);

// The upstream must never have been dialled: the refusal is decided from the header alone, so
// the real credential was never put on the wire for this request. Checked WITHOUT a timer —
// the stub completes only once it has served a connection, and the `413` above is already in
// hand, so "still running" is a settled fact here rather than a race against a deadline.
// the real credential was never put on the wire for this request. The `413` is already in hand
// above, so a connection, had one been made, would be sitting in this listener's backlog now.
assert!(
!stub.is_finished(),
tokio::time::timeout(Duration::from_millis(500), upstream_listener.accept())
.await
.is_err(),
"an over-cap request must not reach the upstream at all"
);
}
Expand Down
Loading
Loading