dsh-harbor-evolution 0.7.3 → 0.8.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/README.md +10 -3
- package/index.js +40 -0
- package/lib/client.js +96 -17
- package/lib/dashboard.js +167 -15
- package/lib/evolution.js +189 -0
- package/lib/model-runtime.js +11 -7
- package/lib/session-diagnostic.js +320 -0
- package/lib/session-materializer.js +194 -0
- package/lib/session-projection.js +161 -0
- package/lib/session-redaction.js +311 -0
- package/lib/session-selection.js +294 -0
- package/lib/setup.js +9 -3
- package/package.json +6 -1
- package/schemas/dsh-session-observation.schema.json +69 -0
- package/schemas/evaluation-result-v2.schema.json +45 -0
- package/schemas/historical-evaluation-context.schema.json +66 -0
- package/schemas/historical-evaluation-summary.schema.json +49 -0
- package/schemas/historical-generation-batch.schema.json +76 -0
- package/skills/evolve-agent-with-harbor/SKILL.md +47 -7
- package/skills/evolve-agent-with-harbor/evals/evals.json +9 -6
- package/skills/evolve-agent-with-harbor/references/evaluator-upgrade.md +3 -1
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://github.com/istarwyh/harbor-self-evolving/schemas/dsh-session-observation.schema.json",
|
|
4
|
+
"title": "DSH Session Observation v1",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["schema_version", "protocol", "record_kind", "execution_mode", "trial_id", "source", "generator", "task", "visible_transcript", "execution", "feedback", "completeness", "redaction", "digest"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"schema_version": { "const": 1 },
|
|
10
|
+
"protocol": { "const": "dsh-session-observation/v1" },
|
|
11
|
+
"record_kind": { "const": "dsh-session" },
|
|
12
|
+
"execution_mode": { "const": "observe-existing" },
|
|
13
|
+
"trial_id": { "type": "string", "minLength": 1 },
|
|
14
|
+
"source": {
|
|
15
|
+
"type": "object",
|
|
16
|
+
"required": ["ref", "captured_through_seq", "source_digest", "created_at", "last_activity_at", "last_turn_reason", "session_format_version"],
|
|
17
|
+
"properties": {
|
|
18
|
+
"ref": { "$ref": "#/$defs/digest" },
|
|
19
|
+
"captured_through_seq": { "type": "integer", "minimum": 0 },
|
|
20
|
+
"source_digest": { "$ref": "#/$defs/digest" },
|
|
21
|
+
"created_at": { "type": ["string", "null"], "format": "date-time" },
|
|
22
|
+
"last_activity_at": { "type": ["string", "null"], "format": "date-time" },
|
|
23
|
+
"last_turn_reason": { "type": ["string", "null"] },
|
|
24
|
+
"session_format_version": { "type": "integer", "minimum": 0 }
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"generator": { "type": "object", "required": ["agent_preset", "model_segments"] },
|
|
28
|
+
"task": {
|
|
29
|
+
"type": "object",
|
|
30
|
+
"required": ["title", "initial_user_goal", "turn_count"],
|
|
31
|
+
"properties": {
|
|
32
|
+
"title": { "type": "string", "minLength": 1 },
|
|
33
|
+
"initial_user_goal": { "type": "string", "minLength": 1 },
|
|
34
|
+
"turn_count": { "type": "integer", "minimum": 1 }
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"visible_transcript": {
|
|
38
|
+
"type": "array",
|
|
39
|
+
"minItems": 2,
|
|
40
|
+
"items": {
|
|
41
|
+
"type": "object",
|
|
42
|
+
"additionalProperties": false,
|
|
43
|
+
"required": ["event_seq", "message_ref", "role", "content", "time"],
|
|
44
|
+
"properties": {
|
|
45
|
+
"event_seq": { "type": "integer", "minimum": 0 },
|
|
46
|
+
"message_ref": { "$ref": "#/$defs/digest" },
|
|
47
|
+
"role": { "enum": ["user", "assistant"] },
|
|
48
|
+
"content": {
|
|
49
|
+
"type": "array",
|
|
50
|
+
"minItems": 1,
|
|
51
|
+
"items": {
|
|
52
|
+
"type": "object",
|
|
53
|
+
"additionalProperties": false,
|
|
54
|
+
"required": ["type", "text"],
|
|
55
|
+
"properties": { "type": { "const": "text" }, "text": { "type": "string", "minLength": 1 } }
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"time": { "type": ["string", "null"], "format": "date-time" }
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"execution": { "type": "object", "required": ["tools", "turns", "usage"] },
|
|
63
|
+
"feedback": { "type": "object", "required": ["items"] },
|
|
64
|
+
"completeness": { "type": "object", "required": ["transcript_complete", "tool_payloads_complete", "attachments_complete", "truncations"] },
|
|
65
|
+
"redaction": { "type": "object", "required": ["replacements", "truncations", "omitted_blocks"] },
|
|
66
|
+
"digest": { "$ref": "#/$defs/digest" }
|
|
67
|
+
},
|
|
68
|
+
"$defs": { "digest": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" } }
|
|
69
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://github.com/istarwyh/harbor-self-evolving/schemas/evaluation-result-v2.schema.json",
|
|
4
|
+
"title": "Harbor DSH Evaluation Result v2",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["schema_version", "protocol", "criteria", "aggregate"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"schema_version": { "const": 2 },
|
|
10
|
+
"protocol": { "const": "evaluation-result/v2" },
|
|
11
|
+
"criteria": {
|
|
12
|
+
"type": "array",
|
|
13
|
+
"minItems": 1,
|
|
14
|
+
"items": {
|
|
15
|
+
"type": "object",
|
|
16
|
+
"additionalProperties": false,
|
|
17
|
+
"required": ["id", "status", "score", "reason", "recommendation", "evidence_refs"],
|
|
18
|
+
"properties": {
|
|
19
|
+
"id": { "type": "string", "minLength": 1 },
|
|
20
|
+
"status": { "enum": ["scored", "not-applicable", "insufficient-evidence", "evaluation-error"] },
|
|
21
|
+
"score": { "type": ["number", "null"], "enum": [0, 0.5, 1, null] },
|
|
22
|
+
"reason": { "type": "string", "minLength": 1 },
|
|
23
|
+
"recommendation": { "type": "string", "minLength": 1 },
|
|
24
|
+
"evidence_refs": { "type": "array", "items": { "type": "string", "minLength": 1 } }
|
|
25
|
+
},
|
|
26
|
+
"allOf": [
|
|
27
|
+
{ "if": { "properties": { "status": { "const": "scored" } } }, "then": { "properties": { "score": { "enum": [0, 0.5, 1] } } } },
|
|
28
|
+
{ "if": { "properties": { "status": { "enum": ["not-applicable", "insufficient-evidence", "evaluation-error"] } } }, "then": { "properties": { "score": { "type": "null" } } } }
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"aggregate": {
|
|
33
|
+
"type": "object",
|
|
34
|
+
"additionalProperties": false,
|
|
35
|
+
"required": ["metric_id", "value", "scored_criteria", "total_criteria", "coverage"],
|
|
36
|
+
"properties": {
|
|
37
|
+
"metric_id": { "type": "string", "minLength": 1 },
|
|
38
|
+
"value": { "type": ["number", "null"], "minimum": 0, "maximum": 1 },
|
|
39
|
+
"scored_criteria": { "type": "integer", "minimum": 0 },
|
|
40
|
+
"total_criteria": { "type": "integer", "minimum": 1 },
|
|
41
|
+
"coverage": { "type": "number", "minimum": 0, "maximum": 1 }
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://github.com/istarwyh/harbor-self-evolving/schemas/historical-evaluation-context.schema.json",
|
|
4
|
+
"title": "Historical Generation Evaluation Context v1",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["schema_version", "protocol", "job_kind", "mode", "promotion_eligible", "execution_mode", "evaluation_level", "evaluation_target", "generation_source", "dataset", "evaluation_stack", "execution_adapter", "runtime", "downstream_analysis", "digest", "full_digest"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"schema_version": { "const": 1 },
|
|
10
|
+
"protocol": { "const": "historical-generation-evaluation-context/v1" },
|
|
11
|
+
"job_kind": { "const": "historical-generation-evaluation" },
|
|
12
|
+
"mode": { "const": "diagnostic" },
|
|
13
|
+
"promotion_eligible": { "const": false },
|
|
14
|
+
"execution_mode": { "const": "observe-existing" },
|
|
15
|
+
"evaluation_level": { "const": "trial" },
|
|
16
|
+
"evaluation_target": {
|
|
17
|
+
"type": "object",
|
|
18
|
+
"required": ["kind", "source_kind", "batch_id", "digest", "record_count", "generator_population"],
|
|
19
|
+
"properties": {
|
|
20
|
+
"kind": { "const": "generation-record-batch" },
|
|
21
|
+
"source_kind": { "const": "dsh-session" },
|
|
22
|
+
"batch_id": { "type": "string", "minLength": 1 },
|
|
23
|
+
"digest": { "$ref": "#/$defs/digest" },
|
|
24
|
+
"record_count": { "type": "integer", "minimum": 1, "maximum": 10 },
|
|
25
|
+
"generator_population": { "type": "object" }
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"generation_source": {
|
|
29
|
+
"type": "object",
|
|
30
|
+
"required": ["mode", "kind", "adapter_id", "selection", "redaction_policy"],
|
|
31
|
+
"properties": {
|
|
32
|
+
"mode": { "const": "existing-records" },
|
|
33
|
+
"kind": { "const": "dsh-session" },
|
|
34
|
+
"adapter_id": { "const": "dsh-session-query" },
|
|
35
|
+
"adapter": { "const": "dsh-session-query" },
|
|
36
|
+
"selection": { "type": "object" },
|
|
37
|
+
"redaction_policy": { "type": "object" }
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"dataset": { "type": "object" },
|
|
41
|
+
"evaluation_stack": { "type": "object", "required": ["stack_id", "version", "digest", "comparison_digest", "components", "judge"] },
|
|
42
|
+
"execution_adapter": { "type": "object", "required": ["id", "version", "import_path", "digest", "model_invocation", "tool_reexecution"] },
|
|
43
|
+
"runtime": { "type": "object", "required": ["harbor_version", "integration_version"] },
|
|
44
|
+
"downstream_analysis": {
|
|
45
|
+
"type": "object",
|
|
46
|
+
"required": ["population_analysis", "generator_diagnosis", "optimizer", "evaluator_meta_evaluation"],
|
|
47
|
+
"properties": {
|
|
48
|
+
"population_analysis": { "const": true },
|
|
49
|
+
"generator_diagnosis": { "type": ["boolean", "object"] },
|
|
50
|
+
"optimizer": { "type": "object" },
|
|
51
|
+
"evaluator_meta_evaluation": {
|
|
52
|
+
"type": "object",
|
|
53
|
+
"additionalProperties": false,
|
|
54
|
+
"required": ["status", "validation_report_ref"],
|
|
55
|
+
"properties": {
|
|
56
|
+
"status": { "const": "not-run" },
|
|
57
|
+
"validation_report_ref": { "type": "null" }
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"digest": { "$ref": "#/$defs/digest" },
|
|
63
|
+
"full_digest": { "$ref": "#/$defs/digest" }
|
|
64
|
+
},
|
|
65
|
+
"$defs": { "digest": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" } }
|
|
66
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://github.com/istarwyh/harbor-self-evolving/schemas/historical-evaluation-summary.schema.json",
|
|
4
|
+
"title": "Historical Generation Evaluation Summary v4",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": ["schema_version", "job", "job_kind", "mode", "execution_mode", "evaluation_target", "generation_source", "evaluation_context", "n_trials", "n_discovered_trials", "n_completed_trials", "n_valid_scores", "n_invalid_scores", "n_unscored_trials", "status_counts", "coverage", "criterion_status_counts", "metrics", "trials", "artifact_validation", "evaluator_meta_evaluation"],
|
|
7
|
+
"properties": {
|
|
8
|
+
"schema_version": { "const": 4 },
|
|
9
|
+
"job": { "type": "string", "minLength": 1 },
|
|
10
|
+
"job_kind": { "const": "historical-generation-evaluation" },
|
|
11
|
+
"mode": { "const": "diagnostic" },
|
|
12
|
+
"execution_mode": { "const": "observe-existing" },
|
|
13
|
+
"evaluation_target": { "type": "object", "required": ["kind", "source_kind", "batch_id", "digest", "record_count"] },
|
|
14
|
+
"generation_source": { "type": "object", "required": ["kind"] },
|
|
15
|
+
"evaluation_context": { "type": "object" },
|
|
16
|
+
"n_trials": { "type": "integer", "minimum": 1, "maximum": 10 },
|
|
17
|
+
"n_discovered_trials": { "type": "integer", "minimum": 0, "maximum": 10 },
|
|
18
|
+
"n_completed_trials": { "type": "integer", "minimum": 0, "maximum": 10 },
|
|
19
|
+
"n_valid_scores": { "type": "integer", "minimum": 0, "maximum": 10 },
|
|
20
|
+
"n_invalid_scores": { "type": "integer", "minimum": 0, "maximum": 10 },
|
|
21
|
+
"n_unscored_trials": { "type": "integer", "minimum": 0, "maximum": 10 },
|
|
22
|
+
"status_counts": { "type": "object", "additionalProperties": { "type": "integer", "minimum": 0 } },
|
|
23
|
+
"coverage": {
|
|
24
|
+
"type": "object",
|
|
25
|
+
"additionalProperties": false,
|
|
26
|
+
"required": ["scored_trials", "unscored_trials", "total_trials", "trial_rate", "criterion_scored", "criterion_total", "criterion_rate"],
|
|
27
|
+
"properties": {
|
|
28
|
+
"scored_trials": { "type": "integer", "minimum": 0 },
|
|
29
|
+
"unscored_trials": { "type": "integer", "minimum": 0 },
|
|
30
|
+
"total_trials": { "type": "integer", "minimum": 1, "maximum": 10 },
|
|
31
|
+
"trial_rate": { "type": "number", "minimum": 0, "maximum": 1 },
|
|
32
|
+
"criterion_scored": { "type": "integer", "minimum": 0 },
|
|
33
|
+
"criterion_total": { "type": "integer", "minimum": 0 },
|
|
34
|
+
"criterion_rate": { "type": "number", "minimum": 0, "maximum": 1 }
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"criterion_status_counts": { "type": "object", "additionalProperties": { "type": "integer", "minimum": 0 } },
|
|
38
|
+
"metrics": { "type": "object", "additionalProperties": { "type": "number" } },
|
|
39
|
+
"trials": { "type": "array", "maxItems": 10, "items": { "type": "object" } },
|
|
40
|
+
"artifact_validation": { "type": "object" },
|
|
41
|
+
"evaluator_meta_evaluation": {
|
|
42
|
+
"type": "object",
|
|
43
|
+
"additionalProperties": false,
|
|
44
|
+
"required": ["status", "validation_report_ref"],
|
|
45
|
+
"properties": { "status": { "const": "not-run" }, "validation_report_ref": { "type": "null" } }
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"not": { "required": ["candidate"] }
|
|
49
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://github.com/istarwyh/harbor-self-evolving/schemas/historical-generation-batch.schema.json",
|
|
4
|
+
"title": "Historical Generation Batch v1",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["schema_version", "protocol", "batch_id", "created_at", "project", "selection", "source", "redaction_policy", "records", "generator_population", "digest"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"schema_version": { "const": 1 },
|
|
10
|
+
"protocol": { "const": "historical-generation-batch/v1" },
|
|
11
|
+
"batch_id": { "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$" },
|
|
12
|
+
"created_at": { "type": "string", "format": "date-time" },
|
|
13
|
+
"project": {
|
|
14
|
+
"type": "object",
|
|
15
|
+
"additionalProperties": false,
|
|
16
|
+
"required": ["cwd_digest"],
|
|
17
|
+
"properties": { "cwd_digest": { "$ref": "#/$defs/digest" } }
|
|
18
|
+
},
|
|
19
|
+
"selection": {
|
|
20
|
+
"type": "object",
|
|
21
|
+
"additionalProperties": false,
|
|
22
|
+
"required": ["scope", "order", "requested_limit", "selected_count", "current_session_excluded"],
|
|
23
|
+
"properties": {
|
|
24
|
+
"scope": { "const": "exact-cwd" },
|
|
25
|
+
"order": { "const": "last-activity-desc" },
|
|
26
|
+
"requested_limit": { "type": "integer", "minimum": 1, "maximum": 10 },
|
|
27
|
+
"selected_count": { "type": "integer", "minimum": 1, "maximum": 10 },
|
|
28
|
+
"current_session_excluded": { "const": true },
|
|
29
|
+
"created_after": { "type": "string", "format": "date-time" }
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"source": {
|
|
33
|
+
"type": "object",
|
|
34
|
+
"additionalProperties": false,
|
|
35
|
+
"required": ["kind", "adapter", "session_format_versions"],
|
|
36
|
+
"properties": {
|
|
37
|
+
"kind": { "const": "dsh-session" },
|
|
38
|
+
"adapter": { "const": "dsh-session-query" },
|
|
39
|
+
"session_format_versions": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "type": "integer", "minimum": 0 } }
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"redaction_policy": {
|
|
43
|
+
"type": "object",
|
|
44
|
+
"required": ["id", "version", "digest"],
|
|
45
|
+
"properties": {
|
|
46
|
+
"id": { "type": "string", "minLength": 1 },
|
|
47
|
+
"version": { "type": "string", "minLength": 1 },
|
|
48
|
+
"digest": { "$ref": "#/$defs/digest" }
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"records": {
|
|
52
|
+
"type": "array",
|
|
53
|
+
"minItems": 1,
|
|
54
|
+
"maxItems": 10,
|
|
55
|
+
"items": {
|
|
56
|
+
"type": "object",
|
|
57
|
+
"additionalProperties": false,
|
|
58
|
+
"required": ["trial_id", "record_kind", "source_ref", "captured_through_seq", "source_digest", "observation_digest", "last_activity_at", "generator", "observation_path"],
|
|
59
|
+
"properties": {
|
|
60
|
+
"trial_id": { "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$" },
|
|
61
|
+
"record_kind": { "const": "dsh-session" },
|
|
62
|
+
"source_ref": { "$ref": "#/$defs/digest" },
|
|
63
|
+
"captured_through_seq": { "type": "integer", "minimum": 0 },
|
|
64
|
+
"source_digest": { "$ref": "#/$defs/digest" },
|
|
65
|
+
"observation_digest": { "$ref": "#/$defs/digest" },
|
|
66
|
+
"last_activity_at": { "type": "string", "format": "date-time" },
|
|
67
|
+
"generator": { "type": "object" },
|
|
68
|
+
"observation_path": { "type": "string", "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))[A-Za-z0-9._/-]+$" }
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"generator_population": { "type": "object" },
|
|
73
|
+
"digest": { "$ref": "#/$defs/digest" }
|
|
74
|
+
},
|
|
75
|
+
"$defs": { "digest": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" } }
|
|
76
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: evolve-agent-with-harbor
|
|
3
|
-
description: Architect, initialize, run, diagnose, compare, and safely improve a DeepSeek Harness business Agent or Evaluator with Harbor. Use for low-friction Harbor setup, Agent self-evolution, vertical-search evaluation loops, running Job inspection, failed Trial diagnosis, Candidate optimization, evaluator governance, turning reviewed reports and natural-language scoring feedback into evaluator meta-evaluation data, or explicit promotion decisions.
|
|
3
|
+
description: Architect, initialize, run, diagnose, compare, and safely improve a DeepSeek Harness business Agent or Evaluator with Harbor. Use for low-friction Harbor setup, evaluating recent completed DSH Sessions when no Dataset is supplied, Agent self-evolution, vertical-search evaluation loops, running Job inspection, failed Trial diagnosis, Candidate optimization, evaluator governance, turning reviewed reports and natural-language scoring feedback into evaluator meta-evaluation data, or explicit promotion decisions.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Evolve Agent With Harbor
|
|
@@ -32,6 +32,7 @@ The runtime must remain `dsh-host-broker` / `dsh-host-model-gateway/v1`: the Can
|
|
|
32
32
|
- **Architecture**: inspect role boundaries and run `harbor_evolution_doctor`.
|
|
33
33
|
- **Initialize**: read `references/initialization.md`, compile the accepted four-concept card, then call `harbor_evolution_init`.
|
|
34
34
|
- **Diagnostic**: investigate failures without making a promotion claim.
|
|
35
|
+
- **Historical generation diagnostic**: when no Dataset was supplied, preview recent completed DSH Sessions and, only after confirmation, evaluate the immutable records without re-executing a Candidate.
|
|
35
36
|
- **Quick diagnostic**: after confirmation, call `harbor_quick_diagnostic_init` for one Query plus a Rubric draft. It generates a Harbor 1.4 wiring project that reuses the current DSH model and is permanently marked non-promotable.
|
|
36
37
|
- **Promotion**: run a `promotion-eligible` Job and apply the deterministic Gate.
|
|
37
38
|
- **Evolve**: baseline → diagnose → one controlled change → regression Job → Gate.
|
|
@@ -40,6 +41,44 @@ The runtime must remain `dsh-host-broker` / `dsh-host-model-gateway/v1`: the Can
|
|
|
40
41
|
|
|
41
42
|
Do not turn an inspection or diagnostic request into Agent mutation or deployment.
|
|
42
43
|
|
|
44
|
+
## Default to recent Sessions only when Dataset is absent
|
|
45
|
+
|
|
46
|
+
Preserve explicit user input. If the user supplies any Dataset, Query, instruction file/directory, Dataset path, or Dataset-bearing curl workflow, use the normal four-concept flow below. Never replace or augment an explicit Dataset with Session history unless the user separately asks for that change.
|
|
47
|
+
|
|
48
|
+
Only when no Dataset was supplied and `harbor_session_diagnostic_preview` is available:
|
|
49
|
+
|
|
50
|
+
1. Call `harbor_session_diagnostic_preview` with `limit=10`. This is a read-only Preview, not a Job. If the user selected a different Judge, pass its provider/model/reasoning options here so that identity is part of the confirmation token.
|
|
51
|
+
2. Present the returned safe Session metadata, exact-cwd scope, last-activity order, excluded counts, warnings, estimated Judge requests, token expiry, and confirmation text. Do not expose or reconstruct raw Session ids, transcripts, tool payloads, or credentials.
|
|
52
|
+
3. Explain the role mapping plainly: the DSH Agent that produced each Session remains the **Generator**; the completed Session is immutable Generation Record evidence; one Historical Generation Evaluation Job contains up to 10 Trials; one selected Session becomes one Trial.
|
|
53
|
+
4. Ask for explicit confirmation. Do not call the run tool merely because Preview succeeded. If the sample changed or the token expired, preview again instead of widening scope.
|
|
54
|
+
5. After confirmation, call `harbor_session_diagnostic_run` with the returned `selectionToken` (and only an optional `jobName`). Evaluator/Judge overrides belong to Preview and are rejected at Run so the confirmed identity cannot change. The tool synchronously materializes the private Batch into its matching Dataset and immutable Historical Evaluation Stack before starting the Job. Do not pass `stackPath`: the MVP rejects custom Historical Stacks so the executed Evaluator cannot drift from the declared Stack. Do not call `harbor_candidate_snapshot`, `harbor_model_binding`, `harbor_context_preview`, or `harbor_eval_run` for this branch.
|
|
55
|
+
|
|
56
|
+
Render this compact confirmation card before running:
|
|
57
|
+
|
|
58
|
+
```text
|
|
59
|
+
会话历史评测确认
|
|
60
|
+
- 范围:当前工作目录,按最后活动时间选取最近 <N>/10 条已完成会话
|
|
61
|
+
- 生成器:产生这些会话的 DSH Agent(本次不会重新执行)
|
|
62
|
+
- 评测对象:<N> 条已有 Generation Records;1 条会话 = 1 Trial
|
|
63
|
+
- 评测器:<evaluation.evaluator.id>@<version> · Judge <evaluation.judge.provider>/<model>
|
|
64
|
+
- 评测耦合:<evaluation.coupling;同模型或 Generator 模型未知时明确仅用于诊断,不声称独立>
|
|
65
|
+
- 成本上界:<estimatedJudgeRequests> 次 Judge 请求
|
|
66
|
+
- 用途:诊断、群体分析与生成器问题定位
|
|
67
|
+
- 本地保留:`.harbor/private` 和 `jobs` 会保存脱敏后的真实业务会话证据,默认不会自动删除
|
|
68
|
+
- VCS 风险:private 根不存在规则时会创建 ignore-all `.gitignore`,但不会覆盖已有规则;`jobs` 的忽略、上传与保留策略仍由项目负责
|
|
69
|
+
- 不会执行:Candidate 生成、本 Historical Job 内的评测器元评测、Promotion Gate 或部署
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Treat the resulting `historical-generation-evaluation` Job as `diagnostic` and `observe-existing`. `completed-unscored` is a normal abstention when evidence is insufficient; report scored/unscored Trial and Criterion coverage separately, and never convert abstention into business score `0`.
|
|
73
|
+
|
|
74
|
+
Population Analysis and Generator Diagnosis summarize the observed records and Generator population. They are not Evaluator Meta-Evaluation. The existing independent-GT flow (`harbor_ground_truth_init` plus repeated evaluator observations and `harbor_evaluator_meta_evaluate`) remains available as a separate governance action, but this Historical Job never invokes or inherits it automatically. For the Historical Job report `evaluator_meta_evaluation.status=not-run`, say that its Evaluator reliability remains unvalidated, and never claim ESF/SCE/RCR evidence from Session scores. A future dedicated `evaluator-meta-evaluation` Job may package that existing flow into a Job lifecycle; do not describe the underlying meta-evaluation capability as absent.
|
|
75
|
+
|
|
76
|
+
Historical Generation Jobs are never comparable Candidate baselines or Promotion Gate inputs. Report Gate as `N/A`; if comparison is requested, explain `UNSUPPORTED_JOB_KIND_FOR_PROMOTION` and first convert reviewed badcases into a fixed regression Dataset.
|
|
77
|
+
|
|
78
|
+
If the Session Query capability or Preview tool is unavailable, state that limitation and continue with the ordinary four-concept intake. Do not invent a filesystem transcript scan as a fallback.
|
|
79
|
+
|
|
80
|
+
State current MVP limits instead of suggesting unsupported controls: selection is exact-cwd, reads at most the configured `sessionMaxReads` candidates (100 by default), accepts an optional ISO-8601 `createdAfter` lower bound, and exposes no cursor. On `SESSION_SELECTION_TOO_EXPENSIVE`, preview again with a narrower `createdAfter`, use an explicit Query/Dataset, or ask an administrator to review the read limit. A token binds Feedback availability, failure state, and content digest without retaining raw Feedback; if any of them changes, Run fails before writing the Batch and requires a new Preview. Do not claim that a real Docker/Harbor/Workbench journey passed from unit tests, generated files, or a zero process exit code alone.
|
|
81
|
+
|
|
43
82
|
## Start with four clear concepts
|
|
44
83
|
|
|
45
84
|
Inspect the current workspace before asking questions. Look for Agent entry files, package metadata, curl examples, Dataset instructions, existing Harbor configuration/Jobs, tests, and available Codex or Claude Code commands. Reuse reliable findings and say what was inferred; do not ask the user to transcribe information already present in files.
|
|
@@ -93,7 +132,7 @@ Never invent GT labels, business thresholds, credentials, production side-effect
|
|
|
93
132
|
|
|
94
133
|
## Enforce the strict architecture
|
|
95
134
|
|
|
96
|
-
Require these before every Job:
|
|
135
|
+
Require these before every Candidate execution Job:
|
|
97
136
|
|
|
98
137
|
- `candidate-manifest.json` verified against the Candidate files.
|
|
99
138
|
- `dataset-manifest.json` with unique task ids, non-empty instructions, safe paths, a matching source digest, and the same Task population that Harbor resolves at runtime. A local Dataset contains immediate Task child directories; each Task uses `schema_version = "1.4"`, `[task].name = "org/name"`, `instruction.md`, `environment/`, and `tests/test.sh`.
|
|
@@ -102,14 +141,14 @@ Require these before every Job:
|
|
|
102
141
|
|
|
103
142
|
Require `input_integrity`, `agent_completed`, `integration_valid`, `renderer_valid`, `judge_completed`, and `artifact_schema_valid` in the Trial validity contract. Specify which failures are hard requirements. Never infer that a numeric raw verifier reward is a valid Candidate quality score.
|
|
104
143
|
|
|
105
|
-
Before a formal Job, call in order:
|
|
144
|
+
Before a formal Candidate execution Job, call in order:
|
|
106
145
|
|
|
107
146
|
1. `harbor_candidate_snapshot`
|
|
108
147
|
2. `harbor_dataset_validate`
|
|
109
148
|
3. `harbor_evolution_doctor`
|
|
110
149
|
4. `harbor_context_preview`
|
|
111
150
|
|
|
112
|
-
Do not launch a `promotion-eligible` Job when Doctor reports an error, no comparable baseline exists, or `fresh_baseline_required` is true. A diagnostic Job may investigate architecture warnings, but still requires a valid Candidate, Dataset Manifest, Evaluation Stack, and Context v2.
|
|
151
|
+
Do not launch a `promotion-eligible` Job when Doctor reports an error, no comparable baseline exists, or `fresh_baseline_required` is true. A Candidate-execution diagnostic Job may investigate architecture warnings, but still requires a valid Candidate, Dataset Manifest, Evaluation Stack, and Context v2. The observe-existing Session branch instead uses its frozen Historical Generation Batch, Historical Evaluation Context, and non-promotion Stack.
|
|
113
152
|
|
|
114
153
|
Keep Runner orchestration-only. Treat these as architecture errors:
|
|
115
154
|
|
|
@@ -176,6 +215,7 @@ Use the formal terminal states precisely:
|
|
|
176
215
|
- `candidate-quality-failed`: valid execution reached evaluation, but a Candidate-owned hard requirement failed.
|
|
177
216
|
- `infrastructure-error`: dependency, sandbox, permission, transport, timeout, or runtime failure; no Candidate quality score.
|
|
178
217
|
- `evaluation-error`: Renderer/Judge/Verifier did not complete; no Candidate quality score.
|
|
218
|
+
- `completed-unscored`: a Historical Generation Trial completed but the Evaluator abstained for insufficient evidence; preserve it in coverage and do not count it as a quality failure or score `0`.
|
|
179
219
|
- `cancelled`: preserve the attempt and do not score it.
|
|
180
220
|
|
|
181
221
|
For retry or resume, retain the old attempt and create a new attempt. Never replace an assessment or event history in place.
|
|
@@ -221,7 +261,7 @@ Call `harbor_context_preview`; establish a fresh baseline if needed. Run the Can
|
|
|
221
261
|
|
|
222
262
|
Never bypass `INFRASTRUCTURE_EXCEPTION_PRESENT`, `ARTIFACT_SCHEMA_INVALID`, Dataset/Stack/Rubric/Judge mismatch, or non-regression failures.
|
|
223
263
|
|
|
224
|
-
A `diagnostic` Job must never invoke Gate. Reading the Workbench, generating a Reporter summary, or producing a non-reward Optimization Report also must not promote, deploy, publish, or replace the Champion. Gate remains a separate, explicit comparison action.
|
|
264
|
+
A `diagnostic` Job must never invoke Gate. A Historical Generation Job always displays Gate as `N/A` and must not be passed to `harbor_candidate_compare`. Reading the Workbench, generating a Reporter summary, or producing a non-reward Optimization Report also must not promote, deploy, publish, or replace the Champion. Gate remains a separate, explicit Candidate comparison action.
|
|
225
265
|
|
|
226
266
|
## Govern evaluator changes
|
|
227
267
|
|
|
@@ -288,7 +328,7 @@ Treat one reviewed report as a diagnostic calibration example, not evidence that
|
|
|
288
328
|
|
|
289
329
|
After cases are populated, run the same Evaluator repeatedly on the fixed reports, collect `evaluator-observations/v1`, and call `harbor_evaluator_meta_evaluate`. The user should not have to hand-author either JSON file. Report ESF, SCE, RCR, coverage, disagreement slices, latency, and cost as applicable, then translate them back into direct conclusions: missed problems, false alarms, unstable judgments, and the smallest justified Evaluator/Rubric change.
|
|
290
330
|
|
|
291
|
-
Manage
|
|
331
|
+
Manage Evaluator Candidates and the existing independent-GT meta-evaluation artifacts with immutable identities, provenance, comparable observations, and an explicit human adoption decision. A dedicated `evaluator-meta-evaluation` Harbor Job lifecycle is future work; do not claim that `harbor_evaluator_meta_evaluate` created such a Job.
|
|
292
332
|
|
|
293
333
|
## Report each cycle
|
|
294
334
|
|
|
@@ -303,5 +343,5 @@ Return:
|
|
|
303
343
|
- One Dataset-level overall conclusion and one prioritized, evidence-linked optimization recommendation; explicitly state when score validity or coverage is insufficient for one.
|
|
304
344
|
- Evidence provenance and any capability unavailable on a legacy Job.
|
|
305
345
|
- Controlled change hypothesis and mutation surface.
|
|
306
|
-
- Gate decision with exact reason codes.
|
|
346
|
+
- Gate decision with exact reason codes for Candidate comparison Jobs, or explicit `N/A` for Historical Generation Jobs.
|
|
307
347
|
- External CI/CD action still required.
|
|
@@ -4,12 +4,14 @@
|
|
|
4
4
|
{
|
|
5
5
|
"id": 1,
|
|
6
6
|
"prompt": "帮我给当前目录里的业务 Agent 建一个 Harbor 自进化流程,我还没有准备任何评测配置。",
|
|
7
|
-
"expected_output": "
|
|
7
|
+
"expected_output": "先检查工作区;用户未提供显式 Dataset 时,先调用 harbor_session_diagnostic_preview(limit=10) 只读预览当前 cwd 最近完成会话,说明原 DSH Agent 是生成器、1 会话是 1 Trial,展示成本、排除原因、Evaluator/Judge identity 与 coupling 后等待确认,不得直接 run。Judge 选择只允许在 Preview,确认后只传 selectionToken;确认卡还要提示 .harbor/private 与 jobs 会本地保留脱敏业务会话及其 VCS 风险。Batch 同步物化匹配的 Dataset/Stack,MVP 不接受自定义 stackPath。明确无 Candidate 重执行、Historical Job 内元评测 status=not-run、Gate N/A,同时说明已有独立 GT/meta-evaluate 流程仍可单独使用;仅当 Session Preview 不可用时,再用评测集、生成器、评测器(评测标准)和优化器四个业务概念继续普通冷启动。",
|
|
8
8
|
"files": [],
|
|
9
9
|
"assertions": [
|
|
10
|
-
"The response
|
|
11
|
-
"The response
|
|
12
|
-
"The response
|
|
10
|
+
"The response calls the read-only Session Preview with a limit of 10 before proposing any Historical Job run.",
|
|
11
|
+
"The response maps the original DSH Agent to Generator and each selected completed Session to one immutable Trial.",
|
|
12
|
+
"The response pauses for explicit confirmation and warns that redacted business Session evidence remains locally under .harbor/private and jobs with VCS risk.",
|
|
13
|
+
"The response says Run receives the selection token, synchronously materializes the matching Dataset and immutable Stack, and does not accept a custom stackPath.",
|
|
14
|
+
"The response keeps Evaluator Meta-Evaluation not-run inside the Historical Job while acknowledging the separate independent-GT meta-evaluate flow, and reports Gate as N/A."
|
|
13
15
|
]
|
|
14
16
|
},
|
|
15
17
|
{
|
|
@@ -26,12 +28,13 @@
|
|
|
26
28
|
{
|
|
27
29
|
"id": 3,
|
|
28
30
|
"prompt": "评测集在 ./evals,生成器调用这个 curl:curl -X POST http://127.0.0.1:9000/run -H 'Authorization: Bearer secret' -d '{\"input\":\"hi\"}'。评测器在 ./judge.py,优化交给 codex。帮我初始化。",
|
|
29
|
-
"expected_output": "
|
|
31
|
+
"expected_output": "保留显式 ./evals Dataset,不用会话历史替换或追加它,也不调用 Session Preview。自动解析四个概念并展示确认卡;不回显或持久化 secret;底层身份与适配器由 Skill 推断,不再追问专业字段;未确认前不写文件或运行 Job。",
|
|
30
32
|
"files": [],
|
|
31
33
|
"assertions": [
|
|
32
34
|
"The Authorization credential is redacted and explicitly excluded from persisted configuration.",
|
|
33
35
|
"The response maps the supplied paths and curl into the four-concept confirmation card.",
|
|
34
|
-
"The response does not run initialization or evaluation before confirmation."
|
|
36
|
+
"The response does not run initialization or evaluation before confirmation.",
|
|
37
|
+
"The response keeps the explicit Dataset authoritative and does not invoke the Session-history Preview."
|
|
35
38
|
]
|
|
36
39
|
},
|
|
37
40
|
{
|
|
@@ -66,6 +66,8 @@ Treat changes to any of these as reward-semantic changes requiring a new Context
|
|
|
66
66
|
|
|
67
67
|
## Meta-evaluate before adopting
|
|
68
68
|
|
|
69
|
+
The current capability is an independent artifact workflow, not a Harbor Job kind: `harbor_ground_truth_init` creates the provenance-bearing GT draft, repeated Evaluator runs produce fixed observations, and `harbor_evaluator_meta_evaluate` writes `meta-evaluation-report/v1`. It does not run inside a Historical Generation Job, and it does not emit a `job_kind=evaluator-meta-evaluation` Job. A future dedicated Job may package this existing workflow into a recoverable lifecycle.
|
|
70
|
+
|
|
69
71
|
Rotate roles:
|
|
70
72
|
|
|
71
73
|
- Candidate: the new Evaluator/Rubric/Judge version.
|
|
@@ -76,7 +78,7 @@ Rotate roles:
|
|
|
76
78
|
|
|
77
79
|
Use the same GT set, repeat policy, and measurement procedure for old and new evaluator Candidates. Report coverage, invalid measurements, aggregate metrics, disagreement slices, latency, cost, and representative errors. Do not select only favorable runs.
|
|
78
80
|
|
|
79
|
-
GT is not synonymous with human labeling. It may be human, programmatic, consensus-based, produced by a separately pinned model, or imported from an external standard. Require explicit provenance and independence from the Candidate evaluator in every case. Use `harbor_ground_truth_init` to create the versioned draft and `harbor_evaluator_meta_evaluate` to calculate ESF, SCE, and RCR from repeated observations.
|
|
81
|
+
GT is not synonymous with human labeling. It may be human, programmatic, consensus-based, produced by a separately pinned model, or imported from an external standard. Require explicit provenance and independence from the Candidate evaluator in every case. Use `harbor_ground_truth_init` to create the versioned draft and `harbor_evaluator_meta_evaluate` to calculate ESF, SCE, and RCR from repeated observations. Keep a Historical Job's own `evaluator_meta_evaluation.status=not-run`; never attach a separate report implicitly or derive it from Session Population scores.
|
|
80
82
|
|
|
81
83
|
The user supplies reports and review evidence; the Agent performs the protocol adaptation. Do not ask the user to hand-author `ground-truth/v1` or `evaluator-observations/v1`. After confirmation, generate the strict files, validate them, run repeated Evaluator observations, and retain a reversible mapping from every normalized field to its raw source.
|
|
82
84
|
|