code wiki / _hdl_build / nx_auction_2ndchance.nx
nx_auction_2ndchance.nx
buildroot/runtime/_hdl_build/nx_auction_2ndchance.nx
about
nx_auction_2ndchance.nx -- MANHEIM-BUILD-L1: SECOND-CHANCE / POST-SALE NEGOTIATION (Manheim's "If-bid"
/ 2nd-Chance Offer channel -- what happens to a lot that DOESN'T meet reserve), COMPOSED on the shared
nx_auction_core engine. Sovereign (nx_cc->nxasm, no gcc), pure integer-exact + deterministic.
FLOW (genuinely distinct from the live-bidding channels -- this is a POST-auction step):
1. settle the primary auction via core at_resolve (reusing out[6]=high_amount, out[7]=high_bidder --
a NO-SALE still has a high bidder to negotiate with).
2. if the primary SOLD (high >= reserve) -> PRIMARY sale, no second chance needed.
3. if the primary NO-SALE -> offer the lot to the high bidder at their bid; the seller ACCEPTS iff
that high bid >= seller_min_accept (a private floor below the public reserve) -> SECOND-CHANCE SALE
at the high bid; else NO-DEAL (seller holds the unit).
result codes: R_PRIMARY=1, R_2NDCHANCE=2, R_NODEAL=0. out[]: [result, price, winner]
EXCEED axis (honest): turns dead NO-SALE inventory into deterministic, auditable post-sale matches at a
disclosed seller floor -- no opaque back-room "if" negotiation; the buyer pays exactly their standing high.
GATE (self-validating): A a NO-SALE lot CONVERTS via second chance (high 950000 >= floor 940000);
B NO-DEAL (high 950000 < floor 970000, seller holds); C control = a primary SALE (high >= reserve)
BYPASSES second chance (result=PRIMARY, proving the channel only fires on NO-SALE). A broken rule
diverges a checked value -> verdict=RED. Evidence -> knowledge/status/auction_2ndchance.log.
license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_auction_core.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 24 | const SC_MAGIC_900000: i64 = 900000 |
| 25 | const SC_MAGIC_925000: i64 = 925000 |
| 26 | const SC_MAGIC_950000: i64 = 950000 |
| 27 | const SC_MAGIC_25000: i64 = 25000 |
| 28 | const SC_MAGIC_1000000: i64 = 1000000 |
| 29 | const SC_MAGIC_940000: i64 = 940000 |
| 30 | const SC_MAGIC_970000: i64 = 970000 |
| 31 | const SC_MAGIC_1050000: i64 = 1050000 |
| 33 | const SC_LOG: *u8 = "knowledge/status/auction_2ndchance.log" |
| 34 | const SC_NODEAL: i64 = 0 |
| 35 | const SC_PRIMARY: i64 = 1 |
| 36 | const SC_2NDCHANCE: i64 = 2 |
functions
| 38 | func sc_w(fd: i64, s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(fd, s, n); return 0 } |
| 39 | func sc_wn(fd: i64, v: i64) -> i64 { let bb: *u8 = sys_mmap(28); var m: i64=v; if m<0 {m=0-m; sys_write(fd,"-" as *u8,1)}; let t: *u8 = sys_mmap(28); var k: i64=0; if m==0 {t[0]=48;k=1}; while m>0 {t[k]=(48+(m%10)) as u8; m=m/10; k=k+1}; var i: i64=0; while i<k {bb[i]=t[k-1-i]; i=i+1}; sys_write(fd, bb, k); return 0 } |
| 42 | func sc_resolve(opening: i64, increment: i64, reserve: i64, start: i64, end: i64, seller_min_accept: i64, bidder: *i64, amount: *i64, time: *i64, n: i64, out3: *i64) -> i64 |
| 63 | func main() -> i64 |