Repository navigation
Encode i3/i6 moveClass support boundary (reject Import/Export) + restore lost #38 fixes - #39
Merged
Merged
Conversation
- routes_aml_move_medium.py: the unload branch now rejects a non-slot destination (422). Slot and drive addresses overlap, so a moveClass=8 request with a DRIVE destination would otherwise silently misroute the cartridge (reviewer-proven). - Refresh the two now-stale docstrings (module docstring in scalar_coordinate.py and the moveMedium route header) that still called moveClass values UNVERIFIED / "3=unload" — they now describe the documented bit field. - tests/i3/test_scalar_http_move_medium.py: assert unload lands in the SPECIFIC target slot (was only "some slot" — a misroute gap), and that a drive destination is rejected with 422. 12 move_medium/moveClass tests green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012K5Zjc2bggcyJtFbz2D4Pw
The Web Services manual marks moveClass Import(2) and Export(4) as "Currently not supported" on Scalar i3/i6 (only Normal/Unload/No-Eject/Closest-slot apply). The emulator models an i3, so it now rejects them (422) like a real appliance instead of silently doing a normal move. - MoveClass.is_supported_on_i3 (false when IMPORT or EXPORT bit set). - moveMedium route returns 422 for import/export. - Tests: unit boundary + route rejection of moveClass 2/4. NOTE: this branch also re-applies the #38 review fixes (unload destination guard + refreshed docstrings + specific-slot/drive-destination tests) that were LOST when auto-merge squashed only #38's first commit before the fix commit was pushed — so master was missing the reviewer-proven misroute guard. Restored here. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012K5Zjc2bggcyJtFbz2D4Pw
There was a problem hiding this comment.
Pull request overview
This PR tightens the Scalar i3/i6 emulator’s AML moveMedium behavior to match the Web Services manual’s supported moveClass boundary, rejecting Import (2) and Export (4) operations instead of silently treating them as normal moves. It also restores previously-reviewed moveClass=8 unload-path fixes and adds regression coverage to ensure unload destination handling remains correct.
Changes:
- Add
MoveClass.is_supported_on_i3and enforce it in the AMLmoveMediumroute (422 on Import/Export). - Reinstate unload-path safeguards/behavior (specific-slot unload + reject drive destinations) and expand integration tests.
- Add unit + i3 integration tests covering the i3-supported
moveClassboundary and route-level rejection.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
openblade/domain/scalar_coordinate.py |
Adds MoveClass.is_supported_on_i3 and updates moveClass documentation/comments. |
openblade/api/routes_aml_move_medium.py |
Rejects unsupported Import/Export moveClass values and strengthens unload destination handling. |
tests/unit/test_scalar_coordinate.py |
Adds unit test for i3/i6 moveClass support boundary. |
tests/i3/test_scalar_http_move_medium.py |
Adds regression/integration tests for unload destination semantics and Import/Export rejection. |
Comment on lines
79
to
80
| except (TypeError, ValueError): | ||
| move_class = MoveClass.NORMAL |
Comment on lines
105
to
+109
| # slot is supplied (client hint), honor it, else the library picks an | ||
| # empty/home slot (Web Services manual). | ||
| # empty/home slot (Web Services manual). Guard the destination type: | ||
| # slot and drive addresses overlap, so an accidental drive destination | ||
| # would otherwise silently misroute the cartridge. | ||
| if destination is not None and destination[0] != "slot": |
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.
Encodes the i3/i6 supported-feature boundary you asked for: the Web Services manual marks moveClass Import(2)/Export(4) as 'not supported on i3/i6' (only Normal/Unload/No-Eject/Closest-slot apply). The emulator models an i3, so it now returns 422 for import/export instead of silently doing a normal move.
MoveClass.is_supported_on_i3; moveMedium route rejects import/export.Also restores lost fixes: #38 auto-merged only its first commit before the review-fix commit was pushed, so master was missing the reviewer-proven unload-destination misroute guard + the refreshed docstrings + the specific-slot/drive-destination tests. This branch re-applies them (commit 6f55ea7).
14 moveClass/move_medium tests green.
https://claude.ai/code/session_012K5Zjc2bggcyJtFbz2D4Pw