@smithers-orchestrator/scorers 0.16.9 → 0.18.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/package.json +20 -7
- package/src/metrics.js +6 -16
- package/src/run-scorers.js +1 -1
- package/src/schema.js +1 -23
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smithers-orchestrator/scorers",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"description": "Smithers scorer definitions, execution, aggregation, and persistence helpers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -10,6 +10,16 @@
|
|
|
10
10
|
"import": "./src/index.js",
|
|
11
11
|
"default": "./src/index.js"
|
|
12
12
|
},
|
|
13
|
+
"./metrics": {
|
|
14
|
+
"types": "./src/index.d.ts",
|
|
15
|
+
"import": "./src/metrics.js",
|
|
16
|
+
"default": "./src/metrics.js"
|
|
17
|
+
},
|
|
18
|
+
"./schema": {
|
|
19
|
+
"types": "./src/index.d.ts",
|
|
20
|
+
"import": "./src/schema.js",
|
|
21
|
+
"default": "./src/schema.js"
|
|
22
|
+
},
|
|
13
23
|
"./*": {
|
|
14
24
|
"types": "./src/index.d.ts",
|
|
15
25
|
"import": "./src/*.js",
|
|
@@ -20,13 +30,16 @@
|
|
|
20
30
|
"src/"
|
|
21
31
|
],
|
|
22
32
|
"dependencies": {
|
|
33
|
+
"drizzle-orm": "^0.45.2",
|
|
34
|
+
"effect": "^3.21.1",
|
|
23
35
|
"zod": "^4.3.6",
|
|
24
|
-
"@smithers-orchestrator/
|
|
25
|
-
"@smithers-orchestrator/db": "0.
|
|
26
|
-
"@smithers-orchestrator/
|
|
27
|
-
"@smithers-orchestrator/
|
|
28
|
-
"@smithers-orchestrator/
|
|
29
|
-
"@smithers-orchestrator/
|
|
36
|
+
"@smithers-orchestrator/agents": "0.18.0",
|
|
37
|
+
"@smithers-orchestrator/db": "0.18.0",
|
|
38
|
+
"@smithers-orchestrator/driver": "0.18.0",
|
|
39
|
+
"@smithers-orchestrator/errors": "0.18.0",
|
|
40
|
+
"@smithers-orchestrator/graph": "0.18.0",
|
|
41
|
+
"@smithers-orchestrator/observability": "0.18.0",
|
|
42
|
+
"@smithers-orchestrator/scheduler": "0.18.0"
|
|
30
43
|
},
|
|
31
44
|
"devDependencies": {
|
|
32
45
|
"@types/bun": "latest",
|
package/src/metrics.js
CHANGED
|
@@ -1,16 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export const scorersFailed = Metric.counter("smithers.scorers.failed");
|
|
8
|
-
// ---------------------------------------------------------------------------
|
|
9
|
-
// Histograms
|
|
10
|
-
// ---------------------------------------------------------------------------
|
|
11
|
-
const scorerBuckets = MetricBoundaries.exponential({
|
|
12
|
-
start: 10,
|
|
13
|
-
factor: 2,
|
|
14
|
-
count: 14,
|
|
15
|
-
}); // ~10ms to ~80s
|
|
16
|
-
export const scorerDuration = Metric.histogram("smithers.scorer.duration_ms", scorerBuckets);
|
|
1
|
+
export {
|
|
2
|
+
scorerDuration,
|
|
3
|
+
scorersFailed,
|
|
4
|
+
scorersFinished,
|
|
5
|
+
scorersStarted,
|
|
6
|
+
} from "@smithers-orchestrator/observability/metrics";
|
package/src/run-scorers.js
CHANGED
|
@@ -3,7 +3,7 @@ import { toSmithersError } from "@smithers-orchestrator/errors/toSmithersError";
|
|
|
3
3
|
import { scorerDuration, scorersFinished, scorersFailed, scorersStarted } from "./metrics.js";
|
|
4
4
|
import { nowMs } from "@smithers-orchestrator/scheduler/nowMs";
|
|
5
5
|
import crypto from "node:crypto";
|
|
6
|
-
/** @typedef {
|
|
6
|
+
/** @typedef {{ emit: (eventName: "event", event: unknown) => unknown }} EventBus */
|
|
7
7
|
/** @typedef {import("./types.js").ScoreResult} ScoreResult */
|
|
8
8
|
/** @typedef {import("./types.js").ScorerContext} ScorerContext */
|
|
9
9
|
/** @typedef {import("./types.js").ScorerBinding} ScorerBinding */
|
package/src/schema.js
CHANGED
|
@@ -1,23 +1 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* Drizzle table definition for the `_smithers_scorers` table.
|
|
4
|
-
* Stores individual scorer results for each task execution.
|
|
5
|
-
*/
|
|
6
|
-
export const smithersScorers = sqliteTable("_smithers_scorers", {
|
|
7
|
-
id: text("id").primaryKey(),
|
|
8
|
-
runId: text("run_id").notNull(),
|
|
9
|
-
nodeId: text("node_id").notNull(),
|
|
10
|
-
iteration: integer("iteration").notNull().default(0),
|
|
11
|
-
attempt: integer("attempt").notNull().default(0),
|
|
12
|
-
scorerId: text("scorer_id").notNull(),
|
|
13
|
-
scorerName: text("scorer_name").notNull(),
|
|
14
|
-
source: text("source").notNull(), // "live" | "batch"
|
|
15
|
-
score: real("score").notNull(),
|
|
16
|
-
reason: text("reason"),
|
|
17
|
-
metaJson: text("meta_json"),
|
|
18
|
-
inputJson: text("input_json"),
|
|
19
|
-
outputJson: text("output_json"),
|
|
20
|
-
latencyMs: real("latency_ms"),
|
|
21
|
-
scoredAtMs: integer("scored_at_ms").notNull(),
|
|
22
|
-
durationMs: real("duration_ms"),
|
|
23
|
-
});
|
|
1
|
+
export { smithersScorers } from "@smithers-orchestrator/db/internal-schema";
|