Repository navigation
moveClass: real documented bit field (8=unload, not deprecated 3) - #38
Merged
Merged
Conversation
…d 3) Grounded in the real Web Services manual (Rev D): moveClass is a bit field — 0=Normal, 2=Import, 4=Export, 8=Unload, 16=No-Eject, 32=Closest-slot — and the single-integer 3=Unload is DEPRECATED. The emulator/client used 3. - MoveClass: real bit values (was auto() -> 1,2,4,8). from_wire parses the bit field (8/16/24/32...), still accepts the deprecated 3 as unload, and ignores unknown bits (never silently unload). to_wire emits the documented 8, not 3. - scalar_http client unload() now sends moveClass=8 (the real flag) with the drive source + target-slot hint — faithful to the appliance, verified against the emulator. - moveMedium route unload branch honors a supplied destination slot (else picks an empty/home slot), so the client's target-slot hint is preserved while moveClass=8 is the trigger. - Unit tests updated to the real values + deprecated-3 acceptance + unknown-bit safety. Emulator-as-reference, verified end-to-end: 24 moveClass/scalar_http tests + 56 AML operations/diagnostics tests green. Deprecated 3 stays accepted for back-compat. 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 updates OpenBlade’s Scalar i3 moveClass handling to match the Quantum Web Services manual (Rev D), treating moveClass as a bit field and standardizing unload to use wire value 8 (while still accepting deprecated 3 for backward compatibility). It also updates the scalar_http client and AML moveMedium route to use/interpret the corrected unload semantics and to honor an optional destination-slot hint.
Changes:
- Update
MoveClassto use documented bit values (IMPORT=2, EXPORT=4, UNLOAD=8, NO_EJECT=16, CLOSEST_SLOT=32) and implement bit-field parsing with deprecated3support. - Update scalar_http
unload()to sendmoveClass=8on the wire. - Update AML
moveMediumunload handling to honor a provided destination slot hint (otherwise select an empty/home slot), and adjust unit tests accordingly.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| tests/unit/test_scalar_coordinate.py | Updates unit tests to assert documented bit-field values and deprecated 3 input behavior. |
| openblade/hardware/scalar_http/library_backend.py | Ensures scalar_http unload requests send moveClass=8 (documented bit-field unload). |
| openblade/domain/scalar_coordinate.py | Reworks MoveClass enum values and wire parsing/serialization for real bit-field semantics. |
| openblade/api/routes_aml_move_medium.py | Updates unload branch to honor a destination-slot hint when provided. |
Comment on lines
+98
to
+105
| value = int(value) | ||
| if value == _DEPRECATED_UNLOAD_WIRE: | ||
| return cls.UNLOAD | ||
| result = cls.NORMAL | ||
| for flag in (cls.IMPORT, cls.EXPORT, cls.UNLOAD, cls.NO_EJECT, cls.CLOSEST_SLOT): | ||
| if value & flag.value: | ||
| result |= flag | ||
| return result |
Comment on lines
+97
to
+101
| # Real moveClass=8 unload takes the drive source only; if a destination | ||
| # slot is supplied (client hint), honor it, else the library picks an | ||
| # empty/home slot (Web Services manual). | ||
| target_slot = destination[1] if destination is not None else _first_empty_slot(context) | ||
| result = context.library.unload(source_address, target_slot) |
Comment on lines
+52
to
+54
| # An unknown bit (1) that maps to no flag must NOT be treated as unload. | ||
| assert MoveClass.from_wire(1) == MoveClass.NORMAL | ||
| assert not MoveClass.from_wire(1).is_unload |
github-actions Bot
pushed a commit
that referenced
this pull request
Jul 20, 2026
…ore lost #38 fixes (#39) * Address review: guard unload destination + fix stale docstrings + tests - 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 * Encode i3/i6 moveClass support boundary: reject Import/Export 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 --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.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.
Second i3-fidelity increment, grounded in the real Web Services manual (Rev D). moveClass is a bit field — 0=Normal, 2=Import, 4=Export, 8=Unload, 16=No-Eject, 32=Closest-slot — and the single-integer 3=Unload is deprecated. The emulator/client used 3.
MoveClass: real bit values (was auto() → 1,2,4,8).from_wireparses the bit field (8/16/24/32…), still accepts deprecated 3 as unload, ignores unknown bits (never silently unload).to_wireemits the documented 8.unload()now sends moveClass=8 with the drive source + target-slot hint — faithful to the appliance, verified against the emulator.Emulator-as-reference, verified end-to-end: 24 moveClass/scalar_http + 56 AML operations/diagnostics tests green. Deprecated 3 kept for back-compat.
(Pre-existing, unrelated: test_controller_isolation::test_moveMedium_accepted_with_service_token fails on clean master, hits /aml/media/move.)
https://claude.ai/code/session_012K5Zjc2bggcyJtFbz2D4Pw