@evomap/evolver-core 2.0.0-beta.15 → 2.0.0-beta.17

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.
@@ -159,12 +159,25 @@ export async function runAutoExecTask(deps, rawTask, safety) {
159
159
  hubCandidates = [];
160
160
  }
161
161
  }
162
+ // evaluation fill-in (slice 6): the validate hook is the run's external verifier (sandboxed validation
163
+ // commands), so its result — when it actually RAN — becomes the packet's evaluation.verification
164
+ // (verifier 'automated_test'). Observation is a pass-through wrapper: the hook's result reaches the
165
+ // bridge unchanged, and a run where validation never fired keeps the evaluation placeholder.
166
+ let observedVerification;
167
+ const baseValidate = deps.validate?.(task);
168
+ const observingValidate = baseValidate
169
+ ? async (mutation, decision, cwd) => {
170
+ const v = await baseValidate(mutation, decision, cwd);
171
+ observedVerification = { verifier: 'automated_test', passed: v.passed, ...(v.score !== undefined ? { score: v.score } : {}) };
172
+ return v;
173
+ }
174
+ : undefined;
162
175
  const execute = makeSafeExecute(task.repo, deps.store, safety, {
163
176
  ...(deps.provenance ? { provenance: deps.provenance } : {}),
164
177
  ...(deps.review ? { review: deps.review } : {}),
165
178
  ...(deps.includeProbation ? { includeProbation: true } : {}),
166
179
  ...(task.validationCmds ? { validationCmds: task.validationCmds } : {}),
167
- ...(deps.validate ? { validate: deps.validate(task) } : {}),
180
+ ...(observingValidate ? { validate: observingValidate } : {}),
168
181
  ...(deps.personality ? { personality: deps.personality } : {}),
169
182
  ...(deps.agent ? { agent: deps.agent } : {}),
170
183
  ...(deps.git ? { git: deps.git } : {}),
@@ -224,6 +237,7 @@ export async function runAutoExecTask(deps, rawTask, safety) {
224
237
  taskSummary: task.expectedEffect,
225
238
  signals: cycleSignals,
226
239
  environment: { repo: task.repo, runner: safety.runner ?? 'claude' },
240
+ ...(observedVerification !== undefined ? { verification: observedVerification } : {}),
227
241
  }));
228
242
  }
229
243
  catch { /* packet delivery is best-effort; never fail the task */ }
@@ -128,12 +128,24 @@ export declare function learningTraceObserver(deps: {
128
128
  recorder: AgentRunTraceRecorder;
129
129
  timeoutMs?: number;
130
130
  }): Observer;
131
+ /**
132
+ * Externally-verified run evidence (Learning Ops slice 6): the runtime's validate hook (sandboxed
133
+ * validation commands) is an `automated_test` verifier in the hub VERIFIERS vocabulary. Only a hook
134
+ * that actually RAN produces one of these — agent self-report never fills evaluation.
135
+ */
136
+ export interface LearningPacketVerification {
137
+ verifier: 'automated_test';
138
+ passed: boolean;
139
+ score?: number;
140
+ }
131
141
  export interface LearningPacketDraftInput {
132
142
  /** e.g. 'evolver-v2'. Hub column sourceRepo. */
133
143
  sourceRepo: string;
134
144
  taskSummary?: string;
135
145
  signals?: readonly string[];
136
146
  environment?: Record<string, unknown>;
147
+ /** When present, fills evaluation (placeholder → false). Omit when no external verifier ran. */
148
+ verification?: LearningPacketVerification;
137
149
  }
138
150
  /** Local draft aligned with hub LearningOpsPacket ingest fields; placeholders are explicit, not implied. */
139
151
  export interface LearningPacketDraft {
@@ -160,10 +172,13 @@ export interface LearningPacketDraft {
160
172
  placeholder: true;
161
173
  items: never[];
162
174
  };
175
+ /** placeholder:false ⇔ an external verifier ran (verification input) — then verifier/verifierPassed are set. */
163
176
  evaluation: {
164
- placeholder: true;
177
+ placeholder: boolean;
165
178
  outcomeStatus: 'success' | 'failed' | 'unknown';
166
- verifier: null;
179
+ verifier: 'automated_test' | null;
180
+ verifierPassed?: boolean;
181
+ verifierScore?: number;
167
182
  failureCategory: string | null;
168
183
  };
169
184
  governance: {
@@ -244,9 +244,11 @@ export function buildLearningPacketDraft(recorder, input) {
244
244
  trajectory: events,
245
245
  artifacts: { placeholder: true, items: [] },
246
246
  evaluation: {
247
- placeholder: true,
247
+ placeholder: input.verification === undefined,
248
248
  outcomeStatus: completedStatus === 'success' ? 'success' : completedStatus === 'failed' ? 'failed' : 'unknown',
249
- verifier: null,
249
+ verifier: input.verification?.verifier ?? null,
250
+ ...(input.verification !== undefined ? { verifierPassed: input.verification.passed } : {}),
251
+ ...(input.verification?.score !== undefined ? { verifierScore: input.verification.score } : {}),
250
252
  failureCategory: typeof failureKind === 'string' ? failureKind : null,
251
253
  },
252
254
  governance: { placeholder: true, redactionStatus: 'metadata_only', consentStatus: 'unknown', trainingEligible: false, retentionPolicy: 'standard' },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evomap/evolver-core",
3
- "version": "2.0.0-beta.15",
3
+ "version": "2.0.0-beta.17",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "hub-无关核心: 算法引擎/原材料/mailbox/资产库/workflow",