@hmharness/evaluation 0.23.27 → 0.23.29
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/dist/benchmark-layers.d.ts +41 -0
- package/dist/benchmark-layers.js +39 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @hmharness/evaluation - benchmark layer taxonomy (upgrade pack 04 section 1, P2)
|
|
3
|
+
*
|
|
4
|
+
* The pack's four physically separated dataset layers, each with a
|
|
5
|
+
* machine-enforced WRITER policy - the headline rule being: the hidden
|
|
6
|
+
* holdout is writable ONLY by the evaluator; the agent and the
|
|
7
|
+
* self-evolution loop can never write it (and can never READ it as a
|
|
8
|
+
* training feed). A rule that lives in a doc is a hope; a rule that lives
|
|
9
|
+
* in assertLayerWrite is a gate.
|
|
10
|
+
*
|
|
11
|
+
* internal - developer-visible, fast regression; evolution may train on it
|
|
12
|
+
* public - external public tasks; HMH MUST NOT MODIFY (read-only
|
|
13
|
+
* ingestion - not even 'developer' may write)
|
|
14
|
+
* real-user - desensitized real-user tasks; user-sourced ingestion
|
|
15
|
+
* hidden - evaluator-only writes, invisible to evolution/agent
|
|
16
|
+
*/
|
|
17
|
+
export type BenchmarkLayer = 'internal' | 'public' | 'real-user' | 'hidden';
|
|
18
|
+
/** who can appear as a writer */
|
|
19
|
+
export type LayerWriter = 'developer' | 'public-source' | 'user' | 'evaluator' | 'evolution' | 'agent';
|
|
20
|
+
export interface LayerPolicy {
|
|
21
|
+
layer: BenchmarkLayer;
|
|
22
|
+
/** the ONLY writers allowed - everyone else refuses */
|
|
23
|
+
writableBy: readonly LayerWriter[];
|
|
24
|
+
/** may self-evolution read tasks of this layer as a training feed */
|
|
25
|
+
visibleToEvolution: boolean;
|
|
26
|
+
description: string;
|
|
27
|
+
}
|
|
28
|
+
export declare const LAYER_POLICIES: Record<BenchmarkLayer, LayerPolicy>;
|
|
29
|
+
/** The machine guard: a disallowed writer refuses WITH the policy stated. */
|
|
30
|
+
export declare function assertLayerWrite(layer: BenchmarkLayer, writer: LayerWriter): void;
|
|
31
|
+
export interface LayeredTask {
|
|
32
|
+
id: string;
|
|
33
|
+
layer: BenchmarkLayer;
|
|
34
|
+
}
|
|
35
|
+
export interface EvolutionFeedCheck {
|
|
36
|
+
ok: boolean;
|
|
37
|
+
/** hidden task ids found in the feed - each one is a contamination */
|
|
38
|
+
violations: string[];
|
|
39
|
+
}
|
|
40
|
+
/** No hidden task may ever enter an evolution training feed. */
|
|
41
|
+
export declare function evolutionFeedOK(feed: LayeredTask[]): EvolutionFeedCheck;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export const LAYER_POLICIES = {
|
|
2
|
+
internal: {
|
|
3
|
+
layer: 'internal',
|
|
4
|
+
writableBy: ['developer'],
|
|
5
|
+
visibleToEvolution: true,
|
|
6
|
+
description: 'developer-visible fast regression set',
|
|
7
|
+
},
|
|
8
|
+
public: {
|
|
9
|
+
layer: 'public',
|
|
10
|
+
// "HMH 不得修改": ingestion only - no hmh-side writer may mutate a public set
|
|
11
|
+
writableBy: ['public-source'],
|
|
12
|
+
visibleToEvolution: true,
|
|
13
|
+
description: 'external public tasks, ingested read-only',
|
|
14
|
+
},
|
|
15
|
+
'real-user': {
|
|
16
|
+
layer: 'real-user',
|
|
17
|
+
writableBy: ['user'],
|
|
18
|
+
visibleToEvolution: true,
|
|
19
|
+
description: 'desensitized real-user tasks',
|
|
20
|
+
},
|
|
21
|
+
hidden: {
|
|
22
|
+
layer: 'hidden',
|
|
23
|
+
writableBy: ['evaluator'],
|
|
24
|
+
visibleToEvolution: false,
|
|
25
|
+
description: 'hidden holdout - evaluator-only writes, invisible to evolution and agent',
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
/** The machine guard: a disallowed writer refuses WITH the policy stated. */
|
|
29
|
+
export function assertLayerWrite(layer, writer) {
|
|
30
|
+
const policy = LAYER_POLICIES[layer];
|
|
31
|
+
if (!policy.writableBy.includes(writer)) {
|
|
32
|
+
throw new Error(`layer '${layer}' refuses writer '${writer}' - allowed writers: [${policy.writableBy.join(', ')}] (${policy.description})`);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/** No hidden task may ever enter an evolution training feed. */
|
|
36
|
+
export function evolutionFeedOK(feed) {
|
|
37
|
+
const violations = feed.filter((t) => LAYER_POLICIES[t.layer] && !LAYER_POLICIES[t.layer].visibleToEvolution).map((t) => t.id);
|
|
38
|
+
return { ok: violations.length === 0, violations };
|
|
39
|
+
}
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hmharness/evaluation",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.29",
|
|
4
4
|
"description": "hmharness evaluation: the Evaluator/Judge contract (V2 blueprint M2). Hard evidence outranks LLM judgment - build results, exit codes, exact/regex assertions first; the LLM judge is a last resort and is labeled as such. Evaluations attach to trajectories (judge.completed events).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"build": "tsc -p tsconfig.build.json"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@hmharness/kernel": "0.23.
|
|
19
|
-
"@hmharness/observability": "0.23.
|
|
18
|
+
"@hmharness/kernel": "0.23.29",
|
|
19
|
+
"@hmharness/observability": "0.23.29"
|
|
20
20
|
},
|
|
21
21
|
"files": [
|
|
22
22
|
"dist"
|