Repository navigation
Conversation
Signed-off-by: Daniel Peng <zgpeng2002@163.com>
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
Self-contained functions and classes defined inside another function currently reach their generated standalone file with the enclosing indentation from
inspect.getsource. Their first evaluation returnsunexpected indentand a zero score before any evolution.Normalize both convenience helpers before their existing marker handling:
Add six tests that pass the actual emitted candidate and evaluator through
_prepare_program/_prepare_evaluatorand a real Python subprocess. They cover nested functions/classes, already-marked nested definitions and top-level controls, including relative body indentation. The existing evaluator serialization contract from #423 is unchanged. This does not add closure/free-global capture or decorator/async support.Evidence
unexpected indent/score0; the two top-level controls pass.OPENAI_API_KEY=test-key-for-unit-tests python -m unittest discover tests: 1093 tests run,1086 passed,7 original skips on current main88efea9. Validation allowed only the original loopback ProposalServer fixtures; no external or LLM provider calls.git diff --checkpasses. With configured Black25.12.0/isort7.0.0, the new test file passes both checks. The existingapi.pyand unchangedtest_api.pyfail the same formatting/import checks before and after (13 Black diff hunks/4 isort hunks; identical residual edit lines). These full-file checks are not reported as passing; unrelated cleanup is excluded.Implementation and validation assisted by OpenAI Codex; no external implementation copied.
@codelion, when convenient, could you review this focused source-generation fix? Thank you.
Merge Danger
Door: two-way.
Blast Radius: API.
Only the source emitted by
evolve_functionandevolve_algorithmis normalized. Existing relative indentation and marker handling remain in use.