@instruments/criteria 0.0.0-stage → 0.2.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/LICENSE +7 -0
- package/README.md +12 -2
- package/dist/assessment-policy.d.ts +47 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +175 -0
- package/package.json +39 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Copyright © 2026 Material Technologies, LLC. All rights reserved.
|
|
2
|
+
|
|
3
|
+
This software and associated documentation files are the proprietary
|
|
4
|
+
property of Material Technologies, LLC. No license, express or implied,
|
|
5
|
+
is granted to use, copy, modify, merge, publish, distribute, sublicense,
|
|
6
|
+
or sell copies of this software except under a separate written
|
|
7
|
+
agreement with Material Technologies, LLC.
|
package/README.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @instruments/criteria
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
MaterialSchema Criteria: what evidence a material value needs, and for which use.
|
|
4
|
+
|
|
5
|
+
- `CONCEPT_ASSESSMENT_POLICIES`: for every active Taxonomy concept, how a value for it can be established (photo, controlled capture, catalog, context or an external authority), its requirements, and its applicability-review status.
|
|
6
|
+
- `ASSESSMENT_POLICY_REVISION`: a hash of the policies, the authority references and the Taxonomy corpus revision they were computed from.
|
|
7
|
+
- `ASSESSMENT_AUTHORITY_REFERENCES`: the owner references the policies were audited against. They are not a claim of standards compliance.
|
|
8
|
+
|
|
9
|
+
These moved here from `@instruments/taxonomy` 5.x. Taxonomy holds words; what evidence a value needs is MaterialSchema's.
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import { CONCEPT_ASSESSMENT_POLICIES } from "@instruments/criteria";
|
|
13
|
+
```
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { ConceptId } from "@instruments/taxonomy";
|
|
2
|
+
/** Evidence routes are consumer contracts, never new appearance concepts. */
|
|
3
|
+
export type AssessmentEvidenceRoute = "photo-candidate" | "capture-conditional" | "catalog-only" | "context-required" | "external-authority" | "unreviewed";
|
|
4
|
+
/** A restriction needs an explicit list AND evidence; absence never means prohibited. */
|
|
5
|
+
export type MaterialApplicability = {
|
|
6
|
+
status: "unreviewed";
|
|
7
|
+
reason: string;
|
|
8
|
+
} | {
|
|
9
|
+
status: "cross-category";
|
|
10
|
+
evidence: readonly string[];
|
|
11
|
+
} | {
|
|
12
|
+
status: "restricted";
|
|
13
|
+
categoryIds: readonly ConceptId[];
|
|
14
|
+
evidence: readonly string[];
|
|
15
|
+
};
|
|
16
|
+
export interface ConceptAssessmentPolicy {
|
|
17
|
+
conceptId: ConceptId;
|
|
18
|
+
evidenceRoute: AssessmentEvidenceRoute;
|
|
19
|
+
materialApplicability: MaterialApplicability;
|
|
20
|
+
requirements: readonly string[];
|
|
21
|
+
references: readonly string[];
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Total accounting for every concept. Unreviewed applicability is intentional:
|
|
25
|
+
* supplier omissions and general word knowledge cannot establish material exclusions.
|
|
26
|
+
* Definitions, aliases and cardinality continue to come from KNOWLEDGE_GRAPH.
|
|
27
|
+
*/
|
|
28
|
+
export declare const CONCEPT_ASSESSMENT_POLICIES: readonly ConceptAssessmentPolicy[];
|
|
29
|
+
/** These owner references anchor the audit, not a claim of standards compliance. */
|
|
30
|
+
export declare const ASSESSMENT_AUTHORITY_REFERENCES: readonly [{
|
|
31
|
+
readonly role: "appearance-terminology";
|
|
32
|
+
readonly url: "https://store.astm.org/e0284-25.html";
|
|
33
|
+
}, {
|
|
34
|
+
readonly role: "property-measurement";
|
|
35
|
+
readonly url: "https://store.astm.org/d0523-25.html";
|
|
36
|
+
}, {
|
|
37
|
+
readonly role: "construction-classification";
|
|
38
|
+
readonly url: "https://uniclass.thenbs.com/";
|
|
39
|
+
}, {
|
|
40
|
+
readonly role: "construction-classification";
|
|
41
|
+
readonly url: "https://www.csiresources.org/standards/overview";
|
|
42
|
+
}, {
|
|
43
|
+
readonly role: "controlled-vocabulary";
|
|
44
|
+
readonly url: "https://www.getty.edu/research/tools/vocabularies/aat/about.html";
|
|
45
|
+
}];
|
|
46
|
+
/** Revisioned separately so adding consumer policy cannot silently change concept meanings. */
|
|
47
|
+
export declare const ASSESSMENT_POLICY_REVISION: `sha256:${string}`;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MaterialSchema Criteria: what evidence a material value needs, and for which use.
|
|
3
|
+
*
|
|
4
|
+
* Every Taxonomy concept has an assessment policy saying how a value for it can be
|
|
5
|
+
* established: from a photo, from a controlled capture, from the catalog, from context
|
|
6
|
+
* or from an external authority.
|
|
7
|
+
*/
|
|
8
|
+
export { ASSESSMENT_AUTHORITY_REFERENCES, ASSESSMENT_POLICY_REVISION, type AssessmentEvidenceRoute, type ConceptAssessmentPolicy, CONCEPT_ASSESSMENT_POLICIES, type MaterialApplicability, } from "./assessment-policy.js";
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
// src/assessment-policy.ts
|
|
2
|
+
import { createHash } from "crypto";
|
|
3
|
+
import {
|
|
4
|
+
KNOWLEDGE_GRAPH,
|
|
5
|
+
TAXONOMY_CORPUS_REVISION
|
|
6
|
+
} from "@instruments/taxonomy";
|
|
7
|
+
var PHOTO_CANDIDATE_IDS = [
|
|
8
|
+
"a25rut4",
|
|
9
|
+
"a36ih4u",
|
|
10
|
+
"nt0r2ay",
|
|
11
|
+
"793mdn0",
|
|
12
|
+
"yg3r9b6",
|
|
13
|
+
"0id0aoo",
|
|
14
|
+
"p9f8bdr",
|
|
15
|
+
"n1attg2",
|
|
16
|
+
"7mo243b",
|
|
17
|
+
"9bo96qi",
|
|
18
|
+
"6outf0s",
|
|
19
|
+
"sqfry5s",
|
|
20
|
+
"4h5tr73",
|
|
21
|
+
"t288du8",
|
|
22
|
+
"0rrptai",
|
|
23
|
+
"311odsh",
|
|
24
|
+
"fyg855f",
|
|
25
|
+
"eei2ebl",
|
|
26
|
+
"6oseuny",
|
|
27
|
+
"n8yl0q8",
|
|
28
|
+
"bhm1cna",
|
|
29
|
+
"fjjmbmf",
|
|
30
|
+
"hn587l1",
|
|
31
|
+
"3npq2th",
|
|
32
|
+
"sfsbcog",
|
|
33
|
+
"7560cyh",
|
|
34
|
+
"rui92tj",
|
|
35
|
+
"t74bipe",
|
|
36
|
+
"cfyj2pr",
|
|
37
|
+
"ic8gy44",
|
|
38
|
+
"1sy3h2r",
|
|
39
|
+
"r6qcy0n",
|
|
40
|
+
"ci3uo8i",
|
|
41
|
+
"mfy7n3u",
|
|
42
|
+
"ut5tai2",
|
|
43
|
+
"s53qj1l",
|
|
44
|
+
"099mirl",
|
|
45
|
+
"8sft4bn",
|
|
46
|
+
"j0pdbj8",
|
|
47
|
+
"nug1q2d",
|
|
48
|
+
"rhnnfjt",
|
|
49
|
+
"620ymje",
|
|
50
|
+
"s6tqm6l",
|
|
51
|
+
"4pn7ro0",
|
|
52
|
+
"oysfto8",
|
|
53
|
+
"3yie787",
|
|
54
|
+
"4jjsb08",
|
|
55
|
+
"8cjuo8y",
|
|
56
|
+
"58mq96h",
|
|
57
|
+
"4d6nn2b",
|
|
58
|
+
"9pt61it",
|
|
59
|
+
"5ih9a7u",
|
|
60
|
+
"rjl9pjf",
|
|
61
|
+
"5nac6a9",
|
|
62
|
+
"7y71s9o",
|
|
63
|
+
"bs3c3pt",
|
|
64
|
+
"3ltf4n5",
|
|
65
|
+
"j803u06",
|
|
66
|
+
"ppb02c7",
|
|
67
|
+
"ldn6y4e",
|
|
68
|
+
"l2990b0",
|
|
69
|
+
"7q54sem",
|
|
70
|
+
"873go2s",
|
|
71
|
+
"btpa8p5"
|
|
72
|
+
];
|
|
73
|
+
var photoIds = new Set(PHOTO_CANDIDATE_IDS);
|
|
74
|
+
var CONTEXT_REQUIRED_IDS = ["shjb82c", "n8pbmtu"];
|
|
75
|
+
var contextRequiredIds = new Set(CONTEXT_REQUIRED_IDS);
|
|
76
|
+
var requirementsFor = (concept) => {
|
|
77
|
+
if (photoIds.has(concept.id)) {
|
|
78
|
+
return [
|
|
79
|
+
"Assess only the supplied material region and visible canonical meaning.",
|
|
80
|
+
"Sufficient native detail and field extent; unavailable evidence is unknown.",
|
|
81
|
+
"A detail-view decision does not automatically describe the overview.",
|
|
82
|
+
"Appearance never proves composition, manufacturing process or product identity."
|
|
83
|
+
];
|
|
84
|
+
}
|
|
85
|
+
if (contextRequiredIds.has(concept.id)) {
|
|
86
|
+
return [
|
|
87
|
+
"A dyeing or weaving method; the catalog must state it, a photo can only say it resembles it."
|
|
88
|
+
];
|
|
89
|
+
}
|
|
90
|
+
if (concept.facet === "7qafh81") {
|
|
91
|
+
return [
|
|
92
|
+
"Retain catalog evidence under ADR 0008; image confirmation is not admitted."
|
|
93
|
+
];
|
|
94
|
+
}
|
|
95
|
+
if (concept.facet === "nocyybu") {
|
|
96
|
+
return [
|
|
97
|
+
"Physical extent or repeat measurement; pixel size alone is insufficient."
|
|
98
|
+
];
|
|
99
|
+
}
|
|
100
|
+
if (concept.facet === "2ggn2ii") {
|
|
101
|
+
return [
|
|
102
|
+
"Specified illumination and viewing angles; an arbitrary photo is insufficient."
|
|
103
|
+
];
|
|
104
|
+
}
|
|
105
|
+
if (concept.axis === "7l4do9f") {
|
|
106
|
+
return [
|
|
107
|
+
"An installed assembly with actual unit boundaries, not an isolated unit or printed resemblance."
|
|
108
|
+
];
|
|
109
|
+
}
|
|
110
|
+
return [];
|
|
111
|
+
};
|
|
112
|
+
var routeFor = (concept) => {
|
|
113
|
+
if (photoIds.has(concept.id)) {
|
|
114
|
+
return "photo-candidate";
|
|
115
|
+
}
|
|
116
|
+
if (contextRequiredIds.has(concept.id)) {
|
|
117
|
+
return "context-required";
|
|
118
|
+
}
|
|
119
|
+
if (concept.axis === "s7js3u7") {
|
|
120
|
+
return "external-authority";
|
|
121
|
+
}
|
|
122
|
+
if (concept.facet === "7qafh81") {
|
|
123
|
+
return "catalog-only";
|
|
124
|
+
}
|
|
125
|
+
if (concept.facet === "nocyybu" || concept.facet === "2ggn2ii" || concept.axis === "7l4do9f") {
|
|
126
|
+
return "capture-conditional";
|
|
127
|
+
}
|
|
128
|
+
if (["40cp0sh", "3ldm0c0", "g3pe1td", "6nqty8t"].some(
|
|
129
|
+
(axis) => concept.axis === axis
|
|
130
|
+
) || concept.facet === "n4fbgls") {
|
|
131
|
+
return "catalog-only";
|
|
132
|
+
}
|
|
133
|
+
if (["jin3f3h", "fr73q6p", "poteq42"].some((axis) => concept.axis === axis)) {
|
|
134
|
+
return "context-required";
|
|
135
|
+
}
|
|
136
|
+
return "unreviewed";
|
|
137
|
+
};
|
|
138
|
+
var CONCEPT_ASSESSMENT_POLICIES = KNOWLEDGE_GRAPH.nodes.filter((node) => node.kind === "concept").map((concept) => ({
|
|
139
|
+
conceptId: concept.id,
|
|
140
|
+
evidenceRoute: routeFor(concept),
|
|
141
|
+
materialApplicability: {
|
|
142
|
+
reason: "Category scope has not received a complete evidence-backed cross-surface review.",
|
|
143
|
+
status: "unreviewed"
|
|
144
|
+
},
|
|
145
|
+
references: [concept.id],
|
|
146
|
+
requirements: requirementsFor(concept)
|
|
147
|
+
}));
|
|
148
|
+
var ASSESSMENT_AUTHORITY_REFERENCES = [
|
|
149
|
+
{
|
|
150
|
+
role: "appearance-terminology",
|
|
151
|
+
url: "https://store.astm.org/e0284-25.html"
|
|
152
|
+
},
|
|
153
|
+
{ role: "property-measurement", url: "https://store.astm.org/d0523-25.html" },
|
|
154
|
+
{ role: "construction-classification", url: "https://uniclass.thenbs.com/" },
|
|
155
|
+
{
|
|
156
|
+
role: "construction-classification",
|
|
157
|
+
url: "https://www.csiresources.org/standards/overview"
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
role: "controlled-vocabulary",
|
|
161
|
+
url: "https://www.getty.edu/research/tools/vocabularies/aat/about.html"
|
|
162
|
+
}
|
|
163
|
+
];
|
|
164
|
+
var ASSESSMENT_POLICY_REVISION = `sha256:${createHash("sha256").update(
|
|
165
|
+
JSON.stringify({
|
|
166
|
+
authorities: ASSESSMENT_AUTHORITY_REFERENCES,
|
|
167
|
+
policies: CONCEPT_ASSESSMENT_POLICIES,
|
|
168
|
+
taxonomyRevision: TAXONOMY_CORPUS_REVISION
|
|
169
|
+
})
|
|
170
|
+
).digest("hex")}`;
|
|
171
|
+
export {
|
|
172
|
+
ASSESSMENT_AUTHORITY_REFERENCES,
|
|
173
|
+
ASSESSMENT_POLICY_REVISION,
|
|
174
|
+
CONCEPT_ASSESSMENT_POLICIES
|
|
175
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,42 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instruments/criteria",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "MaterialSchema Criteria: what evidence a material value needs, and for which use.",
|
|
5
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/materialinstruments/materialschema.git"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist",
|
|
12
|
+
"README.md",
|
|
13
|
+
"LICENSE"
|
|
14
|
+
],
|
|
15
|
+
"type": "module",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"import": "./dist/index.js"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"access": "public"
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@instruments/taxonomy": "5.2.0"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@howells/lint": "^3.10.2",
|
|
30
|
+
"@types/node": "^26.6.6",
|
|
31
|
+
"tsup": "^8.5.1",
|
|
32
|
+
"typescript": "^7.0.2",
|
|
33
|
+
"vitest": "^5.1.0"
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"build": "tsup && tsc -p tsconfig.build.json && node ../../scripts/finalize-declarations.mjs dist",
|
|
37
|
+
"lint": "howells-check .",
|
|
38
|
+
"lint:fix": "howells-fix .",
|
|
39
|
+
"test": "vitest run",
|
|
40
|
+
"typecheck": "tsc --noEmit"
|
|
41
|
+
}
|
|
6
42
|
}
|