@evomap/evolver 1.84.1 → 1.84.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.
- package/assets/gep/genes.seed.json +17 -15
- package/index.js +45 -8
- package/package.json +4 -3
- package/src/adapters/claudeCode.js +44 -31
- package/src/adapters/codex.js +70 -26
- package/src/adapters/cursor.js +3 -1
- package/src/adapters/hookAdapter.js +142 -2
- package/src/adapters/kiro.js +6 -14
- package/src/adapters/opencode.js +6 -14
- package/src/adapters/scripts/_runtimePaths.js +114 -0
- package/src/adapters/scripts/evolver-session-end.js +37 -61
- package/src/adapters/scripts/evolver-session-start.js +1 -31
- package/src/config.js +20 -1
- package/src/evolve/guards.js +1 -1
- package/src/evolve/pipeline/collect.js +1 -1
- package/src/evolve/pipeline/dispatch.js +1 -1
- package/src/evolve/pipeline/enrich.js +1 -1
- package/src/evolve/pipeline/hub.js +1 -1
- package/src/evolve/pipeline/select.js +1 -1
- package/src/evolve/pipeline/signals.js +1 -1
- package/src/evolve/utils.js +1 -1
- package/src/evolve.js +1 -1
- package/src/gep/a2aProtocol.js +1 -1
- package/src/gep/assetStore.js +27 -6
- package/src/gep/candidateEval.js +1 -1
- package/src/gep/candidates.js +1 -1
- package/src/gep/contentHash.js +1 -1
- package/src/gep/crypto.js +1 -1
- package/src/gep/curriculum.js +1 -1
- package/src/gep/deviceId.js +1 -1
- package/src/gep/directoryClient.js +4 -3
- package/src/gep/envFingerprint.js +1 -1
- package/src/gep/epigenetics.js +1 -1
- package/src/gep/explore.js +1 -1
- package/src/gep/hash.js +1 -1
- package/src/gep/hubFetch.js +1 -0
- package/src/gep/hubReview.js +1 -1
- package/src/gep/hubSearch.js +1 -1
- package/src/gep/hubVerify.js +1 -1
- package/src/gep/learningSignals.js +1 -1
- package/src/gep/memoryGraph.js +1 -1
- package/src/gep/memoryGraphAdapter.js +1 -1
- package/src/gep/mutation.js +1 -1
- package/src/gep/narrativeMemory.js +1 -1
- package/src/gep/openPRRegistry.js +1 -1
- package/src/gep/personality.js +1 -1
- package/src/gep/policyCheck.js +1 -1
- package/src/gep/prompt.js +1 -1
- package/src/gep/recallVerifier.js +1 -1
- package/src/gep/reflection.js +1 -1
- package/src/gep/schemas/gene.js +70 -1
- package/src/gep/schemas/protocol.js +9 -1
- package/src/gep/selector.js +1 -1
- package/src/gep/selfPR.js +62 -32
- package/src/gep/skillDistiller.js +1 -1
- package/src/gep/skillPublisher.js +3 -2
- package/src/gep/solidify.js +1 -1
- package/src/gep/strategy.js +1 -1
- package/src/gep/taskReceiver.js +6 -5
- package/src/gep/validator/index.js +10 -6
- package/src/gep/validator/reporter.js +2 -1
- package/src/gep/validator/stakeBootstrap.js +2 -1
- package/src/proxy/index.js +69 -0
- package/src/proxy/lifecycle/manager.js +3 -2
- package/src/proxy/router/cache_passthrough.js +26 -0
- package/src/proxy/router/features.js +84 -0
- package/src/proxy/router/messages_route.js +242 -0
- package/src/proxy/router/model_router.js +113 -0
- package/src/proxy/server/http.js +92 -5
- package/src/proxy/server/routes.js +12 -2
- package/src/proxy/server/settings.js +37 -11
- package/src/proxy/sync/inbound.js +3 -2
- package/src/proxy/sync/outbound.js +2 -1
package/src/gep/selfPR.js
CHANGED
|
@@ -14,7 +14,7 @@ const { execSync } = require('child_process');
|
|
|
14
14
|
// on large repos). See GHSA reports / issue #451.
|
|
15
15
|
const MAX_EXEC_BUFFER = 10 * 1024 * 1024;
|
|
16
16
|
|
|
17
|
-
const { getEvolutionDir, getRepoRoot } = require('./paths');
|
|
17
|
+
const { getEvolutionDir, getRepoRoot, getEvolverInstallRoot } = require('./paths');
|
|
18
18
|
const { fullLeakCheck, redactString } = require('./sanitize');
|
|
19
19
|
const {
|
|
20
20
|
SELF_PR_MIN_SCORE,
|
|
@@ -28,35 +28,52 @@ const {
|
|
|
28
28
|
|
|
29
29
|
const STATE_FILE = 'self_pr_state.json';
|
|
30
30
|
|
|
31
|
-
// Files obfuscated in public.manifest.json -- PRs touching these
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
31
|
+
// Files obfuscated in public.manifest.json -- PRs touching these would land
|
|
32
|
+
// raw source on the public repo where the file ships obfuscated, leaking
|
|
33
|
+
// implementation detail. Source of truth: public.manifest.json `obfuscate`
|
|
34
|
+
// array, loaded lazily on first use.
|
|
35
|
+
//
|
|
36
|
+
// public.manifest.json is itself excluded from the npm package (it's a
|
|
37
|
+
// build-time artifact for the obfuscation pipeline), so on npm installs the
|
|
38
|
+
// file is absent. That is expected — self-PR is dev-only (gated by
|
|
39
|
+
// EVOLVER_SELF_PR=true) and a missing manifest correctly produces the
|
|
40
|
+
// fail-safe behavior (reject all files). We therefore stay silent on load
|
|
41
|
+
// failure here and only surface a warning when maybeCreatePR is actually
|
|
42
|
+
// invoked but the manifest cannot be read.
|
|
43
|
+
let _obfuscatedFilesCache; // undefined = not loaded; Set | null after first attempt
|
|
44
|
+
let _manifestLoadError = null;
|
|
45
|
+
let _warnedAboutMissingManifest = false;
|
|
46
|
+
|
|
47
|
+
function loadObfuscatedFromManifest() {
|
|
48
|
+
if (_obfuscatedFilesCache !== undefined) return _obfuscatedFilesCache;
|
|
49
|
+
try {
|
|
50
|
+
const manifestPath = path.join(getEvolverInstallRoot(), 'public.manifest.json');
|
|
51
|
+
const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8'));
|
|
52
|
+
if (!Array.isArray(manifest.obfuscate)) {
|
|
53
|
+
throw new Error('public.manifest.json missing `obfuscate` array');
|
|
54
|
+
}
|
|
55
|
+
// Reject glob patterns: build_public.js may expand them, but Set.has(rel)
|
|
56
|
+
// would silently miss matches and reintroduce the drift this PR fixed.
|
|
57
|
+
for (const f of manifest.obfuscate) {
|
|
58
|
+
if (typeof f !== 'string' || /[*?[\]]/.test(f)) {
|
|
59
|
+
throw new Error('public.manifest.json `obfuscate` must contain literal paths, got: ' + JSON.stringify(f));
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
_obfuscatedFilesCache = new Set(manifest.obfuscate.map((f) => f.replace(/\\/g, '/').replace(/^\.\/+/, '')));
|
|
63
|
+
} catch (e) {
|
|
64
|
+
_manifestLoadError = e.message;
|
|
65
|
+
_obfuscatedFilesCache = null;
|
|
66
|
+
}
|
|
67
|
+
return _obfuscatedFilesCache;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Test-only: reset the lazy cache so a test can exercise the load path
|
|
71
|
+
// (e.g. cover the fail-safe branch after a missing manifest is restored).
|
|
72
|
+
function _resetObfuscatedCache() {
|
|
73
|
+
_obfuscatedFilesCache = undefined;
|
|
74
|
+
_manifestLoadError = null;
|
|
75
|
+
_warnedAboutMissingManifest = false;
|
|
76
|
+
}
|
|
60
77
|
|
|
61
78
|
// Files that are included in the public manifest (superset patterns).
|
|
62
79
|
const PUBLIC_INCLUDE_PREFIXES = ['src/', 'scripts/'];
|
|
@@ -70,7 +87,9 @@ function normalizeRel(filePath) {
|
|
|
70
87
|
function isPublicNonObfuscated(filePath) {
|
|
71
88
|
const rel = normalizeRel(filePath);
|
|
72
89
|
if (!rel) return false;
|
|
73
|
-
|
|
90
|
+
const obfuscated = loadObfuscatedFromManifest();
|
|
91
|
+
if (obfuscated === null) return false; // fail-safe when manifest is unreadable
|
|
92
|
+
if (obfuscated.has(rel)) return false;
|
|
74
93
|
for (const excl of PUBLIC_EXCLUDE_PREFIXES) {
|
|
75
94
|
if (rel.startsWith(excl)) return false;
|
|
76
95
|
}
|
|
@@ -244,6 +263,16 @@ function getGitDiff(changedFiles, repoRoot) {
|
|
|
244
263
|
async function maybeCreatePR({ capsule, event, mutation, gene, blastRadius }) {
|
|
245
264
|
if (String(process.env.EVOLVER_SELF_PR || '').toLowerCase() !== 'true') return null;
|
|
246
265
|
|
|
266
|
+
// User has explicitly opted into self-PR. Ensure we have the obfuscate
|
|
267
|
+
// list so we don't accidentally leak obfuscated source via a "non-obf" PR.
|
|
268
|
+
if (loadObfuscatedFromManifest() === null) {
|
|
269
|
+
if (!_warnedAboutMissingManifest) {
|
|
270
|
+
console.warn('[SelfPR] public.manifest.json not found at ' + getEvolverInstallRoot() + ' — rejecting all self-PRs (manifest is required to identify obfuscated files). Error: ' + _manifestLoadError);
|
|
271
|
+
_warnedAboutMissingManifest = true;
|
|
272
|
+
}
|
|
273
|
+
return null;
|
|
274
|
+
}
|
|
275
|
+
|
|
247
276
|
const score = capsule && capsule.outcome ? (capsule.outcome.score || 0) : 0;
|
|
248
277
|
const streak = capsule ? (capsule.success_streak || 0) : 0;
|
|
249
278
|
|
|
@@ -402,5 +431,6 @@ module.exports = {
|
|
|
402
431
|
writeState,
|
|
403
432
|
recordPR,
|
|
404
433
|
// For testing
|
|
405
|
-
|
|
434
|
+
_loadObfuscatedFromManifest: loadObfuscatedFromManifest,
|
|
435
|
+
_resetObfuscatedCache,
|
|
406
436
|
};
|