@hmharness/evaluation 0.23.31 → 0.23.33

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/index.d.ts CHANGED
@@ -8,3 +8,4 @@ export * from './marketplace.js';
8
8
  export * from './self-benchmark.js';
9
9
  export * from './metrics.js';
10
10
  export * from './benchmark-layers.js';
11
+ export * from './research-gate.js';
package/dist/index.js CHANGED
@@ -8,3 +8,4 @@ export * from "./marketplace.js";
8
8
  export * from "./self-benchmark.js";
9
9
  export * from "./metrics.js";
10
10
  export * from "./benchmark-layers.js";
11
+ export * from "./research-gate.js";
@@ -0,0 +1,41 @@
1
+ /**
2
+ * @hmharness/evaluation - Research/Production Gate (weekly pack 0.31 P2)
3
+ *
4
+ * The pack asks: "安全、可靠性、泛化、迁移、成本、可解释、可回放、外部复现
5
+ * 八项均有数据;未满足显示 NEEDS-DATA。" This gate audits each dimension
6
+ * against what the codebase actually has (modules, tests, evidence) and
7
+ * reports either the concrete data source or NEEDS-DATA - never a fabricated
8
+ * "pass". The gate is a READ-ONLY instrument: it reports the state of the
9
+ * world, it does not change it.
10
+ *
11
+ * 1 safety Capability Broker + sandbox red-team + SANDBOX_BYPASS_VECTORS
12
+ * 2 reliability flaky root fixes + recorder drain contract + restart-budget hardening
13
+ * 3 generalization skill generalization lab + holdout gates + multi-seed
14
+ * 4 transfer Transfer OS 2.0 (IR + readiness + 5x5 matrix) + cross-env evidence
15
+ * 5 cost 12-metric protocol (cost) + estTokens CJK correction
16
+ * 6 explainability Cognitive Ledger DAG + credit assignment (observational)
17
+ * 7 replayability Evidence Ledger v2 + world-model checkpoint + trajectory replay
18
+ * 8 external reproduction awesome-list PR + open-source public evidence page
19
+ */
20
+ export type GateDimension = 'safety' | 'reliability' | 'generalization' | 'transfer' | 'cost' | 'explainability' | 'replayability' | 'external-reproduction';
21
+ export type GateStatus = 'has-data' | 'needs-data';
22
+ export interface GateFinding {
23
+ dimension: GateDimension;
24
+ status: GateStatus;
25
+ /** what exists (modules, tests, scripts, evidence) when status is has-data */
26
+ evidence: string[];
27
+ /** what is missing and what would fill it, when status is needs-data */
28
+ gap: string;
29
+ }
30
+ export interface GateReport {
31
+ generatedAt: string;
32
+ findings: GateFinding[];
33
+ summary: {
34
+ hasData: number;
35
+ needsData: number;
36
+ total: number;
37
+ };
38
+ }
39
+ /** Audit the eight dimensions against what actually exists in the repo.
40
+ * Pure - takes the existence map as input so tests can construct scenarios. */
41
+ export declare function researchGate(exists: (path: string) => boolean): GateReport;
@@ -0,0 +1,50 @@
1
+ /** Audit the eight dimensions against what actually exists in the repo.
2
+ * Pure - takes the existence map as input so tests can construct scenarios. */
3
+ export function researchGate(exists) {
4
+ const findings = [];
5
+ const check = (dim, paths, gapIfMissing) => {
6
+ const evidence = paths.filter(exists);
7
+ findings.push(evidence.length > 0
8
+ ? { dimension: dim, status: 'has-data', evidence, gap: '' }
9
+ : { dimension: dim, status: 'needs-data', evidence: [], gap: gapIfMissing });
10
+ };
11
+ check('safety', [
12
+ 'packages/sandbox/src/broker.ts',
13
+ 'packages/sandbox/src/redteam.ts',
14
+ 'packages/sandbox/src/__tests__/broker2.test.ts',
15
+ ], 'Capability Broker egress/mount/secret policies + red-team payloads with bypass vectors declared');
16
+ check('reliability', [
17
+ 'packages/observability/src/recorder.ts',
18
+ 'packages/cognitive/src/evalset.ts',
19
+ 'packages/lsp/src/__tests__/lsp.test.ts',
20
+ ], 'Flaky root fixes (recorder drain contract, restart-budget await-the-boundary, holdout discipline)');
21
+ check('generalization', [
22
+ 'scripts/skill-generalization-lab.mts',
23
+ 'scripts/real-cycle-multiseed.mts',
24
+ 'packages/cognitive/src/skill-compiler.ts',
25
+ ], 'Generalization lab (axis attribution), multi-seed instruments, SkillSpecV2 counterexamples');
26
+ check('transfer', [
27
+ 'packages/cognitive/src/abstract-actions.ts',
28
+ 'scripts/prediction-to-action.mts',
29
+ ], 'Transfer OS 2.0 (Skill IR + environment IR + readiness), cross-env prediction-to-action evidence');
30
+ check('cost', [
31
+ 'packages/evaluation/src/metrics.ts',
32
+ ], 'Unified 12-metric protocol including cost dimension');
33
+ check('explainability', [
34
+ 'packages/cognitive/src/ledger.ts',
35
+ 'packages/cognitive/src/credit-assignment.ts',
36
+ ], 'Cognitive Ledger 2.0 (replayable DAG) + credit assignment (observational lift)');
37
+ check('replayability', [
38
+ 'packages/cognitive/src/evidence-ledger.ts',
39
+ 'packages/cognitive/src/world-model.ts',
40
+ ], 'Evidence Ledger v2 (canonical lineageId) + world-model checkpoint round-trip');
41
+ check('external-reproduction', [
42
+ 'website/evidence/index.html',
43
+ ], 'Public evidence page + awesome-list entry + fresh-install verification scripts');
44
+ const hasData = findings.filter((f) => f.status === 'has-data').length;
45
+ return {
46
+ generatedAt: new Date().toISOString(),
47
+ findings,
48
+ summary: { hasData, needsData: findings.length - hasData, total: findings.length },
49
+ };
50
+ }
package/package.json CHANGED
@@ -1,32 +1,32 @@
1
- {
2
- "name": "@hmharness/evaluation",
3
- "version": "0.23.31",
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
- "type": "module",
6
- "main": "dist/index.js",
7
- "exports": {
8
- ".": {
9
- "types": "./dist/index.d.ts",
10
- "default": "./dist/index.js"
11
- }
12
- },
13
- "types": "dist/index.d.ts",
14
- "scripts": {
15
- "build": "tsc -p tsconfig.build.json"
16
- },
17
- "dependencies": {
18
- "@hmharness/kernel": "0.23.31",
19
- "@hmharness/observability": "0.23.31"
20
- },
21
- "files": [
22
- "dist"
23
- ],
24
- "license": "MIT",
25
- "repository": {
26
- "type": "git",
27
- "url": "git+https://github.com/swsgbl/hmharness.git"
28
- },
29
- "engines": {
30
- "node": ">=22"
31
- }
32
- }
1
+ {
2
+ "name": "@hmharness/evaluation",
3
+ "version": "0.23.33",
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
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "default": "./dist/index.js"
11
+ }
12
+ },
13
+ "types": "dist/index.d.ts",
14
+ "scripts": {
15
+ "build": "tsc -p tsconfig.build.json"
16
+ },
17
+ "dependencies": {
18
+ "@hmharness/kernel": "0.23.33",
19
+ "@hmharness/observability": "0.23.33"
20
+ },
21
+ "files": [
22
+ "dist"
23
+ ],
24
+ "license": "MIT",
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "git+https://github.com/swsgbl/hmharness.git"
28
+ },
29
+ "engines": {
30
+ "node": ">=22"
31
+ }
32
+ }