Skip to content

Comments

refactor(yolo-tracker): Phase 12 device governance — remove in-code defaults#101

Open
rogermt wants to merge 2 commits intomainfrom
refactor/phase12-device-governance
Open

refactor(yolo-tracker): Phase 12 device governance — remove in-code defaults#101
rogermt wants to merge 2 commits intomainfrom
refactor/phase12-device-governance

Conversation

@rogermt
Copy link
Owner

@rogermt rogermt commented Feb 9, 2026

Summary

Phase 12: Strict device governance at plugin layer.

Remove DEFAULT_MODEL_CONFIG fallback. Device must come from:

  1. Caller (plugin options dict)
  2. models.yaml configuration
  3. ConfigError if neither present

Changes

  • Remove DEFAULT_MODEL_CONFIG in-code fallback
  • 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'

Issue

Closes #100: Remove default device from code only get the value models yaml file

rogermt and others added 2 commits February 9, 2026 23:08
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use device configuration from models.yaml instead of hardcoding to cpu

1 participant