qlm-measure 0.1.1 → 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/NOTICE
CHANGED
|
@@ -5,9 +5,8 @@ This product includes software developed at
|
|
|
5
5
|
Quantum Learning Machines (https://quantumlearningmachines.com).
|
|
6
6
|
|
|
7
7
|
This SDK provides the public interface layer for the QLM measurement
|
|
8
|
-
infrastructure. The estimation engine
|
|
9
|
-
|
|
10
|
-
hosted service operated by Quantum Learning Machines.
|
|
8
|
+
infrastructure. The estimation engine is a separate hosted service
|
|
9
|
+
operated by Quantum Learning Machines.
|
|
11
10
|
|
|
12
11
|
The SDK itself (event schema, emitter, verifier, and dataset clients)
|
|
13
12
|
is licensed under the Apache License, Version 2.0.
|
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
#
|
|
1
|
+
# qlm-measure
|
|
2
2
|
|
|
3
3
|
Open measurement SDK for education AI — evidence events, record verification, and dataset clients.
|
|
4
4
|
|
|
5
|
-
**v0.
|
|
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)**
|
|
6
6
|
|
|
7
7
|
## Limitations (read first)
|
|
8
8
|
|
|
@@ -30,7 +30,9 @@ Open measurement SDK for education AI — evidence events, record verification,
|
|
|
30
30
|
## Install
|
|
31
31
|
|
|
32
32
|
```bash
|
|
33
|
-
npm install
|
|
33
|
+
npm install qlm-measure
|
|
34
|
+
# or
|
|
35
|
+
pip install qlm-measure
|
|
34
36
|
```
|
|
35
37
|
|
|
36
38
|
## Quickstart
|
|
@@ -38,7 +40,7 @@ npm install @qlm/measure
|
|
|
38
40
|
### 1. Query the misconception ontology (no auth)
|
|
39
41
|
|
|
40
42
|
```typescript
|
|
41
|
-
import { OntologyClient } from "
|
|
43
|
+
import { OntologyClient } from "qlm-measure/clients";
|
|
42
44
|
|
|
43
45
|
const client = new OntologyClient();
|
|
44
46
|
const misconceptions = await client.getMisconceptions("math");
|
|
@@ -48,7 +50,7 @@ console.log(`${misconceptions.length} math misconceptions`);
|
|
|
48
50
|
### 2. Emit measurement events
|
|
49
51
|
|
|
50
52
|
```typescript
|
|
51
|
-
import { MeasurementEmitter } from "
|
|
53
|
+
import { MeasurementEmitter } from "qlm-measure/emitter";
|
|
52
54
|
|
|
53
55
|
const emitter = new MeasurementEmitter({
|
|
54
56
|
baseUrl: "https://play.quantumlearningmachines.com",
|
|
@@ -67,7 +69,7 @@ emitter.emit({
|
|
|
67
69
|
### 3. Verify an evidence record (tamper detection)
|
|
68
70
|
|
|
69
71
|
```typescript
|
|
70
|
-
import { verifyRecord } from "
|
|
72
|
+
import { verifyRecord } from "qlm-measure/verifier";
|
|
71
73
|
|
|
72
74
|
const result = verifyRecord(record);
|
|
73
75
|
if (!result.valid) {
|
|
@@ -98,6 +100,11 @@ if (!result.valid) {
|
|
|
98
100
|
| difficulty | number | no | Item difficulty (0-1) |
|
|
99
101
|
| epistemicMode | EpistemicMode | no | How student arrived at answer |
|
|
100
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) |
|
|
101
108
|
|
|
102
109
|
### Enums
|
|
103
110
|
|
|
@@ -133,10 +140,19 @@ This is the design: **verify instead of trust**.
|
|
|
133
140
|
- Events are buffered locally and sent via sendBeacon/fetch. No cookies are set.
|
|
134
141
|
- The SDK does not store any data persistently.
|
|
135
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
|
+
|
|
136
151
|
## Versioning
|
|
137
152
|
|
|
138
153
|
- Semver from 0.1.0.
|
|
139
154
|
- Schema changes in minor versions (0.2, 0.3).
|
|
155
|
+
- v0.2.0: Added instrument-provenance fields for research reproducibility.
|
|
140
156
|
- Breaking changes in major versions (1.0).
|
|
141
157
|
- Pin your dependency version.
|
|
142
158
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* ObservationEvent v0.
|
|
2
|
+
* ObservationEvent v0.2 — Public evidence-event schema.
|
|
3
3
|
*
|
|
4
4
|
* A deliberate subset of the internal StudentObservation.
|
|
5
5
|
* This is a deliberate public subset. Fields related to internal estimation,
|
|
@@ -54,5 +54,15 @@ export interface ObservationEvent {
|
|
|
54
54
|
selfCorrected?: boolean;
|
|
55
55
|
/** Reserved extension namespace for integrator-specific fields. */
|
|
56
56
|
ext?: Record<string, unknown>;
|
|
57
|
+
/** Model identifier used to generate/evaluate this event, if any. */
|
|
58
|
+
instrumentModel?: string;
|
|
59
|
+
/** Sampling temperature used, if applicable. */
|
|
60
|
+
instrumentTemperature?: number;
|
|
61
|
+
/** Hash of the prompt/configuration that produced the evaluation. */
|
|
62
|
+
instrumentPromptHash?: string;
|
|
63
|
+
/** Source path: how this event was produced. */
|
|
64
|
+
instrumentSource?: "deterministic" | "model_validated" | "model_unvalidated";
|
|
65
|
+
/** If the instrument fell back from model to deterministic, why. */
|
|
66
|
+
instrumentFallbackReason?: string;
|
|
57
67
|
}
|
|
58
68
|
//# sourceMappingURL=observation-event.d.ts.map
|
|
@@ -1 +1 @@
|
|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