Skip to content

Commit a691681

Browse files
committed
fix: take all hints, added NO_MINIMAL to schema
1 parent 4364427 commit a691681

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

evaluation_function/correction/correction.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def _check_minimality(fsa: FSA) -> Tuple[bool, Optional[ValidationError]]:
3535
if len(minimized.states) < len(fsa.states):
3636
return False, ValidationError(
3737
message=f"FSA is not minimal: has {len(fsa.states)} states but can be reduced to {len(minimized.states)}",
38-
code=ErrorCode.NOT_COMPLETE,
38+
code=ErrorCode.NOT_MINIMAL,
3939
severity="error",
4040
suggestion="Minimize your FSA by merging equivalent states"
4141
)
@@ -65,8 +65,8 @@ def _build_feedback(
6565
errors = [e for e in all_errors if e.severity == "error"]
6666
warnings = [e for e in all_errors if e.severity in ("warning", "info")]
6767

68-
# Build hints from suggestions
69-
hints = [e.suggestion for e in equivalence_errors if e.suggestion]
68+
# Build hints from all error suggestions
69+
hints = [e.suggestion for e in all_errors if e.suggestion]
7070
if structural_info:
7171
if structural_info.unreachable_states:
7272
hints.append("Consider removing unreachable states")
@@ -82,7 +82,7 @@ def _build_feedback(
8282
warnings=warnings,
8383
structural=structural_info,
8484
language=language,
85-
hints=hints[:5]
85+
hints=hints
8686
)
8787

8888

evaluation_function/schemas/result.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class ErrorCode(str, Enum):
3636
WRONG_AUTOMATON_TYPE = "WRONG_AUTOMATON_TYPE"
3737
NOT_DETERMINISTIC = "NOT_DETERMINISTIC"
3838
NOT_COMPLETE = "NOT_COMPLETE"
39+
NOT_MINIMAL = "NOT_MINIMAL"
3940

4041
# Language errors
4142
LANGUAGE_MISMATCH = "LANGUAGE_MISMATCH"

0 commit comments

Comments
 (0)