refactor(yolo-tracker): Phase 12 device governance — remove in-code defaults#101
Open
refactor(yolo-tracker): Phase 12 device governance — remove in-code defaults#101
Conversation
…efaults
BREAKING: Remove DEFAULT_MODEL_CONFIG fallback. Device must come from:
1. Caller (api/options dict)
2. models.yaml configuration
3. ConfigError if neither present
Summary:
- Remove DEFAULT_MODEL_CONFIG, in-code fallback logic
- Add strict YAML validation: required keys (models, confidence, device)
- Add get_device() function, validate device in ('cpu', 'cuda')
- Add _reset_config_cache_for_tests() for test isolation
- Update Plugin.run_tool() to use _resolve_device() strictly
- Inference modules unchanged (keep device='cpu' default for backward compat)
Testing:
- All 58 contract tests pass
- Heavy GPU tests will need device in models.yaml
- Tests call inference directly with device='cpu'
This enforces strict device governance at plugin/server layer while
maintaining backward compatibility with legacy test patterns.
Issue #100: Remove default device from code only get the value models yaml file
Amp-Thread-ID: https://ampcode.com/threads/T-019c446a-cc81-72fb-903b-a9012880d930
Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019c446a-cc81-72fb-903b-a9012880d930 Co-authored-by: Amp <amp@ampcode.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.
Summary
Phase 12: Strict device governance at plugin layer.
Remove DEFAULT_MODEL_CONFIG fallback. Device must come from:
Changes
Testing
Issue
Closes #100: Remove default device from code only get the value models yaml file