Repository navigation
State hints: name only the state the call leads to, and no guard when a call sequence works - #524
Merged
Merged
Conversation
… a call sequence works - A call-sequence hint now reads "Call S before this call; afterwards <state>", with no "from" part: the state before is in the message. - A step whose condition gives its only parameter a value is written as the call with that value, e.g. wParam.setCompressionMode(ImageWriteParam.MODE_EXPLICIT). - No guard hint when a sequence of calls reaches a state that allows the call: wrapping the call in the check would skip it where it fails. - The guard reads "Guard this call with if (<check>); inside it, <state>". - The calls allowed now are listed only when no other hint is given. Closes #518 Closes #519 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
Clean-code reviewI audited this PR's new code only ( Fixed
Declined
There are no SOLID or layering issues. All the wording stays in |
Collaborator
Author
Codex review, round 1No findings. Codex reran The full suite passes locally (728 tests). |
This was referenced Nov 10, 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.
Closes #518
Closes #519
What and why
Changes to the state hints in
StateHints(display and choice of hints only; the VC, verdict and category are unchanged):Call S before this call; afterwards <state>. The "from" part is gone, since the Found already shows it. In A1_09 it listed every state of the set (from display(host) == notDisplayable or display(host) == displayable). "Afterwards" is the machine'safterstate for the changed sets, so the hint only states what the machine computes after the calls, and no!=is turned into==. The value form from Show states of named sets by their set in state hints and declared-here #517 stays (markState(buffered) == marked). Classes with no named set readafterwards f is open.param == cfor the method's only parameter, andcnames no variable, the step is writtenwParam.setCompressionMode(ImageWriteParam.MODE_EXPLICIT). Any other condition keepsr.set(int lo, int hi) with lo < hi.Guard this call with if (<check>); inside it, <state>. This replaces "when it returns false", which was ambiguous next to!host.isDisplayable().Study tasks (CLI, before = main, after = this branch)
Each task still gives exactly one error, on its
reportedLine. A2_10, A2_04, practice and practice2 are unchanged.A1_38
A1_01
A1_09
host.dispose()is still the first hint.analysis/check-fixes.py --selftest --task A1_09passes 8/8 and grades the plaindispose()fix (P01) CORRECT.A1_56 (the guard stays)
IDE
Hints reach vscode-liquidjava as plain message text, so they show there with no extension change. There are no screenshots, because nothing in the extension's layout changes.
Tests
The exact-message expectations in
TestStateHintsare updated. Each of these fails on main: the new wording, no "can call" next to another hint, andsetCompressionMode(2)/chain.pick(1)for the argument form. One case is added to the existingErrorStateHintGuardsfixture:reachableOnEveryPath, the A1_09 shape (path-dependent state, a call that reaches the needed state, a query). On main it gives a sequence, a guard and "can call"; now it gives only the sequence. The full suite passes locally (728 tests).Open for the PM
anyState, used by A1_56) can also list a call sequence after the guard. Drop the guard hint when a call-sequence hint exists, and reword it #518 scopes the rule toforCall, so the guard is kept there. None of the study tasks has both.🤖 Generated with Claude Code