@finbheara/archive-client 0.16.1 → 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
 
@@ -287,7 +295,7 @@ earlier row at a joined school alone is no match. `r.school.lineage` lists the i
287
295
  asked ones. A release that publishes no lineage (feature `schools.lineage`) joins
288
296
  nothing and its answer carries no `lineage`, never refused. The line is read on the same school
289
297
  graph as `rel.schools.line` (`@finbheara/domain/school-graph`): untimed, every path, and as of a
290
- year, every path none of whose steps is dated after it (`LINE_AS_OF`).
298
+ year, every path none of whose steps is dated after it, a rename at any year (`LINE_AS_OF`).
291
299
 
292
300
  `population` is how the dancer's published majors population meets the asked one: `same`,
293
301
  `contradicts`, `both`, `unknown`, `unasked`. A dancer's population is read only from its rows at
@@ -321,7 +329,8 @@ words):
321
329
  - `school`: every school row of the dancer up to the asked year reads to a school id (an id
322
330
  followed through the redirects, a print read by `rel.schools`), and none of them is the asked
323
331
  school or a school its line had joined by that year (lineage edges dated in or before the asked
324
- year). A dancer with no school row, or a print no school reads, is unknown and never refuted. A
332
+ year, and a rename at any year: one school under two names).
333
+ A dancer with no school row, or a print no school reads, is unknown and never refuted. A
325
334
  dancer that ever danced for the asked school's line is never refuted by the school. For an
326
335
  adult-category question (the asked band is the adult band, read by `@finbheara/domain`:
327
336
  `Adult`, `Advanced Adult`, `Adult Beginner`, `Open Adult`, `Adult Masters`), a row the
@@ -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);
@@ -861,7 +880,10 @@ class SchoolResolver2 {
861
880
  }
862
881
  }
863
882
 
864
- var LINE_AS_OF = { name: "line-as-of", keep: (s) => !s.flags.datedAfter };
883
+ var LINE_AS_OF = {
884
+ name: "line-as-of",
885
+ keep: (s) => !s.flags.datedAfter || s.link.shape === "rename"
886
+ };
865
887
  function schoolLine(lineage, ids, year) {
866
888
  const reached = new Set(ids);
867
889
  for (const id of ids)
package/dist/cli.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  nameOrderOf,
5
5
  openRelease2,
6
6
  releases2
7
- } from "./chunks/index-hbb1dnnh.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-hbb1dnnh.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.1",
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",