Skip to content

feat(efficacy): read each build's reliability, performance and portability - #181

Merged
braboj merged 19 commits into
mainfrom
feat/quality-probes
Nov 17, 2026
Merged

braboj merged 19 commits into
mainfrom
feat/quality-probes

Conversation

@braboj

@braboj braboj commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

A new reader, quality.py, gives the ISO radar's thin axes probes of their own. It sits beside security.py and has the same shape: a fresh venv per trial, one script run in process, one reading per trial under quality-scores/.

Probe ISO axis, sub-characteristic Pass
fuzz_robustness Reliability, fault tolerance 48 malformed requests: no 500, no exception, no sign-in bounce
concurrent_writes Reliability, availability 2 clients × 20 saves at once: all saved, no lock
latency_p95_ms Performance, time behaviour measured, two repeats; threshold calibrated later
capacity_500_lines Performance, capacity a 500-line invoice previews, saves and renders
n_plus_one Performance, resource use SQL count does not grow from 1 to 20 lines
coexistence Compatibility, co-existence two instances on their own databases stay apart; no stray file
python_portability Flexibility, adaptability installs and serves a signed-in page on Python 3.14

Reference implementation: passes every probe (p95 about 4 ms).

Rules:

Stacked on #180. Refs #119, #158.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DpT5xQh3AgRFs2tJwMT4g3

braboj and others added 4 commits November 15, 2026 17:48
…ility

- quality.py, beside security.py: a fresh venv per scored trial on Python
  3.12, one in-process run through the test client, signed in as the
  seeded administrator; readings under quality-scores/<trial>.json.
- Probes: fuzz_robustness, concurrent_writes, latency_p95_ms (two repeats,
  no threshold yet), capacity_500_lines, n_plus_one, coexistence, and
  python_portability on Python 3.14.
- A probe the build keeps from running is lost and reads failed; one the
  reader could not run is missing; a stalled run keeps what it read.
- Fuzzed integers stay within SQLite's 64-bit range: the spec sets no
  upper bound on a quantity or an id.
- Self-tests plant each fault on a stand-in app; FR-15-01 to FR-15-06,
  FR-14-01 extended, coverage rows, AGENTS.md, trace.py, building blocks.

Refs #119.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DpT5xQh3AgRFs2tJwMT4g3
…line

Codex round 1 on the quality reader:

- Hidden fields are read with an HTML parser, so a single-quoted CSRF
  token signs in.
- The sign-in holds only where the dashboard then answers 200; a 401, or
  a 403 to a request carrying its token, is the sign-in turning it away,
  like its redirect, and the probe is lost.
- The 500-line probe passes only where the export holds all 500 lines and
  the preview and the page show every line and the export's total.
- Stand-in modes: single-quoted sign-in, `refusing` (401), `forbidding`
  (403 on bad input), `truncating` (keeps 100 lines).

Refs #119.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DpT5xQh3AgRFs2tJwMT4g3
@braboj

braboj commented Nov 15, 2026

Copy link
Copy Markdown
Contributor Author

Codex round 1:

# Sev Finding Outcome
1 P2 Hidden fields need double quotes, so a single-quoted sign-in form loses every probe Fixed: HTML parser; every stand-in's sign-in form single-quoted
2 P2 A 401/403 in place of a page counted as signed in, so fuzz passed unreached Fixed: sign-in holds only on a 200 at /; 401, or 403 to a request with its token, is withheld; stand-ins refusing, forbidding
3 P2 The 500-line probe passed on statuses alone, so a truncating app passed Fixed: export, preview and page must carry all 500 lines; stand-in truncating

Each check fails with its fix removed. Also merged #180's 401/403 fix.

@braboj

braboj commented Nov 15, 2026

Copy link
Copy Markdown
Contributor Author

Codex round 2:

# Sev Finding Outcome
1 P2 Rendered rows counted by SKU occurrences, so a 250-row page with SKUs shown twice passes Simplified by design: the export proves all 500 lines are kept, and the preview and page must show the exact total only 500 lines give. A page that paginates rows but shows the full total is not a capacity failure. HTML row counting is dropped
2 P2 A null line in the export raised in the reader and read missing Fixing: malformed export lines fail the probe

braboj and others added 2 commits November 15, 2026 19:03
Codex round 2 on the quality reader:

- The export must list all 500 lines in order, each a record with a sku
  and an integer quantity; a null or malformed line fails, never missing.
- The preview and the page are read by the invoice's total alone, matched
  however it is grouped and beside any currency sign; row counting in
  HTML is dropped, so a page that paginates its rows passes.
- A fault mode's check now needs its probe failed, not merely unpassed.
- Stand-in modes: `paginating` (passes), `miscounting`, `nulling`; pages
  write grouped amounts beside the euro's sign.

Refs #119.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DpT5xQh3AgRFs2tJwMT4g3
… times 100

Codex round 3 on the quality reader:

- The CI loop runs quality.py's self-test, so the trace finds its output;
  trace.py's self-test checks the loop covers every module it reads.
- Totals are matched with character references resolved, so `&nbsp;` and
  `&#8239;` group thousands.
- The 500 lines are SEE-5 at multiples of 6: zero-rated, priced per line,
  each net a whole 15.00, so the price is linear; the first 100 priced
  alone must cost a fifth of the 500-line total, within a cent.
- Stand-in mode `capped` prices 100 lines while exporting 500; the
  preview writes its total with `&nbsp;`.

Refs #119.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DpT5xQh3AgRFs2tJwMT4g3
@braboj

braboj commented Nov 15, 2026

Copy link
Copy Markdown
Contributor Author

Codex round 3:

# Sev Finding Outcome
1 P1 CI never ran the quality self-test, so the trace check failed Fixed: quality in the workflow loop; a trace check fails when a traced module is missing from it
2 P2 Totals with &nbsp; separators were not read Fixed: page text unescaped first; no-break spaces count as group separators
3 P2 A calculation truncated to 100 lines passed when the export kept 500 Fixed: the first 100 lines alone must cost a fifth of the 500-line total, within 1 cent; lines chosen so pricing is linear

@braboj

braboj commented Nov 15, 2026

Copy link
Copy Markdown
Contributor Author

Codex round 4:

# Sev Finding Outcome
1 P2 Hidden fields gathered from every form, so a second form's token wins Fixing, simplified: the fields of the form whose action is the posted path; otherwise all, first name wins. formaction is not modelled, by design
2 P2 An export total of "NaN" reads missing, not failed Fixing: a non-finite or unparseable total fails capacity

…ails

Codex round 4 on the quality reader:

- Hidden fields are read per form: a post carries the fields of the first
  form whose action resolves to its path, else the page's first of each
  name; `formaction` is not read, by design.
- An export total that is not a finite amount, NaN or Infinity, fails the
  500-line probe as malformed output, never reads missing.
- Stand-in pages carry a sign-out form with another token, before the
  main form on the products page and after it elsewhere; mode `unpriced`
  exports its total as NaN.

Refs #119.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DpT5xQh3AgRFs2tJwMT4g3
@braboj

braboj commented Nov 15, 2026

Copy link
Copy Markdown
Contributor Author

Round 4 fixes pushed (75b34fe): a post carries its own form's token; a NaN total fails capacity.

@braboj

braboj commented Nov 15, 2026

Copy link
Copy Markdown
Contributor Author

Codex round 5: two P2s, fixing — a SQLite file URI on Windows misread as a stray path (coexistence false fail); an app pricing no lines passed the one-fifth check (now needs a positive total).

Codex round 5 on the quality reader:

- A database opened by a `file:` URI is read back to the path it names,
  its query dropped, its escapes undone, `/C:/...` read as a drive, so an
  isolated build no longer reads as writing outside its folder.
- The 500-line total must be positive before it is scaled: every line is
  a Seed pack at six or more, which costs more than nothing.
- Stand-in modes open their databases by URI with `?mode=rwc`; mode
  `free` prices every line at nothing while exporting all 500.

Refs #119.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DpT5xQh3AgRFs2tJwMT4g3
@braboj

braboj commented Nov 15, 2026

Copy link
Copy Markdown
Contributor Author

Codex round 6: two P2s. (1) Any amount on the page could stand in for the total: by design, amounts are now read only from the JSON export, at 500 and 100 lines; pages are read for answering. (2) A writer outliving its join could trip the next probe: concurrent writes runs last, and a hung writer fails it.

braboj and others added 2 commits November 15, 2026 20:50
Codex round 6 on the quality reader:

- Capacity reads no amount from HTML: the 500-line invoice previews,
  saves and renders 2xx; its export lists every line with a finite,
  positive total; a 100-line invoice of its first lines, saved alone,
  exports a fifth of that total within a cent.
- The separator parser and the page-total stand-ins go.
- Concurrent writes run last, on a fresh instance of their own: a writer
  the build hangs fails them and stops the run, every reading before it
  kept; no product fuzzing stored reaches them.
- Stand-in modes `hanging` and `poisoned`; the self-test waits 5 s for a
  writer.

Refs #119.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DpT5xQh3AgRFs2tJwMT4g3
- The comment above the fuzz rule states that only the malformed
  requests' own answers are read, never a later page after one stored an
  extreme value: the spec bounds no price's size, so it defines no answer.

Refs #119.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DpT5xQh3AgRFs2tJwMT4g3
@braboj

braboj commented Nov 15, 2026

Copy link
Copy Markdown
Contributor Author

Round 6 fixes pushed (93a0609, 906548f). Codex round 7:

# Sev Finding Outcome
1 P2 The archive omits quality-scores/ By design here: #184, stacked on this PR, adds it to archive.py and reuse.py
2 P2 A stored extreme price breaks later fuzz cases, which then pass on CSRF rejection Fixing: each case on a fresh app; a form that cannot be reached fails the case

…s form

Codex round 7 on the quality reader:

- Each malformed request goes to a fresh instance on its own database,
  signed in afresh, so no case meets what another stored.
- A case sent with its form's token whose form page does not answer 200
  fails as its form not reached, never as a handled refusal.
- Stand-in mode `unformed` answers 500 on its rules page; `poisoned` now
  passes fuzzing with every case reaching its route.
- On the reference, fuzzing takes about 22 s, 0.47 s a case.

Refs #119.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DpT5xQh3AgRFs2tJwMT4g3
@braboj

braboj commented Nov 15, 2026

Copy link
Copy Markdown
Contributor Author

Round 7 fix pushed (7d04ebe). Codex round 8: three P2s, fixing in this PR — quality readings in the archive and its stamp; quality.py registered with the archive's live-run guard; an export answered 500 no longer passes capacity. (#184 also touches the archive; the stack merges keep one copy.)

…port fails

Codex round 8 on the quality reader:

- archive.py keeps quality-scores/ among its readings, hashed into the
  stamp, refuses to run beside a live quality.py claim, and drops the
  quality reader's leftover environments.
- reuse.py copies a trial's quality reading with it.
- The 500-line probe needs a 2xx export, for both invoices, before it
  reads the lines and the total; stand-in mode `unexported` answers 500
  with valid JSON.

Refs #119.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DpT5xQh3AgRFs2tJwMT4g3
@braboj

braboj commented Nov 15, 2026

Copy link
Copy Markdown
Contributor Author

Round 8 fixes pushed (be75b63). Codex round 9: two P2s, fixing — the save control's formaction is now modelled, so a sign-out form placed first no longer steals the post; writes are watched from before the import, so a handle opened early is seen.

braboj and others added 2 commits November 15, 2026 22:26
…e counts

Codex round 9 on the quality reader:

- A post carries the fields of the form that sends it there: by its
  action, or by a submit control's `formaction`, a control outside the
  form linked by its `form` id included.
- Every file opened to write is recorded from before the package's
  import; co-existence fails on any outside the workspace and the
  reader's database root, read again as the run ends.
- The temporary folder is asked for before the watch, so the standard
  library's own scratch-file test is not read as the build's.
- Stand-ins put the sign-out form before the main form; `detached` and
  `plain-save` pass; `stray` writes through a handle opened at import.

Refs #119.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DpT5xQh3AgRFs2tJwMT4g3
…led at once

Codex round 10 on the quality reader:

- Co-existence needs a 2xx product list from both instances before it
  compares them; a list that does not answer fails the probe.
- A write outside the workspace and the reader's database root is filed
  to the report the moment it is seen, and the reader folds it into
  co-existence, so a run killed later keeps it.
- Stand-in modes `unlisted` (the second instance's list answers 500) and
  `late-stray` (writes outside on its first malformed request, then
  hangs).

Refs #119.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DpT5xQh3AgRFs2tJwMT4g3
@braboj

braboj commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

Codex round 10 (gpt-6-astra, high): 2 findings, both fixed in 41aca91.

Sev Finding Outcome
P2 Coexistence passed when the second instance's product list answered 500 Fixed: both lists must answer 2xx; stand-in mode unlisted
P2 A stray write was lost if the run was killed later Fixed: strays saved as seen; stand-in mode late-stray

Quality self-test 53/53, trace 0 problems. Round 11 running.

🤖 Generated with Claude Code

braboj and others added 2 commits November 16, 2026 08:33
…se is no write

Codex round 11 on the quality reader:

- A trial whose source tree is not present, as an archived round leaves
  it, has every probe missing with "source tree not present"; nothing is
  installed and the tree is not restored.
- A database opened by a `file:` URI with `mode=ro` is traced but not
  read as a write, so it is no stray for co-existence.
- Stand-in mode `reader` reads a database outside its folder read-only
  and passes.

Refs #119.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DpT5xQh3AgRFs2tJwMT4g3
…ay alone

- "a slowed app reads slower by its delay" now needs each repeat's p95 of
  the 20 ms-delayed stand-in to be at least 20 ms, and no longer compares
  it with the sound run's, which read the machine's load.

Refs #119.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DpT5xQh3AgRFs2tJwMT4g3
@braboj

braboj commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

Codex round 11 (gpt-6-astra, high): 2 findings, both fixed in ab0c9c8.

Sev Finding Outcome
P2 A trial whose tree was dropped by archiving read every probe as lost Fixed: reads missing, "source tree not present"
P2 A read-only SQLite URI (mode=ro) counted as a stray write Fixed: ro records no write; stand-in mode reader

Also 9d82672: the latency self-test checks each slowed p95 is at least its 20 ms delay, no longer against the sound run (machine load made it flaky).

Self-test 55/55, trace 0 problems. Round 12 running.

🤖 Generated with Claude Code

Codex round 12 on the quality reader:

- Every redirect's `Location` is resolved against the path the answer
  was asked on, with `urljoin`, before it is matched or fetched, so a
  relative `invoices/1` after `POST /invoices` names the invoice page; the
  sign-in's redirect is read the same way.
- Stand-in mode `relative` answers a save with that relative form and
  reads as the sound app on capacity, N+1 and latency.

Refs #119.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DpT5xQh3AgRFs2tJwMT4g3
@braboj

braboj commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

Codex round 12 (gpt-6-astra, high): 1 finding, fixed in 70e5755.

Sev Finding Outcome
P2 A relative Location: invoices/1 after saving was rejected Fixed: every redirect resolved with urljoin; stand-in mode relative

Self-test 56/56, trace 0 problems. Round 13 running.

🤖 Generated with Claude Code

@braboj

braboj commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

Codex round 13 (gpt-6-astra, high): no findings.

🤖 Generated with Claude Code

braboj and others added 2 commits November 16, 2026 10:25
…ters

- The self-test shortened the reader's wait for concurrent writers to
  5 s for every stand-in mode; under load a sound stand-in's 40 writes
  could outlast it, read as hung, and fail a mode's "no other probe"
  check. The short wait now applies to the `hanging` mode alone; every
  other mode keeps the reader's own 120 s.

Refs #119.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DpT5xQh3AgRFs2tJwMT4g3
- The `late-stray` check kills its run in fuzzing to prove a stray write
  survives the kill. At 40 s a slow or loaded runner could be killed
  before co-existence ran, so the check would read the machine; at 120 s
  it has ample margin. What the check asserts is unchanged.

Refs #119.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DpT5xQh3AgRFs2tJwMT4g3
braboj added a commit that referenced this pull request Nov 16, 2026
…so-targets

- `archive.py` and `reuse.py` take #181's versions whole: one
  `quality-scores` in each `READINGS`, `quality.py` in `AREA_TOOLS`, and
  #181's checks in place of this branch's duplicates.
- FR-13-21 keeps the reuse rule, now covered by #181's reuse check.
- A report check builds readings with quality.py's own functions, so the
  quality targets read its lost and missing states, a gone source tree, and
  the 500-line probe as the reader files them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DpT5xQh3AgRFs2tJwMT4g3
@braboj

braboj commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

Two self-test flakes fixed after round 13 (no rule changed):

Commit Flake Fix
297da26 The 5 s write wait applied to every stand-in; under load the concurrent writes read hung beside the mode's own probe 5 s only for hanging; others use the reader's 120 s
1e06346 late-stray killed at 40 s could stop before coexistence on a slow runner Kill at 120 s

Self-test 56/56 three runs in a row. Round 14 running.

🤖 Generated with Claude Code

@braboj

braboj commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

Codex round 14 (gpt-6-astra, high): no findings.

🤖 Generated with Claude Code

@braboj
braboj changed the base branch from fix/web-probe-signs-in to main November 17, 2026 05:40
@braboj
braboj merged commit 15bf525 into main Nov 17, 2026
2 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