fix: three runtime and logic bugs#25
Merged
autogame-17 merged 3 commits intoEvoMap:mainfrom Feb 22, 2026
Merged
Conversation
evolve.js imports matchPatternToSignals from selector.js (line 17) to filter external hub candidates against the current signal set, but the function was never included in module.exports. Any evolution cycle that calls the hub-candidate filtering path would throw: TypeError: matchPatternToSignals is not a function Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The expression `Math.min(maxSleepMs, Math.max(minSleepMs, minSleepMs))` reduces to `Math.min(maxSleepMs, minSleepMs)`. When maxSleepMs is misconfigured to be smaller than minSleepMs, this initialises currentSleepMs below the intended minimum, violating the invariant that currentSleepMs >= minSleepMs that the rest of the loop maintains. Replace with the straightforward `minSleepMs`, which is the correct initial value (the loop resets to minSleepMs on every successful cycle). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Two fixes in this commit:
1. Gene max_files constraint silently ignored (solidify.js:265)
`Math.max(Number(constraints.max_files) || 0, 20)` forced the
effective limit to at least 20, so any gene with `max_files < 20`
(e.g. the built-in gene at line 780 uses `max_files: 12`) had its
constraint silently overridden. Replace with a conditional that only
falls back to the default of 20 when no constraint is configured:
Number(constraints.max_files) > 0 ? Number(constraints.max_files) : DEFAULT_MAX_FILES
2. Redundant variable declarations shadowing outer scope
- solidify.js: `const sourceType` re-declared inside the
`eligible_to_broadcast` block with identical logic; the outer
declaration (line 942) is already in scope there.
- evolve.js: `const selectedBy` re-declared inside the solidify
`try` block with identical logic; the outer declaration (line 1036)
is already in scope there.
Removing the inner declarations eliminates the shadowing and ensures
any future change to the outer declaration propagates correctly.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
kunwl123456
approved these changes
Feb 20, 2026
kunwl123456
left a comment
There was a problem hiding this comment.
Verified per docs/PR25-verification-report.md. LGTM, thanks for your contribution.
4 tasks
fmw666
pushed a commit
that referenced
this pull request
Mar 11, 2026
- PR #68 (hendrixAIDev): guard performMaintenance with IS_DRY_RUN - PR #26 (onthebigtree): hash hostname in env fingerprint, portable validation paths - PR #63 (voidborne-d): add 61 unit tests for core GEP modules - PR #21 (LKCY33): add dotenv path rewrite for public build - PR #25 (onthebigtree): already applied (currentSleepMs, matchPatternToSignals, max_files) - Update public.manifest.json: include test/*.test.js, add index.js dotenv rewrite Co-authored-by: Cursor <cursoragent@cursor.com>
fmw666
pushed a commit
that referenced
this pull request
Mar 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
selector.js:matchPatternToSignalswas defined but missing frommodule.exports.evolve.jsimports it at line 17 to filter hub candidates against current signals — any evolution cycle reaching that path threwTypeError: matchPatternToSignals is not a function.index.js: Initial value ofcurrentSleepMswas computed asMath.min(maxSleepMs, Math.max(minSleepMs, minSleepMs)). The innerMath.max(minSleepMs, minSleepMs)always equalsminSleepMs, reducing the expression toMath.min(maxSleepMs, minSleepMs). IfEVOLVER_MAX_SLEEP_MSis misconfigured belowEVOLVER_MIN_SLEEP_MS, the daemon starts with a sleep value below its own minimum — violating the invariant the rest of the loop maintains. Replaced withminSleepMs.solidify.js:checkConstraintsusedMath.max(Number(constraints.max_files) || 0, 20), silently raising any gene-definedmax_filesbelow 20 to 20. A built-in gene already usesmax_files: 12(line 780), which was ignored. Changed to only fall back to the default of 20 when no constraint is set.solidify.js/evolve.js(cleanup): Removed two redundantconstdeclarations that shadowed identical outer-scope variables (sourceTypein solidify.js,selectedByin evolve.js). No behaviour change — outer variables carry the same value and are in scope.Test plan
TypeErrorfrommatchPatternToSignalsEVOLVER_MAX_SLEEP_MS<EVOLVER_MIN_SLEEP_MSand confirm initial sleep respects the minimummax_files: 5and verify a 6-file patch is correctly flagged as a violation🤖 Generated with Claude Code
Note
Low Risk
Small, localized runtime/logic fixes in the evolver loop, selector exports, and solidify constraint handling; low risk but affects scheduling and enforcement paths that are exercised frequently.
Overview
Fixes three runtime/logic issues affecting evolution cycles.
index.jsnow initializes the daemon loop sleep interval tominSleepMs(avoids starting below the configured minimum).src/gep/selector.jsexportsmatchPatternToSignalsto prevent runtime failures when filtering hub/external candidates.src/gep/solidify.jscorrectsmax_filesconstraint handling to respect gene-defined limits below 20 instead of silently raising them to the default; plus minor cleanup removing redundant/shadowing locals insrc/evolve.jsandsrc/gep/solidify.js.Written by Cursor Bugbot for commit 8824801. This will update automatically on new commits. Configure here.