@finbheara/archive-client 0.16.2 → 0.17.0

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.
package/README.md CHANGED
@@ -228,9 +228,17 @@ unknown type, each dated where a year is known) read by `@finbheara/domain/schoo
228
228
  simple path between two schools, each with its flags (`relatedHops`, `maxYearGap`, `datedAfter`,
229
229
  `undated`, `provisional`, `redirected` and the rest), never a yes or a no. Pass a `policy`, your
230
230
  reading over those flags, and the answer carries its verdict (`l.policy.passes`), exact however
231
- many paths are listed. A retired id is followed to the live one. The release publishes no decision
232
- behind an edge, so a path carries no `confidence` here. A release that publishes no lineage
233
- refuses both calls by name.
231
+ many paths are listed. A retired id is followed to the live one.
232
+
233
+ A release that publishes the decision behind each edge (a lineage line's `decision` and
234
+ `confidence`) gives each step its `link.decision` and `link.confidence`. A path's `confidence` is
235
+ its weakest step's. Read it for what it is: the decision's probability that the two ids are
236
+ not one school. It is not the probability that the edge's shape or year is right, nor that the
237
+ two schools are linked at all: a decision whose alternative is two schools with no link counts
238
+ that alternative inside its confidence. An edge no recorded decision backs has a `null` `decision`: its step reads
239
+ `unbacked`, the path counts it in `flags.unbacked`, and the path's `confidence` is `null`. On a
240
+ release that publishes neither field, no step carries either, no path is `unbacked`, and every
241
+ path's `confidence` is `null`. A release that publishes no lineage refuses both calls by name.
234
242
 
235
243
  ## Dancers
236
244
 
@@ -650,12 +650,31 @@ function linksOfLineage2(lines) {
650
650
  const k = `${from}\x00${to}\x00${r.shape}\x00${year}`;
651
651
  const was = seen.get(k);
652
652
  if (was === undefined)
653
- seen.set(k, { from, to, shape: r.shape, year, provisional: r.provisional === true });
654
- else if (r.provisional === true)
655
- was.provisional = true;
653
+ seen.set(k, {
654
+ from,
655
+ to,
656
+ shape: r.shape,
657
+ year,
658
+ provisional: r.provisional === true,
659
+ ...backingOf(r)
660
+ });
661
+ else {
662
+ if (r.provisional === true)
663
+ was.provisional = true;
664
+ if (was.decision === undefined)
665
+ Object.assign(was, backingOf(r));
666
+ }
656
667
  }
657
668
  return [...seen.values()];
658
669
  }
670
+ function backingOf(r) {
671
+ if (r.decision === undefined)
672
+ return {};
673
+ return {
674
+ decision: r.decision,
675
+ confidence: typeof r.confidence === "number" ? r.confidence : null
676
+ };
677
+ }
659
678
  async function releaseSchoolGraph2(rel) {
660
679
  await rel.require("schools.lineage");
661
680
  await rel.fetch(LINEAGE_FILE2);
package/dist/cli.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  nameOrderOf,
5
5
  openRelease2,
6
6
  releases2
7
- } from "./chunks/index-bpd2j026.js";
7
+ } from "./chunks/index-598c5w9d.js";
8
8
  import"./chunks/index-hne1wadw.js";
9
9
  import"./chunks/index-hghdy980.js";
10
10
 
package/dist/index.js CHANGED
@@ -50,7 +50,7 @@ import {
50
50
  openCached2,
51
51
  ReleaseManager2,
52
52
  releases2
53
- } from "./chunks/index-bpd2j026.js";
53
+ } from "./chunks/index-598c5w9d.js";
54
54
  import {
55
55
  cacheRoot2,
56
56
  repoOf2
@@ -8,6 +8,8 @@ export interface LineageLine {
8
8
  shape: string;
9
9
  year?: number | null;
10
10
  provisional?: boolean;
11
+ decision?: string | null;
12
+ confidence?: number | null;
11
13
  }
12
14
  export declare function linksOfLineage(lines: Iterable<LineageLine>): SchoolLink[];
13
15
  export declare function releaseSchoolGraph(rel: Release): Promise<SchoolGraph>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finbheara/archive-client",
3
- "version": "0.16.2",
3
+ "version": "0.17.0",
4
4
  "description": "Open a versioned release of an Irish dance results archive: download, verify, decompress and cache it by tag, keep the cache, and resolve feises and schools against it",
5
5
  "keywords": ["irish-dance", "results", "release", "cache", "sqlite"],
6
6
  "license": "MIT",