@evomap/evolver-core 2.0.0-beta.1 → 2.0.0-beta.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 (75) hide show
  1. package/assets/gep/genes.jsonl +5 -0
  2. package/dist/algo/candidateAssembly.js +17 -11
  3. package/dist/algo/capabilityCandidates.d.ts +2 -0
  4. package/dist/algo/capabilityCandidates.js +5 -0
  5. package/dist/algo/conversationSniffer.d.ts +18 -0
  6. package/dist/algo/conversationSniffer.js +132 -0
  7. package/dist/algo/cycleEngine.js +2 -0
  8. package/dist/algo/cycleFailureClassifier.js +13 -5
  9. package/dist/algo/geneIntake.d.ts +14 -4
  10. package/dist/algo/geneIntake.js +37 -9
  11. package/dist/algo/geneSelection.d.ts +6 -0
  12. package/dist/algo/geneSelection.js +19 -11
  13. package/dist/algo/index.d.ts +1 -0
  14. package/dist/algo/index.js +1 -0
  15. package/dist/assetstore/assetSyncLedger.d.ts +28 -0
  16. package/dist/assetstore/assetSyncLedger.js +86 -0
  17. package/dist/assetstore/index.d.ts +3 -1
  18. package/dist/assetstore/index.js +3 -1
  19. package/dist/assetstore/localJsonl.d.ts +9 -2
  20. package/dist/assetstore/localJsonl.js +75 -23
  21. package/dist/assetstore/pendingSignals.js +3 -1
  22. package/dist/assetstore/provenance.d.ts +7 -2
  23. package/dist/assetstore/provenance.js +85 -25
  24. package/dist/assetstore/reviewFilter.js +2 -1
  25. package/dist/assetstore/reviewLedger.d.ts +6 -0
  26. package/dist/assetstore/reviewLedger.js +9 -0
  27. package/dist/assetstore/seedGenes.d.ts +3 -0
  28. package/dist/assetstore/seedGenes.js +134 -0
  29. package/dist/benchmark/antiGeneBenchmark.d.ts +2 -0
  30. package/dist/benchmark/antiGeneBenchmark.js +11 -1
  31. package/dist/benchmark/antiGeneImpact.d.ts +16 -0
  32. package/dist/benchmark/antiGeneImpact.js +34 -0
  33. package/dist/benchmark/antiGeneRollout.d.ts +2 -0
  34. package/dist/benchmark/antiGeneRollout.js +13 -1
  35. package/dist/events/eventArchive.d.ts +65 -0
  36. package/dist/events/eventArchive.js +343 -0
  37. package/dist/events/eventStore.js +2 -12
  38. package/dist/events/public.d.ts +3 -1
  39. package/dist/events/public.js +2 -1
  40. package/dist/events/retention.d.ts +24 -1
  41. package/dist/events/retention.js +133 -37
  42. package/dist/exec/autoExec.js +3 -0
  43. package/dist/exec/claudeBridge.js +23 -0
  44. package/dist/exec/runnerRegistry.d.ts +8 -6
  45. package/dist/exec/runnerRegistry.js +71 -18
  46. package/dist/exec/selfPrObfuscation.d.ts +2 -1
  47. package/dist/exec/selfPrObfuscation.js +19 -6
  48. package/dist/hub/agentDirectory.d.ts +90 -0
  49. package/dist/hub/agentDirectory.js +104 -0
  50. package/dist/hub/bindings.js +13 -3
  51. package/dist/hub/capability.d.ts +14 -2
  52. package/dist/hub/fake.d.ts +4 -2
  53. package/dist/hub/fake.js +3 -2
  54. package/dist/hub/index.d.ts +1 -0
  55. package/dist/hub/index.js +1 -0
  56. package/dist/mailbox/catalog.js +3 -0
  57. package/dist/mailbox/ipcServer.js +2 -2
  58. package/dist/mailbox/store.d.ts +14 -0
  59. package/dist/mailbox/store.js +44 -2
  60. package/dist/material/consumer.js +9 -6
  61. package/dist/material/index.d.ts +1 -0
  62. package/dist/material/index.js +1 -0
  63. package/dist/material/materialArchive.d.ts +81 -0
  64. package/dist/material/materialArchive.js +466 -0
  65. package/dist/material/materialStore.d.ts +1 -0
  66. package/dist/material/materialStore.js +6 -13
  67. package/dist/schema/common.d.ts +1 -1
  68. package/dist/schema/common.js +1 -1
  69. package/dist/schema/material.d.ts +5 -5
  70. package/dist/trace/trajectoryExport.js +2 -2
  71. package/dist/wire/geneHints.d.ts +42 -1
  72. package/dist/wire/geneHints.js +52 -1
  73. package/dist/wire/index.d.ts +14 -2
  74. package/dist/wire/index.js +1 -1
  75. package/package.json +2 -1
@@ -22,13 +22,22 @@
22
22
  export const ROUTING_TIERS = ['cheap', 'mid', 'expensive'];
23
23
  export const REASONING_LEVELS = ['off', 'low', 'medium', 'high'];
24
24
  export const TOOL_POLICY_SEVERITIES = ['warn', 'block'];
25
+ /**
26
+ * Provenance classification (V1 #302 classifyProvenance, aligned with TaskGenome Bench §3.1): a Gene's value
27
+ * depends on WHERE it came from, not on being short. The three tiers:
28
+ * evolved -- distilled from a real solve -> fail -> mutate -> pass trajectory; beats Skills (+8.7..+15.5pp)
29
+ * distilled -- transcribed from reference/teacher text with no real failing trajectory; WORSE than Skills (-3.2..-11.2pp)
30
+ * manual -- pure human transcription, no execution evidence at all
31
+ * The high-value payload of an evolved Gene is the corrective_insight that flipped the outcome.
32
+ */
33
+ export const GENERATION_SOURCES = ['evolved', 'distilled', 'manual'];
25
34
  /**
26
35
  * The v2-delta hint field names, in one place — the intake gate strips these before the gep-sdk schema check.
27
36
  * IMPORTANT: when a gep-sdk gene-schema bump makes one of these first-class, REMOVE it from this list in the
28
37
  * same change. Otherwise intakeGene keeps stripping a now-validated field before validateWire (fail-open — the
29
38
  * field's new schema constraints go unchecked at intake) while asset_id still commits it.
30
39
  */
31
- export const GENE_HINT_FIELDS = ['routing_hint', 'tool_policy'];
40
+ export const GENE_HINT_FIELDS = ['routing_hint', 'tool_policy', 'generation_meta'];
32
41
  function includesEnum(set, v) {
33
42
  return typeof v === 'string' && set.includes(v);
34
43
  }
@@ -89,6 +98,48 @@ function cleanToolList(raw) {
89
98
  const cleaned = raw.filter((x) => typeof x === 'string' && x.length > 0);
90
99
  return cleaned.length > 0 ? cleaned : undefined;
91
100
  }
101
+ /**
102
+ * Normalize an arbitrary generation_meta fragment to a strict { source, quality_score?, quality_heuristics?,
103
+ * overcame_errors? } object, or null. Lossy (mirrors normalizeRoutingHint / normalizeToolPolicy): unknown source
104
+ * values are dropped (the whole block collapses to null — a generation_meta with no recognized source carries no
105
+ * usable provenance signal); quality_score is clamped to [0,1]; heuristics keeps only its numeric/boolean fields;
106
+ * overcame_errors keeps only non-empty strings. A block with a valid source but all-else-empty still survives (source
107
+ * alone is a meaningful provenance tag); only a missing/unknown source yields null.
108
+ */
109
+ export function normalizeGenerationMeta(raw) {
110
+ if (!raw || typeof raw !== 'object')
111
+ return null;
112
+ const r = raw;
113
+ const source = r['source'];
114
+ if (!includesEnum(GENERATION_SOURCES, source))
115
+ return null;
116
+ const out = { source };
117
+ const qs = r['quality_score'];
118
+ if (typeof qs === 'number' && Number.isFinite(qs))
119
+ out.quality_score = Math.max(0, Math.min(1, qs));
120
+ const eh = r['quality_heuristics'];
121
+ if (eh && typeof eh === 'object') {
122
+ const h = eh;
123
+ const heuristics = {};
124
+ const numFields = [
125
+ 'strategy_steps', 'avoid_count', 'validation_declared_count', 'validation_runnable_count',
126
+ 'signals_extracted', 'preconditions_extracted', 'trajectory_depth',
127
+ ];
128
+ for (const k of numFields) {
129
+ const v = h[k];
130
+ if (typeof v === 'number' && Number.isFinite(v))
131
+ heuristics[k] = v;
132
+ }
133
+ if (typeof h['has_corrective_insight'] === 'boolean')
134
+ heuristics.has_corrective_insight = h['has_corrective_insight'];
135
+ if (Object.keys(heuristics).length > 0)
136
+ out.quality_heuristics = heuristics;
137
+ }
138
+ const errs = cleanToolList(r['overcame_errors']);
139
+ if (errs)
140
+ out.overcame_errors = errs;
141
+ return out;
142
+ }
92
143
  /** Strip the v2-delta hint fields from a gene-shaped object (used to validate the gep-sdk-known core). */
93
144
  export function stripGeneHints(gene) {
94
145
  const hidden = GENE_HINT_FIELDS;
@@ -2,12 +2,18 @@
2
2
  * 资产 wire 层. SSOT = @evomap/gep-sdk/schemas/*.schema.json (D19).
3
3
  * 字段一律 snake_case 锁定 (asset_id 跨实现契约); 本仓不发明 wire 字段, 只镜像 + 重导出工具.
4
4
  */
5
- import type { GeneRoutingHint, GeneToolPolicy } from './geneHints.js';
5
+ import type { GeneRoutingHint, GeneToolPolicy, GenerationMeta } from './geneHints.js';
6
6
  export { SCHEMA_VERSION, canonicalize, computeAssetId, verifyAssetId } from '@evomap/gep-sdk';
7
7
  export type GepCategory = typeof import('@evomap/gep-sdk').GEP_GENE_CATEGORIES[number];
8
8
  export type OutcomeStatus = typeof import('@evomap/gep-sdk').GEP_OUTCOME_STATUSES[number];
9
9
  export type SourceType = typeof import('@evomap/gep-sdk').GEP_SOURCE_TYPES[number];
10
10
  export type RiskLevel = typeof import('@evomap/gep-sdk').GEP_RISK_LEVELS[number];
11
+ export type CapsuleVisibility = typeof import('@evomap/gep-sdk').GEP_CAPSULE_VISIBILITIES[number];
12
+ export type CapsuleCostTier = typeof import('@evomap/gep-sdk').GEP_CAPSULE_COST_TIERS[number];
13
+ export interface CapsuleAuthor {
14
+ handle: string;
15
+ evox_install_id: string;
16
+ }
11
17
  /** Gene = 基因型/方法论 (gene.schema.json). */
12
18
  export interface Gene {
13
19
  type: 'Gene';
@@ -28,6 +34,7 @@ export interface Gene {
28
34
  anti_patterns?: unknown[];
29
35
  routing_hint?: GeneRoutingHint | null;
30
36
  tool_policy?: GeneToolPolicy | null;
37
+ generation_meta?: GenerationMeta | null;
31
38
  asset_id: string;
32
39
  }
33
40
  /** Capsule = 表现型/纯进化产物 (capsule.schema.json). */
@@ -49,6 +56,11 @@ export interface Capsule {
49
56
  };
50
57
  resolution_status?: 'pending' | 'suppressed_observationally' | 'resolved_by_evidence' | 'regressed' | 'inconclusive';
51
58
  proof_of_work?: unknown;
59
+ visibility?: CapsuleVisibility | null;
60
+ scope?: string[] | null;
61
+ cost_tier?: CapsuleCostTier | null;
62
+ pack_of?: string[] | null;
63
+ author?: CapsuleAuthor | null;
52
64
  execution_trace?: unknown[];
53
65
  trigger_context?: unknown;
54
66
  asset_id: string;
@@ -88,4 +100,4 @@ export interface Mutation {
88
100
  risk_level: RiskLevel;
89
101
  }
90
102
  export { validateWire, schemaProperties, type WireValidation } from './schemaGate.js';
91
- export { ROUTING_TIERS, REASONING_LEVELS, TOOL_POLICY_SEVERITIES, GENE_HINT_FIELDS, normalizeRoutingHint, normalizeToolPolicy, stripGeneHints, type RoutingTier, type ReasoningLevel, type ToolPolicySeverity, type GeneRoutingHint, type GeneToolPolicy, } from './geneHints.js';
103
+ export { ROUTING_TIERS, REASONING_LEVELS, TOOL_POLICY_SEVERITIES, GENERATION_SOURCES, GENE_HINT_FIELDS, normalizeRoutingHint, normalizeToolPolicy, normalizeGenerationMeta, stripGeneHints, type RoutingTier, type ReasoningLevel, type ToolPolicySeverity, type GenerationSource, type GeneRoutingHint, type GeneToolPolicy, type GeneGenerationHeuristics, type GenerationMeta, } from './geneHints.js';
@@ -1,3 +1,3 @@
1
1
  export { SCHEMA_VERSION, canonicalize, computeAssetId, verifyAssetId } from '@evomap/gep-sdk';
2
2
  export { validateWire, schemaProperties } from './schemaGate.js';
3
- export { ROUTING_TIERS, REASONING_LEVELS, TOOL_POLICY_SEVERITIES, GENE_HINT_FIELDS, normalizeRoutingHint, normalizeToolPolicy, stripGeneHints, } from './geneHints.js';
3
+ export { ROUTING_TIERS, REASONING_LEVELS, TOOL_POLICY_SEVERITIES, GENERATION_SOURCES, GENE_HINT_FIELDS, normalizeRoutingHint, normalizeToolPolicy, normalizeGenerationMeta, stripGeneHints, } from './geneHints.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evomap/evolver-core",
3
- "version": "2.0.0-beta.1",
3
+ "version": "2.0.0-beta.2",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "hub-无关核心: 算法引擎/原材料/mailbox/资产库/workflow",
@@ -23,6 +23,7 @@
23
23
  },
24
24
  "files": [
25
25
  "dist/",
26
+ "assets/",
26
27
  "README.md",
27
28
  "package.json"
28
29
  ]