dsh-harbor-evolution 0.6.0 → 0.7.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 CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Installable DeepSeek Harness Plugin + Skill for running stable Harbor evaluation and controlled Agent evolution loops, with a native DSH Web dashboard.
4
4
 
5
- The package gives DSH twelve strict Harbor tools, dedicated Tool cards, a nine-stage Evaluation Workbench, an installation Doctor, and the model- and user-invocable `evolve-agent-with-harbor` Skill. The Skill clarifies and initializes the Evaluation Stack, validates Dataset identity, checks Trial Lifecycle and Score Validity, governs independent Ground Truth meta-evaluation, diagnoses evidence provenance, limits each iteration to one controlled Candidate change, and invokes the Promotion Gate only as an explicit action.
5
+ The package gives DSH twelve strict Harbor tools, dedicated Tool cards, a nine-stage Evaluation Workbench, an installation Doctor, and the model- and user-invocable `evolve-agent-with-harbor` Skill. The Skill starts with four user-facing concepts—Dataset (what to test), Generator (who answers), Evaluator plus criteria (what good means), and Optimizer (who improves it)—then compiles accepted choices into the strict Evaluation Stack. It validates Dataset identity, checks Trial Lifecycle and Score Validity, governs independent Ground Truth meta-evaluation, diagnoses evidence provenance, limits each iteration to one controlled Candidate change, and invokes the Promotion Gate only as an explicit action.
6
6
 
7
7
  ## Install
8
8
 
@@ -14,8 +14,8 @@ npx --yes dsh-harbor-evolution@latest setup --project-root "$PWD"
14
14
 
15
15
  The setup command installs both required runtimes:
16
16
 
17
- - `harbor-dsh-evolution==0.6.0` in a managed Python environment.
18
- - `dsh-harbor-evolution@0.6.0` in the selected DSH profile.
17
+ - `harbor-dsh-evolution==0.7.0` in a managed Python environment.
18
+ - `dsh-harbor-evolution@0.7.0` in the selected DSH profile.
19
19
 
20
20
  It then stores the absolute Harbor executable paths and `projectRoot` in the profile's `harbor-evolution` block and verifies the integration. Existing unrelated profile entries are preserved, and rerunning setup updates the same block.
21
21
 
@@ -32,6 +32,8 @@ Stop any old DSH process and run the exact restart command printed by setup. The
32
32
  Inspect this workspace and help me clarify and initialize a stable Harbor self-evolution loop.
33
33
  ```
34
34
 
35
+ Users may provide a single Query or Dataset path, a Generator curl or local Agent path, an Evaluator curl/path or natural-language criteria, and an optional Optimizer such as Codex or Claude Code. The Skill inspects the workspace first, defaults the Optimizer to the current Agent, and shows one confirmation card before writing files. Evaluation Stack roles, ids, versions, Judge configuration, Contract, and Policy stay behind advanced configuration unless they materially affect a decision.
36
+
35
37
  The Plugin registers:
36
38
 
37
39
  - `harbor_candidate_snapshot`
package/index.js CHANGED
@@ -74,7 +74,7 @@ export function apply(ctx, config) {
74
74
 
75
75
  ctx.tools.register(jsonTool({
76
76
  name: 'harbor_evolution_init',
77
- description: 'Initialize a strict, non-overwriting Evaluation Stack project after the Skill has clarified identities, primary metric, judge, and promotion threshold.',
77
+ description: 'Compile an accepted Dataset, Generator, Evaluator/criteria, and Optimizer onboarding card into a strict, non-overwriting Evaluation Stack project. Detailed identity fields are internal tool inputs, not a user questionnaire.',
78
78
  parameters: {
79
79
  datasetPath: { type: 'string', required: true },
80
80
  stackId: { type: 'string', required: true },
package/lib/setup.js CHANGED
@@ -267,7 +267,11 @@ export async function setupIntegration(raw = {}, dependencies = {}) {
267
267
  try {
268
268
  await run('pnpm', [
269
269
  '--silent', 'dlx', `@deepseek-ai/dsh@${DSH_VERSION}`,
270
- 'plugin', '--profile', config.profile, 'add', '-w', '--save-exact', config.pluginSpec,
270
+ // Registry packages ship their built client and need no lifecycle
271
+ // scripts. Skipping scripts also prevents pnpm 11 from reclassifying
272
+ // unrelated DSH native dependencies as newly unapproved builds while
273
+ // adding this plugin to an existing profile.
274
+ 'plugin', '--profile', config.profile, 'add', '-w', '--save-exact', '--ignore-scripts', config.pluginSpec,
271
275
  ], { env: { ...env, DSH_HOME: config.dshHome } })
272
276
  } catch (error) {
273
277
  throw new Error(processFailure(error))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-harbor-evolution",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "DeepSeek Harness plugin and bundled Skill for safely evolving Cordis Candidates with Harbor.",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -5,19 +5,22 @@ description: Architect, initialize, run, diagnose, compare, and safely improve a
5
5
 
6
6
  # Evolve Agent With Harbor
7
7
 
8
- Build a reproducible improvement loop around three boundaries:
8
+ Build a reproducible improvement loop around four concepts that users can describe in business language:
9
9
 
10
- - **Generator/Candidate**: the immutable DSH Agent composition being improved.
11
- - **Evaluator/Evaluation Stack**: Integration, Renderer, Evaluator, Rubric, Diagnoser, Optimizer, Runner, Reporter, and Judge identities.
12
- - **Optimizer**: proposes one evidence-linked Candidate change; it never controls the final Gate.
10
+ - **评测集 (Dataset)** what should be tested: one Query, a file, a directory of instructions, or an existing Harbor Dataset.
11
+ - **生成器 (Generator)** who produces the answer or artifact: a curl request, a local Agent entry, or an Agent already found in the workspace.
12
+ - **评测器(含评测标准) (Evaluator)** what “good” means and who scores it: an evaluator endpoint, a local evaluator, or a versioned evaluator drafted from natural-language criteria.
13
+ - **优化器 (Optimizer)** — who uses badcases and evidence to propose the next controlled change: this Agent by default, Codex/Claude Code, or a local command/Agent.
14
+
15
+ Keep these four names visible during onboarding and confirmation; they establish the product's concept space. Treat Integration, Renderer, Rubric, Diagnoser, Runner, Reporter, Judge identity, Contract, Policy, Context, and Gate as the compiled evaluation architecture. Explain them only when they affect a decision or the user opens advanced configuration.
13
16
 
14
17
  Treat Harbor as the experiment boundary. Deployment, CI/CD, and Champion replacement remain external actions requiring separate authority.
15
18
 
16
19
  ## Select the narrowest mode
17
20
 
18
- - **Clarify**: define progress, identities, constraints, and promotion ownership.
21
+ - **Clarify**: identify the Dataset, Generator, Evaluator/criteria, and Optimizer with the least user effort.
19
22
  - **Architecture**: inspect role boundaries and run `harbor_evolution_doctor`.
20
- - **Initialize**: read `references/initialization.md`, obtain explicit values, then call `harbor_evolution_init`.
23
+ - **Initialize**: read `references/initialization.md`, compile the accepted four-concept card, then call `harbor_evolution_init`.
21
24
  - **Diagnostic**: investigate failures without making a promotion claim.
22
25
  - **Promotion**: run a `promotion-eligible` Job and apply the deterministic Gate.
23
26
  - **Evolve**: baseline → diagnose → one controlled change → regression Job → Gate.
@@ -26,20 +29,52 @@ Treat Harbor as the experiment boundary. Deployment, CI/CD, and Champion replace
26
29
 
27
30
  Do not turn an inspection or diagnostic request into Agent mutation or deployment.
28
31
 
29
- ## Clarify before initializing
32
+ ## Start with four clear concepts
33
+
34
+ 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.
35
+
36
+ When no Harbor workspace exists, propose `./harbor-evolution/` under the current working directory as the managed evaluation workspace. Keep imported snapshots and generated evaluation files there. If the installed Plugin is configured to a different `projectRoot`, explain the mismatch and propose the exact configuration change before writing anything.
37
+
38
+ Ask only for missing parts of the four-concept intake, using the user's language and short examples:
39
+
40
+ 1. **评测集:测什么?** Accept one Query, a file path, a directory containing multiple instructions, or an existing Dataset path.
41
+ 2. **生成器:谁来回答?** Accept a curl request or a local Agent file/directory. Offer an Agent entry discovered in the workspace instead of asking again.
42
+ 3. **评测器(评测标准):怎样算好?** Accept an evaluator curl request, a local evaluator path, or “请你生成”. If no evaluator exists, ask only for natural-language criteria and draft a versioned evaluator plus Rubric for confirmation.
43
+ 4. **优化器:谁根据结果改进?** Default to the current Agent. If Codex CLI or Claude Code is available, present it as an optional alternative; also accept a local command or Agent path.
44
+
45
+ One compact message may contain all unresolved concepts, but do not turn it into a form full of architecture terms. Never ask a first-time user to enumerate Evaluation Stack roles, identities, versions, Judge parameters, Contract fields, Policy fields, holdout rules, or CI/CD details.
46
+
47
+ Interpret common inputs helpfully:
48
+
49
+ - A single Query becomes a one-task **diagnostic** Dataset. It is useful for checking wiring, but never counts as promotion evidence by itself.
50
+ - A file or directory may become a multi-task Dataset after instructions and safe paths are validated.
51
+ - For curl input, infer method, endpoint, headers, body shape, and response protocol. Never persist Authorization values or other credentials.
52
+ - “请你生成评测器” means the current Agent may author a pinned evaluator implementation; it does not permit ad-hoc, unversioned scoring by the current chat model.
53
+ - “你来优化” selects the current Agent as Optimizer; it does not authorize mutation before baseline evidence and an accepted hypothesis exist.
54
+
55
+ Before creating files, show one confirmation card:
56
+
57
+ ```text
58
+ 开始前确认
59
+ - 工作空间:<path>
60
+ - 评测集:<source and task count; diagnostic or regression>
61
+ - 生成器:<curl/local Agent/detected Agent>
62
+ - 评测器(评测标准):<implementation or draft criteria>
63
+ - 优化器:<current Agent/Codex/Claude Code/local>
64
+ - 我将自动补全:版本标识、适配器、产物呈现、诊断、报告和运行配置
65
+ - 暂不启用:<holdout / formal promotion Gate / deployment, when unresolved>
66
+ ```
67
+
68
+ Offer three next actions in natural language: **开始初始化**, **修改以上内容**, or **查看高级配置**. Call `harbor_evolution_init` only after the user accepts the card. Generate internal ids and initial versions from the workspace/project identity, use `reward`/`maximize` as a visible draft when the criteria imply quality scoring, and do not use the generated Policy for a `promotion-eligible` Job until real business thresholds are accepted.
30
69
 
31
- Inspect the workspace first. Resolve only material gaps, preferably in no more than three grouped questions. Obtain:
70
+ Ask advanced questions just in time:
32
71
 
33
- 1. Business behavior, failure pattern, and Candidate path/product identity.
34
- 2. Dataset path/id/version, task population, holdout boundary, and side-effect sandbox.
35
- 3. Evaluation Stack id/version and one entry for every required role.
36
- 4. Judge provider/model/version/parameters without credentials.
37
- 5. Evaluation Contract id/version, primary metric and direction, diagnostic metrics, groups, and hard requirements.
38
- 6. Promotion Policy id/version, delta, minimums, maximums, non-regression metrics, and metric directions.
39
- 7. Baseline Job/Candidate, repeat policy, run budget, stopping rule, allowed mutation surface, and forbidden files.
40
- 8. Promotion owner and external CI/CD handoff.
72
+ - Ask for holdout boundaries and side-effect constraints before they can affect a real run.
73
+ - Ask for metric thresholds, non-regression limits, repeat policy, and promotion owner before the first `promotion-eligible` Job.
74
+ - Ask for GT identity, provenance, and independence only when calibrating or replacing the Evaluator.
75
+ - Ask for deployment/CI authority only after Gate recommends promotion.
41
76
 
42
- Never invent GT, a Judge model, reward definitions, thresholds, credentials, or deployment authority. Offer draft values only when clearly labeled and accepted.
77
+ Never invent GT labels, business thresholds, credentials, production side-effect permission, or deployment authority. A Generator and Evaluator may share a provider only after disclosing the coupling; do not treat that as independent GT.
43
78
 
44
79
  ## Enforce the strict architecture
45
80
 
@@ -68,7 +103,7 @@ Keep Runner orchestration-only. Treat these as architecture errors:
68
103
 
69
104
  ## Initialize without overwriting
70
105
 
71
- Read `references/initialization.md` when required files are missing. After the user accepts all required identities and metric semantics, call `harbor_evolution_init`. It preserves existing files and creates explicit placeholders that still require business implementation.
106
+ Read `references/initialization.md` when required files are missing. Translate the accepted four-concept card into strict internal identities and call `harbor_evolution_init`; do not send the user back a second architecture questionnaire. It preserves existing files and creates explicit placeholders that still require business implementation.
72
107
 
73
108
  After initialization:
74
109
 
@@ -0,0 +1,38 @@
1
+ {
2
+ "skill_name": "evolve-agent-with-harbor",
3
+ "evals": [
4
+ {
5
+ "id": 1,
6
+ "prompt": "帮我给当前目录里的业务 Agent 建一个 Harbor 自进化流程,我还没有准备任何评测配置。",
7
+ "expected_output": "先检查工作区,再用评测集、生成器、评测器(评测标准)和优化器四个业务概念提出少量短问题;不得要求用户枚举 Evaluation Stack 八个角色或版本号。",
8
+ "files": [],
9
+ "assertions": [
10
+ "The response visibly uses the four concepts Dataset, Generator, Evaluator with criteria, and Optimizer.",
11
+ "The response does not ask for eight Evaluation Stack roles, Judge version parameters, Contract ids, or Policy ids.",
12
+ "The response proposes a managed workspace and states that inferred values will be confirmed before files are created."
13
+ ]
14
+ },
15
+ {
16
+ "id": 2,
17
+ "prompt": "评测问题先用‘什么是重力?’,生成器就是 ./agent.ts。没有现成评测器,你帮我做;我觉得答到问题、表达有趣、引用可靠就算好。",
18
+ "expected_output": "识别为单任务诊断评测,复用本地生成器,依据三条自然语言标准起草版本化评测器,并默认由当前 Agent 作为优化器;先展示确认卡,不把单条 Query 当作晋级依据。",
19
+ "files": [],
20
+ "assertions": [
21
+ "The single query is explicitly classified as diagnostic rather than promotion evidence.",
22
+ "The evaluator is described as a pinned draft derived from the three supplied criteria, not ad-hoc chat scoring.",
23
+ "The output includes a confirmation card before initialization."
24
+ ]
25
+ },
26
+ {
27
+ "id": 3,
28
+ "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": "自动解析四个概念并展示确认卡;不回显或持久化 secret;底层身份与适配器由 Skill 推断,不再追问专业字段;未确认前不写文件或运行 Job。",
30
+ "files": [],
31
+ "assertions": [
32
+ "The Authorization credential is redacted and explicitly excluded from persisted configuration.",
33
+ "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."
35
+ ]
36
+ }
37
+ ]
38
+ }
@@ -1,10 +1,25 @@
1
- # Strict Project Initialization
1
+ # Progressive Project Initialization
2
2
 
3
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 worksheet
5
+ ## User-facing concept card
6
6
 
7
- Resolve every value before calling `harbor_evolution_init`:
7
+ Keep onboarding anchored on four visible concepts:
8
+
9
+ | User concept | Plain-language prompt | Accepted input | Compiled architecture |
10
+ | --- | --- | --- | --- |
11
+ | 评测集 (Dataset) | 测什么? | One Query, file, instruction directory, or Dataset | Dataset tasks, manifest, population, diagnostic/regression mode |
12
+ | 生成器 (Generator) | 谁来回答? | curl or local/detected Agent | Candidate snapshot, Integration, Renderer, runtime identity |
13
+ | 评测器(评测标准) (Evaluator) | 怎样算好? | evaluator curl/path, or natural-language criteria | Evaluator, Rubric, Judge identity, Evaluation Contract |
14
+ | 优化器 (Optimizer) | 谁根据结果改进? | current Agent, Codex, Claude Code, or local command | Optimizer identity, mutation surface, rollback workflow |
15
+
16
+ Inspect first and prefill everything reliable. Ask only about missing rows. Use `./harbor-evolution/` as the proposed managed workspace when no project exists, but do not write outside the Plugin's configured `projectRoot`; surface a configuration mismatch before initialization.
17
+
18
+ Before any write, show the four rows plus inferred workspace, diagnostic/promotion scope, and deferred capabilities. The user may start initialization, modify the card, or open advanced configuration.
19
+
20
+ ## Internal compilation worksheet
21
+
22
+ The Agent, not the user, compiles the accepted concept card into the strict `harbor_evolution_init` arguments:
8
23
 
9
24
  | Field | Required meaning |
10
25
  | --- | --- |
@@ -13,11 +28,13 @@ Resolve every value before calling `harbor_evolution_init`:
13
28
  | `datasetId` / `datasetVersion` | Stable identity of task population and GT boundary |
14
29
  | `contractId` / `contractVersion` | Stable metric semantics |
15
30
  | `primaryMetric` / `primaryDirection` | Exact reward key and `maximize` or `minimize` |
16
- | Judge provider/model/version | Reproducible Judge identity, never credentials |
31
+ | Judge provider/model/version | Infer from the accepted Evaluator implementation; never persist credentials |
17
32
  | Policy id/version | Stable Gate identity |
18
- | `minImprovement` | Accepted primary-metric delta |
33
+ | `minImprovement` | Use only an explicitly accepted business delta for promotion; a diagnostic scaffold may use `0` and remain ineligible for promotion |
34
+
35
+ Derive ids from a stable project slug and start newly generated identities at `1.0.0`. Use `reward` with `maximize` only as a visible draft when the user's criteria describe answer quality. The initializer creates a minimal Policy; do not pass it to a `promotion-eligible` Job until the user accepts real thresholds, non-regression metrics, repeat policy, mutation boundaries, and promotion ownership.
19
36
 
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.
37
+ Do not ask the user to name Integration, Renderer, Diagnoser, Runner, or Reporter during ordinary onboarding. Generate their identities and explain them only in advanced configuration or when Doctor finds a boundary problem.
21
38
 
22
39
  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.
23
40
 
@@ -122,11 +139,12 @@ Use business-accepted thresholds. Do not assume all metrics are `/10`, maximized
122
139
 
123
140
  Show the user:
124
141
 
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.
142
+ 1. The accepted four-concept card and resolved paths.
143
+ 2. Whether the run is a quick diagnostic or a promotion-eligible regression.
144
+ 3. Any remaining choice that materially affects cost, safety, score meaning, or comparability.
145
+ 4. Doctor findings and Context preview in plain language.
146
+
147
+ Put role identities, digests, metric directions, hard requirements, and generated defaults under an advanced/audit section. Do not make the user reconfirm unchanged internal fields.
130
148
 
131
149
  Start with a baseline. Do not create Candidate v2 until baseline evidence supports one controlled hypothesis.
132
150