dsh-harbor-evolution 0.4.0 → 0.6.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 +15 -7
- package/index.js +109 -2
- package/lib/candidate.js +29 -2
- package/lib/client.js +767 -260
- package/lib/dashboard.js +644 -67
- package/lib/evolution.js +164 -26
- package/lib/process.js +2 -1
- package/lib/service.js +137 -2
- package/lib/web.js +76 -15
- package/package.json +7 -1
- package/schemas/evaluation-result.schema.json +27 -0
- package/schemas/evaluator-observations.schema.json +51 -0
- package/schemas/ground-truth.schema.json +61 -0
- package/schemas/meta-evaluation-report.schema.json +23 -0
- package/skills/evolve-agent-with-harbor/SKILL.md +149 -78
- package/skills/evolve-agent-with-harbor/references/evaluator-upgrade.md +61 -0
- package/skills/evolve-agent-with-harbor/references/initialization.md +100 -81
|
@@ -1,114 +1,133 @@
|
|
|
1
|
-
# Initialization
|
|
1
|
+
# Strict Project Initialization
|
|
2
2
|
|
|
3
|
-
Load this reference only when the
|
|
3
|
+
Load this reference only when the project is missing the Evaluation Stack structure or the user asks to initialize it.
|
|
4
4
|
|
|
5
|
-
## Readiness
|
|
5
|
+
## Readiness worksheet
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Resolve every value before calling `harbor_evolution_init`:
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
| Field | Required meaning |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| `datasetPath` | Existing Harbor Dataset inside `projectRoot` |
|
|
12
|
+
| `stackId` / `stackVersion` | Stable identity of the complete evaluation architecture |
|
|
13
|
+
| `datasetId` / `datasetVersion` | Stable identity of task population and GT boundary |
|
|
14
|
+
| `contractId` / `contractVersion` | Stable metric semantics |
|
|
15
|
+
| `primaryMetric` / `primaryDirection` | Exact reward key and `maximize` or `minimize` |
|
|
16
|
+
| Judge provider/model/version | Reproducible Judge identity, never credentials |
|
|
17
|
+
| Policy id/version | Stable Gate identity |
|
|
18
|
+
| `minImprovement` | Accepted primary-metric delta |
|
|
14
19
|
|
|
15
|
-
|
|
20
|
+
Also establish diagnostic metrics, min/max thresholds, non-regression metrics, mutation surface, repeat policy, and promotion owner. The initializer creates a minimal Policy; update its explicit placeholders before a formal Gate.
|
|
16
21
|
|
|
17
|
-
|
|
22
|
+
If the Evaluator itself will be optimized, separately establish Ground Truth id/version, source kind (`human`, `programmatic`, `consensus`, `model`, or `external`), provenance, owner, Criteria, case population, and adjudication rule. Do not hide these semantics inside the Agent Dataset identity. Use `harbor_ground_truth_init` only after they are accepted.
|
|
18
23
|
|
|
19
|
-
|
|
20
|
-
| --- | --- | --- |
|
|
21
|
-
| Target behavior | Produce cited research answers | Defines task success |
|
|
22
|
-
| Candidate identity | `deep-research-agent` | Keeps v1/v2 in one product line |
|
|
23
|
-
| Candidate path | `candidates/deep-research/v1` | Defines what is snapshotted |
|
|
24
|
-
| Dataset path | `datasets/deep-research-regression` | Fixes tasks and Verifier |
|
|
25
|
-
| Primary metric | `reward` | Ranks Candidates |
|
|
26
|
-
| Minimums | completion and citation >= 0.95 | Prevents unsafe tradeoffs |
|
|
27
|
-
| Non-regression | tool success, latency | Protects existing capability |
|
|
28
|
-
| Mutation surface | prompt and search plugin only | Controls causal attribution |
|
|
29
|
-
| Repeat policy | 5 fixed-seed runs | Controls stochastic variance |
|
|
30
|
-
| Promotion owner | CI gate plus human approval | Keeps deployment external |
|
|
31
|
-
|
|
32
|
-
## Recommended layout
|
|
24
|
+
## Generated layout
|
|
33
25
|
|
|
34
26
|
```text
|
|
35
|
-
|
|
27
|
+
projectRoot/
|
|
28
|
+
├── .harbor/
|
|
29
|
+
│ ├── evolution.yml
|
|
30
|
+
│ └── evaluation-stack.yml
|
|
36
31
|
├── candidates/
|
|
37
|
-
│ └── <agent-id>/
|
|
38
|
-
│ ├── v1/
|
|
39
|
-
│ │ ├── cordis.yml
|
|
40
|
-
│ │ ├── package.json
|
|
41
|
-
│ │ ├── package-lock.json
|
|
42
|
-
│ │ └── business plugins...
|
|
43
|
-
│ └── v2/
|
|
44
32
|
├── datasets/
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
├──
|
|
53
|
-
|
|
33
|
+
├── integrations/default.py
|
|
34
|
+
├── renderers/default.py
|
|
35
|
+
├── evaluators/default.py
|
|
36
|
+
├── rubrics/default.md
|
|
37
|
+
├── diagnosers/default.py
|
|
38
|
+
├── optimizers/default.py
|
|
39
|
+
├── runners/harbor.py
|
|
40
|
+
├── reporters/default.py
|
|
41
|
+
├── policies/promotion.json
|
|
54
42
|
└── jobs/
|
|
55
43
|
```
|
|
56
44
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
##
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
45
|
+
The initializer never overwrites existing files. `created` and `preserved` in its result are part of the audit. Placeholder components provide identities, not a finished business evaluator.
|
|
46
|
+
|
|
47
|
+
## Evaluation Stack shape
|
|
48
|
+
|
|
49
|
+
```yaml
|
|
50
|
+
schema_version: 1
|
|
51
|
+
stack_id: vertical-search
|
|
52
|
+
version: 1.0.0
|
|
53
|
+
components:
|
|
54
|
+
integration: { id: search-api, version: 1.0.0, entry: integrations/default.py }
|
|
55
|
+
renderer: { id: search-renderer, version: 1.0.0, entry: renderers/default.py }
|
|
56
|
+
evaluator: { id: search-evaluator, version: 1.0.0, entry: evaluators/default.py }
|
|
57
|
+
rubric: { id: search-rubric, version: 1.0.0, entry: rubrics/default.md }
|
|
58
|
+
diagnoser: { id: search-diagnoser, version: 1.0.0, entry: diagnosers/default.py }
|
|
59
|
+
optimizer: { id: search-optimizer, version: 1.0.0, entry: optimizers/default.py }
|
|
60
|
+
runner: { id: harbor-runner, version: 1.0.0, entry: runners/harbor.py, semantic: false }
|
|
61
|
+
reporter: { id: search-reporter, version: 1.0.0, entry: reporters/default.py }
|
|
62
|
+
judge:
|
|
63
|
+
provider: accepted-provider
|
|
64
|
+
model: accepted-model
|
|
65
|
+
version: pinned-version
|
|
66
|
+
parameters: { temperature: 0 }
|
|
67
|
+
evaluation_contract:
|
|
68
|
+
contract_id: vertical-search
|
|
69
|
+
version: 1.0.0
|
|
70
|
+
primary_metric: reward
|
|
71
|
+
metrics:
|
|
72
|
+
- { id: reward, label: Overall reward, direction: maximize }
|
|
73
|
+
- { id: valid_search_rate, label: Valid search rate, direction: maximize }
|
|
74
|
+
- { id: citation_accuracy, label: Citation accuracy, direction: maximize }
|
|
75
|
+
hard_requirements:
|
|
76
|
+
- { id: input_integrity }
|
|
77
|
+
- { id: agent_completed }
|
|
78
|
+
- { id: integration_valid }
|
|
79
|
+
- { id: renderer_valid }
|
|
80
|
+
- { id: judge_completed }
|
|
81
|
+
- { id: artifact_schema_valid }
|
|
82
|
+
```
|
|
68
83
|
|
|
69
|
-
|
|
84
|
+
The validity requirements answer whether a quality score is admissible. They are separate from metric thresholds. Infrastructure and evaluation failures may retain raw verifier output for audit, but must emit `score.valid=false` and never enter Population aggregates.
|
|
70
85
|
|
|
71
|
-
|
|
86
|
+
Do not duplicate Evaluator logic inside each Task. Reference one Stack Evaluator from task metadata when task-specific routing is needed.
|
|
72
87
|
|
|
73
|
-
|
|
88
|
+
## Dataset rules
|
|
74
89
|
|
|
75
|
-
|
|
76
|
-
- `instruction.md`: the behavior requested from the Candidate.
|
|
77
|
-
- `environment/Dockerfile`: a reproducible sandbox with required runtime dependencies.
|
|
78
|
-
- `tests/test.sh`: the verifier entrypoint.
|
|
79
|
-
- Verifier code that writes primary and diagnostic metrics to Harbor's reward output.
|
|
90
|
+
Keep `dataset-manifest.json` at Dataset root. Generate it through initialization or `harbor-dsh dataset snapshot`; do not hand-edit its digest. Validation rejects:
|
|
80
91
|
|
|
81
|
-
|
|
92
|
+
- Missing/duplicate Task ids or empty instructions.
|
|
93
|
+
- Duplicate normalized queries.
|
|
94
|
+
- Missing/out-of-root paths or symlinks.
|
|
95
|
+
- Source/file counts that no longer match.
|
|
96
|
+
- Secret-bearing metadata fields.
|
|
82
97
|
|
|
83
|
-
|
|
98
|
+
Intentional Dataset changes require a new Dataset version, a new snapshot, and a fresh baseline.
|
|
84
99
|
|
|
85
|
-
|
|
100
|
+
## Promotion Policy v2
|
|
86
101
|
|
|
87
102
|
```json
|
|
88
103
|
{
|
|
89
|
-
"schema_version":
|
|
104
|
+
"schema_version": 2,
|
|
105
|
+
"policy_id": "vertical-search",
|
|
106
|
+
"version": "1.0.0",
|
|
90
107
|
"primary_metric": "reward",
|
|
108
|
+
"primary_direction": "maximize",
|
|
91
109
|
"min_improvement": 0.05,
|
|
92
|
-
"minimums": {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
"
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
],
|
|
99
|
-
"non_regression_tolerance": 0.0
|
|
110
|
+
"minimums": { "citation_accuracy": 0.9 },
|
|
111
|
+
"maximums": { "latency_seconds": 20 },
|
|
112
|
+
"non_regression": ["valid_search_rate"],
|
|
113
|
+
"metric_directions": { "valid_search_rate": "maximize" },
|
|
114
|
+
"non_regression_tolerance": 0.0,
|
|
115
|
+
"hard_requirements": ["exception_free", "artifact_schema_valid", "doctor_error_free"]
|
|
100
116
|
}
|
|
101
117
|
```
|
|
102
118
|
|
|
103
|
-
|
|
119
|
+
Use business-accepted thresholds. Do not assume all metrics are `/10`, maximized, or universal across domains.
|
|
120
|
+
|
|
121
|
+
## Handoff before the first Job
|
|
104
122
|
|
|
105
|
-
|
|
123
|
+
Show the user:
|
|
106
124
|
|
|
107
|
-
|
|
125
|
+
1. Resolved Candidate, Dataset, Stack, Policy, and Jobs paths.
|
|
126
|
+
2. Role identities and which ones affect reward comparability.
|
|
127
|
+
3. Metric directions, thresholds, groups, and hard requirements.
|
|
128
|
+
4. Holdout, mutation, side-effect, repeat, and deployment boundaries.
|
|
129
|
+
5. Doctor findings and Context preview.
|
|
108
130
|
|
|
109
|
-
|
|
110
|
-
2. The metric and promotion contract.
|
|
111
|
-
3. The mutation and side-effect boundaries.
|
|
112
|
-
4. Any assumptions still being used.
|
|
131
|
+
Start with a baseline. Do not create Candidate v2 until baseline evidence supports one controlled hypothesis.
|
|
113
132
|
|
|
114
|
-
|
|
133
|
+
The first completed Job should produce `trial-lifecycle.json`, `trial-events.jsonl`, Trial Assessment v2 files, `artifact-registry.json`, Population Report v2, and Optimization Report v2. Treat missing 0.6 capabilities on older Jobs as read-only historical limitations, not synthetic defaults.
|