@lapxo/obligations 0.4.0 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/README.md +32 -2
  2. package/TARGET.bound +151 -30
  3. package/dist/lattice/obligatory.js +29 -1
  4. package/dist/measures/capacity.d.ts +324 -0
  5. package/dist/measures/capacity.js +184 -0
  6. package/dist/measures/coincidence.d.ts +111 -0
  7. package/dist/measures/coincidence.js +81 -0
  8. package/dist/measures/confidence.d.ts +73 -0
  9. package/dist/measures/confidence.js +52 -0
  10. package/dist/measures/error-events.js +23 -4
  11. package/dist/measures/fitting.d.ts +1 -1
  12. package/dist/measures/index.d.ts +8 -0
  13. package/dist/measures/index.js +4 -0
  14. package/dist/measures/unanimity-fit.d.ts +156 -0
  15. package/dist/measures/unanimity-fit.js +133 -0
  16. package/docs/img/cell.svg +28 -0
  17. package/docs/img/logo-fork.svg +6 -0
  18. package/docs/img/logo.svg +6 -0
  19. package/docs/img/price.svg +28 -0
  20. package/docs/img/thermometer.svg +28 -0
  21. package/docs/img/withdrawal.svg +28 -0
  22. package/docs/learn/in-phase.md +46 -0
  23. package/docs/learn/price.md +52 -0
  24. package/docs/learn/signature.md +50 -0
  25. package/docs/learn/thermometer.md +58 -0
  26. package/docs/learn/withdrawal.md +51 -0
  27. package/docs/measures.md +64 -0
  28. package/docs/paper.md +233 -0
  29. package/docs/reference.md +495 -0
  30. package/package.json +1 -1
  31. package/receipts.bound +138 -70
  32. package/samples/measures/capacity.json +71 -0
  33. package/samples/measures/coincidence.json +624 -0
  34. package/samples/measures/common-cause-capacity.json +48 -0
  35. package/samples/measures/confidence/union-bound.json +54 -0
  36. package/samples/measures/confidence.json +70 -0
  37. package/samples/measures/decisions.json +66 -0
  38. package/samples/measures/t12/common-cause.json +32 -0
  39. package/samples/measures/tolerant-count.json +144 -0
  40. package/samples/measures/unanimity-fit.json +166 -0
  41. package/samples/no/installed-artifact.json +19 -3
  42. package/samples/yes/installed-artifact.json +42 -6
  43. package/vectors/measures/capacity.cli.json +97 -0
  44. package/vectors/measures/coincidence.cli.json +97 -0
  45. package/vectors/measures/common-cause-capacity.cli.json +97 -0
  46. package/vectors/measures/confidence/expected.json +26 -0
  47. package/vectors/measures/confidence.cli.json +97 -0
  48. package/vectors/measures/decisions.cli.json +97 -0
  49. package/vectors/measures/descent.cli.json +19 -70
  50. package/vectors/measures/implementation-042.json +86 -0
  51. package/vectors/measures/implementation.json +82 -0
  52. package/vectors/measures/installed-artifact.cli.json +8 -8
  53. package/vectors/measures/m3.cli.json +19 -70
  54. package/vectors/measures/observations.cli.json +19 -70
  55. package/vectors/measures/spectrum.cli.json +18 -69
  56. package/vectors/measures/t12/expected.json +35 -0
  57. package/vectors/measures/tolerant-count.cli.json +97 -0
  58. package/vectors/measures/unanimity-fit.cli.json +97 -0
  59. package/vectors/measures/unanimity.cli.json +19 -70
  60. package/samples/measures/m3-reader.mjs +0 -732
  61. package/samples/measures/reader.mjs +0 -424
@@ -0,0 +1,28 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 178" width="640" height="178" role="img" aria-labelledby="title desc">
2
+ <title id="title">A cell</title>
3
+ <desc id="desc">Two origins on one scale: seller claims 2 to 9 and buyer claims 5 to 12; what they hold together runs from a floor of 5 to a ceiling of 9.</desc>
4
+ <style>
5
+ text{font:14px ui-sans-serif,-apple-system,"Segoe UI",Helvetica,Arial,sans-serif;fill:#59636e}
6
+ .claim{fill:#8c959f}.held{fill:#2da44e}.pole{fill:#2da44e;font-weight:600}.axis,.tick{stroke:#8c959f;stroke-width:1}.touch{stroke:#2da44e;stroke-width:1;stroke-dasharray:3 3}
7
+ @media (prefers-color-scheme:dark){text{fill:#9198a1}}
8
+ </style>
9
+ <line class="touch" x1="269.3" y1="12" x2="269.3" y2="126"/>
10
+ <line class="touch" x1="442.7" y1="12" x2="442.7" y2="126"/>
11
+ <text x="82" y="32" text-anchor="end">seller</text>
12
+ <rect class="claim" x="139.3" y="18" width="303.4" height="18" rx="4"/>
13
+ <text x="82" y="66" text-anchor="end">buyer</text>
14
+ <rect class="claim" x="269.3" y="52" width="303.4" height="18" rx="4"/>
15
+ <text x="82" y="100" text-anchor="end">held</text>
16
+ <rect class="held" x="269.3" y="86" width="173.4" height="18" rx="4"/>
17
+ <line class="axis" x1="96" y1="126" x2="616" y2="126"/>
18
+ <line class="tick" x1="139.3" y1="126" x2="139.3" y2="131"/>
19
+ <text x="139.3" y="148" text-anchor="middle">2</text>
20
+ <line class="tick" x1="269.3" y1="126" x2="269.3" y2="131"/>
21
+ <text x="269.3" y="148" text-anchor="middle">5</text>
22
+ <line class="tick" x1="442.7" y1="126" x2="442.7" y2="131"/>
23
+ <text x="442.7" y="148" text-anchor="middle">9</text>
24
+ <line class="tick" x1="572.7" y1="126" x2="572.7" y2="131"/>
25
+ <text x="572.7" y="148" text-anchor="middle">12</text>
26
+ <text class="pole" x="269.3" y="168" text-anchor="middle">floor</text>
27
+ <text class="pole" x="442.7" y="168" text-anchor="middle">ceiling</text>
28
+ </svg>
@@ -0,0 +1,28 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 228" width="640" height="228" role="img" aria-labelledby="title desc">
2
+ <title id="title">A cell</title>
3
+ <desc id="desc">Four origins on one scale: a claims 19.8 to 20.2, b claims 19.9 to 20.3, c claims 19.7 to 20.1 and d claims 24 to 24.4; their claims do not meet.</desc>
4
+ <style>
5
+ text{font:14px ui-sans-serif,-apple-system,"Segoe UI",Helvetica,Arial,sans-serif;fill:#59636e}
6
+ .claim{fill:#8c959f}.held{fill:#2da44e}.pole{fill:#2da44e;font-weight:600}.axis,.tick{stroke:#8c959f;stroke-width:1}.touch{stroke:#2da44e;stroke-width:1;stroke-dasharray:3 3}
7
+ @media (prefers-color-scheme:dark){text{fill:#9198a1}}
8
+ </style>
9
+ <text x="82" y="32" text-anchor="end">a</text>
10
+ <rect class="claim" x="181.4" y="18" width="31" height="18" rx="4"/>
11
+ <text x="82" y="66" text-anchor="end">b</text>
12
+ <rect class="claim" x="189.1" y="52" width="31.1" height="18" rx="4"/>
13
+ <text x="82" y="100" text-anchor="end">c</text>
14
+ <rect class="claim" x="173.6" y="86" width="31.1" height="18" rx="4"/>
15
+ <text x="82" y="134" text-anchor="end">d</text>
16
+ <rect class="claim" x="507.3" y="120" width="31.1" height="18" rx="4"/>
17
+ <text x="82" y="168" text-anchor="end">held</text>
18
+ <text x="96" y="168">their claims do not meet</text>
19
+ <line class="axis" x1="96" y1="194" x2="616" y2="194"/>
20
+ <line class="tick" x1="173.6" y1="194" x2="173.6" y2="199"/>
21
+ <text x="173.6" y="216" text-anchor="middle">19.7</text>
22
+ <line class="tick" x1="204.7" y1="194" x2="204.7" y2="199"/>
23
+ <text x="204.7" y="216" text-anchor="middle">20.1</text>
24
+ <line class="tick" x1="507.3" y1="194" x2="507.3" y2="199"/>
25
+ <text x="507.3" y="216" text-anchor="middle">24</text>
26
+ <line class="tick" x1="538.4" y1="194" x2="538.4" y2="199"/>
27
+ <text x="538.4" y="216" text-anchor="middle">24.4</text>
28
+ </svg>
@@ -0,0 +1,28 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 178" width="640" height="178" role="img" aria-labelledby="title desc">
2
+ <title id="title">A cell</title>
3
+ <desc id="desc">Two origins on one scale: a claims 2 to 9 and b claims 5 to 12; what they hold together runs from a floor of 5 to a ceiling of 9.</desc>
4
+ <style>
5
+ text{font:14px ui-sans-serif,-apple-system,"Segoe UI",Helvetica,Arial,sans-serif;fill:#59636e}
6
+ .claim{fill:#8c959f}.held{fill:#2da44e}.pole{fill:#2da44e;font-weight:600}.axis,.tick{stroke:#8c959f;stroke-width:1}.touch{stroke:#2da44e;stroke-width:1;stroke-dasharray:3 3}
7
+ @media (prefers-color-scheme:dark){text{fill:#9198a1}}
8
+ </style>
9
+ <line class="touch" x1="269.3" y1="12" x2="269.3" y2="126"/>
10
+ <line class="touch" x1="442.7" y1="12" x2="442.7" y2="126"/>
11
+ <text x="82" y="32" text-anchor="end">a</text>
12
+ <rect class="claim" x="139.3" y="18" width="303.4" height="18" rx="4"/>
13
+ <text x="82" y="66" text-anchor="end">b</text>
14
+ <rect class="claim" x="269.3" y="52" width="303.4" height="18" rx="4"/>
15
+ <text x="82" y="100" text-anchor="end">held</text>
16
+ <rect class="held" x="269.3" y="86" width="173.4" height="18" rx="4"/>
17
+ <line class="axis" x1="96" y1="126" x2="616" y2="126"/>
18
+ <line class="tick" x1="139.3" y1="126" x2="139.3" y2="131"/>
19
+ <text x="139.3" y="148" text-anchor="middle">2</text>
20
+ <line class="tick" x1="269.3" y1="126" x2="269.3" y2="131"/>
21
+ <text x="269.3" y="148" text-anchor="middle">5</text>
22
+ <line class="tick" x1="442.7" y1="126" x2="442.7" y2="131"/>
23
+ <text x="442.7" y="148" text-anchor="middle">9</text>
24
+ <line class="tick" x1="572.7" y1="126" x2="572.7" y2="131"/>
25
+ <text x="572.7" y="148" text-anchor="middle">12</text>
26
+ <text class="pole" x="269.3" y="168" text-anchor="middle">floor</text>
27
+ <text class="pole" x="442.7" y="168" text-anchor="middle">ceiling</text>
28
+ </svg>
@@ -0,0 +1,46 @@
1
+ # In phase
2
+
3
+ A claim carries a size and a direction, how much it narrows and the turn it landed on, and a withdrawal is the same size the other way: two hundred claims in phase make the square of their number and the same two hundred strewn make its order, while a write and its withdrawal at one epoch leave nothing and at different epochs do not cancel.
4
+
5
+ ## Run it
6
+
7
+ ```ts
8
+ import { coherence, interfere } from '@lapxo/obligations/views/field';
9
+
10
+ const span = { lo: 0, hi: 0 };
11
+ let held = 11;
12
+ const next = (): number => { held = (held * 1103515245 + 12345) % 2147483648; return held / 2147483648; };
13
+ const together = Array.from({ length: 32 }, (_, i) => ({ origin: `o${i}`, epoch: 8, span }));
14
+ const strewn = Array.from({ length: 32 }, (_, i) => ({ origin: `o${i}`, epoch: Math.floor(next() * 8), span }));
15
+
16
+ console.log('in phase ', interfere(together, 8), 'coherence', coherence(together, 8).toFixed(2));
17
+ console.log('strewn ', interfere(strewn, 8).toFixed(0), 'coherence', coherence(strewn, 8).toFixed(2));
18
+ console.log('their number is 32, and its square is', 32 ** 2);
19
+ console.log('why claims that land at one turn of the period add as the square of their number, and the same claims strewn across it add as its order');
20
+ ```
21
+
22
+ ```
23
+ in phase 1024 coherence 1.00
24
+ strewn 50 coherence 0.22
25
+ their number is 32, and its square is 1024
26
+ why claims that land at one turn of the period add as the square of their number, and the same claims strewn across it add as its order
27
+ ```
28
+
29
+ Its origins meet.
30
+
31
+ ## What it rests on
32
+
33
+ ```mermaid
34
+ flowchart LR
35
+ c0["coherence"]
36
+ c1["interfere"]
37
+ l0(["amplitude has sign and phase"])
38
+ c0 --> l0
39
+ c1 --> l0
40
+ classDef shown fill:#2da44e,color:#ffffff,stroke:#2da44e
41
+ class l0 shown
42
+ ```
43
+
44
+ ## Source
45
+
46
+ [Its source](../../examples/release/in-phase.ts) is one of the examples of obligations, and it runs as it is written, against the built package, with nothing compiled for it.
@@ -0,0 +1,52 @@
1
+ # Price
2
+
3
+ <p align="center"><img src="../img/price.svg" alt="Two origins on one scale: seller claims 2 to 9 and buyer claims 5 to 12; what they hold together runs from a floor of 5 to a ceiling of 9." width="640"></p>
4
+
5
+ A claim from one origin is potential; a cell is information only where two independent origins touch it and their intervals meet.
6
+
7
+ ## Run it
8
+
9
+ ```ts
10
+ import { chain, disagree, freedom, meetAt, origins, point, unit } from '@lapxo/obligations';
11
+
12
+ const said = (cell: Parameters<typeof meetAt>[0]): string =>
13
+ (origins(cell) < 2 ? 'grey' : disagree(cell) ? 'split' : 'agreed');
14
+
15
+ const price = point('price', 0, [
16
+ { origin: 'seller', span: { lo: 2, hi: 9 } },
17
+ { origin: 'buyer', span: { lo: 5, hi: 12 } },
18
+ ]);
19
+ const scale = chain(Array.from({ length: 16 }, (_, i) => `l${i}`));
20
+
21
+ console.log('verdict ', said(price));
22
+ console.log('they hold ', JSON.stringify(meetAt(price)));
23
+ console.log('still free', freedom(scale, unit('price', { floor: 'l5', ceiling: 'l9' })).toFixed(2), 'bits');
24
+ console.log('why a seller and a buyer are two origins; where their marks meet is a price, and what is left between the marks is what nobody has decided yet');
25
+ ```
26
+
27
+ ```
28
+ verdict agreed
29
+ they hold {"lo":5,"hi":9}
30
+ still free 2.32 bits
31
+ why a seller and a buyer are two origins; where their marks meet is a price, and what is left between the marks is what nobody has decided yet
32
+ ```
33
+
34
+ Its origins meet.
35
+
36
+ ## What it rests on
37
+
38
+ ```mermaid
39
+ flowchart LR
40
+ c0["point"]
41
+ c1["unit"]
42
+ l0(["encounter"])
43
+ l1(["debit in bits"])
44
+ c0 --> l0
45
+ c1 --> l1
46
+ classDef shown fill:#2da44e,color:#ffffff,stroke:#2da44e
47
+ class l0 shown
48
+ ```
49
+
50
+ ## Source
51
+
52
+ [Its source](../../examples/release/price.ts) is one of the examples of obligations, and it runs as it is written, against the built package, with nothing compiled for it.
@@ -0,0 +1,50 @@
1
+ # Signature
2
+
3
+ ```mermaid
4
+ flowchart LR
5
+ c0["cell"]
6
+ c1["meet"]
7
+ c2["sign"]
8
+ l0(["the obligatory"])
9
+ c0 --> l0
10
+ c1 --> l0
11
+ classDef shown fill:#2da44e,color:#ffffff,stroke:#2da44e
12
+ class l0 shown
13
+ ```
14
+
15
+ The object is c = ⟨⊥, ⊤, O, ⊑⟩ over L at r: four parts in two pairs, the value (⊥, ⊤) and the relations (O, ⊑), with the lattice L it is given and the resolution r it is read at belonging to the reading and the sign to the act; an origin is (o, φ), and the poles are read, never stored: ⊥ is what is required joined with what its live claims hold, ⊤ what is signed met with what they allow; eight acts in four pairs and seven names answer for it: meet and join on the ceiling, local, a join only with a witness; observe and withdraw on the floor, local, a withdrawal being an observation at −1 that restores exactly; sign and require on both poles, travelling by rest, commuting and both closing freedom; encounter and refine with no pole; and no widening travels.
16
+
17
+ ## Run it
18
+
19
+ ```ts
20
+ import { intervals } from '@lapxo/obligations/forms';
21
+ import { cell, meet, sign } from '@lapxo/obligations/views/field';
22
+
23
+ const scale = intervals(0, 100);
24
+ const world = [0, 1, 2, 3].map((i) => cell(`c${i}`, 0, [{ origin: `own${i}`, span: { lo: 20 * i, hi: 100 } }], ['ceiling']));
25
+ const before = new Map([['ceiling', cell<{ lo: number; hi: number }>('ceiling')]]);
26
+ const after = sign(scale, before, 'ceiling', { lo: 0, hi: 45 });
27
+
28
+ console.log('cells resting on the ceiling', world.filter((one) => one.restsOn.includes('ceiling')).length);
29
+ for (const [i, one] of world.entries()) {
30
+ console.log(`c${i} before`, JSON.stringify(meet(scale, one, before)), '· after', JSON.stringify(meet(scale, one, after)));
31
+ }
32
+ console.log('claims edited by the signature', world.flatMap((one) => one.seen).filter((claim) => claim.span.hi !== 100).length);
33
+ console.log('why one signature narrows a bound and every cell resting on it reads the narrower one, without touching a single claim any origin made');
34
+ ```
35
+
36
+ ```
37
+ cells resting on the ceiling 4
38
+ c0 before {"lo":0,"hi":100} · after {"lo":0,"hi":45}
39
+ c1 before {"lo":20,"hi":100} · after {"lo":20,"hi":45}
40
+ c2 before {"lo":40,"hi":100} · after {"lo":40,"hi":45}
41
+ c3 before {"lo":60,"hi":100} · after {"lo":60,"hi":45}
42
+ claims edited by the signature 0
43
+ why one signature narrows a bound and every cell resting on it reads the narrower one, without touching a single claim any origin made
44
+ ```
45
+
46
+ Its origins meet.
47
+
48
+ ## Source
49
+
50
+ [Its source](../../examples/release/signature.ts) is one of the examples of obligations, and it runs as it is written, against the built package, with nothing compiled for it.
@@ -0,0 +1,58 @@
1
+ # Thermometer
2
+
3
+ <p align="center"><img src="../img/thermometer.svg" alt="Four origins on one scale: a claims 19.8 to 20.2, b claims 19.9 to 20.3, c claims 19.7 to 20.1 and d claims 24 to 24.4; their claims do not meet." width="640"></p>
4
+
5
+ A claim from one origin is potential; a cell is information only where two independent origins touch it and their intervals meet.
6
+
7
+ ## Run it
8
+
9
+ ```ts
10
+ import { disagree, origins, point } from '@lapxo/obligations';
11
+ import { steady } from '@lapxo/obligations/views/product';
12
+
13
+ const said = (cell: ReturnType<typeof point>): string =>
14
+ (origins(cell) < 2 ? 'grey' : disagree(cell) ? 'split' : 'agreed');
15
+
16
+ const bath = point('bath', 0, [
17
+ { origin: 'a', span: { lo: 19.8, hi: 20.2 } },
18
+ { origin: 'b', span: { lo: 19.9, hi: 20.3 } },
19
+ { origin: 'c', span: { lo: 19.7, hi: 20.1 } },
20
+ { origin: 'd', span: { lo: 24.0, hi: 24.4 } },
21
+ ]);
22
+ const without = (name: string) => point('bath', 0, bath.seen.filter((one) => one.origin !== name));
23
+
24
+ console.log('four thermometers', said(bath));
25
+ for (const one of ['a', 'b', 'c', 'd']) console.log(`without ${one} `, said(without(one)));
26
+ console.log('holds without any one of them:', steady(bath));
27
+ console.log('why leaving one out names the instrument that disagrees, and a verdict that needs every origin is not a verdict');
28
+ ```
29
+
30
+ ```
31
+ four thermometers split
32
+ without a split
33
+ without b split
34
+ without c split
35
+ without d agreed
36
+ holds without any one of them: false
37
+ why leaving one out names the instrument that disagrees, and a verdict that needs every origin is not a verdict
38
+ ```
39
+
40
+ Its origins meet.
41
+
42
+ ## What it rests on
43
+
44
+ ```mermaid
45
+ flowchart LR
46
+ c0["point"]
47
+ c1["steady"]
48
+ l0(["encounter"])
49
+ l1(["origins are a polygon"])
50
+ c0 --> l0
51
+ c1 --> l1
52
+ classDef shown fill:#2da44e,color:#ffffff,stroke:#2da44e
53
+ class l0 shown
54
+ ```
55
+
56
+ ## Source
57
+
58
+ [Its source](../../examples/release/thermometer.ts) is one of the examples of obligations, and it runs as it is written, against the built package, with nothing compiled for it.
@@ -0,0 +1,51 @@
1
+ # Withdrawal
2
+
3
+ <p align="center"><img src="../img/withdrawal.svg" alt="Two origins on one scale: a claims 2 to 9 and b claims 5 to 12; what they hold together runs from a floor of 5 to a ceiling of 9." width="640"></p>
4
+
5
+ The object is c = ⟨⊥, ⊤, O, ⊑⟩ over L at r: four parts in two pairs, the value (⊥, ⊤) and the relations (O, ⊑), with the lattice L it is given and the resolution r it is read at belonging to the reading and the sign to the act; an origin is (o, φ), and the poles are read, never stored: ⊥ is what is required joined with what its live claims hold, ⊤ what is signed met with what they allow; eight acts in four pairs and seven names answer for it: meet and join on the ceiling, local, a join only with a witness; observe and withdraw on the floor, local, a withdrawal being an observation at −1 that restores exactly; sign and require on both poles, travelling by rest, commuting and both closing freedom; encounter and refine with no pole; and no widening travels.
6
+
7
+ ## Run it
8
+
9
+ ```ts
10
+ import { intervals } from '@lapxo/obligations/forms';
11
+ import { cell, encounter, meet, observe } from '@lapxo/obligations/views/field';
12
+
13
+ const scale = intervals(0, 20);
14
+ const held = cell('x', 0, [{ id: 'k1', origin: 'a', span: { lo: 2, hi: 9 } }, { id: 'k2', origin: 'b', span: { lo: 5, hi: 12 } }]);
15
+ const back = observe(held, { origin: 'b', span: { lo: 5, hi: 12 }, takes: 'k2' });
16
+
17
+ console.log('two origins ', encounter(scale, held).origins, JSON.stringify(meet(scale, held)));
18
+ console.log('b takes k2 ', encounter(scale, back).origins, JSON.stringify(meet(scale, back)));
19
+ console.log('claims kept ', back.seen.length);
20
+ console.log('why a withdrawal names the claim it takes back, so the cell returns to one origin while all three claims stay on it and nothing is matched by looking like something');
21
+ ```
22
+
23
+ ```
24
+ two origins 2 {"lo":5,"hi":9}
25
+ b takes k2 1 {"lo":2,"hi":9}
26
+ claims kept 3
27
+ why a withdrawal names the claim it takes back, so the cell returns to one origin while all three claims stay on it and nothing is matched by looking like something
28
+ ```
29
+
30
+ Its origins meet.
31
+
32
+ ## What it rests on
33
+
34
+ ```mermaid
35
+ flowchart LR
36
+ c0["cell"]
37
+ c1["encounter"]
38
+ c2["meet"]
39
+ c3["observe"]
40
+ l0(["the obligatory"])
41
+ c0 --> l0
42
+ c1 --> l0
43
+ c2 --> l0
44
+ c3 --> l0
45
+ classDef shown fill:#2da44e,color:#ffffff,stroke:#2da44e
46
+ class l0 shown
47
+ ```
48
+
49
+ ## Source
50
+
51
+ [Its source](../../examples/release/withdrawal.ts) is one of the examples of obligations, and it runs as it is written, against the built package, with nothing compiled for it.
package/docs/measures.md CHANGED
@@ -147,3 +147,67 @@ TypeScript implementation reproduces every captured vector exactly in rational
147
147
  arithmetic; validation refuses by name; budget is computed before work; every result
148
148
  carries model, handed parameters and conditions; states identical before and after;
149
149
  the descriptive 0.4.0 measures and all algebra hashes unchanged.
150
+
151
+ ## 12. Capacity under a single dominant factor
152
+
153
+ `capacityBound`, `capacityP0`, `mutualInformation`, and `unanimityNoFactor` use the declared single-dominant-factor model. T is uniform on n >= 2 values. F is independent of T with probability c. On F=1 all witnesses report one W, uniform among values different from T. On F=0 they use independent homogeneous private channels: correct with probability 1-p, otherwise uniform among n-1 wrong values. These hypotheses are handed, never inferred.
154
+
155
+ For every positive k, I(T;V) <= log2(n)-c*log2(n-1). The entropy chain rule gives
156
+ H(T|V) = c*log2(n-1) + (1-c)*H(T|V,F=0) + I(T;F|V).
157
+ The first term is exclusion uncertainty, the second private uncertainty, the third factor ambiguity. A decoder cannot increase information about T.
158
+
159
+ For 0<p<1 and p!=(n-1)/n, the bound is attained as k tends to infinity: the empirical private vote distribution distinguishes T, and private unanimity has probability (1-p)^k+p^k/(n-1)^(k-1), tending to zero. For p=1,n>2 the missing value identifies T asymptotically. For p=1,n=2 every vote is the complement of T, giving one bit for every k. At p=0, I=log2(n)-h(c)-c*log2(n-1) for every k. At c=1, I=log2(n/(n-1)) for every k. At c=0 the uninformative private channel p=(n-1)/n gives zero for every k; c=0 does not by itself imply log2(n). At that uninformative p with a factor, the limit is c*log2(n/(n-1)), not the general upper bound.
160
+
161
+ Probabilities and the conditional-entropy expression are exact rationals. Numerical entropy uses the explicitly handed `binary64-log2` policy, in bits, and is an approximation; it is not an exact rational logarithm. `mutualInformation` declares its joint-cell enumeration budget before work. `unanimityNoFactor` declares a rational-bit upper-bound budget before exponentiation. Budget exhaustion is unmeasured, never zero.
162
+
163
+ Captured finite information, n=4,c=1/5,p=3/10: k=1,2,4,7 gives approximately 0.313028978, 0.469712906, 0.914458010, 1.332321771 bits. The bound is approximately 1.683007500 bits. At p=0 the information is approximately 0.961079405 bits for every k. These decimals are illustrative approximations under the named policy.
164
+
165
+ ## 13. Decision results are separate
166
+
167
+ `decisionInformation` accepts `plurality-uniform-ties@1` or `posterior-map-uniform-ties@1`. The second compares exact declared joint probabilities for finite k; it does not apply an intuition-based unanimity threshold. Ties are uniformly distributed among maximizers. It returns posterior information I(T;V), decision information I(T;answer), and exact rational decision accuracy as distinct quantities. The exact T/answer joint table accompanies them. A randomized answer cannot gain information over V.
168
+
169
+ Under p<(n-1)/n, asymptotically plurality emits the forced wrong value on the factor event. Posterior MAP identifies that event and samples uniformly among its n-1 alternatives. For n=4,c=1/5, plurality decision information is approximately 0.961079405 bits; MAP decision information is approximately 1.222162 bits; posterior information is approximately 1.683007500 bits. The two information gains differ. None is a finite-k or model-free guarantee.
170
+
171
+ ## 14. No-truth fitting
172
+
173
+ `fitUnanimityModel` uses `exact-c-slices-on-declared-p-grid@1`. It takes one named lineage, cardinality, k/count/denominator rows, a declared p grid, exact absolute rate tolerance, and a work budget. For each handed p it intersects the exact inequalities for c, returning the entire compatible c interval and midpoint residual diagnostics. No claim is made about p values between slices or continuous identification. A measured fit means the declared procedure was evaluated; it does not mean parameters or causes were identified.
174
+
175
+ The observed rate is compared with c+(1-c)*[(1-p)^k+p^k/(n-1)^(k-1)]. Binary p versus 1-p ambiguity remains visible. Perfect unanimity leaves p=0 and c=1 indistinguishable. Too few informative sizes or no compatible slice are explicitly unmeasured. Mixed populations require a separately declared mixture model and are not pooled here.
176
+
177
+ Optional bootstrap samples complete paired groups across sizes with a handed xorshift32 seed, B and random-word budget. It retains the full compatible regions in each replicate, not independent uncertainty intervals for each size. Groups are the declared resampling units; the procedure assumes exchangeable independent groups and does not establish that assumption. Counts alone leave uncertainty unmeasured. Replicate regions are empirical bootstrap output, not guaranteed confidence sets. Exhausted random words never produce successful uncertainty.
178
+
179
+ ## 15. False coincidence relative to a declared reference
180
+
181
+ `coincidenceExcess` takes event/origin/value rows, truth rows (`kind=truth`), an explicit selection S and the `independent-uniform-wrong@1` reference. Order h is |S|; identity and redelivery never add origins or events. Values belong to the declared alphabet. Conflicting values or truth refuse. Incomplete shared events and insufficient declared event counts remain unmeasured. Imperfect probes need a separate contract and are not silently accepted as truth.
182
+
183
+ The reference uses handed error marginals, or explicitly estimated marginals stratified by observed truth. For handed homogeneous errors p_i, reference false coincidence is product(p_i)/(n-1)^(h-1). Estimated strata use their event weights, never a pooled error probability that confounds truth populations. Output contains the false-coincidence count, denominator, exact observed and reference rates, signed delta=observed-reference, and ratio=observed/reference. Delta is never floored at zero. At reference zero the ratio is unmeasured, while counts and delta remain available. No sampling design is inferred; uncertainty is separately unmeasured.
184
+
185
+ A ratio greater than one means more coincidence than this reference, not a discovered common cause. Nonuniform wrong labels can exceed the uniform reference with independent witnesses. Independent errors with one shared wrong label give ratio (n-1)^(h-1): at n=64 this is 63 for pairs and 3969 for triples. The fair-bit XOR vector explicitly assigns one common wrong label: pairs have ratio 63, triples ratio zero and a negative delta. Indicators alone do not define the reported-value vector.
186
+
187
+ Under the separately handed dominant-factor model c=1/10,p=1/5,n=64, observed error marginals are 7/25. Relative to those marginals, delta at orders 2 and 3 is approximately 0.099326984 and 0.099996283. Its convergence to c is a conclusion under this model, never model-free identification.
188
+
189
+ ## 16. Research demands and boundaries
190
+
191
+ The spectrum summarizes covariance of binary error indicators. It is not a sufficient statistic of reported values, closure events or independence. False-unanimity excess summarizes one event and does not replace the full joint distribution. Higher-order closure statistics need a declared closure rule and the appropriate joint law of reported values given truth; neither is inferred from a form name.
192
+
193
+ Helly is a property of a declared geometric family, not a probabilistic independence order or a truth guarantee. Geometry, factor precedence, partial label sharing, reproduction, percolation, time-varying fitting, imperfect-probe identification and model-free capacity remain explicitly open until their models, procedures and falsifiers close. Controlled experiments live in a world. No new origin, permission, algebraic amount or state is created by a measure.
194
+
195
+ ## 17. Publication and stability
196
+
197
+ The historical nine publication groups are linked to their contracts, yes/no data and declared Bound 0.1.7 captures in two places. The 0.4.2 operations below require new captures under their selected reader; historical implementation-bound receipts do not cover changed bytes. Validation readers are maintained TypeScript worlds with ordinary modular compilation; no .mjs bundle or private executor ships in this library. Their implementation inventory is retained once by digest. The installed archive must expose the same public exports, preserve the four states, match all published bytes and close native receipts without a private store. Declaring these requirements does not pay them.
198
+
199
+ ## 18. Declared failure bounds
200
+
201
+ `unionBoundConfidence(failures)` requires distinct nonempty IDs, explicit rational probabilities in [0,1], and nonempty justification references. The caller must establish every failure bound in one probability space. References are retained, not verified. The returned lower bound for all events succeeding is max(0,1−Σp_i), with exact rational arithmetic. The empty family gives 1; Σp_i≥1 gives the trivial bound 0. No independence, truth probability, or algebraic state is inferred.
202
+
203
+ `tolerantCountConfidence(failures,k)` requires a safe integer 0≤k≤m. For k<m it bounds failure by min(1,min_{0≤j≤k}(Σ of the m−j smallest p_i)/(k+1−j)); its exact success lower bound is the complement. For k=m success is certain. For m=3,k=1 and all p_i=1/10 the result is 17/20, not an inferred success rate. The distinct subset-intersection guarantee gives the weaker bound 7/10. Three disjoint paired failures among six events, each pair having probability 1/10, refute the former 4/5 claim: success is 7/10.
204
+
205
+ These operations compute conditional probability bounds. They select neither a geometric tolerance nor a consumer policy. Count-tolerant intersection T_k and widened-interval intersection T_eps remain named forms; tolerant-choice remains open.
206
+
207
+ ## 19. Declared covering cause
208
+
209
+ `commonCauseCapacityBound(n,c,q,{logarithm:'binary64-log2'})` requires integer n≥2 and explicit rational c,q in [0,1]. Truth is uniform; the covering-cause indicator is independent of truth; when active, every report copies one symmetric channel with accuracy q. The inactive private channel is unrestricted. Revealing the indicator gives the upper bound log2(n)−c[h(q)+(1−q)log2(n−1)] in approximate bits. Copy count is no input. This is neither finite-sample mutual information nor an achievability claim.
210
+
211
+ At n=4,c=1,q=1/4 the bound is exactly zero; q=0 gives log2(4/3), and q=1 gives two bits. Missing q refuses. The operational declaration or detection of activation remains open in identification.model. Unconditioned coincidence does not identify q.
212
+
213
+ M/3 and M/4 retain their existing definitions. Partial-factor governance proposals do not supply a conditional joint observation and selection law. The information carried by dissent, including a bottom symbol, is open for those unspecified proposals.