@instruments/taxonomy 0.1.0 → 0.3.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
@@ -1,10 +1,8 @@
1
1
  # @instruments/taxonomy
2
2
 
3
- The canonical materials taxonomy for the Material Instruments ecosystem: the governed
4
- **dictionaries** (material families, sectors, and the hierarchical application zones) plus the
5
- **consumer crosswalks** that map an external vendor's local vocabulary onto the canon. This package
6
- is the single publishable home of the Material Semantics vocabularies that were previously vendored
7
- per-repo as drifting local copies.
3
+ The canonical materials taxonomy for the Material Instruments ecosystem: the governed **dictionaries** (material families, sectors, and the hierarchical application zones) plus the **consumer crosswalks** that map an external vendor's local vocabulary onto the canon. This package is the single publishable home of the Material Semantics vocabularies that were previously vendored per-repo as drifting local copies.
4
+
5
+ It also publishes appearance concepts and a portable taste-assertion contract. Applications own their evidence stores and ranking policy; this package owns shared meaning, source crosswalk verdicts, and the envelope that lets evidence travel without turning a source label into fact.
8
6
 
9
7
  ## Install
10
8
 
@@ -16,9 +14,7 @@ pnpm add @instruments/taxonomy
16
14
 
17
15
  ### `@instruments/taxonomy` — the dictionaries
18
16
 
19
- The pinned public vocabularies: `MATERIAL_FAMILIES` (17), `SECTORS` (10), `APPLICATIONS` (88 — 30
20
- top-level zones plus 58 children). Each ships a `*_TERMS` array of labelled `TaxonomyTerm`s, an
21
- `as const` id tuple, a string-literal type, and a `Set`-backed guard.
17
+ The pinned public vocabularies: `MATERIAL_FAMILIES` (17), `SECTORS` (10), `APPLICATIONS` (88 — 30 top-level zones plus 58 children). Each ships a `*_TERMS` array of labelled `TaxonomyTerm`s, an `as const` id tuple, a string-literal type, and a `Set`-backed guard.
22
18
 
23
19
  ```ts
24
20
  import {
@@ -36,9 +32,7 @@ applicationTopLevelOf("wall"); // "wall" (already top-level)
36
32
 
37
33
  ### `@instruments/taxonomy/crosswalks/miu` — the MIU consumer crosswalk
38
34
 
39
- Maps the Materials In Use (MIU) local vocabularies onto the canonical dictionaries. Total,
40
- compile-time-checked `Record` maps plus string accessors that resolve unknown input to `null`
41
- instead of throwing.
35
+ Maps the Materials In Use (MIU) local vocabularies onto the canonical dictionaries. Total, compile-time-checked `Record` maps plus string accessors that resolve unknown input to `null` instead of throwing.
42
36
 
43
37
  ```ts
44
38
  import {
@@ -51,35 +45,72 @@ miuFamilyToCanonical("greenery_planting"); // null (declines to classify)
51
45
  MIU_SURFACE_APPLICATION_TO_CANONICAL.railing; // "stair_railing"
52
46
  ```
53
47
 
48
+ ### Canonical bundles and match semantics
49
+
50
+ Consumers compose qualified assertions into canonical bundles rather than minting app-specific compound tags. Every constitutive assertion is required; matched constitutive assertions score 2 and matched accents score 1. Unroled assertions default to accent, extra candidate annotations are not penalised, and the package publishes residential and commercial test vectors so another language can reproduce the ranking exactly.
51
+
52
+ ```ts
53
+ import { defineBundle, matchBundle } from "@instruments/taxonomy";
54
+
55
+ const quietKitchen = defineBundle([
56
+ { assertion: "space.kitchen", role: "constitutive" },
57
+ { assertion: "mood.calm" },
58
+ { assertion: "style.minimalism" },
59
+ ]);
60
+
61
+ matchBundle(quietKitchen, ["space.kitchen", "mood.calm"]);
62
+ // { eligible: true, score: 0.75, ... }
63
+ ```
64
+
65
+ `defineAlternatives` preserves a source term known to have one of several readings without guessing. The DesignShop and materia `Modern` crosswalk rows now carry an explicit any-of between `style.modernism` and `style.contemporary` instead of disappearing from downstream joins.
66
+
67
+ ### Appearance axes
68
+
69
+ Product category, specific material, pattern, finish, format and construction are independent axes. That separation is deliberate: plain porcelain, geometric porcelain and stone-effect porcelain share `material.porcelain` while carrying different pattern concepts. A commercial carpet and residential wallcovering use the same pattern semantics; there is no “commercial style” branch.
70
+
71
+ Requirement concepts name dimensions such as slip resistance, availability and fire performance. The assertion envelope carries the operator and required value separately, because a taxonomy can name the question but cannot assert that a particular product passes it.
72
+
73
+ ### `@instruments/taxonomy/crosswalks/designshop`
74
+
75
+ The frozen DesignShop vocabulary resolves through a versioned four-state crosswalk:
76
+
77
+ ```ts
78
+ import { canonicaliseDesignShop } from "@instruments/taxonomy/crosswalks/designshop";
79
+
80
+ canonicaliseDesignShop({
81
+ provenance: {
82
+ sourceRecordId: "scheme:123",
83
+ sourceSnapshotVersion: "designshop-estate-1",
84
+ sourceSystem: "designshop",
85
+ },
86
+ sourceField: "pattern",
87
+ sourceValue: "Solid",
88
+ });
89
+ // resolved -> pattern.plain
90
+ ```
91
+
92
+ `resolved`, `ambiguous`, `unresolved` and `declined` are different results. Unknown input remains unresolved with its raw value intact; only a curated row can decline. `Modern` remains an ambiguous choice between contemporary and modernism until another source or a person confirms one reading. `DESIGNSHOP_APPEARANCE_TEST_VECTORS` is the executable consumer contract.
93
+
94
+ ### `@instruments/taxonomy/taste`
95
+
96
+ `PortableTasteAssertion` separates actor, taste subject and project; taste, context and requirement roles; canonical and unresolved meaning; scope, authority, polarity, time and provenance. It intentionally contains no boost, rank or serving weight. Those are application policy, not portable meaning. Requirement assertions additionally carry a typed constraint.
97
+
98
+ `PORTABLE_ASSERTION_TEST_VECTORS` gives TypeScript and non-TypeScript consumers stable fixtures for serialization and contract tests.
99
+
54
100
  ## Provenance and the re-sync ritual
55
101
 
56
- The dictionaries are lifted **verbatim** from materialgraph —
57
- `packages/schema/src/registry/value-dictionaries.ts`, snapshot `2026-07-08` (see the exported
58
- `PROVENANCE` constant). Every term was lifecycle-active at that snapshot; lifecycle fields are
59
- deferred from the published shape until governance needs them.
102
+ The dictionaries are lifted **verbatim** from materialgraph — `packages/schema/src/registry/value-dictionaries.ts`, snapshot `2026-07-08` (see the exported `PROVENANCE` constant). Every term was lifecycle-active at that snapshot; lifecycle fields are deferred from the published shape until governance needs them.
60
103
 
61
- To re-sync: re-read the upstream file, re-check the terms list, the `broaderTermId` edges, and the
62
- lifecycle fields, then bump this package. `src/materialgraph-sync.test.ts` mechanises the check — it
63
- reads a sibling `~/Sites/materialgraph` checkout and asserts every id is still present upstream
64
- (skipping only when that checkout is absent).
104
+ To re-sync: re-read the upstream file, re-check the terms list, the `broaderTermId` edges, and the lifecycle fields, then bump this package. `src/materialgraph-sync.test.ts` mechanises the check — it reads a sibling `~/Sites/materialgraph` checkout and asserts every id is still present upstream (skipping only when that checkout is absent).
65
105
 
66
106
  ## The other-vs-null policy
67
107
 
68
- For families and sectors, `other` is a **positive** classification — the canon's own dictionary
69
- would file the term under `other`. `null` **declines** to classify: it is not a member at all, it
70
- spans members, or any claim (including `other`) would be false. `unknown` therefore always maps to
71
- `null`, never `other` — unknown is epistemic ("we couldn't identify it") while other is ontological
72
- ("identified; fits no bucket"); the application crosswalk has no `other` term at all, so there its
73
- policy collapses to mapped-or-`null`.
108
+ For families and sectors, `other` is a **positive** classification — the canon's own dictionary would file the term under `other`. `null` **declines** to classify: it is not a member at all, it spans members, or any claim (including `other`) would be false. `unknown` therefore always maps to `null`, never `other` — unknown is epistemic ("we couldn't identify it") while other is ontological ("identified; fits no bucket"); the application crosswalk has no `other` term at all, so there its policy collapses to mapped-or-`null`.
74
109
 
75
110
  ## Versioning
76
111
 
77
- Semver; changesets will drive releases later. Consumers should keep a **single pin** of this
78
- package. The anti-pattern to avoid is the colorscope `3.6.0` / `3.7.1` split, where two pinned
79
- copies of the same taxonomy drifted apart inside one dependency graph — the exact fragmentation this
80
- package exists to end.
112
+ Semver; changesets will drive releases later. Consumers should keep a **single pin** of this package. The anti-pattern to avoid is the colorscope `3.6.0` / `3.7.1` split, where two pinned copies of the same taxonomy drifted apart inside one dependency graph — the exact fragmentation this package exists to end.
81
113
 
82
114
  ## Roadmap
83
115
 
84
- Additive minors, all backward-compatible: an exported Material Bank category tree artifact, and
85
- per-term lifecycle fields (status, deprecation, successor pointers) once governance requires them.
116
+ Additive minors, all backward-compatible: an exported Material Bank category tree artifact, and per-term lifecycle fields (status, deprecation, successor pointers) once governance requires them.