Skip to content

The port of 0.18.9: the stable section, split and gift-claim refuse before the post for a coin mined before Genesis (#634), and the door's script answers pinned on beta - #641

Merged
Calgooon merged 13 commits into
betafrom
lane/p1-port-0189
Nov 18, 2026
Merged

Calgooon merged 13 commits into
betafrom
lane/p1-port-0189

Conversation

@Calgooon

@Calgooon Calgooon commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

A user of beta now meets split and gift-claim refusing by name, before anything is signed or posted, a spend the wallet could not then record: a coin whose transaction the wallet's own records place below the Genesis height its door judges by (or the unmined change of a spend of one). Before this PR beta posted such a split and then printed Warning: the split outputs were not self-internalized, and posted such a claim and answered "recorded": false.
The other coins are spent when they cover the split (Not spent: ... / notSpent); every other command's offer is unchanged. After the two cold reads a send to the wallet's own address holds them too ((1) below).
CHANGELOG.md carries the stable line's ## [0.18.9] word for word and README.md names 0.18.9 as the release of record. No pin moves.
The door's script answers are pinned on beta: wire rows 284 to 290, and one door test.

For #634

The tests that decided (commit d178f05, run at the base 5f343c4 before any source line moved)

test at the base
split::genesis_tests::a_split_of_a_coin_mined_before_genesis_is_not_posted: the only coin a payment its BEEF proves at 600,000, taken in through the door; split::run with the mock broadcaster red: answer: Ok(()); posts: 1; the door's refusals of the record: [Some("spend refused at offset 175, input 0 of <split>: input 0 not judged: coin height 600000 is before Genesis height 620538.")]; the command printed Split into 2 UTXOs (24750 sats each), its TxID, and Warning: the split outputs were not self-internalized (see the log)
gift_chain::genesis_tests::a_claim_of_a_deposit_mined_before_genesis_is_not_posted: the deposit proven at 620,537; gift_claim::run red: answer: Ok(()); posts: 1; word: Some(("announced", None, None)); spendable: 0; printed {"broadcast":"MockProvider",...,"recordError":"spend refused at offset 1213, input 0 of <claim>: input 0 not judged: coin height 620537 is before Genesis height 620538.","recorded":false,"word":"announced"}

So beta has the stable line's order on both commands.

The cure (9324808), in beta's shape of the stable line's

  • The chain. On this line the door judges by its store's own chain setting (the toolbox's published CHANGELOG at 0.14.0-beta.4, The inspector's query route guards writes by the SQL's prefix on a writable pool: a read-only connection is the guard (before #414's grant rows live in the store) #440: "The live script word (The inspector's query route guards writes by the SQL's prefix on a writable pool: a read-only connection is the guard (before #414's grant rows live in the store) #440) is bsv-rs's input_script_flags from the store's chain (main, test, regtest): testnet and regtest judge at their own Genesis and Chronicle heights (1,344,302 / 1,713,168; 10,000 / 15,000) where they read mainnet's"), the word init writes from --testnet (src/config.rs:264-267, src/commands/init.rs:41-42). Not the Wallet's Chain: on a --testnet context this repository's test reads ctx.wallet.chain() as Chain::Main (a_testnet_context_holds_by_the_chain_its_door_judges_by). genesis::door_network reads the store.
  • The height. bsv-rs 0.9's public ChainParams::{mainnet,testnet,regtest}().genesis_height (src/block/params.rs:73, activation.rs:89-102), for the three words the CHANGELOG entry above names. No host figure.
  • split's hold (src/spend_gate/pre_genesis.rs, GateOptions::split_hold, set by split alone): a coin whose creator the wallet's records prove below that height (proven_txs.height, else a BUMP of the stored input_beef, else the unproven ancestry, at most 64 transactions), its reason mined before Genesis: ...; split does not offer it, typed by HeldCoin::before_genesis and never read from its words (tests/arch_no_prefix_errors.rs, tests/arch_no_error_words.rs stand). The refusal is the gate's own: INSUFFICIENT_FUNDS, or INPUT_NOT_OFFERED when --from names the coin. The message ends with the stable line's sentence. The records are read through store::stored_tx (rule A2).
  • gift-claim: broadcast_claim asks the BEEF it is about to post the rule under the door's store's height, and refuses before post_beef.
  • Tests: src/genesis/tests.rs (8: the heights, the BEEF check's four, the boundary through the door on a mainnet store and on a store migrated as --testnet migrates it (1,344,301 refused, 1,344,302 taken, the Wallet's own chain mainnet), and the create-and-sign row below); src/commands/split/genesis_tests.rs (6: the deciding test, now also pinning the refusal's code, held reason and closing sentence; one coin at 620,537 and one at 620,538, the one at Genesis spent and its outputs recorded; --from naming the old coin; a send of it not held; the unmined change of a posted send held; a --testnet context, its coin at 700,000 held and one at 1,344,302 split and recorded); src/commands/gift_chain/genesis_tests.rs (4: the deciding test with the exact text; the pure check; a deposit at 620,538 posted and recorded; a --testnet context at 700,000 refused and at 1,344,302 posted and recorded). The mock broadcaster saw no post on each refusal. With the hold and the check switched off (a scratch edit, reverted) 7 of the 10 command tests are red. The 3 that stay green are the passing shapes.

The inventory: every answer the stable line's 0.18.9 reads at POST /internalizeAction

answer (main tests/served_internalize_scripts.rs) this line's toolbox's published line beta's pin before this PR added here
a failing script in the unproven subject #422: "judges each input of every unproven raw transaction, including parents" 103 internalizeAction.badUnlock: 400 VALIDATION_ERROR, spend refused at offset 176, input 0 of 56648b3b...: OP_EQUALVERIFY requires the top two stack items to be equal. none needed
in an unproven ancestor the same none 284: 400 VALIDATION_ERROR, spend refused at offset 176, input 0 of <ancestor>: OP_EQUALVERIFY ...
a coin proven below Genesis, not judged 0.14.0-beta.4: spend refused at offset N, input 0 of <txid>: input 0 not judged: coin height 620537 is before Genesis height 620538. (class InvalidParameter) none (a typed PreGenesisCoin 409 mapping exists in src/server/error.rs:302-317, but the Wallet door answers WalletRefusal { class: InvalidParameter }, read in the_door_refuses_a_coin_proven_one_below_genesis_and_takes_one_at_it) 285: 400 VALIDATION_ERROR, ... input 0 not judged: coin height 600000 is before Genesis height 620538.
a repeated internalize of a held transaction, unproven and not passing #422 (every unproven raw transaction) none (260/265 pin a held repeat's index rule, not its scripts) 286 proven 200, 287 unproven 400 VALIDATION_ERROR OP_EQUALVERIFY, 288 proven again 200
passing: through two unmined parents the same none (102, 104, 238: one unproven child over a mined parent) 289: 200
passing: a wallet's own createAction+signAction, taken in by another the same none served through the router: tests/served_internalize_door.rs a_transaction_a_wallets_own_create_and_sign_built_is_stored_by_another (the second wallet's POST /internalizeAction 200, stored, posted once to the mock; tests/support/served_internalize.rs serves the router with the storage's services swapped for the mock); the door test of the same name in src/genesis/tests.rs stays. Not a wire row: the wire harness serves one wallet per world
nothing stored by a refusal 290: the basket holds 286's and 289's outputs alone

Recorded with WIRE_RECORD=1 cargo test --locked --test wire (290 fixtures), replayed plain (19 passed), recorded again: the two recordings are equal (git diff tests/wire, 0 lines against the staged copy). Rows 001 to 283 replay byte-identical. The harness's Services (tests/wire_support/mod.rs:504-512) point the header service and ARC at loopback stubs, BananaBlocks off, GorillaPool none; on these rows the door asks headers of the stub and posts to the ARC stub.

The two lines side by side

answer stable (0.18.9) beta difference and its reason
subject's script fails 400 VALIDATION_ERROR, wallet error: Validation error: spend refused at offset <n>, input 0 of <txid>: OP_EQUALVERIFY ... 400 VALIDATION_ERROR, spend refused at offset 176, input 0 of <txid>: OP_EQUALVERIFY ... (103) beta's typed refusal (#330) carries no wallet error: Validation error:
ancestor's script fails the same, the ancestor's txid 284, the same the head, as above
coin proven at 600,000 400, ... not judged: coin height 600000 is before Genesis height 620538. 285, the same the head
held, handed again unproven 400, refused the same way; proven repeat as before 287 400; 288 200 the head
two unmined parents that pass 200 289 200 beta's inputs are the stranger's P2PKH signatures, main's the placeholder against 14 <20 zero bytes> 75 75 51; both pass
create+sign by another wallet 200 200, stored, posted once, served (tests/served_internalize_door.rs); accepted at the door (src/genesis/tests.rs) none in the answer; not a wire row: the wire harness serves one wallet per world
the chain a --testnet wallet is judged by mainnet's 620,538 (the Wallet's Chain, #639) testnet's 1,344,302 (the store's chain) the doors judge by different chains; on each line host and door agree
split of such a coin refused before the post, INSUFFICIENT_FUNDS the same; --from naming it INPUT_NOT_OFFERED the stable line's split has no --from at all (main's src/cli.rs: --count, --allow-pending, --coin); beta's split --from uses the gate's named door
send to the wallet's own address of such a coin no such road (main's send has no self-payment step) refused before the post, INSUFFICIENT_FUNDS (--from: INPUT_NOT_OFFERED), its reason ...; a send to this wallet's own address does not offer it beta's self-send (#38) posts and then records through the door, split's shape
gift-claim of such a deposit refused before the post the same text main's check carries a second text its own command cannot reach (its PR's cold read); beta carries the reachable text alone
gift-claim of a gift whose deposit is not mined yet (#638) posted, its record refused BEEF structure is invalid, not recorded by a later pass the same order, its record refused Invalid BEEF at byte 48: InputNamesNoElement, not recorded by a later pass, balance 0 the text alone. From one hermetic scratch run by this PR's earlier lane (a mock broadcaster, a deposit with no proof), not committed; no row or test of this line pins it; the recovery by receive was not run on this line. Not changed here; #638 holds the recovery and the cures

No beta answer here is a 500 or an ERROR where the stable line serves a named class. The wire rows show that the refusals stored nothing (row 290); they count no posts. The Rust tests that count the mock's posts on each refusal read none: the split, self-send and gift-claim refusing tests named in docs/WIRE.md. The one order here that posts and then refuses its record is #638's. The same table is docs/WIRE.md's section "The stable line's 0.18.9, served on beta".

One finding beyond the brief, not changed here: on beta, send to the wallet's own address is a self-payment (#38) that posts and then records through internalizeAction (src/commands/send.rs). A self-send of a coin mined before Genesis would meet the same refusal after the post. The brief keeps every other command's offer unchanged, so it is named here for the captain and not held. After the two cold reads it is held, in split's shape (0f5114a; (1) below).

The docs

git grep -n -E '0\.18\.8|=0\.13\.5|=0\.8\.12' origin/beta -- '*.md' ':!CHANGELOG.md' ':!HANDOFF.md' ':!docs/lanes': 8 lines. Moved: README.md:10, :11 (the release of record 0.18.9, bsv-wallet-toolbox-rs =0.13.7, bsv-rs =0.8.13) and :52 (cargo install bsv-wallet-cli --version 0.18.9). Left: changelog.d/633.md:1 (the 0.18.8 port's own fragment), docs/WIRE.md:535, :537, :543 (that port's section, a record of the past), docs/DEPENDENTS.md:109 (an announcement's history; its version column is not this lane's). CHANGELOG.md: ## [0.18.9] - 2026-11-18 directly above ## [0.18.8]; diff of the section against main's prints nothing; 13 insertions, 0 deletions. docs/NORTH-STAR.md: the wire fixtures row 283 to 290 (tools/scoreboard --render).

The proof (at 3299539)

$ cargo fmt --all -- --check                                    # exit 0
$ cargo clippy --workspace --all-targets --locked -- -D warnings
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.70s   # exit 0
$ cargo test --workspace --locked                               # exit 0, 35 result lines
passed 1038 failed 0 ignored 0     # the base 5f343c4: passed 1020 (+8 genesis, +6 split, +4 gift)
$ cargo test --locked --test wire
test result: ok. 19 passed; 0 failed; ... (290 fixtures; the base 283)
$ cargo test --locked --test wire_consumers -- --nocapture
48 consumer fixtures replayed (app-payers 6, dolphinmilk 3, e2e-harness 7, low-fleet 12, mcp 11, stack-witness 1, x402-skill 8), 0 differ, 0 gaps
$ cargo test --locked --test gate_vectors -- --nocapture
gate vectors: 0 divergences, every one recorded: true
$ python3 -B tools/ratchet --check
  duplicated_tokens: 31644 -> 31608 (-36)        # lower; the record not moved here
ratchet: no number above the record
$ python3 -B tools/scoreboard --check
scoreboard: docs/NORTH-STAR.md is current
$ tools/check-links
check-links: 29 files, 0 broken links
$ tools/check-cites
check-cites: 1 files, 266 citations, 69 line-count rows checked, 0 findings
$ python3 -B tools/changelog --check --base origin/beta
changelog: added fragment: changelog.d/641.md
$ cargo deny --locked check bans licenses sources
bans ok, licenses ok, sources ok
$ git diff origin/beta --stat
 32 files changed, 4257 insertions(+), 22 deletions(-)

The ratchet at the cure's tip read clippy_pedantic +17, functions_over_60_lines +3, duplicated_tokens +947 and missing_docs +1. Each was fixed in code in 7ee80fe; no record moved.

After the two cold reads (3c59f4c to efaa624)

  • (1) The third road, send to the wallet's own address (send to the wallet's own address relinquishes the sats: a self-spend should keep them (the stack's witness spend) #38). The test that decides, send::genesis_tests::a_self_send_of_a_coin_mined_before_genesis_is_not_posted (3c59f4c, run before any source change): a wallet whose only coin is proven at 600,000, send::run to its own deposit address over the mock services, the post-broadcast verifier off. At 3c59f4c it is red: posts: 1; spent: Some(2), the answer send <txid> is broadcast (do not send again), but its output to this wallet was not kept; keep it with `bsv-wallet fund <BEEF> --vout 0`, the BEEF being <hex>: spend refused at offset 175, input 0 of <txid>: input 0 not judged: coin height 600000 is before Genesis height 620538. The cure (0f5114a), in split's shape: the hold is typed by its holder (GenesisHolder::{Split, SelfSend}, pre_genesis_coins_for), GateOptions::split_hold becomes genesis_hold, set by split and by a send to the wallet's own address alone; the self-send's reason mined before Genesis: coin height <h> is before Genesis height <g>; a send to this wallet's own address does not offer it, its refusal ending in its own sentence (SELF_SEND_PRE_GENESIS_WHY); split's words unchanged. Tests (src/commands/send/genesis_tests.rs, 5): the deciding test, now pinning INSUFFICIENT_FUNDS, the reason and the sentence; one coin at 600,000 and one at 700,000, the one above spent and the payment recorded; the boundary, 620,537 refused and 620,538 sent and recorded; --from naming the old coin, INPUT_NOT_OFFERED; a send of the old coin to another party's address posted. split::genesis_tests::a_send_of_the_coin_mined_before_genesis_is_not_held is untouched and green. The mock saw no post on each refusal.
  • (2) The create-and-sign row, served. tests/served_internalize_door.rs a_transaction_a_wallets_own_create_and_sign_built_is_stored_by_another (69f6192): a sender holding one received coin (the helper's Paid) builds a payment with its own createAction (signAndProcess false, noSend, the underReceivedRule label) and signAction (noSend); a second wallet's POST /internalizeAction answers 200, accepted, its balance 300, the row stored, posted once to its mock. The helper is create_and_sign in tests/support/served_internalize.rs, whose served wallet holds a mainnet Services with the storage's services swapped for the mock. The door test stays; the reason is corrected in its doc comment, the module doc, docs/WIRE.md, the fragment and this body.
  • (3) The records (ce38fa2): (a) the gift-claim of a gift whose deposit is not mined yet posts the claim and then cannot record it: the claimed coin is never recorded #638 row, in docs/WIRE.md, the fragment and the table above; (b) the stable line's split has no --from; (c) the closing sentence says what the rows show (nothing stored, row 290) and names the tests that count posts; (d) src/genesis.rs cites the toolbox's CHANGELOG entry (0.14.0-beta.4, The inspector's query route guards writes by the SQL's prefix on a writable pool: a read-only connection is the guard (before #414's grant rows live in the store) #440) in its words, and no toolbox source line. The send road's row and fragment entry are in the same commit.
  • (4) This body: "The cure" cites the toolbox's CHANGELOG and this repository's test where it cited toolbox source lines; the providers sentence is gone; the inventory and the tables follow (2) and (3).
  • The ratchet (efaa624): at ce38fa2 duplicated_tokens +1103, clippy_pedantic +1 (similar_names), functions_over_60_lines +1 (Refusal's Display); fixed in code (shared test helpers, one gate literal, renamed bindings, genesis_holders); no record moved.
  • The counts: cargo test --workspace --locked passed 1044 failed 0 ignored 0 (35 result lines; 3299539: 1038; +5 send, +1 served); wire 290 fixtures, 19 passed; consumers 48 replayed, 0 differ; gate vectors 0 divergences; ratchet no number above the record (duplicated_tokens 31552, record 31644); git diff 3299539 --stat: 15 files changed, 524 insertions(+), 105 deletions(-).

The proof (at efaa624)

$ cargo fmt --all -- --check                                    # exit 0
$ cargo clippy --workspace --all-targets --locked -- -D warnings
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 18.73s   # exit 0
$ cargo test --workspace --locked                               # exit 0, 35 result lines
passed 1044 failed 0 ignored 0     # 3299539: 1038 (+5 send::genesis_tests, +1 served_internalize_door)
$ cargo test --locked --test wire
test result: ok. 19 passed; 0 failed; ... (290 fixtures)
$ cargo test --locked --test wire_consumers -- --nocapture
48 consumer fixtures replayed (app-payers 6, dolphinmilk 3, e2e-harness 7, low-fleet 12, mcp 11, stack-witness 1, x402-skill 8), 0 differ, 0 gaps
$ cargo test --locked --test gate_vectors -- --nocapture
gate vectors: 0 divergences, every one recorded: true
$ python3 -B tools/ratchet --check
  duplicated_tokens: 31644 -> 31552 (-92)        # lower; the record not moved here
ratchet: no number above the record
$ python3 -B tools/scoreboard --check
scoreboard: docs/NORTH-STAR.md is current
$ tools/check-links
check-links: 29 files, 0 broken links
$ tools/check-cites
check-cites: 1 files, 266 citations, 69 line-count rows checked, 0 findings
$ python3 -B tools/changelog --check --base origin/beta
changelog: added fragment: changelog.d/641.md
$ cargo deny --locked check bans licenses sources
bans ok, licenses ok, sources ok
$ git diff 3299539 --stat
 15 files changed, 524 insertions(+), 105 deletions(-)

The tests added: commands::send::genesis_tests::{a_self_send_of_a_coin_mined_before_genesis_is_not_posted, a_self_send_spends_the_coin_above_genesis_and_leaves_the_one_below, a_self_send_holds_one_below_genesis_and_spends_one_at_it, a_self_send_from_the_coin_mined_before_genesis_is_refused_by_name, a_send_of_the_coin_mined_before_genesis_to_another_party_is_posted} and served_internalize_door::a_transaction_a_wallets_own_create_and_sign_built_is_stored_by_another.

The queue landing is the captain's: this PR is not merged and not enqueued by its lane.

After the rebase and the re-read (the captain's)

  • The branch was rebased onto beta 07d939e6 because it conflicted with beta in docs/WIRE.md alone; both sections are kept. Every commit id above is the rebased one (the queue's own replay gives the landed commits other ids again). The proofs the lanes ran were run before the rebase; the seven checks are green on the rebased head.
  • Two commits of the captain's follow the lanes': the fragment's "no pin moves here" reads "the port itself moves no pin", and docs/WIRE.md names the send road's deciding test by its place, not by a commit id.
  • The re-read (fix 0.85, records only: the stale commit ids) found the code, the tests and CI sound: the hold reaches split and a send to the wallet's own address alone, every flow that records through the door after a post is held or checked before the post, and the served create-and-sign row never calls the services it constructs.

🤖 Generated with Claude Code

@Calgooon

Copy link
Copy Markdown
Contributor Author

The captain's record of the two reads at 7013ab1. Read A (the host's half), fix 0.8: the road of #634 was open on this line at the base for both commands (each deciding test red: the split posted and its own record refused as not judged; the claim posted and recorded false), the two cures are right, the host reads the store's chain word and bsv-rs's published heights as the door does; one road is left: on this line send to the wallet's own address also posts and then records through the door. Read B (the record, the wire and the public text), fix 0.8: the stable section is word for word, each new fixture answers for its own row's reason; six records to correct (the create-and-sign row's stated reason is untrue: the served helper exists on this line; #638 is not stated for this line; the split --from difference's reason; two passages that cite the toolbox's source lines; one word against rule 6; one sentence the wire rows cannot support).

The captain's reading. All are taken. The principle of the ruling is that a command that posts and then records refuses by name before anything is posted when the record cannot be made, so it covers send to the wallet's own address too: its deciding test is written before any source change, then the same hold with a sentence of its own; a send to another party stays untouched. A fix lane takes the builder slot when the box's memory line frees one (the beta.10 pin's lane holds it now); then one re-read, then the queue.

Calgooon and others added 12 commits November 18, 2026 00:46
… that decide (For #634)

Written and run at the base (5f343c4, toolbox =0.14.0-beta.9) before any
source line moves, to read whether this line has the stable line's order.
It does, for both commands; both tests are red here and the next commit
cures them.

- split (src/commands/split/genesis_tests.rs): the wallet's only coin is
  a payment its BEEF proves at 600,000, taken in through the toolbox's
  internalizeAction. `split::run` posts once (the mock broadcaster), then
  its self-internalize is refused by the door, "spend refused at offset
  175, input 0 of <split>: input 0 not judged: coin height 600000 is
  before Genesis height 620538."; the command prints its warning ("the
  split outputs were not self-internalized") and answers Ok.
- gift-claim (src/commands/gift_chain/genesis_tests.rs): the deposit is
  proven at 620,537. `gift_claim::run` posts the claim (broadcast
  MockProvider, word "announced") and answers Ok with "recorded": false,
  "recordError": "spend refused at offset 1213, input 0 of <claim>: input
  0 not judged: coin height 620537 is before Genesis height 620538."

Each asserts the cure: refused, nothing posted, the ledger unmoved.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…uld not judge (For #634)

The cure of the order the previous commit's tests read on this line, in
this line's shape of the stable line's 0.18.9. Both commands post and then
record through internalizeAction, whose door refuses a payment spending a
coin its BEEF proves below Genesis as not judged; each now refuses by name
before anything is posted when that record could not be made.

- src/genesis.rs (new, in the library): the chain the door judges by is
  its store's own `chain` setting (toolbox 0.14.0-beta.9
  internalize_action.rs:98, `storage.get_settings().chain`, the word
  `init` migrated from --testnet), not the Wallet's Chain, which
  `Wallet::with_options` makes mainnet on every wallet; `door_network`
  reads it. `genesis_height` reads bsv-rs's public
  `ChainParams::{mainnet,testnet,regtest}().genesis_height`, as the door's
  `chain_params` does (no host figure). `unproven_spend_of_pre_genesis_coin`
  is the stable line's BEEF check, the Genesis rule alone.
- split's hold (src/spend_gate/pre_genesis.rs, `GateOptions::split_hold`,
  set by split alone): a coin whose creator the wallet's records prove
  below that height (`proven_txs.height`, else a BUMP of the stored
  `input_beef`, else the unproven ancestry, at most 64 transactions) is
  held, its reason "mined before Genesis: ...; split does not offer it",
  typed by `HeldCoin::before_genesis` (never read from the words); the
  refusal is the gate's own (INSUFFICIENT_FUNDS, or INPUT_NOT_OFFERED for
  `--from`) and ends in the sentence on why and what works. The other
  coins are spent when they cover the split (`Not spent:` / `notSpent`).
  The records are read through `store::stored_tx` (rule A2).
- gift-claim: `broadcast_claim` asks the BEEF it is about to post the
  rule under the door's store's height and refuses by name before
  `post_beef`; nothing posted, no tracker row.

Tests: src/genesis/tests.rs (7, two through the door: a mainnet store and
a store migrated on testnet, each one below refused and one at taken),
src/commands/split/genesis_tests.rs (6), src/commands/gift_chain/
genesis_tests.rs (4). With the hold and the check switched off (a scratch
edit, reverted) the seven refusing tests are red.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e door test (For #634)

The served proof of each answer the stable line's 0.18.9 reads at POST
/internalizeAction (its tests/served_internalize_scripts.rs), on this line,
whose toolbox already runs a received BEEF's unproven scripts (#422). The
inventory found row 103 pinning the failing unproven subject and rows 102,
104 and 238 the passing payments; the rest had no pin here.

- 284: a failing script in an unproven ancestor, 400 VALIDATION_ERROR,
  "spend refused at offset 176, input 0 of <ancestor>: OP_EQUALVERIFY ...".
- 285: a coin its BEEF proves at 600,000, 400 VALIDATION_ERROR, "... input 0
  not judged: coin height 600000 is before Genesis height 620538.".
- 286 to 288: a spend whose input is the placeholder 00, taken proven (200),
  refused when handed again unproven (400, OP_EQUALVERIFY), and the proven
  repeat answered as before (200).
- 289: a payment through two unmined parents that pass, 200.
- 290: the basket after them, 286's and 289's outputs alone: the refusals
  stored nothing.

Recorded last in the funded world (new stranger payments, their roots
seeded in the header stub), so rows 001 to 283 replay byte-identical;
recorded, replayed, recorded again: the second recording equal to the
first. The one row the harness does not build (a transaction one wallet's
createAction and signAction built, taken in by a second wallet) is a test
through the toolbox's door over its mock in src/genesis/tests.rs: the
served router takes a wallet over the concrete Services and the harness
serves one wallet per world. docs/WIRE.md gains the section for this port,
the two lines side by side.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CHANGELOG.md gains `## [0.18.9] - 2026-11-18` directly above `## [0.18.8]`,
word for word as on main, its last bullet (#638) included; nothing above it
moves. README.md names 0.18.9 as the release of record, with its pins
(bsv-wallet-toolbox-rs =0.13.7, bsv-rs =0.8.13), and its install line; the
beta pins it states are unchanged. Left as they are: changelog.d/633.md
(the 0.18.8 port's own fragment), docs/WIRE.md's 0.18.7 and 0.18.8 section
(that port's record) and docs/DEPENDENTS.md (not this lane's).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ard's wire count (For #634)

tools/ratchet --check found the port's code above the record:
clippy_pedantic +17, functions_over_60_lines +3, duplicated_tokens +947,
missing_docs +1. Each is fixed in the code, no record moved:

- pedantic: #[must_use] on src/genesis.rs's four functions, the doc's
  backticks, `# Errors` on `pre_genesis_coins`, `if let` for two single
  patterns, `u64::from` in split's `sized`, `cast_unsigned` in the gift
  tests, the create-and-sign test's bindings renamed (first, second).
- long functions: the split tests' wallet split into its store and its
  intake of one coin, the door's boundary into its store and its
  insertion, the create-and-sign test into its funded wallet and its
  template.
- missing docs: `PreGenesisCoin::satoshis`.
- duplicates: a `refused_split` helper and the gift tests'
  `posted_and_recorded`; the tests' store setups and struct literals no
  longer copy their neighbours' token for token; the wire harness's
  `spend_of` builds on `parent_tx` (the recorded bytes unchanged: rows 284
  to 290 replay).

Now 823, 82, 31608 (record 31644) and 126: no number above the record.
docs/NORTH-STAR.md is rendered (tools/scoreboard --render): the wire
fixtures row reads 290, rows 284 to 290 added in this PR.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…per rule 6 (For #634)

The fragment as tools/changelog wants it: the stable section ported, what
split and gift-claim now do for a user of beta, in a caller's terms, the
chain they judge by, the wire rows 284 to 290 and the differences between
the lines. Two words of this PR's code that rule 6 does not allow
("first", as a binding and in a comment) are renamed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s, the test that decides (For #634)

The cold reads named a third road: `send` to the wallet's own address
(#38) selects through the ordinary gate, posts, and then records its own
payment through internalizeAction (`keep_own_payment`), split's shape.
This commit adds the test that decides it, run before any source change:
a wallet whose only coin is proven at 600,000 (below mainnet's Genesis,
620,538), `send::run` to its own deposit address over the toolbox's mock
services, the post-broadcast verifier off so no explorer is asked.

At this commit it is red: the self-send is posted (posts: 1, the coin
spent) and its record is refused, the command answering `send <txid> is
broadcast (do not send again), but its output to this wallet was not kept;
... spend refused at offset 175, input 0 of <txid>: input 0 not judged:
coin height 600000 is before Genesis height 620538.` The next commit
cures it. split's test helpers become pub(crate) to be shared.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…in the door would not judge (For #634)

The cure of the order the previous commit's test read, in the shape this
PR gave split. A send to the wallet's own address (#38) posts and then
records its payment through internalizeAction, whose door refuses a
payment spending a coin mined before Genesis as not judged; it now holds
what split holds: a coin whose creating transaction the wallet's own
records place below the Genesis height of the chain the door judges by
(its store's own setting, `genesis::door_network`), and the unmined change
of a spend of one.

- The hold is typed by its holder: `GenesisHolder::{Split, SelfSend}` in
  `src/spend_gate/pre_genesis.rs`. `pre_genesis_coins_for` names the
  coins with the holder's reason (`...; a send to this wallet's own
  address does not offer it` for send, split's words unchanged), and the
  refusal ends in the holder's own sentence (`SELF_SEND_PRE_GENESIS_WHY`
  for send, `PRE_GENESIS_WHY` for split, unchanged), read from
  `HeldCoin::before_genesis` (now `Option<GenesisHolder>`) and never from
  the words. `GateOptions::split_hold` becomes `genesis_hold`, set by
  split and by a send to the wallet's own address alone.
- send: when the destination is the wallet's own, `self_send_hold` reads
  the hold and the gate offers the other coins; when they do not cover,
  the gate refuses by name (`INSUFFICIENT_FUNDS`, or `INPUT_NOT_OFFERED`
  for `--from`), nothing signed or posted. A send to another party's
  address holds nothing for this reason.

Tests (src/commands/send/genesis_tests.rs): the deciding test, now green
and pinning the code, the held reason and the closing sentence; one coin
at 600,000 and one at 700,000, the one above spent and the payment
recorded; the boundary, 620,537 refused and 620,538 sent and recorded;
`--from` naming the old coin; a send of the old coin to another party's
address posted. The mock broadcaster saw no post on each refusal. split's
tests stand, their `before_genesis` asserts now naming `Split`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rected (For #634)

The cold reads found the stated reason untrue: beta already has
tests/support/served_internalize.rs (used by tests/served_internalize_door.rs),
which serves the router with the storage's services swapped for the mock.
So the stable line's last passing shape is served here as main's
`a_transaction_a_wallets_own_create_and_sign_built_is_stored_by_another`
serves it: a payer wallet holding one received coin (the helper's
`Paid`, taken in through its door) builds a payment to a second wallet's
derived P2PKH with its own `createAction` (`signAndProcess` false,
`noSend`, the `underReceivedRule` label so its received coin is selected)
and `signAction` (`noSend`), and the second wallet takes it in through
`POST /internalizeAction`: 200, accepted, stored (balance 300, the row
present), posted once to its mock. The helper is `create_and_sign` in the
support file.

The door test in src/genesis/tests.rs stays. Its doc comment, the module
doc, docs/WIRE.md (the section's paragraph and its side-by-side row) and
the fragment no longer say the router cannot serve it: they name the
served row, and keep the true reason it is not a wire row (the wire
harness serves one wallet per world).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… refusals, the chain's citation (For #634)

The cold reads asked four records corrected; with them the third road's
records (the send cure of 309a6c5).

(a) docs/WIRE.md's 0.18.9 table and the fragment gain one row for #638 on
this line, from the earlier lane's one hermetic scratch run and no further:
a gift-claim of a gift whose deposit is not mined yet is posted and its
record refused (this line: `Invalid BEEF at byte 48: InputNamesNoElement`;
the stable line: `BEEF structure is invalid`), the claim is not recorded by
a later pass; the run was not committed, no row or test pins it, the
recovery by `receive` was not run here, and #638 holds the recovery and
the cures.
(b) split --from: the stable line's split has no --from at all (main's
src/cli.rs gives it --count, --allow-pending and --coin alone), said in
the table and the fragment.
(c) The closing sentence no longer says no row answers a refusal "after
anything was ... posted": it says what the wire rows show (nothing stored,
row 290), that they count no posts, names the Rust tests that count the
mock's posts on each refusal, and names #638 as this section's one order
that posts and then refuses.
(d) src/genesis.rs cites the toolbox's published CHANGELOG entry for the
store's `chain` word (0.14.0-beta.4, #440) in its words, and no longer
cites the toolbox's source lines or says what the door does with a word
its notes do not state.

The send road: a row in the table (no such road on the stable line, whose
send has no self-payment step), a sentence in the section's paragraph
naming its deciding commit 7268dd3, and a fragment entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
At 4822880 the ratchet read three numbers above the record:
duplicated_tokens 31644 -> 32747 (+1103), clippy_pedantic +1
(similar_names: `payer` and `payee` in the served create-and-sign test)
and functions_over_60_lines +1 (Refusal's Display, 64 lines with the
holders' sentences). Each is fixed in code; no record moves.

- The send road's tests use split's tests' helpers (`spender`,
  `refusal_of`, and two new shared assertions, `assert_held_alone` and
  `assert_named_held`, which split's own tests now use too) in place of
  copies, and their own repeats are helpers (`wallet`, `old_and_new`,
  `self_send`, `posts`, `held_for`). Every assertion stands.
- send builds its gate options once (`gate`, the hold added when the
  destination is its own) in place of the literal split also has.
- The served test names its wallets `sender` and `receiver`.
- Refusal's Display reads the holders from `genesis_holders`.

Now: duplicated_tokens 31552 (below the record and below 7013ab1's
31608), clippy_pedantic 823, functions_over_60_lines 82, the rest at
the record: "ratchet: no number above the record".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…release's section could make stale)

The fragment said "no pin moves here". It is assembled into the section of
whichever prerelease next carries it, beside that release's own pin move,
where the sentence would read as false (the 0.19.0-beta.10 release lane
stopped on the same words in changelog.d/633.md). It now says the port
itself moves no pin. The captain's commit, on the branch as rebased onto
beta 07d939e with docs/WIRE.md's two sections both kept.

Co-Authored-By: Claude <noreply@anthropic.com>
@Calgooon

Copy link
Copy Markdown
Contributor Author

The captain's rebase, and what follows. The fix lane finished at 26fd67e (the third road was real: a send to the wallet's own address of a coin mined before Genesis posted once and its record was then refused; it now holds what split holds, with a sentence of its own, and a send to another party still posts; the create-and-sign row goes through the served router; the records are corrected; 1044 tests, the wire corpus 290). GitHub then read the PR as conflicting with beta in docs/WIRE.md alone: the beta.10 pin (PR 642) had added its section at the anchor this PR's section follows.

The captain rebased the branch onto beta's tip 07d939e6 (the 0.19.0-beta.10 release) and kept both sections, beta's and then this PR's; the rebased tree equals the old tip plus exactly what beta gained since the old base (checked by a diff of the two diffs); no heading is doubled. One commit of the captain's sits on top (5382f2b3): the fragment's "no pin moves here" now reads "the port itself moves no pin", so that a later release's section, which also carries that release's pin move, cannot make it false. The earlier commits' shas changed with the rebase (the reads' tip 7013ab1 is now 3299539c). Next: the seven checks on the new head, one re-read of what was added after the two reads, then the queue. This PR rides the prerelease after 0.19.0-beta.10.

…t by a commit id

The sentence cited the test's commit by an id the rebase onto beta changed,
and the queue's own replay changes every id of this PR again at the landing.
It now says the test was committed and run before its cure. The re-read's
finding; the captain's fold; no other line moves.

Co-Authored-By: Claude <noreply@anthropic.com>
@Calgooon
Calgooon added this pull request to the merge queue Nov 18, 2026
Merged via the queue into beta with commit fd9fc94 Nov 18, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant