qlm-measure 0.2.0 → 0.2.2

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.
Files changed (61) hide show
  1. package/LICENSE +159 -12
  2. package/README.md +24 -139
  3. package/dist/checks.d.ts +21 -0
  4. package/dist/checks.d.ts.map +1 -0
  5. package/dist/checks.js +25 -0
  6. package/dist/checks.js.map +1 -0
  7. package/dist/cli.d.ts +7 -0
  8. package/dist/cli.d.ts.map +1 -0
  9. package/dist/cli.js +314 -0
  10. package/dist/cli.js.map +1 -0
  11. package/dist/clients/engine-client.d.ts +1 -1
  12. package/dist/clients/engine-client.d.ts.map +1 -1
  13. package/dist/clients/engine-client.js +1 -1
  14. package/dist/clients/engine-client.js.map +1 -1
  15. package/dist/clients/index.d.ts +4 -4
  16. package/dist/clients/index.d.ts.map +1 -1
  17. package/dist/clients/index.js +2 -2
  18. package/dist/clients/index.js.map +1 -1
  19. package/dist/clients/ontology-client.d.ts +10 -0
  20. package/dist/clients/ontology-client.d.ts.map +1 -1
  21. package/dist/clients/ontology-client.js +4 -0
  22. package/dist/clients/ontology-client.js.map +1 -1
  23. package/dist/emitter/index.d.ts +2 -2
  24. package/dist/emitter/index.d.ts.map +1 -1
  25. package/dist/emitter/index.js +1 -1
  26. package/dist/emitter/index.js.map +1 -1
  27. package/dist/emitter/measurement-emitter.d.ts +1 -1
  28. package/dist/emitter/measurement-emitter.d.ts.map +1 -1
  29. package/dist/index.d.ts +19 -16
  30. package/dist/index.d.ts.map +1 -1
  31. package/dist/index.js +12 -8
  32. package/dist/index.js.map +1 -1
  33. package/dist/rules.d.ts +10 -0
  34. package/dist/rules.d.ts.map +1 -0
  35. package/dist/rules.js +46 -0
  36. package/dist/rules.js.map +1 -0
  37. package/dist/schema/evidence-record.d.ts +2 -2
  38. package/dist/schema/evidence-record.d.ts.map +1 -1
  39. package/dist/schema/index.d.ts +6 -6
  40. package/dist/schema/index.d.ts.map +1 -1
  41. package/dist/schema/index.js +2 -2
  42. package/dist/schema/index.js.map +1 -1
  43. package/dist/schema/measurement-event.d.ts +1 -1
  44. package/dist/schema/measurement-event.d.ts.map +1 -1
  45. package/dist/schema/observation-event.d.ts +1 -1
  46. package/dist/schema/observation-event.d.ts.map +1 -1
  47. package/dist/verifier/hash.d.ts +8 -7
  48. package/dist/verifier/hash.d.ts.map +1 -1
  49. package/dist/verifier/hash.js +17 -31
  50. package/dist/verifier/hash.js.map +1 -1
  51. package/dist/verifier/index.d.ts +4 -4
  52. package/dist/verifier/index.d.ts.map +1 -1
  53. package/dist/verifier/index.js +3 -3
  54. package/dist/verifier/index.js.map +1 -1
  55. package/dist/verifier/replay.d.ts +1 -1
  56. package/dist/verifier/replay.d.ts.map +1 -1
  57. package/dist/verifier/verify-record.d.ts +4 -30
  58. package/dist/verifier/verify-record.d.ts.map +1 -1
  59. package/dist/verifier/verify-record.js +44 -83
  60. package/dist/verifier/verify-record.js.map +1 -1
  61. package/package.json +4 -1
package/LICENSE CHANGED
@@ -1,3 +1,4 @@
1
+
1
2
  Apache License
2
3
  Version 2.0, January 2004
3
4
  http://www.apache.org/licenses/
@@ -5,24 +6,63 @@
5
6
  TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
7
 
7
8
  1. Definitions.
9
+
8
10
  "License" shall mean the terms and conditions for use, reproduction,
9
11
  and distribution as defined by Sections 1 through 9 of this document.
12
+
10
13
  "Licensor" shall mean the copyright owner or entity authorized by
11
14
  the copyright owner that is granting the License.
15
+
12
16
  "Legal Entity" shall mean the union of the acting entity and all
13
17
  other entities that control, are controlled by, or are under common
14
- control with that entity.
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
15
24
  "You" (or "Your") shall mean an individual or Legal Entity
16
25
  exercising permissions granted by this License.
17
- "Source" form shall mean the preferred form for making modifications.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
18
31
  "Object" form shall mean any form resulting from mechanical
19
- transformation or translation of a Source form.
20
- "Work" shall mean the work of authorship made available under the License.
21
- "Derivative Works" shall mean any work that is based on the Work.
22
- "Contribution" shall mean any work of authorship submitted to the
23
- Licensor for inclusion in the Work.
24
- "Contributor" shall mean Licensor and any Legal Entity on behalf of
25
- whom a Contribution has been received by the Licensor.
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to the Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by the Licensor and
65
+ subsequently incorporated within the Work.
26
66
 
27
67
  2. Grant of Copyright License. Subject to the terms and conditions of
28
68
  this License, each Contributor hereby grants to You a perpetual,
@@ -34,10 +74,117 @@
34
74
  3. Grant of Patent License. Subject to the terms and conditions of
35
75
  this License, each Contributor hereby grants to You a perpetual,
36
76
  worldwide, non-exclusive, no-charge, royalty-free, irrevocable
37
- patent license to make, have made, use, offer to sell, sell, import,
38
- and otherwise transfer the Work.
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding any notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
39
180
 
40
- 4-9. [Standard Apache 2.0 terms apply]
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. Please also get specific
186
+ permission from your organization's legal counsel before applying
187
+ the license to work owned by your organization.
41
188
 
42
189
  Copyright 2026 Quantum Learning Machines
43
190
 
package/README.md CHANGED
@@ -2,166 +2,51 @@
2
2
 
3
3
  Open measurement SDK for education AI — evidence events, record verification, and dataset clients.
4
4
 
5
- **v0.2.0 · Apache-2.0 (code) · CC-BY-4.0 (data/schemas) · [Documentation](https://play.quantumlearningmachines.com/developer) · [Manifesto](https://play.quantumlearningmachines.com/resources/open-measurement-layer)**
5
+ **Apache-2.0 · [Developer Portal](https://play.quantumlearningmachines.com/developer)**
6
6
 
7
- ## Limitations (read first)
8
-
9
- - This SDK is the **public interface layer**, not the measurement engine. The estimation service (Bayesian posteriors, IRT ability estimation, calibration) is QLM's hosted engine.
10
- - The verifier checks **bookkeeping integrity**, not estimation correctness. It can tell you if a record was tampered with. It cannot tell you if the posteriors are accurate. That distinction is the design.
11
- - Evidence event schemas are **v0.1** and may change in minor versions. Pin your dependency.
12
- - The ontology client requires the QLM API to be reachable. No offline mode.
13
- - Classifier runners require model weights downloaded separately from Hugging Face.
7
+ ## What this is
14
8
 
15
- ## What it is
9
+ A typed evidence-event vocabulary, a hash-chained record format, and a verifier that checks bookkeeping integrity without containing any estimation mathematics. The verifier runs locally, makes no network calls, and records never leave your machine.
16
10
 
17
- 1. **Typed evidence-event vocabulary** (`ObservationEvent`) — a schema any tool can emit to describe a student interaction, with scaffold level, depth, epistemic mode.
18
- 2. **Buffered telemetry emitter** (`MeasurementEmitter`) — sends events to the measurement service with sendBeacon fallback.
19
- 3. **Evidence record format + replay verifier** (`verifyRecord`, `replayToVersion`) — audits a record's hash-chain and posterior-chain integrity without containing any estimation mathematics.
20
- 4. **Dataset clients** (`OntologyClient`) — typed wrappers over the public misconception ontology, learning graph, and standards alignment APIs.
21
- 5. **Engine client** (`EngineClient`) — commercial boundary for the hosted measurement service.
11
+ ## What this is not
22
12
 
23
- ## What it is NOT
24
-
25
- - Not the estimation engine (that runs server-side at QLM)
26
- - Not a standalone learning analytics system
27
- - Not a replacement for the measurement service
28
- - Not a classifier or scorer (those are separate open-weights releases)
13
+ Not the estimation engine (that runs server-side). Not a learning analytics system. Not a replacement for the measurement service.
29
14
 
30
15
  ## Install
31
16
 
17
+ **Python:**
32
18
  ```bash
33
- npm install qlm-measure
34
- # or
35
19
  pip install qlm-measure
36
20
  ```
37
21
 
38
- ## Quickstart
39
-
40
- ### 1. Query the misconception ontology (no auth)
41
-
42
- ```typescript
43
- import { OntologyClient } from "qlm-measure/clients";
44
-
45
- const client = new OntologyClient();
46
- const misconceptions = await client.getMisconceptions("math");
47
- console.log(`${misconceptions.length} math misconceptions`);
48
- ```
49
-
50
- ### 2. Emit measurement events
51
-
52
- ```typescript
53
- import { MeasurementEmitter } from "qlm-measure/emitter";
54
-
55
- const emitter = new MeasurementEmitter({
56
- baseUrl: "https://play.quantumlearningmachines.com",
57
- product: "my-tool",
58
- });
59
-
60
- emitter.emit({
61
- eventType: "answer_submitted",
62
- eventCategory: "learning",
63
- domain: "math",
64
- topic: "fractions",
65
- payload: { questionId: "q1", correct: true },
66
- });
22
+ **JavaScript / TypeScript:**
23
+ ```bash
24
+ npm install qlm-measure
67
25
  ```
68
26
 
69
- ### 3. Verify an evidence record (tamper detection)
27
+ ## Verify a record
70
28
 
71
- ```typescript
72
- import { verifyRecord } from "qlm-measure/verifier";
73
-
74
- const result = verifyRecord(record);
75
- if (!result.valid) {
76
- for (const v of result.violations) {
77
- console.log(`[${v.category}] v${v.version}: ${v.message}`);
78
- }
79
- }
29
+ ```bash
30
+ qlm-measure verify record.json
31
+ qlm-measure verify records.jsonl --format json --report report.json
32
+ qlm-measure explain HASH.ENTRY_RECOMPUTE
33
+ qlm-measure version
80
34
  ```
81
35
 
82
- ## Schema Reference
36
+ Exit codes: `0` all valid, `1` at least one invalid, `2` usage or parse error.
83
37
 
84
- ### ObservationEvent (evidence input)
38
+ ## Packages
85
39
 
86
- | Field | Type | Required | Description |
87
- |-------|------|----------|-------------|
88
- | studentId | string | yes | Pseudonymous ID (no PII) |
89
- | sessionId | string | yes | Session identifier |
90
- | source | string | yes | Source system |
91
- | timestamp | string | yes | ISO 8601 |
92
- | correct | boolean | yes | Was the response correct? |
93
- | responseTimeMs | number | yes | Response time in ms |
94
- | domain | string | yes | Subject domain |
95
- | scaffoldType | ScaffoldType | no | What preceded this response |
96
- | misconceptionId | string | no | Detected misconception ID |
97
- | classifierConfidence | number | no | Classifier confidence (0-1) |
98
- | skillId | string | no | Skill being assessed |
99
- | score | number | no | Response score (0-1) |
100
- | difficulty | number | no | Item difficulty (0-1) |
101
- | epistemicMode | EpistemicMode | no | How student arrived at answer |
102
- | ext | Record | no | Extension namespace |
103
- | instrumentModel | string | no | Model used to produce this event (v0.2) |
104
- | instrumentTemperature | number | no | Sampling temperature (v0.2) |
105
- | instrumentPromptHash | string | no | SHA-256 of prompt/config (v0.2) |
106
- | instrumentSource | string | no | `deterministic` / `model_validated` / `model_unvalidated` (v0.2) |
107
- | instrumentFallbackReason | string | no | Why model fell back to deterministic (v0.2) |
40
+ - **[Python](python/README.md)** — `pip install qlm-measure`
41
+ - **[JavaScript/TypeScript](js/README.md)** — `npm install qlm-measure`
108
42
 
109
- ### Enums
43
+ Both packages ship the same 10 checks, the same report schema, and produce byte-identical reports (minus the `tool` block). The check catalog, canonicalization spec, and golden vectors are shared.
110
44
 
111
- **ScaffoldType:** `none`, `socratic`, `probing`, `metacognitive`, `scaffolding`, `explain`, `hint`, `demonstrate`
112
-
113
- **EpistemicMode:** `experience`, `inference`, `analogy`, `testimony`
114
-
115
- **DepthLevel:** `surface`, `conceptual`, `transfer`, `integration`
116
-
117
- **TriageResult:** `correct`, `slip`, `misconception`, `disengagement`, `ambiguous`
118
-
119
- ## Verifier
120
-
121
- The verifier checks:
122
- - Schema validity (required fields, correct types)
123
- - Strictly monotonic version numbers
124
- - Timestamp monotonicity (configurable tolerance)
125
- - Hash-chain integrity (prevHash linkage, entryHash recompute)
126
- - Posterior chain consistency (each prior = previous updated)
127
- - Compaction-boundary integrity
128
- - Enum validity
129
-
130
- What it deliberately **cannot** check:
131
- - Whether posteriors are correctly computed (that requires the engine)
132
- - Whether evidential weights are appropriate (those are calibrated server-side)
133
- - Whether triage classifications are accurate (those use rules not in this package)
134
-
135
- This is the design: **verify instead of trust**.
136
-
137
- ## Privacy
138
-
139
- - `studentId` MUST be a pseudonymous identifier. Never include names, emails, or other PII.
140
- - Events are buffered locally and sent via sendBeacon/fetch. No cookies are set.
141
- - The SDK does not store any data persistently.
142
-
143
- ## Licensing
144
-
145
- - **Code** (SDK, emitter, verifier, clients): Apache-2.0
146
- - **Data** (misconception ontology, learning graph, standards alignments served by the API): **CC-BY-4.0**
147
- - **Estimation engine**: Proprietary, hosted by QLM. Not included in this package.
148
-
149
- When using data from the ontology or alignment APIs in publications, cite as: "QLM Misconception Ontology (CC-BY-4.0), accessed via qlm-measure SDK v0.2.0."
150
-
151
- ## Versioning
152
-
153
- - Semver from 0.1.0.
154
- - Schema changes in minor versions (0.2, 0.3).
155
- - v0.2.0: Added instrument-provenance fields for research reproducibility.
156
- - Breaking changes in major versions (1.0).
157
- - Pin your dependency version.
158
-
159
- ## Links
45
+ ## Limitations (read first)
160
46
 
161
- - [Developer portal](https://play.quantumlearningmachines.com/developer)
162
- - [Open Measurement Manifesto](https://play.quantumlearningmachines.com/resources/open-measurement-layer)
163
- - [Misconception ontology](https://play.quantumlearningmachines.com/developer)
164
- - [Model cards on Hugging Face](https://huggingface.co/QuantumLearningMachines)
47
+ - The verifier checks **bookkeeping integrity**, not estimation correctness. It can tell you if a record was tampered with. It cannot tell you if the posteriors are accurate.
48
+ - Evidence event schemas are **v0.2** and may change in minor versions. Pin your dependency.
49
+ - The estimation service requires the QLM API. The verifier does not.
165
50
 
166
51
  ## License
167
52
 
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Check catalog v1 — single source of truth for all verification checks.
3
+ */
4
+ export interface CheckDef {
5
+ id: string;
6
+ category: string;
7
+ label: string;
8
+ description: string;
9
+ howToPass: string;
10
+ scope: "record" | "entry";
11
+ status: "shipped" | "planned";
12
+ introducedIn: string;
13
+ }
14
+ export declare const CATALOG: CheckDef[];
15
+ export declare const CATALOG_BY_ID: {
16
+ [k: string]: CheckDef;
17
+ };
18
+ export declare const SHIPPED_CHECKS: CheckDef[];
19
+ export declare const PLANNED_CHECKS: CheckDef[];
20
+ export declare const CATEGORIES: string[];
21
+ //# sourceMappingURL=checks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checks.d.ts","sourceRoot":"","sources":["../src/checks.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC1B,MAAM,EAAE,SAAS,GAAG,SAAS,CAAC;IAC9B,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,OAAO,EAAE,QAAQ,EAgB7B,CAAC;AAEF,eAAO,MAAM,aAAa;;CAAkD,CAAC;AAC7E,eAAO,MAAM,cAAc,YAA8C,CAAC;AAC1E,eAAO,MAAM,cAAc,YAA8C,CAAC;AAC1E,eAAO,MAAM,UAAU,UAAoD,CAAC"}
package/dist/checks.js ADDED
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Check catalog v1 — single source of truth for all verification checks.
3
+ */
4
+ export const CATALOG = [
5
+ { id: "SCHEMA.REQUIRED", category: "Schema", label: "Required fields present", description: "Every entry must carry version, timestamp, evidentialWeight, priorPosterior, updatedPosterior, entryHash, and prevHash. The record must carry studentScopeId.", howToPass: "Emit every required field on every entry.", scope: "entry", status: "shipped", introducedIn: "0.1.0" },
6
+ { id: "SCHEMA.TYPES", category: "Schema", label: "Field types valid", description: "version is a positive integer; evidentialWeight, priorPosterior, and updatedPosterior are numbers.", howToPass: "Validate against the JSON Schema before writing.", scope: "entry", status: "shipped", introducedIn: "0.1.0" },
7
+ { id: "SCHEMA.TIMESTAMP_FORMAT", category: "Schema", label: "Timestamp is ISO 8601", description: "Every timestamp parses as RFC 3339 with a timezone offset or Z.", howToPass: "Write UTC timestamps with Z suffix.", scope: "entry", status: "shipped", introducedIn: "0.2.2" },
8
+ { id: "VERSION.MONOTONIC", category: "Sequence", label: "Versions strictly increase", description: "Each entry's version must be strictly greater than the previous.", howToPass: "Assign version from an append counter.", scope: "entry", status: "shipped", introducedIn: "0.1.0" },
9
+ { id: "TIMESTAMP.MONOTONIC", category: "Sequence", label: "Timestamps do not go backward", description: "Each entry's timestamp must be >= the previous minus tolerance.", howToPass: "Write timestamps at append time from one clock.", scope: "entry", status: "shipped", introducedIn: "0.1.0" },
10
+ { id: "ENUM.VALID", category: "Enums", label: "Enum values permitted", description: "scaffoldType, depthLevel, epistemicMode, and triageResult must be from the published sets.", howToPass: "Use the exported enums from the SDK.", scope: "entry", status: "shipped", introducedIn: "0.1.0" },
11
+ { id: "HASH.PREV_LINK", category: "Hash chain", label: "Chain link valid", description: "Each entry's prevHash must equal the previous entry's entryHash.", howToPass: "Never insert, delete, or reorder entries. Append only.", scope: "entry", status: "shipped", introducedIn: "0.1.0" },
12
+ { id: "HASH.ENTRY_RECOMPUTE", category: "Hash chain", label: "Entry hash recomputes", description: "SHA-256 of the canonical hashable subset must equal entryHash.", howToPass: "Hash after all fields are final. Canonicalize per the SDK spec.", scope: "entry", status: "shipped", introducedIn: "0.1.0" },
13
+ { id: "POSTERIOR.CHAIN", category: "Posterior chain", label: "Posterior chain consistent", description: "Each entry's priorPosterior must equal the previous updatedPosterior within 1e-9.", howToPass: "Carry the previous posterior forward unchanged.", scope: "entry", status: "shipped", introducedIn: "0.1.0" },
14
+ { id: "COMPACTION.BOUNDARY", category: "Compaction", label: "Compaction boundary intact", description: "First entry after compaction links to summaryHash; version continues.", howToPass: "Compact only via the SDK helper.", scope: "record", status: "shipped", introducedIn: "0.1.0" },
15
+ { id: "ESTIMATE.REPRODUCE", category: "Estimation", label: "Update reproduces posterior", description: "Given the published update rule, the verifier reproduces updatedPosterior.", howToPass: "Include an estimator declaration. Use the published update rule.", scope: "entry", status: "planned", introducedIn: "0.3.0" },
16
+ { id: "TEMPORAL.T_DESIGN", category: "Temporal", label: "Item created before session", description: "The item existed before the session started.", howToPass: "Include item metadata creation timestamp.", scope: "entry", status: "planned", introducedIn: "0.3.0" },
17
+ { id: "TEMPORAL.T_RESULT", category: "Temporal", label: "Response within session window", description: "The response timestamp falls within session bounds.", howToPass: "Include session bounds.", scope: "entry", status: "planned", introducedIn: "0.3.0" },
18
+ { id: "CONSENT.SCOPE", category: "Consent", label: "Consent scope covers export", description: "The learner's consent scope covers the export level.", howToPass: "Include a consent block.", scope: "record", status: "planned", introducedIn: "0.3.0" },
19
+ { id: "CONSENT.WITHDRAWAL", category: "Consent", label: "No active withdrawal", description: "No active withdrawal for this learner.", howToPass: "Include withdrawal status.", scope: "record", status: "planned", introducedIn: "0.3.0" },
20
+ ];
21
+ export const CATALOG_BY_ID = Object.fromEntries(CATALOG.map(c => [c.id, c]));
22
+ export const SHIPPED_CHECKS = CATALOG.filter(c => c.status === "shipped");
23
+ export const PLANNED_CHECKS = CATALOG.filter(c => c.status === "planned");
24
+ export const CATEGORIES = [...new Set(SHIPPED_CHECKS.map(c => c.category))];
25
+ //# sourceMappingURL=checks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checks.js","sourceRoot":"","sources":["../src/checks.ts"],"names":[],"mappings":"AAAA;;GAEG;AAaH,MAAM,CAAC,MAAM,OAAO,GAAe;IACjC,EAAE,EAAE,EAAE,iBAAiB,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,yBAAyB,EAAE,WAAW,EAAE,+JAA+J,EAAE,SAAS,EAAE,2CAA2C,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,OAAO,EAAE;IAC/W,EAAE,EAAE,EAAE,cAAc,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,mBAAmB,EAAE,WAAW,EAAE,oGAAoG,EAAE,SAAS,EAAE,kDAAkD,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,OAAO,EAAE;IAClT,EAAE,EAAE,EAAE,yBAAyB,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,uBAAuB,EAAE,WAAW,EAAE,iEAAiE,EAAE,SAAS,EAAE,qCAAqC,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,OAAO,EAAE;IACjR,EAAE,EAAE,EAAE,mBAAmB,EAAE,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,4BAA4B,EAAE,WAAW,EAAE,kEAAkE,EAAE,SAAS,EAAE,wCAAwC,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,Y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AAW,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AAC7E,MAAM,CAAC,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC;AAC1E,MAAM,CAAC,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC;AAC1E,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC"}
package/dist/cli.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * qlm-measure CLI — verify evidence records from the command line.
4
+ * verify makes no network calls. Records never leave your machine.
5
+ */
6
+ export {};
7
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;GAGG"}