Repository navigation
D3 — three verdicts, so the headline cannot say yes to a trader the answer is warning about - #26
Merged
Merged
Conversation
Live, the command printed COPYABLE and exited 0 directly above a line saying the fees, not the strategy, would decide this member's result. PDR-0002 was written for that and never built. It is built now, and accepted. COPYABLE clears the floor and trips nothing. COPYABLE WITH RESERVATIONS clears the floor and names what it is reserving about, on the first line, so the headline alone is actionable — the middle verdict will be the common one and a vague caution would be read as noise. NOT COPYABLE does not clear the floor, whatever else is true: impossible beats expensive, and the reservations are still printed so an administrator learns why twice over. Exit codes run by severity, 0/1/2/3, a breaking change made before anything consumes it. A fourth reservation and a ceiling, decided while implementing and recorded as an amendment to the PDR rather than left in the code. The PDR said a cut-short window changes nothing beyond naming the figures extrapolated. Running it live showed otherwise: a 30-day question answered from 2.4 hours is stretched by 319, and the command printed `125.34% of their ticket per month in fees` as though it were a measurement. Past 3x that is a reservation; past 30x there is no verdict, which is the case this PDR already defined as "the data cannot support an answer", now given a threshold so it can be applied rather than argued about. Two defects found while writing the tests, both in code that was already merged or about to be: `traded on 31 of the 30 days read`. UTC day buckets, so a window exactly `window_days` long can straddle one bucket more than it has days. S10 pinned this on the path where the window is inferred; this is the other path, and it was printing an impossible sentence to an administrator. And the extrapolation reservation could never have fired in production. The command passes `window_days=None` when the window is cut short — correctly, so the monthly figures extrapolate from what was read rather than from what was asked for — which left the stretch measured against itself, always 1. It worked in every unit test because those pass the window directly. `assess` now takes the window that was *requested* as its own argument, and a CLI test drives the whole path so the reservation cannot go quiet again. Live on the trader this module is tested against, at 14:14 UTC: `COPYABLE WITH RESERVATIONS (fees, extrapolation)`, exit 1. Fifty-six tests. Agent-Session: session_01NGwPYhV6fYZhjrh41GNfJy Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NGwPYhV6fYZhjrh41GNfJy
…reates Three blocking findings from verification, all in the interface this PDR exists to define, plus the small ones that share their root. The first is a regression I introduced. Renumbering by severity gave 2 to NOT COPYABLE — and argparse already exits 2 on a usage error. A missing --ticket or a mistyped flag made the command say "this trader cannot be copied at this ticket" to a script that reads the code and never sees a sentence. `--ticket nan` was worse: it escaped as an uncaught exception, which Python exits 1 for, and 1 now means COPYABLE WITH RESERVATIONS. A crash read as a qualified yes. Both are now no verdict, which is what a malformed question deserves, and `Infinity` no longer prints a full verdict headed `at a Infinity ticket`. The second is that the middle verdict's own exit code was pinned by nothing. Setting EXIT_WITH_RESERVATIONS = 2 — collapsing it onto NOT COPYABLE, the exact distinction this decision exists to create — left the whole suite green. The one CLI assertion touching it admitted `code in (1, 2)`, which is the sixth fixture of mine on this module to prove nothing. That the fee reservation lands on the *first line* was asserted nowhere either, and the ceiling had no CLI test at all: its unit test passes a combination `main` never produces, so the production path to it was unpinned — the same shape as the defect D3 was written to fix. Seven mutants that survived the suite before now fail it: the middle exit code, the four thresholds flipped from > to >=, the ceiling flipped, and deleting the days clamp. The third is that PDR-0002 names updating the module README with the four verdicts and their codes as an impact of this decision, in so many words, and it was not done. A breaking interface change was shipped with no user-facing record of what it broke. The README now carries both tables. Two more from the same report, fixed rather than deferred: the floor beats the ceiling, because whether orders clear 10 USDC is read straight off the notionals and needs no extrapolation, and the PDR says the floor alone decides; and the refusal message printed a stretch of 30.00002 as `30`, a number the rule says is not refused. And one the wording did not settle, now settled in the PDR: concentration counts against the days actually read, not the days asked for, because a reservation is a statement about what was observed — counting against a window never read would be the mistake this module spent a cycle removing. Sixty-five tests. Agent-Session: session_01NGwPYhV6fYZhjrh41GNfJy Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NGwPYhV6fYZhjrh41GNfJy
…ushed `nstack check` reported twelve mypy errors and the commit went out anyway. The shell chain tested the exit status of `tail`, not of the check — so the gate ran, failed, printed its failure, and the `&&` that followed saw a successful `tail`. The check did its job; I did not read it. The errors themselves were trivial: a `**dict` splat into `_reservations` erases the argument types. It is a keyword-only helper with defaults now, which is also easier to read than four dictionary merges. Recording the how rather than only the what, because a gate whose output is printed and not read is the same as no gate, and this is the second time this week a figure went out unchecked because I chained a command onto the wrong exit status. Agent-Session: session_01NGwPYhV6fYZhjrh41GNfJy Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NGwPYhV6fYZhjrh41GNfJy
…amendment A verifier refused this branch over a change nobody asked for, and was right. Last round I made the floor beat the extrapolation ceiling, reasoning that whether orders clear 10 USDC is read straight off the notionals and needs no extrapolation. That reasoning is false. The notionals read are the ones inside the window the venue actually returned, so `refused_share` and `minimum_ticket` computed from half an hour are inferences printed as facts about a trader — the exact move the amendment I had written five hours earlier forbids one section above. What it produced, measured: `NOT COPYABLE` above `8352.24% of their ticket per month in fees` and `extrapolated ... by a factor of 823.3`. The amendment's own dated success criterion says no administrator is ever shown a figure stretched past 30x. I violated it within the hour, in the same file, and then pinned it with a test so the nonsense became the contract. The ceiling is checked before any verdict is formed again. `NO VERDICT` is the most severe outcome and the exit codes already said so. "The floor alone decides NOT COPYABLE" means nothing OTHER than the floor may produce that verdict; it is not a statement of precedence over the absence of one, and the PDR now says which it is, along with why the reasoning that looked like a justification was wrong. The README table written last round to close a blocker asserted `Past 30x there is no verdict at all`, which my own change had just made false. It is true again. Two more drifts in the same tables are fixed: `COPYABLE` claimed the orders clear the floor when the code tolerates up to 20% refused, and the `NOT COPYABLE` row lacked the reservations the command actually prints after it. Five mutants the verifier found surviving are now caught. Two of them are the reservation ORDER — swapping fees and reproducibility, or moving fees last, left all sixty-five tests green, while the test named `..._named_on_the_first_line_not_merely_somewhere` asserted only that the word appeared, on a fixture that tripped one reservation. The seventh fixture on this module to read like a guarantee and prove nothing. The order is now asserted whole, on a fixture where all four fire. Also from the report: the floor boundary at exactly the coverage target is pinned, since D3 made it the sole gate for exit 2; `--help` returns 0 instead of raising through a function typed `-> int`; the dead `ArithmeticError` branch is removed rather than left as an untested brace; and the dead `calendar_days > 0` guard goes with it. Sixty-eight tests. Agent-Session: session_01NGwPYhV6fYZhjrh41GNfJy Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NGwPYhV6fYZhjrh41GNfJy
…g nothing
Three blockers, all of them created by my cleanup last round, and the pattern
is the same in each: I removed a protection while believing I was tidying.
B1. I deleted the `ArithmeticError` handler and wrote that `is_finite()`
"already stops every case". That is false. `is_finite()` guards `--ticket`;
every other number in `assess` comes from the venue. A verifier walked
`accountValue: "NaN"`, `accountValue: "Infinity"`, a `px: "NaN"` fill and a
zero-notional fill straight through to an uncaught decimal error — which the
process reports as exit 1, and this deliverable is what made 1 mean COPYABLE
WITH RESERVATIONS. My own test docstring says a crash must never read as a
qualified yes.
`assess` now refuses all four with reasons, checking finiteness before any
comparison because `Decimal("NaN") <= 0` does not answer False, it raises. The
zero-notional case needs no exotic input: enough of them inside the coverage
target and the minimum ticket divides by zero. The handler is back as a
backstop for the fifth shape nobody has thought of, and a test forces it rather
than leaving a brace nobody can show does anything.
B2. The reservation order was asserted on the private helper, one layer below
the headline the decision is about. Sorting the tuple inside `_render` passed
every test. Asserted through the command now — and my first attempt at that
test used `fees, reproducibility`, which are already in alphabetical order, so
sorting left it identical and it proved nothing. It uses `fees, concentration`,
where the decision's order and alphabetical order disagree.
B3. Rewriting the floor-versus-ceiling test deleted the only assertion of the
literal `NOT COPYABLE`; renaming the verdict passed the whole suite. Restored.
Fixing a blocker should not cost coverage that already existed.
Also pinned, each verified against a mutant with the patch confirmed applied
first: the 10 USDC notional boundary, `EXTRAPOLATION_ALERT` against the literal
3 rather than against itself, and the one line deciding whether the monthly
figures are measured or extrapolated — my first test of that used fills
spanning the full window, where both wirings agree.
Smaller: a posted share of 0.4% printed `0% of the fills were posted ... a
copier cannot reproduce them`, warning about nothing; the README says what
`--help` returns, since 0 is otherwise the code for COPYABLE; and
`modules/screening/.coverage`, a SQLite file carrying one workstation's
absolute paths, is out of the index and into `.gitignore` — the file the
`.gitignore` comment describes by name.
Seventy-five tests.
Agent-Session: session_01NGwPYhV6fYZhjrh41GNfJy
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NGwPYhV6fYZhjrh41GNfJy
…a qualified yes The confirmation run refused this branch, and was right. Two ordinary environment variables — `https_proxy=socks5://...` with no `socksio` installed, and `SSL_CERT_FILE` naming a file that is not there — killed the command with exit **1**, which this deliverable is what made mean COPYABLE WITH RESERVATIONS. An empty stdout and a qualified yes about a trader whose fills were never read: strictly worse than the two-state answer D3 replaced, because it invents an opinion out of a configuration error. `venue.client()` was built one line before the `try` that guards the reads, so nothing caught it. `venue`'s own handlers are narrower than they look as well — they catch `httpx.HTTPError`, and `httpx.StreamError` is a `RuntimeError`. The reason it went unseen for six rounds is the part worth recording: **every one of the twenty `main(...)` calls in the suite passes `client=`**. The single line the administrator's own invocation runs was run by no test at all, and seventy-five green tests were green on a path nobody takes. I wrote the same argument into this file last round, about `ArithmeticError`, and then left the identical hole one call earlier. So `main` is now a backstop over `_decide`: any unhandled exception prints its reason and returns the no-verdict code. Same reasoning as the `ArithmeticError` handler, applied to the command instead of to `assess`. Both tests were seen failing against the unpatched file — `FileNotFoundError` escaping from the SSL context, and a `RuntimeError` from the transport — with the revert confirmed before the run rather than assumed. The first one passes no `client=`, on purpose. Verified on its own exit status, not through a pipe: 77 passed, `nstack check screening` 0, and the four reproductions now exit 3 with an empty stdout. Agent-Session: 4151570f-613e-475f-ba3f-b465b35d9a83 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The confirmation run found that this PDR and D3's sixth criterion both say *"the verdict is NO VERDICT"*, while the command prints those two words nowhere: empty stdout, `no verdict: <reason>` on stderr, exit 3. The module's README, written on this branch, had already restated the criterion as `*(nothing on stdout)*` — which is the right reading and the wrong route. An expected result had been changed by the author, in a README, with nobody's agreement visible. Asked directly, the decider kept the behaviour: stdout carries the answer a script consumes, stderr the explanation a human reads, and when there is no answer stdout is empty so nothing read back can be mistaken for a verdict. It is the concern that renumbered the exit codes, applied to the output. Recorded in the PDR, where decisions live. No code, no test, no threshold, and the README is left alone — it now follows this document instead of amending it. Agent-Session: 4151570f-613e-475f-ba3f-b465b35d9a83 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…ng the exit code The confirmation run at `71acb63` refused the branch again, on the fix's own reporting line, and both of its findings reproduce exactly as written. **Exit 1 on an empty stdout, still reachable.** `... 2>&1 >/dev/null | true` with an unbuffered stderr — `PYTHONUNBUFFERED=1` is ordinary in a container image — raises `BrokenPipeError` out of `print`. It escaped `main`, including out of the backstop I added last commit, which is precisely where a failure lands last, and CPython exits **1**: COPYABLE WITH RESERVATIONS, decided by a reader that consumed nothing. Measured 5/5 through the installed command, and under the same `https_proxy=socks5://...` environment this branch was refused over two commits ago. **The reason landing on stdout.** `... 2>&-` closes fd 2, CPython sets `sys.stderr` to `None`, and `print(file=None)` writes to stdout: 59 bytes of explanation where the verdict goes, under exit 3. The amendment I recorded one commit ago says stdout is empty when there is no answer, so nothing read back can be mistaken for one. It was not universally true of the code it described. Neither was introduced by the backstop — both are byte-identical at `b41e6f6` and older than this deliverable. That is not a reason to leave them: this is the fourth blocker of the same class on this branch, and the invariant is one line from holding. Every write to stderr in the file goes through `_say` now: nothing when there is no stderr — never stdout as a fallback — and a suppressed `OSError` when the write fails. The exit code carries the answer alone. Both tests were seen failing against the unguarded file, the revert verified before the run: `BrokenPipeError` escaping, and the reason landing on stdout. Verified on their own exit status: 79 passed, `nstack check screening` 0, the two reproductions now exit 3 (five runs each, stdout 0 bytes), and the four original ones still exit 3. Live at this head: `NOT COPYABLE (fees)`, exit 2, 9805 fills read over a window ending today, 9 heavy reads of a 20 budget. Agent-Session: 4151570f-613e-475f-ba3f-b465b35d9a83 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…actually hold Fifth finding of one class, and the decider's call was to close it and stop the class rather than close it and wait for the sixth. **argparse was outside the guard.** `ArgumentParser.error` calls `print_usage(sys.stderr)`; with fd 2 closed `sys.stderr` is `None` and `print_usage` substitutes **stdout**, so six ordinary malformed command lines put 46 bytes of `usage: ...` where the verdict goes, under exit 3. Last commit's guard covered every write in this file — and argparse is not in this file, which is exactly the gap the previous confirmation run named. The parser now reports through `_say` and exits with no message of its own. `--help` stays on stdout, 451 bytes, exit 0; a usage error with a working stderr still explains itself there. **`_say` suppresses `Exception`, not `(OSError, ValueError)`.** The same report reached exit 1 — a code that names a verdict — through a `sys.stderr` whose `write` raised `RuntimeError`. It found no route to that through a shell, and one character closes it. `KeyboardInterrupt` and `SystemExit` are `BaseException` and still leave. **And the promise is bordered.** *"It writes nothing at all on stdout"* is a claim about every way a process can be started, and three confirmation runs walked into it one layer at a time: this file's prints, the backstop's print, argparse's usage line — and then CPython's finaliser, which writes its own message and exits 120 when it cannot flush a stream. That fourth layer is not reachable from inside the module. A promise the code cannot keep produces refusals for ever, so the PDR now states the three guarantees the command does hold — nothing of ours on stdout without a verdict, the exit code as the interface, no verdict word unless that verdict was formed — and names 120 as a verdict that could not be delivered rather than an opinion. The README says so where a script author reads it. The stdout test was seen failing against the unpatched parser, on all four malformed shapes, the revert confirmed first. The `--help` test is a regression guard, not a discriminating one: it passes either way, and it is there because routing the parser's errors is exactly the change that could have taken `--help` off stdout with them. Verified on their own exit status: 81 passed, `nstack check screening` 0, and `screening --bogus >out 2>&-` now exits 3 with stdout at 0 bytes. Agent-Session: 4151570f-613e-475f-ba3f-b465b35d9a83 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The run at `6109baa` returned `merge`, with no blocker, and three findings that are all one thing: the amendment I wrote in that same commit says more than the code does, or less than the interpreter does. **A verdict that cannot be delivered comes back two ways, and I named the rarer one.** I wrote that it surfaces as `120`. That is the flush failing. When the *write* fails — `PYTHONIOENCODING=ascii` cannot encode the em dash in the headline — the backstop returns **3**, which is one of the four codes and reads as *the data cannot support an answer* about a trader whose data supported one perfectly. It fails safe, and it is the common case. Now written as both. **`PYTHONINSPECT=1` replaces the exit code with 1.** CPython re-enters the REPL and discards the program's status; the command returns 3 and the process exits 1. Not this command deciding — `python -c "sys.exit(3)"` does the same — and not undoable from inside the process. My exclusion list named only the 120, so the next run would have filed this as new. Named as the general case instead. **Guarantee 3 was absolute where input validation is a follow-up.** The address is echoed into the headline as typed, so an address carrying a newline and the words `NOT COPYABLE` prints a complete headline for a verdict never formed. Now "no word this command chooses", with the caveat stated and the reason it is not fixed here — unvalidated input is a recorded follow-up and this deliverable is already over budget. What the venue says still never reaches stdout: 150 fuzzed answers with coin names literally `"COPYABLE"` leaked nothing. No code, no test, no threshold. `nstack check screening` 0; the module is untouched at `git diff 6109baa HEAD -- modules/screening/src modules/screening/tests`. T4 makes this commit reprint the sheet: it is dated at the head, and the head moved. The confirmation run is being repeated rather than the sheet edited. Agent-Session: 4151570f-613e-475f-ba3f-b465b35d9a83 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
napkinstack-admin
previously approved these changes
Sep 22, 2026
…dy gone Sixth finding on this branch and the fourth in prose rather than in code. The re-confirmation at `3483b26` passed 28 of 29 rows — every acceptance criterion, both gates, the live run, the module byte-identical to the head it had already accepted — and refused the twenty-ninth, which is a sentence I wrote in the commit whose only content was sentences. I claimed that when the write fails the backstop returns 3 with **stdout genuinely empty**. True for the case I named: an encoder that cannot take the em dash refuses the answer whole, measured up to 133 KB. False for the other member of the same class: a reader closing a pipe partway through an answer larger than the buffer leaves the bytes already written — exit 3 over 40 bytes reading `COPYABLE — …`, three reproductions out of three. I named a class in the heading and described one member under it. The verifier also caught what that did to the guarantee above, which I had not reread in the light of my own amendment: it says *no partial answer* under *when there is no verdict*, while the paragraph below now establishes that **3 is also what a formed verdict returns when it cannot be delivered**. The two sentences had come apart in writing, in the same document, on the same day. So the correction is made once, at the top, for all three guarantees: they speak about what the command **chooses** to write. Bytes already handed to the operating system, before a reader went away or a stream refused the rest, are not a choice. The first guarantee now says *no verdict formed* rather than *no verdict*, and names the route where exit 3 and a non-empty stdout coexist. The bullet says which half of its class leaves stdout empty and which does not, with both measurements. Closing the class rather than the instance is what the `PYTHONINSPECT` paragraph got right two commits ago and what this one got wrong; a per-instance clause is how a document produces a refusal per round. No code, no test, no threshold. `nstack check screening` 0, and `git diff 3483b26..HEAD -- modules/` is empty. T4 reprints the sheet again: the head moved, so the twenty-nine rows are being re-measured rather than relabelled. Agent-Session: 4151570f-613e-475f-ba3f-b465b35d9a83 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
napkinstack-agent
Bot
dismissed
napkinstack-admin’s stale review
via
September 22, 2026 23:18
e0af8e6
The class sentence worked — row 14 passes, and the verifier bounded rather than asserted it: the module writes to stdout from exactly two places, `_say`, which only ever touches stderr, and the render call, which runs only after a verdict exists. So bytes of an answer can reach stdout unchosen only through a write that started and did not finish, which is the family the sentence excludes. It did not reach a different absolute three paragraphs above. Guarantee 1 lists *"not a usage line"*, and `--help` writes 451 bytes of usage to stdout and forms no verdict. Nine routes to it, from `-h` to `0xabc --ticket 500 --help`, all print the usage and exit 0. **Older than this branch, and sharpened by my own correction.** The guarantee said *"when there is no verdict"*, which could be read as the `NO VERDICT` outcome — the thing that exits 3 — and `--help` argued its way out of that reading. Narrowing it to *no verdict formed* was right and load-bearing, and it pulled `--help` squarely inside a sentence that then denied what it does. The command was never wrong here; three drafts of this paragraph were. Named as the exception to the first two guarantees, since it also exits 0 where 0 means COPYABLE — the one exit 0 that is not a verdict, which the README has said since the day the table was written. An exception rather than a defect because it says nothing about a trader: a caller who asked how to run the command is not a caller being told an answer. The verifier's own note on this, worth keeping: it measured `--help` on all three of its sheets and never read it against the bullet three paragraphs down. The sequence has produced six findings of one family, every one a sentence more absolute than the code. Having enumerated the two writes, it does not see a seventh. No code, no test, no threshold. `nstack check screening` 0, and `git diff e0af8e6..HEAD -- modules/` is empty. Agent-Session: 4151570f-613e-475f-ba3f-b465b35d9a83 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
napkinstack-admin
approved these changes
Sep 23, 2026
This was referenced Sep 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
D3 — three verdicts, so the headline cannot say yes to a trader the answer is warning about
Module
modules/screening— exactly one.Deliverable
Deliverable: D3
What it changes
The command answered
COPYABLEorNOT COPYABLE, and the middle case had nowhere to go: atrader whose fee burden the same answer was warning would decide the member's result still got a
headline saying yes, and an exit code of 0 with it.
Three verdicts now, and four exit codes ordered by severity (PDR-0002, accepted here):
COPYABLECOPYABLE WITH RESERVATIONS (…)NOT COPYABLE (…)The reservations —
fees,reproducibility,concentration,extrapolation— are named inthe headline, so the first line alone is actionable. The renumbering is a breaking change to
this command's interface, made now, before anything consumes it, so that a script keeping the
idiom it already has —
if code == 0— stops getting a zero for a trader the command waswarning it about.
Four amendments to PDR-0002 ride with it, and the last three exist because verification
refused the branch:
by a factor of 319, and the answer printed
125.34% of their ticket per month in feesasthough it were a measurement.
extrapolationbecame the fourth reservation past 3×, andpast 30× there is no verdict at all — the ceiling is checked before any verdict is formed,
the floor included.
NO VERDICTis the name of an absence, and the absence is what is printed. Empty stdout,the reason on stderr, exit 3. The behaviour was already this; what was wrong is that a README
had restated an acceptance criterion on the author's own authority. Asked directly, the
decider kept the behaviour, and the decision is recorded where decisions live.
the verification section.
--helpis the exception, and the only one — named in the PDR at last, having been in theREADME since the table was written.
Oracle
criteria were fixed when cycle 02 was framed
revert it was measured against, verified before the run rather than assumed
Kind of oracle: unit test · fitness function · explored against the live venue
Review budget
Justification. Indivisible at the seam that matters: every intermediate point is an exit-code
scheme that means two things at once. Splitting the third verdict from the renumbering would
merge a state where
COPYABLE WITH RESERVATIONSreturns the same0asCOPYABLE, which is thedefect this deliverable exists to remove.
For the reviewer's attention budget: 596 lines are tests, 282 are the PDR and the READMEs,
and 291 are behaviour across
cli.py,model.pyandverdict.py. Seven of the twelvecommits are answers to verification findings, and each is readable on its own. The last three
commits change no code at all —
git diff 6109baa..HEAD -- modules/screening/src modules/screening/testsis empty, verified blob by blob by the verifier at each head.Contracts
Verification — six runs, five refusals, and what they were all about
Under ADR-0003, a
highread-only module gets one adversarial round; this branch had sixbefore that rule existed, and what follows is the confirmation run at the head, which the ADR says
is not a round. Five earlier confirmation runs refused this branch. Each found something real,
each is recorded here, and they were all one class: a statement asserted more absolutely than
the thing it describes. The first three were the code making that mistake. The last two were the
document.
b41e6f6httpx.Clientwas built one line outside thetryguarding the reads.https_proxy=socks5://…withoutsocksio, orSSL_CERT_FILEnaming a missing file, killed the command with exit 1 — which this deliverable made meanCOPYABLE WITH RESERVATIONS— on an empty stdout. A configuration error returned a qualified yes about a trader whose fills were never read4dd123071acb63printwas unguarded: a broken stderr pipe raisedBrokenPipeErrorout of it and the process exited 1 again; and2>&-closes fd 2, sosys.stderrisNoneandprint(file=None)wrote the reason to stdout, 59 bytes under exit 37fd09147fd0914argparse.errorcallsprint_usage(sys.stderr), which substitutes stdout when that isNone: six ordinary malformed command lines put 46 bytes ofusage: …where the verdict goes. The previous commit's guard covered every write in that file, and argparse is not in that file6109baa6109baaPYTHONINSPECTreplaces the exit code and only the finaliser's 120 was excluded; the "undeliverable verdict → 120" sentence missed that the command's own 3 is the common case; guarantee 3 was absolute where input validation is a follow-up3483b263483b26e0af8e6e0af8e6--helpforms no verdict and writes 451 bytes of usage to stdout. Older than the branch; the narrowing is what pulled it into view2d9fee9The fix that ended the sequence was not another clause. At
e0af8e6the guarantees gained onesentence above all three: they speak about what the command chooses to write; bytes already
handed to the operating system, before a reader went away or a stream refused the rest, are not a
choice. That closes a family instead of an instance, and the verifier then bounded it rather
than accepting it — enumerating the module's writes statically, instrumenting 18 paths with a
recording
sys.stdout, and cross-checking bytes at the descriptor. Exactly two origins exist: therender, after a verdict, and argparse's help action. Both are now named in the document. That is
row 32, and it is the reason there is no seventh instance of this family to find.
What the record says about the author. Several of the defects on this branch were introduced by
the author inside later fixes, and the reason the first survived six rounds is worth reading twice:
all 20
main(...)calls in the suite passedclient=, so the single line an administrator'sown invocation runs was exercised by no test at all. Seventy-five green tests were green on a path
nobody takes. Four of the six refusals were then about sentences rather than code — the same habit,
moved into prose. That is what ADR-0002 and ADR-0003 were written about, and this branch is the
evidence for both.
Definition of Done
nstack check screening, exit 0, read on its own exit statusnstack test screeningexit 0nstack fitnessexit 0, compliantauthenticates nowhere and reads only public endpoints
Test sheet
Verifier: session ad21b91a7adfcf8d5
git diff e0af8e6..2d9fee9 -- modules/returns 0 bytes;--name-onlylists onlydocs/pdr/0002-three-verdicts-not-two.md, +11 lines;ls-tree -rover the whole repo withdocs/excluded diffs clean--bogus, no args, address only,--ticketwith no value,--ticket 500alone, an extra positional · when run with>out 2>&-· then exit 3 and out is 0 bytes--helpand-h· when run · then the usage is on stdout, exit 0, stderr emptyexit=0 stdout=451B stderr=0B, first lineusage: screening [-h] --ticket TICKET address--bogusand no-args 120 B on stderr, address-only 111 B, all threestdout=0Bsys.stderrwhosewriteraisesRuntimeError,TypeError,ValueErrororOSError, or which has nowrite, or whosewritereturnsNone· when run on the parser and venue routes · then no code that names a verdictexit=3 stdout=0B, flush left intact so the finaliser is not involvedsys.stderrreplaced byNone· when a malformed command line is parsed · then exit 3 and nothing on stdoutexit=3 stdout=0B; this is the route that put 46 bytes of usage on stdout at7fd0914exit=3; with fd 1 closed and fd 2 open the reason still reaches stderr, 120 B parser and 59 B venueCOLUMNS,TZ, optimize, verbose and locale · when run on both no-verdict routes · then exit 3 and 0 bytes on stdoutb41e6f6PYTHONINSPECT=1· when run on either no-verdict route · then the process exits 1 and the amendment's account of why is accurate in every clauseexit=1 stdout=0B; instrumenting the return value showsmain()returning 3 while the process exits 1; controlPYTHONINSPECT=1 python -c "sys.exit(N)"exits 1 for N of 0, 1, 2, 3--ticketvalues includingnan,inf,1e400,1e100000, empty,abc,5,000, an Arabic-Indic digit and0E-500· when run with the venue unreachable · then exit 3 and 0 bytes on stdout0,-5,-0,0E-500give exit 3 with empty stdout;.5,+5,1e-100000, the Arabic-Indic digit give exit 2 underNOT COPYABLE;1_000and1e400give exit 0 underCOPYABLENaN,Infinity,null, dict-for-list, statuses 429, 500, 503, 404, 204 and coin names literally"COPYABLE"· when run · then every exit is in 0 to 3, exit 3 pairs only with empty stdout, no traceback, and no verdict word reaches stdout from a venue stringanomalies=0 word_leaks=0sys.stdoutthat raises on write, isNone, or is a silent sink · when run on the no-verdict and parser routes · then exit 3 and the real fd 1 stays emptyexit=3 realfd1=0Bcmd_exit=3fromPIPESTATUS[0],stdout_seen=40B, first bytesCOPYABLE — 0xabc at a 10,000,000,000,0; the class sentence excludes bytes handed over before a reader went away and guarantee 1 names the route; control with a normal answer exits 0PYTHONIOENCODING=ascii,latin-1orcp037, orLC_ALL=en_US.ISO-8859-1, and a trader whose data forms a cleanCOPYABLE· when run · then exit 3 with stdout empty, the half the bullet attributes to the encoderexit=3 stdout=0B; the 133 KB answer under ascii also leaves stdout at 0 bytes, confirming the encoder refuses the chunk whole;utf-8control exits 0 with 396 BNOT COPYABLE· when aCOPYABLEverdict is formed · then the words on stdout are the caller's own, as amended guarantee 3 statesCOPYABLE — x, line 2NOT COPYABLE — you at a 1 ticket at a 500 ticket, exit 0COPYABLEand the exit code is 0httpx.MockTransportfixture, 30 fills over 30 days at notional 4 000, all taker:COPYABLE — 0xabc at a 500 ticket,exit=0 stdout=396B stderr=0BCOPYABLE WITH RESERVATIONS, the fee reservation is named on the first line, and the exit code is 1COPYABLE WITH RESERVATIONS (fees), body6.52% of their ticket per month in fees,exit=1 stdout=514BCOPYABLE WITH RESERVATIONSand the reproducibility reservation is namedCOPYABLE WITH RESERVATIONS (reproducibility), body67% of the fills were posted rather than taken,exit=1 stdout=536BCOPYABLE WITH RESERVATIONSand the concentration reservation is namedCOPYABLE WITH RESERVATIONS (concentration),exit=1 stdout=594BNOT COPYABLEand the exit code is 2, whatever the reservations sayNOT COPYABLE, body100% of this trader's orders fall under the venue's 10 USDC floor,exit=2 stdout=516B; with a fee reservation also applying,NOT COPYABLE (fees)still exit 2accountValueofNaN,0,Infinity,-5and missing, and no fills at all — every oneexit=3 stdout=0Bexit=3 stdout=0B, stderrthe venue returned 0.23 days of a 30-day window; control at the same notional with a complete window givesNOT COPYABLE (fees)exit 2(fees)only; 9.3, 4.6 and 1.1 days give(fees, extrapolation)at exit 1; 0.46 and 0.23 days are refused at exit 3 with 0 bytestest_a_malformed_command_line_never_writes_to_stdout· when it is run against7fd0914'scli.pyin a fresh scratch copy and against this head · then it fails there and passes herec5064b2f…against head0055598d…; at7fd0914FAILED … AssertionError: [] wrote to stdout, pytest exit 1; at this head pytest exit 0test_help_still_goes_to_stdout_and_exits_zero· when it is run against both revisions · then it passes either way, being a regression guard rather than a discriminating test7fd0914the run reports the other test as the only failure; at this head both pass, pytest exit 0nstack check screeningEXIT=0 — ruff format 16 files, ruff check all passed, mypy no issues in 10 source filesnstack test screeningEXIT=0 — 81 passed in 12.58s0x102d1d1a6240581a809bac9b9b4dff2eafe8c058at a 500 ticket:NOT COPYABLE (fees, extrapolation), exit 2, 7 939 fills, 20 of a 20 heavy-read budget, 9.2 days read, stretch 3.3x,stdout=1065B stderr=0B--help· when it runs, forming no verdict and writing a usage line to stdout · then the guarantees name it as the exception rather than denying it--helpis the exception to the first two, and the only one" now stands after the three bullets, naming the usage on stdout, the exit 0 and the measured routes; measured again here atexit=0 stdout=451B stderr=0Bexit=0 stdout=451B stderr=0B:--help,-h,--h,--he,--hel,-hh,--bogus --help,--help --bogus,0xabc --help,--help --ticket,0xabc --ticket 500 --help,-h --ticket nan,0xabc --ticket 500 -h extra. 6 near-misses stay outside, allexit=3 stdout=0B:--help=x,-- --help,--ticket 500 -- --help,--HELP,--hE, the bare positionalhelp. Repeated with fd 2 closed for seven of the help routes, allexit=0 stdout=451Bcli.py:71print(reason, file=stream)withstream = sys.stderrand an early return when it isNone, andcli.py:218print(_render(...)); nosys.stdout,os.write,logging,warnings,traceback,input,pprintorbreakpointanywhere, and no subparser or version action. Dynamic: 18 paths instrumented with a recordingsys.stdoutcapturing the stack of every write; exactly two distinct origins appear —cli.py:218on the two verdict paths only, and argparse's_print_messageviaprint_helpvia_HelpAction.__call__on the six help paths only;_sayreached stdout on no path. Descriptor cross-check: bytes counted atsys.stdoutequal bytes landing on fd 1 exactly, 396/396 on a verdict, 451/451 on help, 0/0 on no verdictThe attack surface behind those rows: 120 repeated malformed command lines, 15
unreadable-venue shapes, 30 environment runs, 22 hostile tickets, 150 fuzzed venue answers, 12
hostile-stderr and 10 hostile-stdout configurations, 13 help routes and 6 near-misses, and 18
instrumented paths — "no route where the module's own code produced a code naming a verdict it
had not formed, and no route where it put a byte on stdout without one."
Follow-ups recorded, not fixed here
Per ADR-0003: blockers are fixed, everything else is recorded rather than tidied inside the fix.
measured nine; the run at this head measured thirteen, all behaving identically, plus six
near-misses that stay outside. The sentence claims a measurement, not a total — worth making
exact the next time that paragraph is touched, not worth a head of its own.
-hhand0xabc --ticket 500 -h extraexit 0. They would be usage errors at exit 3without the help flag, and the help action pre-empts the error. Ordinary argparse, and it is
help — but this branch contains a commit called "Stop a typo reading as a verdict", so it is
written down.
COPYABLEover a body that is warning, at exactly the documentedthresholds: 20% of orders under the floor, 50% of fills posted, volume on 11 of 30 days. Each
conforms to PDR-0002, and the deliverable's own title asks whether the thresholds are in the
right place. Belongs with the PDR's success-criterion review.
"the sentence is present" is not a reliable signal that it did.
is echoed into the headline as typed, so a caller can read its own
NOT COPYABLEback;--ticket .5renders asat a 0 ticket;1e400prints 400 digits;-5and0reach thevenue before being refused; and an answer past 64 KB needs
1e100000, which is what makes thepartial-write route reachable at all. The day the address comes from a list the caller did not
write is the day this stops being a follow-up — the PDR says so.
PYTHONINSPECTreplacing the code. Named inthe PDR as outside the command's reach; recorded here so they are not rediscovered as defects.
unreadable venue. The trade is deliberate — the alternative is a crash at exit 1, which means a
qualified yes — and it is on the record rather than hidden.
crossedis not type-checked wherepxandszare: a venue returning the string"false"would read as a taker. Not reachable with the venue as it behaves today.and
operations.md's 60s budget being per call wherecli.mainmakes several.Summary
DONE
A third verdict,
COPYABLE WITH RESERVATIONS, naming which of four reservations applies in theheadline itself. Exit codes renumbered by severity, 0/1/2/3. An extrapolation ceiling that refuses
to answer at all past 30×, checked before any verdict is formed. Three fixes to defects found by
independent verification — the client built outside the guard, the reporting print deciding the
exit code, argparse's usage line reaching stdout — and three corrections to the decision record
that the same verification refused. Four amendments to PDR-0002.
VERIFIED
nstack check screening0,nstack test screening0 (81 tests),nstack fitnesscompliant —each read on its own exit status, never through a pipe. Six delegated confirmation runs; the sheet
above is the sixth, all 32 rows at the head commit. One live run against the venue per run.
ASSUMED
That the thresholds — 80% floor coverage, 5% fees, half the fills posted, a third of the days, 3×
and 30× stretch — are in the right places. They are one set of numbers for every administrator,
they were sampled against live traders, and no member has yet used any of this.
NOT VERIFIED
Nothing here was seen by an administrator. The module answers a question nobody has been observed
to ask: D1 stays
deferred, and the copying module does not exist. The120andPYTHONINSPECTexit paths are outside the command's reach and are stated rather than fixed.
RISKS
The middle verdict will be common — most real traders sampled land in it — and a state that applies
to most cases risks being read as noise. The exit-code renumbering is breaking, and it is done now
precisely because nothing consumes it yet. Ten follow-ups above are real, and a follow-up list
nobody reads is the failure mode ADR-0003 names. And the cycle owes a harder sentence than any of
these: this is a tool for choosing traders, built with no evidence that a member wants to copy one.
Signals to report
The signal, measured rather than supposed. A delegated verifier session has no identifier of
its own that it can read:
CLAUDE_CODE_SESSION_IDin its shell holds the parent's id — thesame value every
Agent-Sessiontrailer on this branch carries. Each run established its ownidentity from the harness's subagent records instead, and each said so unprompted, including that
CI would refuse the parent's id and be right to. So T2, which compares the sheet's verifier against
the commits' authors, cannot detect that a verifier is a child of the session that wrote the
code. ADR-0002 already records this as owed and calls the mitigation social rather than
mechanical; this branch is what that looks like in numbers — six delegated runs, five refusals,
four distinct agent identifiers, and not one session identifier among them.
A second signal, about T4 rather than T2. Three of the six runs were spent re-measuring 30-odd
rows because a documentation commit moved the head, and T4 requires every row to carry it. The rule
is right — a sheet dated on another commit proves nothing — but a change that touches no module
file could be recognised as one that cannot invalidate a module's sheet.
git diff -- modules/being empty is mechanical to check, and each of those three runs verified it by hand before
trusting it.