@instruments/taxonomy 0.3.0 → 1.1.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.
@@ -1,31 +0,0 @@
1
- import { a as BundleMemberInput, M as MatchStrength } from './match-CWzTEuL-.js';
2
-
3
- type CrosswalkMapping = {
4
- status: "resolved";
5
- assertions: readonly BundleMemberInput[];
6
- match: MatchStrength;
7
- note?: string;
8
- } | {
9
- status: "ambiguous";
10
- alternatives: readonly (readonly BundleMemberInput[])[];
11
- match: MatchStrength;
12
- note?: string;
13
- } | {
14
- status: "declined";
15
- reason: string;
16
- };
17
- /** A compound row: the source value is fully carried by the assertions together. */
18
- declare const resolved: (...assertions: readonly string[]) => CrosswalkMapping;
19
- /** One canonical term, interchangeable with the source value in retrieval. */
20
- declare const constitutive: (assertion: string) => CrosswalkMapping;
21
- /**
22
- * A row that is not an identity. The strength says how it falls short and the note says why, both
23
- * required: an approximation nobody had to justify is how a close match ships as an exact one.
24
- */
25
- declare const approximates: (match: Exclude<MatchStrength, "exact">, note: string, ...assertions: readonly string[]) => CrosswalkMapping;
26
- /** The source is known to mean one of these and never recorded which. `match` grades each reading. */
27
- declare const ambiguous: (match: MatchStrength, ...assertions: readonly string[]) => CrosswalkMapping;
28
- /** A curated refusal. Distinct from an absent row, which means nobody has looked. */
29
- declare const declined: (reason: string) => CrosswalkMapping;
30
-
31
- export { type CrosswalkMapping as C, ambiguous as a, approximates as b, constitutive as c, declined as d, resolved as r };
@@ -1,403 +0,0 @@
1
- /** An external vocabulary this package crosswalks out to. */
2
- type ExternalScheme =
3
- /** Getty Art & Architecture Thesaurus. ODC-By 1.0 - redistributable with attribution. */
4
- "aat"
5
- /** Uniclass 2015 (NBS). CC BY-ND 4.0 - referenced by code, never adapted. */
6
- | "uniclass"
7
- /** Wikidata Q-items. CC0. */
8
- | "wikidata";
9
- /**
10
- * SKOS mapping strength, using SKOS's own vocabulary so the published RDF is a direct rendering
11
- * rather than a translation. `exact` asserts the two terms are interchangeable in retrieval;
12
- * `close` asserts they are near enough to substitute in most contexts but not all; `broad` and
13
- * `narrow` assert containment in the named direction; `related` asserts association only.
14
- */
15
- type MatchStrength = "exact" | "close" | "broad" | "narrow" | "related";
16
- interface ExternalMapping {
17
- scheme: ExternalScheme;
18
- /** The external identifier, verbatim: an AAT subject id, a Uniclass code, a Wikidata Q-number. */
19
- id: string;
20
- /** The external vocabulary's own label for that identifier, verbatim and unedited. */
21
- label: string;
22
- match: MatchStrength;
23
- }
24
- /**
25
- * Where a term's content came from, and when. Ranks the SOURCE, never the accuracy: a term lifted
26
- * verbatim from an upstream dictionary is `vendored` whether or not the upstream got it right.
27
- * Using this field as a proxy for correctness is how confident wrong answers get made.
28
- */
29
- type SourceBasis =
30
- /** Copied unedited from a named upstream dictionary at a stated snapshot. */
31
- "vendored"
32
- /** Written here, from scratch, by a named editor. */
33
- | "authored"
34
- /** Written here, but derived from measured usage in a named corpus. */
35
- | "evidenced"
36
- /** Adopted from a published external standard, with its identifier carried. */
37
- | "standard";
38
- interface TermProvenance {
39
- basis: SourceBasis;
40
- /** The upstream file, corpus or standard. Free text, but always specific enough to re-read. */
41
- source: string;
42
- /** ISO date the source was read. Absent only for `authored`. */
43
- snapshot?: string;
44
- }
45
- /**
46
- * A DATED NEGATIVE RESULT: a scheme that was searched for this term and did not have it.
47
- *
48
- * This is the field that makes the gap publishable. ADR 0001 section 8 softens the planned
49
- * invariant "every STYLE and PERIOD term carries an AAT mapping" to "carries a mapping OR carries
50
- * one of these", because AAT has no consumer interiors coverage at all - a live search for
51
- * *japandi* returns nothing, and *farmhouse*, *transitional* and *coastal* are absent as interior
52
- * idioms. Without this field an unmapped term is indistinguishable from an unchecked one, and the
53
- * two are opposites: one is evidence and the other is a to-do.
54
- *
55
- * A dated negative against the best art-and-architecture thesaurus in the world is the clearest
56
- * available statement of why this vocabulary needs to exist.
57
- */
58
- interface SearchedWithout {
59
- scheme: ExternalScheme;
60
- /** ISO date the search was run. */
61
- date: string;
62
- /** What was searched, so a reader can repeat it. */
63
- query: string;
64
- /** Where the search was run, e.g. the SPARQL endpoint. */
65
- via: string;
66
- }
67
- type TermStatus = "active" | "deprecated";
68
- /**
69
- * A band, never a count.
70
- *
71
- * THE SCALE, stated once so every axis uses the same one. Measured against the corpus named on the
72
- * term: `dominant` is the top decile of values by frequency, `common` the next, `occasional` a
73
- * value that appears regularly, `rare` one that barely does, and `unattested` a value the corpus
74
- * never uses. Set `usage` only where the named corpus can actually speak to the term: omitting it
75
- * says "not measured here", which is honest, whereas `unattested` against an unrelated corpus
76
- * would read as a claim about the term rather than about the corpus. The usage figures behind these derive from Material Bank's warehouse and
77
- * from the DesignShop capture; publishing a raw number would publish a figure from someone else's
78
- * business. The band carries the signal a reader actually needs - is this term common or rare -
79
- * and nothing more.
80
- */
81
- type UsageBand = "dominant" | "common" | "occasional" | "rare" | "unattested";
82
- interface TermUsage {
83
- band: UsageBand;
84
- /** The corpus the band was measured against, and when. */
85
- corpus: string;
86
- snapshot: string;
87
- }
88
- /**
89
- * Why a term carries no usage band when the corpus plainly has something to say about it.
90
- *
91
- * The distinguishing case is `style.modernism`. DesignShop tags a dominant share of its room
92
- * schemes `Modern`, but that is the crosswalk row that DECLINES: `Modern` reads as either
93
- * `style.modernism` or `style.contemporary` and the source never recorded which. Attributing the
94
- * usage would smuggle in the guess the crosswalk refused to make.
95
- *
96
- * Without this field, a reader sees "not measured" and cannot tell that apart from "nobody looked",
97
- * and those are opposite claims. Same reasoning as `searchedWithout`: an absence somebody reasoned
98
- * their way to is evidence, and an absence nobody has examined is a to-do.
99
- */
100
- interface UsageWithheld {
101
- reason: string;
102
- /** The corpus that would otherwise have supplied a band. */
103
- corpus: string;
104
- }
105
- /**
106
- * A period's extent, as four numbers rather than two.
107
- *
108
- * Two dates cannot answer the questions consumers actually ask. "Is 1832 Georgian?" wants the
109
- * outer edge; "give me a canonical date for Georgian" wants the core. So each period carries a
110
- * fuzzy interval: `earliest` and `latest` bound what could defensibly be called this period,
111
- * `start` and `end` bound what uncontroversially is.
112
- *
113
- * `end` and `latest` are NULLABLE, and that is load-bearing rather than tidy. An open-ended period
114
- * closed with the current year needs an arbitrary edit at every release, and the edit is a lie in
115
- * between: `contemporary` does not end in 2026, it has not ended.
116
- *
117
- * SIBLING SPANS ARE ALLOWED TO OVERLAP, deliberately. Georgian and Regency genuinely do. Resolving
118
- * "what period is 1800?" is therefore an accessor's job, not the data's - see `periodAt`, which
119
- * prefers the narrowest match and then the un-hedged one. Leaving that to each consumer would get
120
- * it reinvented differently every time.
121
- */
122
- interface PeriodSpan {
123
- /** The earliest year anyone would defensibly call this period. */
124
- earliest: number;
125
- /** The first year it uncontroversially is this period. */
126
- start: number;
127
- /** The last year it uncontroversially is. Null when the period has not ended. */
128
- end: number | null;
129
- /** The last year anyone would defensibly call it this. Null when the period has not ended. */
130
- latest: number | null;
131
- /** True when the boundaries are conventional rather than evidenced by an event. */
132
- circa: boolean;
133
- /**
134
- * Where these dates apply, as ISO 3166-1 alpha-2, or `global`. Regional variance beyond this
135
- * belongs in NARROWER TERMS with their own spans, never in a region-to-span map on one term: a
136
- * map invites partial coverage, and a narrower term is something a relation can point at.
137
- */
138
- regions: readonly string[];
139
- }
140
- /**
141
- * What KIND of thing a style term is, because the three kinds have different truth conditions and
142
- * conflating them is most of why style vocabularies rot.
143
- *
144
- * A `movement` has an art-historical literature, dates and adherents, and its boundaries are
145
- * arguable in the way a scholarly claim is arguable. A `tradition` is a body of regional or
146
- * vernacular practice, defined by what is done rather than by what was declared. A `market-idiom`
147
- * is a prototype category the trade converged on, defined by resemblance to central cases and by
148
- * nothing else - it has no manifesto to appeal to, and asking for necessary and sufficient
149
- * conditions misunderstands it.
150
- *
151
- * Publishing the kind does two things. It tells a reader what sort of disagreement to expect: a
152
- * dispute about Brutalism is a dispute about the record, a dispute about Farmhouse is a dispute
153
- * about a prototype, and neither settles like the other. And it is the grouping a browse page needs
154
- * once STYLE passes about fifty terms, when a flat alphabetical list stops being navigable.
155
- */
156
- type StyleKind = "movement" | "tradition" | "market-idiom";
157
- interface Term {
158
- id: string;
159
- label: string;
160
- /** Explicitly authored Material Semantics id (dashed); absent where none was authored. */
161
- semanticId?: string;
162
- /**
163
- * Parent term id. Carries TAXONOMIC SUBSUMPTION ONLY - every instance of this term must be an
164
- * instance of the parent. Part-of, used-in, typically-found-in and evokes are relations, and
165
- * belong in `related`, never here. See ADR 0001.
166
- */
167
- broaderTermId?: string;
168
- /** One sentence, stating the boundary rather than restating the label. */
169
- definition?: string;
170
- /** Other correct names for this term. */
171
- altLabels?: readonly string[];
172
- /**
173
- * Labels observed in the wild that mean this term but are not correct names for it: upstream
174
- * spellings, typos, and off-canon coinages. Published, because a crosswalk that hides the wrong
175
- * forms cannot be used to clean anyone's data.
176
- */
177
- seenAs?: readonly string[];
178
- /** Non-taxonomic relations to other canonical terms, by predicate. */
179
- related?: readonly TermRelation[];
180
- external?: readonly ExternalMapping[];
181
- /**
182
- * Schemes searched for this term that did not have it. An absent `external` means nobody looked;
183
- * a `searchedWithout` entry means somebody looked and the term is not there. Published, dated,
184
- * and repeatable.
185
- */
186
- searchedWithout?: readonly SearchedWithout[];
187
- provenance?: TermProvenance;
188
- /**
189
- * Position on this term's own ordered scale, low to high. Present only on ordinal axes.
190
- *
191
- * MOST AXES HERE ARE UNORDERED SETS and must stay that way: `style.brutalism` is not greater
192
- * than `style.rustic`, and a consumer that sorted them would be inventing a claim. TIER is
193
- * different - value really is below premium, and "one rung cheaper" is a question people ask of
194
- * it - so the order is data rather than an accident of array position.
195
- *
196
- * Ranks are NOT comparable across facets. `tier.market.premium` and `tier.chain_scale.upscale`
197
- * both sit at 3 on their own ladders and are not the same claim about the world; the ladders
198
- * have different lengths and different subjects. Compare within a facet or not at all.
199
- *
200
- * Dense from 1 within a facet, and either present on every term there or on none - both checked
201
- * in `axes.test.ts`, because a half-ranked facet silently drops its unranked half from any sort.
202
- */
203
- rank?: number;
204
- /** Present on PERIOD terms only. */
205
- span?: PeriodSpan;
206
- /** Present on STYLE terms only. */
207
- styleKind?: StyleKind;
208
- usage?: TermUsage;
209
- /**
210
- * Set instead of `usage` when a corpus has evidence but it cannot honestly be attributed to this
211
- * term. Never set alongside `usage`.
212
- */
213
- usageWithheld?: UsageWithheld;
214
- status?: TermStatus;
215
- /** The term that replaced this one. Required when status is "deprecated". */
216
- supersededBy?: string;
217
- /** Why the term is deprecated, or any other governance note a reader needs. */
218
- note?: string;
219
- }
220
- /**
221
- * The named predicates a term may carry to another canonical term. Everything that is not ISA
222
- * lives here, so `broaderTermId` never silently becomes a bag of loose associations.
223
- */
224
- type RelationPredicate =
225
- /** This element is physically a component of that element. */
226
- "part-of"
227
- /** This application or element is typically found in that space. */
228
- | "typically-in"
229
- /** This term is a material-suitability claim about that space. */
230
- | "suitable-for"
231
- /**
232
- * The subject exists to serve that sector's market, wherever the building that contains it
233
- * stands: a hotel room in a mixed-use tower still serves hospitality, an operating room serves
234
- * healthcare whoever the landlord is. An IDENTITY claim, never an occurrence claim - "occurs
235
- * only in that sector" is false for almost any room (a multifamily amenity floor holds
236
- * restrooms, a commercial kitchen and a gym inside `sector.residential`), which is why most
237
- * rooms rightly carry no edge.
238
- *
239
- * ABSENCE IS A CLAIM, NOT A GAP. A SPACE term carrying no serves edge and inheriting none
240
- * through `broaderTermId` asserts that no market is part of its identity: it serves whatever
241
- * market its project serves, and a consumer must read it as unrestricted - fail-open - never as
242
- * a restriction nobody wrote down. What makes that reading safe is `MARKET_NEUTRAL_SPACES`
243
- * (`axes/space/market-neutral.ts`, with the authoring criterion): every SPACE term either
244
- * carries an edge or is registered there as reviewed-neutral, and the build fails naming any
245
- * term that is neither. A reviewed absence and an unreviewed one cannot be confused - the same
246
- * move `searchedWithout` and `usageWithheld` make.
247
- *
248
- * Authored on SPACE only, and pinned there by test. The claim's shape would generalise, but
249
- * TYPOLOGY must never carry it: sector moves when the tenant moves and typology does not, so a
250
- * typology-to-sector edge dies on conversion - ADR 0001's converted warehouse full of flats is
251
- * the standing counterexample.
252
- */
253
- | "serves"
254
- /** This style or idiom draws on that place idiom or period. */
255
- | "evokes"
256
- /** This style descends from that style. */
257
- | "influenced-by"
258
- /** This style is a deliberate blend of two or more named styles, and is defined by being so. */
259
- | "blend-of"
260
- /** This surface reads as a material it is not made of. */
261
- | "reads-as"
262
- /** Association with no stronger claim available. */
263
- | "related-to";
264
- /**
265
- * How much of the thing a relation accounts for.
266
- *
267
- * Without this, a room whose whole scheme is built on a Japanese reference and a room with one
268
- * rattan pendant both carry `evokes(place.region.japanese)`, and retrieval cannot tell the theme
269
- * from the garnish. It matters more as annotation density rises than it does today, which is why
270
- * it is optional: an edge with no role stated is a claim about presence and nothing more.
271
- */
272
- type RelationRole =
273
- /** Remove it and the thing stops being what it is. */
274
- "constitutive"
275
- /** Present and deliberate, but the scheme survives without it. */
276
- | "accent";
277
- interface TermRelation {
278
- predicate: RelationPredicate;
279
- /**
280
- * Fully qualified target: `<axis>.<term id>`, or `<axis>.<facet>.<term id>` on a faceted axis.
281
- *
282
- * QUALIFICATION IS LOAD-BEARING, not a formatting preference. One `evokes` predicate works only
283
- * because the target's axis types the reference: `evokes(place.region.nordic)` says "place"
284
- * exactly once, and a consumer wanting the three-way split into place, period and typology
285
- * reference recovers it losslessly by joining on the target's axis. A bare `nordic` would make
286
- * that join impossible and would force a predicate per axis, which grows with the axis count.
287
- *
288
- * Twenty-one bare ids currently appear on more than one axis - `wall` on both application and
289
- * element, `restaurant` on both space and typology, `contemporary` on both style and period -
290
- * and every one of those pairs is deliberate. Qualification is what keeps them from colliding.
291
- */
292
- target: string;
293
- role?: RelationRole;
294
- }
295
-
296
- /** The role an assertion plays inside a compound expression. */
297
- type BundleRole = RelationRole;
298
- interface BundleMemberInput {
299
- /** A qualified canonical term or typed relation, e.g. `style.minimalism`. */
300
- assertion: string;
301
- /** Defaults to accent: an unspecified role is evidence of presence, not necessity. */
302
- role?: BundleRole;
303
- }
304
- interface BundleMember {
305
- assertion: string;
306
- role: BundleRole;
307
- }
308
- interface CanonicalBundle {
309
- kind: "all-of";
310
- /** Stable, reversible identity derived from the canonical serialization. */
311
- id: string;
312
- members: readonly BundleMember[];
313
- serialization: string;
314
- }
315
- type AlternativeReason = "query-alternative" | "source-ambiguous";
316
- interface CanonicalAlternatives {
317
- kind: "any-of";
318
- /** Stable, reversible identity derived from the sorted alternative bundle identities. */
319
- id: string;
320
- alternatives: readonly CanonicalBundle[];
321
- reason: AlternativeReason;
322
- serialization: string;
323
- }
324
- declare const MATCH_WEIGHTS: Readonly<Record<RelationRole, number>>;
325
- declare const DEFAULT_BUNDLE_ROLE: BundleRole;
326
- /**
327
- * Give a bundle one canonical spelling. Duplicate assertions collapse; constitutive wins when the
328
- * same assertion was supplied in both roles because removing it would otherwise change identity.
329
- */
330
- declare const defineBundle: (inputs: readonly BundleMemberInput[]) => CanonicalBundle;
331
- declare const defineAlternatives: (inputs: readonly (CanonicalBundle | readonly BundleMemberInput[])[], reason: AlternativeReason) => CanonicalAlternatives;
332
- interface BundleMatch {
333
- eligible: boolean;
334
- matched: readonly string[];
335
- missingAccents: readonly string[];
336
- missingConstitutive: readonly string[];
337
- /** Fixed-weight score in [0, 1]. Ineligible matches always score zero. */
338
- score: number;
339
- }
340
- /**
341
- * Match without penalising extra candidate annotations. Richer annotation should not make an
342
- * otherwise identical subject rank lower.
343
- */
344
- declare const matchBundle: (bundle: CanonicalBundle, candidateAssertions: Iterable<string>) => BundleMatch;
345
- interface AlternativesMatch {
346
- alternative: CanonicalBundle;
347
- match: BundleMatch;
348
- }
349
- /** The strongest eligible reading wins; bundle identity makes ties deterministic. */
350
- declare const matchAlternatives: (alternatives: CanonicalAlternatives, candidateAssertions: Iterable<string>) => AlternativesMatch;
351
- /** How well a candidate answered the query. `exact` matched every member, accents included. */
352
- type MatchTier = "exact" | "eligible" | "relaxed";
353
- /** A subject to rank: an opaque id and the assertions annotating it. */
354
- interface CandidateAnnotations {
355
- id: string;
356
- assertions: readonly string[];
357
- }
358
- interface RankedCandidate {
359
- id: string;
360
- tier: MatchTier;
361
- match: BundleMatch;
362
- }
363
- interface BundleSearch {
364
- /** The strongest tier present. Absent when no candidate carried even one member. */
365
- tier?: MatchTier;
366
- results: readonly RankedCandidate[];
367
- /** True when nothing was eligible and the relaxed tier was served in its place. */
368
- relaxed: boolean;
369
- /**
370
- * Constitutive members NO candidate in this corpus carries. Populated only when nothing was
371
- * eligible, because that is when it is the answer: these are the conjuncts the corpus cannot
372
- * satisfy, and naming them is what turns an empty result into a usable one.
373
- */
374
- blocking: readonly string[];
375
- }
376
- interface SearchOptions {
377
- /** Refuse the relaxed tier: return nothing rather than a labelled partial answer. */
378
- strict?: boolean;
379
- /** Truncate the ranked list. Applied after ordering, so it never changes which result is first. */
380
- limit?: number;
381
- }
382
- /**
383
- * Rank a corpus against a bundle under the published rule. Deterministic: the same corpus in any
384
- * input order returns the same list.
385
- */
386
- declare const searchBundle: (bundle: CanonicalBundle, candidates: Iterable<CandidateAnnotations>, options?: SearchOptions) => BundleSearch;
387
- interface MatchTestCandidate {
388
- assertions: readonly string[];
389
- id: string;
390
- }
391
- interface MatchTestVector {
392
- candidates: readonly MatchTestCandidate[];
393
- expectedEligibleOrder: readonly string[];
394
- id: string;
395
- query: CanonicalBundle;
396
- }
397
- /**
398
- * Executable test vectors published for consumers implementing the same rule in another language.
399
- * One is residential, one commercial; the matcher itself has no market branch.
400
- */
401
- declare const MATCH_TEST_VECTORS: readonly MatchTestVector[];
402
-
403
- export { type AlternativeReason as A, type BundleRole as B, type CanonicalAlternatives as C, DEFAULT_BUNDLE_ROLE as D, type ExternalMapping as E, matchBundle as F, searchBundle as G, type MatchStrength as M, type PeriodSpan as P, type RelationPredicate as R, type SearchOptions as S, type Term as T, type UsageBand as U, type BundleMemberInput as a, type AlternativesMatch as b, type BundleMatch as c, type BundleMember as d, type BundleSearch as e, type CandidateAnnotations as f, type CanonicalBundle as g, type ExternalScheme as h, MATCH_TEST_VECTORS as i, MATCH_WEIGHTS as j, type MatchTestCandidate as k, type MatchTestVector as l, type MatchTier as m, type RankedCandidate as n, type RelationRole as o, type SearchedWithout as p, type SourceBasis as q, type StyleKind as r, type TermProvenance as s, type TermRelation as t, type TermStatus as u, type TermUsage as v, type UsageWithheld as w, defineAlternatives as x, defineBundle as y, matchAlternatives as z };
package/dist/taste.d.ts DELETED
@@ -1,155 +0,0 @@
1
- import { C as CanonicalAlternatives, g as CanonicalBundle, M as MatchStrength } from './match-CWzTEuL-.js';
2
-
3
- declare const TASTE_ASSERTION_CONTRACT_VERSION: "1.0.0";
4
- declare const TAXONOMY_SNAPSHOT_VERSION: "2026-08-25";
5
- type AssertionRole = "taste" | "project_context" | "requirement";
6
- type AssertionAuthority = "explicit" | "behavioral" | "inferred";
7
- type AssertionPolarity = "positive" | "negative" | "never";
8
- type AssertionScope = {
9
- kind: "person";
10
- } | {
11
- kind: "household";
12
- householdId: string;
13
- } | {
14
- kind: "project";
15
- projectId: string;
16
- } | {
17
- kind: "room_type";
18
- roomTypeId: string;
19
- } | {
20
- kind: "room";
21
- roomId: string;
22
- } | {
23
- kind: "surface";
24
- roomId: string;
25
- surfaceId: string;
26
- };
27
- interface AssertionProvenance {
28
- /** The application, import or instrument that produced the observation. */
29
- sourceSystem: string;
30
- /** Version of the source data, prompt, fixture or export used when the evidence was observed. */
31
- sourceSnapshotVersion: string;
32
- sourceRecordId?: string;
33
- sourceUrl?: string;
34
- /** Optional id for the observation from which this assertion was proposed. */
35
- observationId?: string;
36
- }
37
- interface SourceMeaning {
38
- /** Source vocabulary field, before canonicalisation. */
39
- sourceField: string;
40
- /** Verbatim source value; never replaced by the canonical label. */
41
- sourceValue: string;
42
- /** Version of the source-specific mapping policy. */
43
- crosswalkVersion: string;
44
- /** Version of the canonical vocabulary against which mapping ran. */
45
- taxonomySnapshotVersion: string;
46
- }
47
- interface ResolvedAssertionMeaning extends SourceMeaning {
48
- kind: "resolved";
49
- canonical: CanonicalBundle;
50
- }
51
- interface AmbiguousAssertionMeaning extends SourceMeaning {
52
- kind: "ambiguous";
53
- alternatives: CanonicalAlternatives;
54
- }
55
- interface UnresolvedAssertionMeaning extends SourceMeaning {
56
- kind: "unresolved";
57
- }
58
- type AssertionMeaning = ResolvedAssertionMeaning | AmbiguousAssertionMeaning | UnresolvedAssertionMeaning;
59
- interface PortableAssertionBase {
60
- /** Stable application-owned identifier for this assertion event. */
61
- id: string;
62
- contractVersion: typeof TASTE_ASSERTION_CONTRACT_VERSION;
63
- actorId: string;
64
- /** Whose taste or project view the assertion describes; never inferred from actorId. */
65
- subjectId: string;
66
- /** Project context is explicit even when the assertion's scope is durable and personal. */
67
- projectId: string;
68
- authority: AssertionAuthority;
69
- polarity: AssertionPolarity;
70
- scope: AssertionScope;
71
- meaning: AssertionMeaning;
72
- provenance: AssertionProvenance;
73
- observedAt: string;
74
- confirmedAt?: string;
75
- validFrom?: string;
76
- validUntil?: string;
77
- /** Logical withdrawal is append-only; physical privacy deletion is an application concern. */
78
- retractedAt?: string;
79
- supersedesAssertionId?: string;
80
- }
81
- interface TasteAssertion extends PortableAssertionBase {
82
- role: "taste";
83
- }
84
- interface ProjectContextAssertion extends PortableAssertionBase {
85
- role: "project_context";
86
- }
87
- type RequirementOperator = "equals" | "not_equals" | "at_least" | "at_most" | "includes" | "excludes";
88
- interface RequirementConstraint {
89
- operator: RequirementOperator;
90
- value: boolean | number | string;
91
- unit?: string;
92
- }
93
- interface RequirementAssertion extends PortableAssertionBase {
94
- role: "requirement";
95
- /** The dimension is canonical meaning; the source-owned required value remains typed here. */
96
- constraint: RequirementConstraint;
97
- }
98
- /** Portable evidence semantics only. Ranking weights and serving policy belong to each consumer. */
99
- type PortableTasteAssertion = TasteAssertion | ProjectContextAssertion | RequirementAssertion;
100
- interface PortableAssertionTestVector {
101
- assertion: PortableTasteAssertion;
102
- id: string;
103
- expected: {
104
- actorId: string;
105
- subjectId: string;
106
- projectId: string;
107
- role: AssertionRole;
108
- meaningKind: AssertionMeaning["kind"];
109
- };
110
- }
111
- /** Executable fixtures for consumers serialising the portable envelope in another repository. */
112
- declare const PORTABLE_ASSERTION_TEST_VECTORS: readonly PortableAssertionTestVector[];
113
-
114
- interface CanonicalisationInput {
115
- sourceSystem: string;
116
- sourceField: string;
117
- sourceValue: string;
118
- provenance: AssertionProvenance;
119
- }
120
- interface CanonicalisationBase extends CanonicalisationInput {
121
- crosswalkVersion: string;
122
- taxonomySnapshotVersion: string;
123
- }
124
- interface ResolvedCanonicalisation extends CanonicalisationBase {
125
- status: "resolved";
126
- canonical: CanonicalBundle;
127
- /**
128
- * How strongly the canonical bundle stands for the source value, in SKOS's own vocabulary. A
129
- * consumer may treat `exact` as an identity and must treat everything else as an approximation
130
- * it has been told about. See `crosswalks/strength.ts` for the direction convention.
131
- */
132
- match: MatchStrength;
133
- /** Why the row is not exact. Present whenever `match` is not `exact`. */
134
- note?: string;
135
- }
136
- interface AmbiguousCanonicalisation extends CanonicalisationBase {
137
- status: "ambiguous";
138
- alternatives: CanonicalAlternatives;
139
- /** How strongly each alternative would stand for the source value, were it the right reading. */
140
- match: MatchStrength;
141
- note?: string;
142
- }
143
- interface UnresolvedCanonicalisation extends CanonicalisationBase {
144
- status: "unresolved";
145
- }
146
- interface DeclinedCanonicalisation extends CanonicalisationBase {
147
- status: "declined";
148
- reason: string;
149
- }
150
- /** Four honest outcomes: absence of a mapping is never silently treated as a decline or a match. */
151
- type CanonicalisationVerdict = ResolvedCanonicalisation | AmbiguousCanonicalisation | UnresolvedCanonicalisation | DeclinedCanonicalisation;
152
- /** Convert a usable verdict to assertion meaning; a declined value does not assert anything. */
153
- declare const assertionMeaningFrom: (verdict: CanonicalisationVerdict) => AssertionMeaning | null;
154
-
155
- export { type AmbiguousAssertionMeaning, type AmbiguousCanonicalisation, type AssertionAuthority, type AssertionMeaning, type AssertionPolarity, type AssertionProvenance, type AssertionRole, type AssertionScope, type CanonicalisationInput, type CanonicalisationVerdict, type DeclinedCanonicalisation, PORTABLE_ASSERTION_TEST_VECTORS, type PortableAssertionTestVector, type PortableTasteAssertion, type ProjectContextAssertion, type RequirementAssertion, type RequirementConstraint, type RequirementOperator, type ResolvedAssertionMeaning, type ResolvedCanonicalisation, TASTE_ASSERTION_CONTRACT_VERSION, TAXONOMY_SNAPSHOT_VERSION, type TasteAssertion, type UnresolvedAssertionMeaning, type UnresolvedCanonicalisation, assertionMeaningFrom };
package/dist/taste.js DELETED
@@ -1,14 +0,0 @@
1
- import {
2
- assertionMeaningFrom
3
- } from "./chunk-CTKOLWGS.js";
4
- import {
5
- PORTABLE_ASSERTION_TEST_VECTORS,
6
- TASTE_ASSERTION_CONTRACT_VERSION,
7
- TAXONOMY_SNAPSHOT_VERSION
8
- } from "./chunk-FCMCKNQF.js";
9
- export {
10
- PORTABLE_ASSERTION_TEST_VECTORS,
11
- TASTE_ASSERTION_CONTRACT_VERSION,
12
- TAXONOMY_SNAPSHOT_VERSION,
13
- assertionMeaningFrom
14
- };