@evomap/evolver 1.88.0 → 1.88.2

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.
Files changed (60) hide show
  1. package/index.js +232 -1
  2. package/package.json +2 -1
  3. package/src/adapters/claudeCode.js +21 -1
  4. package/src/adapters/hookAdapter.js +4 -2
  5. package/src/adapters/scripts/evolver-session-start.js +14 -10
  6. package/src/adapters/scripts/evolver-task-recall.js +173 -0
  7. package/src/atp/atpExecute.js +20 -7
  8. package/src/atp/cli.js +17 -9
  9. package/src/atp/protocol.js +41 -0
  10. package/src/config.js +23 -0
  11. package/src/evolve/guards.js +1 -1
  12. package/src/evolve/pipeline/collect.js +1 -1
  13. package/src/evolve/pipeline/dispatch.js +1 -1
  14. package/src/evolve/pipeline/enrich.js +1 -1
  15. package/src/evolve/pipeline/hub.js +1 -1
  16. package/src/evolve/pipeline/select.js +1 -1
  17. package/src/evolve/pipeline/signals.js +1 -1
  18. package/src/evolve/utils.js +1 -1
  19. package/src/evolve.js +1 -1
  20. package/src/forceUpdate.js +108 -3
  21. package/src/gep/a2aProtocol.js +1 -1
  22. package/src/gep/assetCallLog.js +40 -1
  23. package/src/gep/autoDistillConv.js +1 -0
  24. package/src/gep/autoDistillLlm.js +1 -0
  25. package/src/gep/bridge.js +69 -2
  26. package/src/gep/candidateEval.js +1 -1
  27. package/src/gep/candidates.js +1 -1
  28. package/src/gep/contentHash.js +1 -1
  29. package/src/gep/conversationSniffer.js +1 -0
  30. package/src/gep/crypto.js +1 -1
  31. package/src/gep/curriculum.js +1 -1
  32. package/src/gep/deviceId.js +1 -1
  33. package/src/gep/envFingerprint.js +1 -1
  34. package/src/gep/epigenetics.js +1 -1
  35. package/src/gep/execBridge.js +1 -0
  36. package/src/gep/explore.js +1 -1
  37. package/src/gep/hash.js +1 -1
  38. package/src/gep/hubFetch.js +1 -1
  39. package/src/gep/hubReview.js +1 -1
  40. package/src/gep/hubSearch.js +1 -1
  41. package/src/gep/hubVerify.js +1 -1
  42. package/src/gep/learningSignals.js +1 -1
  43. package/src/gep/memoryGraph.js +1 -1
  44. package/src/gep/memoryGraphAdapter.js +1 -1
  45. package/src/gep/mutation.js +1 -1
  46. package/src/gep/narrativeMemory.js +1 -1
  47. package/src/gep/openPRRegistry.js +1 -1
  48. package/src/gep/personality.js +1 -1
  49. package/src/gep/policyCheck.js +1 -1
  50. package/src/gep/prompt.js +1 -1
  51. package/src/gep/recallInject.js +1 -0
  52. package/src/gep/recallVerifier.js +1 -1
  53. package/src/gep/reflection.js +1 -1
  54. package/src/gep/selector.js +1 -1
  55. package/src/gep/skillDistiller.js +1 -1
  56. package/src/gep/solidify.js +1 -1
  57. package/src/gep/strategy.js +1 -1
  58. package/src/gep/workspaceKeychain.js +1 -1
  59. package/src/proxy/index.js +46 -6
  60. package/src/proxy/lifecycle/manager.js +456 -2
package/src/atp/cli.js CHANGED
@@ -14,6 +14,14 @@
14
14
  // injectable for tests. Each runner returns a Promise that resolves to
15
15
  // { exitCode: number, output?: string, data?: object }.
16
16
 
17
+ const {
18
+ ATP_VERIFY_MODES,
19
+ ATP_VERIFY_ACTIONS,
20
+ ATP_ROUTING_MODES,
21
+ ATP_PROOF_STATUSES,
22
+ ATP_ROLES,
23
+ } = require('./protocol');
24
+
17
25
  function _parseNamed(args, longFlag, shortFlag) {
18
26
  const long = args.findIndex(a => typeof a === 'string' && (a === longFlag || a.startsWith(longFlag + '=')));
19
27
  if (long !== -1) {
@@ -83,11 +91,11 @@ function parseBuyArgs(args) {
83
91
 
84
92
  function parseOrdersArgs(args) {
85
93
  const role = _parseNamed(args, '--role', null);
86
- if (role && !['consumer', 'merchant'].includes(role)) {
87
- return { ok: false, error: 'invalid --role: ' + role + ' (expected consumer|merchant)' };
94
+ if (role && !ATP_ROLES.includes(role)) {
95
+ return { ok: false, error: 'invalid --role: ' + role + ' (expected ' + ATP_ROLES.join('|') + ')' };
88
96
  }
89
97
  const status = _parseNamed(args, '--status', null);
90
- if (status && !['pending', 'verified', 'disputed', 'settled'].includes(status)) {
98
+ if (status && !ATP_PROOF_STATUSES.includes(status)) {
91
99
  return { ok: false, error: 'invalid --status: ' + status };
92
100
  }
93
101
  const limitRaw = _parseNamed(args, '--limit', null);
@@ -112,8 +120,8 @@ function parseVerifyArgs(args) {
112
120
  return { ok: false, error: 'verify requires <orderId>' };
113
121
  }
114
122
  const action = _parseNamed(args, '--action', null) || 'confirm';
115
- if (!['confirm', 'ai_judge'].includes(action)) {
116
- return { ok: false, error: 'invalid --action: ' + action + ' (expected confirm|ai_judge)' };
123
+ if (!ATP_VERIFY_ACTIONS.includes(action)) {
124
+ return { ok: false, error: 'invalid --action: ' + action + ' (expected ' + ATP_VERIFY_ACTIONS.join('|') + ')' };
117
125
  }
118
126
  return { ok: true, opts: { orderId, action } };
119
127
  }
@@ -324,11 +332,11 @@ async function runAtp(opts, deps) {
324
332
  function printUsage() {
325
333
  return [
326
334
  'ATP subcommands:',
327
- ' evolver buy <caps> [--budget=N] [--question "..."] [--routing=fastest|cheapest|auction|swarm]',
328
- ' [--verify=auto|ai_judge|bilateral] [--no-wait] [--timeout=<seconds>]',
329
- ' evolver orders [--role=consumer|merchant] [--status=pending|verified|disputed|settled]',
335
+ ' evolver buy <caps> [--budget=N] [--question "..."] [--routing=' + ATP_ROUTING_MODES.join('|') + ']',
336
+ ' [--verify=' + ATP_VERIFY_MODES.join('|') + '] [--no-wait] [--timeout=<seconds>]',
337
+ ' evolver orders [--role=' + ATP_ROLES.join('|') + '] [--status=' + ATP_PROOF_STATUSES.join('|') + ']',
330
338
  ' [--limit=N] [--json]',
331
- ' evolver verify <orderId> [--action=confirm|ai_judge]',
339
+ ' evolver verify <orderId> [--action=' + ATP_VERIFY_ACTIONS.join('|') + ']',
332
340
  ' evolver atp <enable|disable|status> -- manage auto-spend consent',
333
341
  ].join('\n');
334
342
  }
@@ -0,0 +1,41 @@
1
+ // Protocol-level enum constants for the Agent Transaction Protocol.
2
+ //
3
+ // These values (verify modes, routing modes, proof statuses, roles,
4
+ // execution modes) live in @evomap/atp-sdk. This module is a thin
5
+ // CommonJS facade so callsites in src/atp/ can `require('./protocol')`
6
+ // for the authoritative sets instead of re-spelling the literals.
7
+ //
8
+ // Why move them out: ATP is the wire contract between this engine, the
9
+ // EvoMap Hub, and (in future) evox-Rust. Hand-maintaining the allowed
10
+ // value sets in each implementation is exactly the drift that the
11
+ // v1.80.8 "explore" enum incident taught us to avoid for GEP. The ATP
12
+ // contract is extracted into its own SDK before a second runtime wires
13
+ // in, while it is still cheap. If you find yourself writing an enum
14
+ // list literal here again (e.g. ['pending','verified',...]), stop --
15
+ // import the constant from this facade instead, and bump
16
+ // @evomap/atp-sdk if the set itself needs to change.
17
+ //
18
+ // Implementation note: @evomap/atp-sdk is published as ESM
19
+ // (`"type": "module"`). Node supports `require()` of synchronous ESM
20
+ // packages on 22.12.0 and later. The SDK itself stays permissive
21
+ // (`engines.node >=18`) so `import`-based consumers on 18/20 aren't
22
+ // blocked; the `>=22.12` guarantee that makes the require() below work
23
+ // is pinned in THIS package's (evolver's) `engines.node`, not the SDK's.
24
+
25
+ const {
26
+ ATP_VERIFY_MODES,
27
+ ATP_VERIFY_ACTIONS,
28
+ ATP_ROUTING_MODES,
29
+ ATP_PROOF_STATUSES,
30
+ ATP_ROLES,
31
+ ATP_EXECUTION_MODES,
32
+ } = require('@evomap/atp-sdk');
33
+
34
+ module.exports = {
35
+ ATP_VERIFY_MODES,
36
+ ATP_VERIFY_ACTIONS,
37
+ ATP_ROUTING_MODES,
38
+ ATP_PROOF_STATUSES,
39
+ ATP_ROLES,
40
+ ATP_EXECUTION_MODES,
41
+ };
package/src/config.js CHANGED
@@ -177,6 +177,26 @@ const SELF_PR_TIMEOUT_MS = envInt('EVOLVER_SELF_PR_TIMEOUT_MS', 30000);
177
177
 
178
178
  const LEAK_CHECK_MODE = envStr('EVOLVER_LEAK_CHECK', 'strict');
179
179
 
180
+ // --- Reuse attribution (P4-a, Slice A) ---
181
+ // Controls whether the evolver attaches a `reuse_attribution` block to the
182
+ // synced `outcome` MemoryGraphEvent so the Hub can LATER (P4-a Slice B, gated +
183
+ // team-signed-off) credit the SOURCE node when its asset is reused. Modes:
184
+ // off (default) — attach nothing; byte-identical to pre-P4-a behavior.
185
+ // shadow — attach the attribution block; it rides the existing
186
+ // syncEventToHub -> /a2a/memory/event into the Hub's
187
+ // MemoryGraphEvent.payload blob, which is GDI-inert and
188
+ // read by NO payout path today.
189
+ // There is intentionally NO `enforce` on the CLIENT: the evolver cannot move
190
+ // money, so an enforce word would be a lie. The report stays economy-inert
191
+ // until a SIGNED-OFF Hub reader converts it to credit (which MUST add the
192
+ // anti-sybil gating — see P4-a Slice B). Until then it only emits honest,
193
+ // runtime-observed attribution data (never agent-supplied identity).
194
+ const REUSE_ATTRIBUTION_MODE = envStr('EVOLVER_REUSE_ATTRIBUTION', 'off');
195
+ function reuseAttributionMode() {
196
+ const v = String(process.env.EVOLVER_REUSE_ATTRIBUTION || REUSE_ATTRIBUTION_MODE || 'off').toLowerCase().trim();
197
+ return v === 'shadow' ? 'shadow' : 'off';
198
+ }
199
+
180
200
  // --- Validator mode (opt-out) ---
181
201
  // Node role: the evolver periodically fetches assigned validation tasks from
182
202
  // the Hub, runs the commands in an isolated sandbox, and submits
@@ -257,6 +277,9 @@ module.exports = {
257
277
  BLAST_RADIUS_HARD_CAP_LINES,
258
278
  // Security
259
279
  LEAK_CHECK_MODE,
280
+ // Reuse attribution (P4-a Slice A)
281
+ REUSE_ATTRIBUTION_MODE,
282
+ reuseAttributionMode,
260
283
  // Validator (opt-in role)
261
284
  VALIDATOR_ENABLED,
262
285
  VALIDATOR_STAKE_AMOUNT,