Skip to content

Runs of steps judged from two built states; the whole way takes the noise of its steps - #22

Open
mklarmann wants to merge 11 commits into
first-versionfrom
step-ranges
Open

mklarmann wants to merge 11 commits into
first-versionfrom
step-ranges

Conversation

@mklarmann

@mklarmann mklarmann commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

sentier-diagnostics PR #22, on first-version (where #20 and #21 were merged; merged in at 9bbb9c2). Head 3ed06c0. Reviewer: the sentier-diagnostics session (Manuel: we review each other's PRs for now); Manuel merges.

The request: choose several fixes at the top of the page and have everything below show what they did together. The first version of this PR precomputed runs into the file; the second had the page add up any steps, apart ones too. Both are replaced. Manuel decided that any set of fixes comes from one base with fixes measured on their own (SPEC §16, proposed in #23, validator in #24). This PR keeps what a chain can answer exactly: one step, a run of steps, the whole way.

Summary

 file
+  states[k].noise = {measured, between, by, note}  # two builds of that state; never on the published results (exact)
   steps:  [s0, s1, ..., sn]
-  steps[k].noise: declared on the step
+  steps[k].noise: n(state k) + n(state k+1), between null, held to its states
-  ranges: [...]                              # precomputed runs, gone
   rule:   {floors, total_tolerance, ...,
+          total_noise: {indicator: share}}   # n(first state) + n(last state)
   items[].classes[indicator] = [s0, ..., sn, total]   # total is last again
 matrix
-  of.ranges, range codes                     # gone
   values = [state0, "=", "=", state3, ...]   # "=": bit-identical to the state before

What the page compares on a chain:

one step     -> the file's own classes and counts
whole way    -> the file's own, judged with rule.total_noise
run a..b     -> judged by the page from two built states: values[a] against values[b+1]
                tolerance = largest of the run, noise = n(state a) + n(state b+1), no inner state
                no verdict; needs every item (the matrix)
                first: each step of the run re-judged on every item, must match the file, else refused
steps apart  -> refused, with the reason (a step's difference was measured on every step before it)

The selector, built to scale:

<picker>
  "Every step: N" / "k of N steps"           [Find and choose steps]
  <strip>  The whole way | one thin cell per step (bar = values moved alone, log)
           click: one step · Shift (or Cmd/Ctrl): a run from the step chosen before
           arrows: next step · Shift+arrows: grow or shrink the run
           chosen cells filled and underlined, so a run reads as a band at any density
  <list>   search by number, name or kind · "only steps where something moved"
           rows: click one, Shift a run · a heading per group of one kind chooses its run
address:   #step=<id> · #steps=<first>:<last> · &item=<id>

Under the strip, a run says the two states it lies between, each step's claim with what moved in it alone, the quiet steps folded into one line ("Steps 5 to 9: nothing moved in any of them, as each claims."), its tolerance and its noise.

Docs: SPEC §3 "A run of steps" and "Steps apart are not compared on a chain", §4.2, §4.4, §4.5 ("="), §5.3 (total noise, Manuel's ruling), §10 and §10.1a, A28, A29. GLOSSARY: whole way, run of steps.

Noise belongs to a state (Manuel, 17 November 2026; sum: also his ruling). Rebuilding both ends of a comparison moves its difference by up to the sum of their noise; a state inside a run adds nothing, as the pair holds none of its results. sentier-agribalyse found why it matters: with the largest noise of any step, upstream main's 21 % water noise (an inner state) put 1,504 of 2,451 real differences from the published results "within noise" (A30).

Evidence

  • tests/test_boundaries.py (new) writes tests/fixtures/boundaries.json: 813 pairs on, just under and just over every edge of rule.judge (tolerance, noise, floor, sign crossing, ten times, every band edge, factors too large for a float, subnormals), mirrored and below zero. The node suite holds the page's port to every one.
    • Mutation probes on the port: <=→< at the tolerance (6 cases fail), the noise (4), the floor (50), a band edge (32), ten times (16). One survivor: the subnormal branch of distance, which orders the worst list and changes no class.
  • A run's tolerance is the largest of its steps: a chain of steps at 1e-5, 1e-2 and 1e-5 where an item moves by 5e-3 in the first (mixed_tolerances, in the fixture). It differs in that step and agrees in the run of the first two. Taking the smallest instead fails the Python suite (2 tests) and the node suite (1).
  • tests/test_together.py:
    • TotalNoise: the whole way takes the largest measured noise; a 2 % move within a 3 % step noise stays "within noise" over the whole way; nobody measured means no noise; the validator refuses a wider, missing, non-share or unknown total_noise; dropping total_noise_level makes the validator and the matrix refuse; a file made before still reads.
    • Matrix: "=" round-trips; only bit-identical results become "="; "=" first, after null, or another word is refused.
    • Together: a run equals the rule on its two states, item by item; no verdict; closer/further only without step 0; one step, every step and reversed runs are refused; the fixture holds every run of the local example.
  • tests/js/page.test.js: page counts and grid classes equal the Python fixture for all 5 runs; steps apart from an address are refused and said; Shift and Cmd make runs; list rows and group headings; search and moved filter; no matrix: said, one step remains; a step whose file classes disagree refuses its runs; ids with , and : survive the address; quiet steps fold, with and without claims.
  • Noise per state, StateNoise and Together:
    • A step takes the sum of its two states' noise.
    • Noise in inner states only gives the whole way none: n differs over the whole way, as in sentier-agribalyse's case.
    • Noise at an end puts n within noise over the whole way (A28 still holds).
    • A run whose two ends measured 3 % and 1 % takes 4 %: q, which moved by 3.4 %, is within noise there and differs in its own step. It is in tests/fixtures/together.json, and the page is held to it.
    • The published results are exact.
    • The validator refuses:
      • a wider or missing total_noise;
      • a step noise that isn't its states';
      • a step noise that names builds;
      • noise on the published results;
      • noise on some built states only;
      • a total_noise in a file whose states carry none.
    • A file made before still reads.
  • Mutation probes, each caught:
    • sum → max: Python 6 failures, node 3;
    • the run's end one state off: Python 2, node 2;
    • a run without noise: Python 3, node 2.
  • The example: the only class that moved is oats' water use in Rebuilt (two builds of one commit), from differs to within noise. total_noise goes from water 2.4 % to none, since the whole way runs from the published results (exact) to Mapping 2 (not measured).
  • Review of the noise format (sentier-diagnostics): 18 mutations, 16 caught. The two left (ends_known without its indicator check, the summary's end count) are now caught in Python too, from a built file. Python and the page agree bit for bit on 2,000 random pairs of ends.
  • Runs: Python 215 OK, Node 82 pass.
  • Browser, local only, on sentier-bafu's 15-step chain over BAFU:2026 v1 (11,947 datasets × 25 indicators, matrix loaded): runs judged, #steps=0001,0003 refused with the reason, list Shift-click makes a run. On a made-up 300-step page: the strip fits and marks a run as a band; phone width shows no sideways scroll of the page.
  • Sizes on that chain with 200 listed: file 6.1 MB (15.2 MB with precomputed ranges), matrix 45.2 MB (64.9 MB).

Not checked: keyboard use of the list with a screen reader; the noise wording in a browser (checked through the node DOM only).

Merge Danger

Door: two-way

Unversioned before 0.1.0. The precomputed ranges were never merged, so no file outside this branch carries them. rule.total_noise is optional on read: files made by #21 still check and are judged as written.

The other way does not hold: a reader on #21's code refuses #22's files. Its validator refuses the rule ("rule is not {beyond, floor_factor, floors, floors_from, total_tolerance}") and the matrix ("not one finite number or null per indicator and state", for every "="). So a reader updates with its writer. The same holds for noise: states are read strictly, so a #21 or #22-era reader refuses a file whose states carry noise.

Producers must move noise from steps to states:

  • chain.step(noise=...) raises, and says to give the noise to chain.state;
  • a tables description with noise on a step is refused the same way;
  • the published results take none.

sentier-bafu and sentier-agribalyse write their noise per step today, so both producers need that change before they can build with this version. Files they built with c1b8477 carry total_noise without state noise, and the validator now refuses them.

Blast Radius: page

A producer that declares noise on a step fails on its next build until it moves that noise to the state built twice: chain.step(noise=...) raises, and so does a step's noise in a tables description. A producer that declares none builds as before, with every build "not measured". No host on disk styles the old chips (.sd-chips; searched sentier-bafu, sentier-agribalyse, sentier-bafu-agribalyse). sentier-agribalyse's local review view was built from the first version of this PR and needs a rebuild.

🤖 Generated with Claude Code

mklarmann and others added 2 commits November 17, 2026 03:52
A reviewer of a chain of fixes asks what some of them did together. A range is
a run of at least two consecutive steps, short of every step: the state before
its first step against the state after its last, judged as the whole way is
(largest tolerance of its steps, no noise, no verdict). Its classes come from
the rule on those two states, never from a sum of steps: two moves of 0.8 %
under a 1 % tolerance agree one by one and differ together.

- chain: `ranges=` ("all", (first, last) pairs, None, "auto": all up to 8
  steps); `ranges_within`; pairs held as references to a few dozen judgments,
  so 16 states x 66 ranges x 25 indicators x 12k items fit in memory.
- format: `ranges`, `counts.ranges`, one class/direction/band per range on
  every item after the total; the validator works each out again and counts
  range-only moves as worth a look. Mutation probes in tests/test_ranges.py.
- matrix: `of.ranges`, a code per range, and "=" for a result equal to the
  state before it (a chain of fixes would otherwise hold every number 16
  times); a "=" first in an indicator or after a missing result is refused.
- description: `ranges` ("all", "none", pairs, {"within": [a, b]}).
- page: Shift-click (or Shift+arrow) for the steps from one to another, ⌘/Ctrl
  to add or take off an end, a "Several steps" switch for touch. Steps apart
  take in those between, hatched and said; a run the file does not compare is
  said and changes nothing. The matrix, distributions, worst list and drawer
  follow the range from the file's own counts. `#step=first..last`.
- SPEC sections 3, 4.2, 4.5, 5.3, 10; A28, A29; GLOSSARY "Range".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…to one line

A Shift-click chose only the two ends of a run, so the steps between were
hatched as if taken in, and so did a run opened from an address. Now Shift
and an address choose every step of the run; only steps between two
chosen with ⌘ or Ctrl are hatched.

In a run's line, two or more steps with a claim where nothing moved and
nothing was judged fold into one line that opens to each. A run of twelve
fixes where one moves something now reads as that one, and one line for
the rest.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mklarmann
mklarmann requested a review from lbougan November 17, 2026 03:13
mklarmann and others added 3 commits November 17, 2026 04:15
…he default warns

Two states had collapsed into one silence: a file whose producer asked for
no ranges and a file made before ranges existed both left the key out.
Now a file holds `ranges: []` (and `counts.ranges: {}`) where none was
asked for, and only an older file leaves the key out. The page says which
of the two it is when a reader asks for several steps.

A chain that gained a ninth step lost every range under the default
without anyone choosing it. The build now warns when the default leaves a
chain without ranges, naming the ways to ask for them. Both points from
the sentier-diagnostics session's review.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s reads with its file

A file made before ranges was accepted, its matrix refused: of.ranges was
required. Now a matrix mirrors its file: of.ranges is [] where none was
asked for and left out where the file was made before ranges, and a
matrix of one kind is never taken for a file of the other. Found in review
by the sentier-diagnostics session.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… of its steps

Precomputed ranges are gone from the file and the matrix. The page composes any
set of steps from every item's results instead: an item's pair is its result
before the first chosen step and that result with each run's difference added;
a single run is exactly its two states. It judges the pair with the rule ported
from rule.py, after holding every chosen step to the file's own classes, and
refuses a set whose steps disagree. together.py is the Python reference, and
tests/fixtures/together.json holds the counts the page is held to.

The whole way (and any set) takes, per indicator, the largest noise measured in
its steps: rule.total_noise, checked by the validator and the matrix. A file
made before has none and is judged as it was written.

The chips are replaced by a strip (one thin cell per step, Shift for a run, Cmd
or Ctrl to add one) and a list to find and tick steps by number, name or kind,
grouped by kind, with "only steps where something moved". The address names any
set: #steps=<id>:<id>,<id>.

The matrix writes a result equal to the one before it as "=".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mklarmann mklarmann changed the title Ranges: choose several steps at the top, and the page shows them together Any set of steps: the page composes it; the whole way takes the noise of its steps Nov 17, 2026
The page no longer adds up the differences of steps apart. A step's difference
was measured with every step before it applied, and an LCA result is not
linear in the technosphere, so a sum would use differences measured in a state
the set never had. Any set of fixes belongs to a file of fixes measured on one
base (SPEC section 16, proposed in #23).

On a chain the page compares one step, a run of consecutive steps, or the
whole way. A run is judged from the state before its first step and the state
after its last, with the largest tolerance and the largest measured noise of
its steps. Steps apart, from an address, are refused and the reason is said.

The strip and the list choose one step, or with Shift (or Cmd or Ctrl) a run;
a group heading chooses its run. The ticks and "the steps where something
moved" are gone, since both made steps apart.

The page's port of rule.judge is now held to 813 pairs on every edge of the
rule, written by tests/test_boundaries.py: the tolerance, the noise, the floor,
a sign crossing, ten times, every band edge, factors too large for a float and
subnormal results, mirrored and below zero. Probes that turn one comparison of
the port from <= to < are caught.

together.py judges a run (first, last), and tests/fixtures/together.json holds
every run of the local example.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mklarmann mklarmann changed the title Any set of steps: the page composes it; the whole way takes the noise of its steps Runs of steps judged from two built states; the whole way takes the noise of its steps Nov 17, 2026
The fixture gave every step a tolerance of 1 %, so a page or a reference that took the
smallest tolerance of a run passed both suites (found in review). A chain of three steps at
1e-5, 1e-2 and 1e-5, where an item moves by 5e-3 in the first, is now in
tests/fixtures/together.json: the item differs in that step and agrees in the run of the
first two. Taking the smallest fails the Python suite (2 tests) and the node suite (1).

The page's compose and composeSaid are judgeRun and runRefused: nothing is summed on a
chain, and "compose" is section 16's word for a set of fixes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mklarmann
mklarmann changed the base branch from page-review to dashboard-page November 17, 2026 05:24
Decided by Manuel on 17 November 2026, after sentier-agribalyse found the largest noise of
any step putting 1,504 of 2,451 real water differences "within noise": the noise came from
upstream main, a state inside the whole way, whose pair holds none of its results.

- `states[k].noise` {measured, between, by, note}: two builds of that state. Every build
  carries it; the published results never do (exact).
- A step's noise is the sum of its two states', written with `between` null and held to
  them by the validator. A run takes the sum of its two end states', the whole way
  (`rule.total_noise`) that of the first and last; a state inside adds nothing. Rebuilding
  both ends moves a difference by up to the sum of their noise.
- `chain.step(noise=...)` and a step's `noise` in a tables description are refused with
  where the noise goes now. A file made before keeps its steps' own noise; its runs and its
  whole way are judged without noise, and a `total_noise` in it is refused.
- The page and the summary say each end: exact, measured, not measured, and "measured at
  1 of 2 ends".
- The example's two builds of commit 0000002 (With fix 1, Rebuilt) carry the noise: oats'
  2.4 % in Rebuilt is now within noise; the whole way has none.
- SPEC 3, 4, 5.3 (with the reasoning), A28, A30; GLOSSARY.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mklarmann
mklarmann changed the base branch from dashboard-page to first-version November 17, 2026 05:36
mklarmann and others added 2 commits November 17, 2026 06:36
…ts that tell

- The summary counted the ends over the indicators measured, so an end built twice with no
  result beyond the floor (by: {}) lost "measured at 1 of 2 ends" and read "in both builds"
  for a state never built twice. It now counts the ends that measured at all, and says "where
  it was measured" for a noise taken from two states.
- Python now tells an end that measured one indicator from one that measured another
  (`ends_known`), and reads "measured at 1 of 2 ends" from a built file; dropping either
  fails one test each (node already caught both).
- The run guard's node test rewrites an item the file does not list: since #20 a listed
  item that is not the file's refuses the matrix before a run is judged.
- SPEC 4: a step's noise reads measured whether one end or both measured; A30 after A29.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mklarmann added a commit that referenced this pull request Nov 17, 2026
… review

Noise belongs to a build, as it belongs to a state (SPEC 5.3, Manuel: "sum, go ahead"):
- the base's noise is its state's (`of.base_noise`, left out where the base is the
  published results, which are exact), held to the diagnostics file; a diagnostics
  file whose states carry no noise is refused;
- a fix is judged with the noise of its build and of the build it was measured against;
- a set takes the sum, over its fixes, of both (the base once for each fix measured
  against it), or the noise of a build it takes a result from and the base's, where
  larger; it says at how many builds the noise is known;
- a built set is held to its sum with the noise of every build both sides stand on,
  and to its state with its own noise and the state's.

The matrix of #22 writes a result equal to the one before as "=": the base and the
state check read it written out.

From sentier-bafu's review as producer (12 fixes and the release, written from its chain):
- `largest` is the rule's own measure, the smallest tolerance under which a built pair
  agrees with its sum (`size_of`); "no size" where none is enough, apart from null (not
  measured); a pair with no size must be built, and its build must have none;
- the kinds of pair are in their order of precedence: same entry first;
- an item a fix brings in a unit no item of the chain has takes a floor of 0 from nothing;
- SPEC 16: effects on the base's route, results read exactly, reach counted on the build
  with both fixes, the premise of the list of pairs for fixes that edit data.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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