Skip to content

Keep identifiers like handleInvalidInput in filter_leaf_nodes - #102

Merged
anhnh2002 merged 3 commits into
FSoft-AI4Code:mainfrom
StefanZoerner:fix/leaf-node-identifier-filter
Sep 7, 2026
Merged

Keep identifiers like handleInvalidInput in filter_leaf_nodes#102
anhnh2002 merged 3 commits into
FSoft-AI4Code:mainfrom
StefanZoerner:fix/leaf-node-identifier-filter

Conversation

@StefanZoerner

@StefanZoerner StefanZoerner commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

filter_leaf_nodes rejects any candidate containing error, exception, failed or invalid as a substring, case-insensitively. The intent is to catch error strings that reach leaf-node selection instead of an identifier, but the check also silently discards ordinary names — handleInvalidInput, gameFailedCheck, ErrorLog.

This matches on word boundaries instead, and only for candidates that are not known components: a string that resolves to a component cannot be an error message.

Adds tests/test_leaf_selection.py; the function was previously uncovered. The test for identifier survival fails on main and passes with this change.

This is a part of #101, which I closed after the discussion there.

anhnh2002 added 2 commits September 7, 2026 11:30
…t in .gitignore

The membership check against known components already drops every
candidate that is not a component id, including error messages and
malformed entries, so a separate keyword/regex check never changes the
result. Remove it rather than keep dead code.

tests/* is gitignored with per-file exceptions; add one for the new
tests/test_leaf_selection.py so it is not tracked-but-ignored.
CI lints every changed file in full. Replace typing.Dict/List/Set with
builtin generics, sort imports, and apply ruff format; no behavior change.
@anhnh2002
anhnh2002 merged commit f5dac8c into FSoft-AI4Code:main Sep 7, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants