ksjsb/docs/superpowers/plans/2026-07-11-dfp-runtime-hints.md
2026-07-30 20:25:56 +08:00

42 lines
1.3 KiB
Markdown

# DFP Runtime Hints Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** Add persistent native/runtime hint fields to `DeviceProfile` and map them into full DFP kNN fields.
**Architecture:** Store native/runtime-like values in a `DfpRuntimeHints` dataclass nested inside `DeviceProfile`. `core.dfp_knn` reads those hints for full kNN fields such as `k4/k20/k51/k84/k101/k102/k105/k108/k109/k110/k111/k112/k113/k119`.
**Tech Stack:** Python 3.13, standard library, `unittest`.
---
## Tasks
### Task 1: Runtime hints model
**Files:**
- Modify: `core/device_profile.py`
- Modify: `tests/test_device_profile.py`
- [ ] Write failing tests that generated profiles include runtime hints and roundtrip them.
- [ ] Implement `DfpRuntimeHints`.
- [ ] Add deterministic generation and `.env` export.
- [ ] Verify `tests.test_device_profile`.
### Task 2: full kNN mapping
**Files:**
- Modify: `core/dfp_knn.py`
- Modify: `tests/test_dfp_knn.py`
- [ ] Write failing tests mapping runtime hints to full kNN.
- [ ] Implement mapping.
- [ ] Verify `tests.test_dfp_knn`.
### Task 3: Verification
- [ ] Run focused phase tests.
- [ ] Compile `core tools tests`.
- [ ] Regenerate `out/devices_dfp_sample`.
- [ ] Record progress.