From ababc587abbdaf2bce47c64f63386e32e7c70b48 Mon Sep 17 00:00:00 2001 From: Kai Chappell Date: Wed, 22 Jan 2025 12:14:32 +0000 Subject: [PATCH] Update development plan with vertical slice approach - Reorder sprints for visual-first development - Dashboard (Sprint 4) now follows Physics Engine (Sprint 3) - Infrastructure layers (SCPI, TCP, HAL) follow visual demo - Update project references to py-dvt-ate --- docs/01_requirements.md | 6 +- docs/02_technical_specification.md | 10 +- docs/03_architecture_decisions.md | 2 +- docs/04_development_plan.md | 816 +++++++++++++++-------------- 4 files changed, 432 insertions(+), 402 deletions(-) diff --git a/docs/01_requirements.md b/docs/01_requirements.md index d2526ac..68f9865 100644 --- a/docs/01_requirements.md +++ b/docs/01_requirements.md @@ -1,5 +1,5 @@ # Business Requirements Document -## ThermalATE: Coupled Physics DVT Simulation Platform +## py_dvt_ate: Coupled Physics DVT Simulation Platform | Document ID | BRD-001 | |-------------|---------| @@ -13,7 +13,7 @@ ## Purpose -This document defines **what** the ThermalATE system must do. It specifies the functional and non-functional requirements, constraints, and success criteria. +This document defines **what** the py_dvt_ate system must do. It specifies the functional and non-functional requirements, constraints, and success criteria. For **why** decisions were made, see `03_architecture_decisions.md`. For **how** to implement the system, see `02_technical_specification.md`. @@ -51,7 +51,7 @@ For **how** to implement the system, see `02_technical_specification.md`. ### 1.1 Purpose -ThermalATE is a coupled-physics Device Validation Test (DVT) simulation platform that enables engineers to develop, validate, and debug characterisation test sequences without physical access to laboratory equipment. +py_dvt_ate is a coupled-physics Device Validation Test (DVT) simulation platform that enables engineers to develop, validate, and debug characterisation test sequences without physical access to laboratory equipment. ### 1.2 Background diff --git a/docs/02_technical_specification.md b/docs/02_technical_specification.md index be84341..e96abef 100644 --- a/docs/02_technical_specification.md +++ b/docs/02_technical_specification.md @@ -1,5 +1,5 @@ # Technical Design Document -## ThermalATE: Implementation Specification +## py_dvt_ate: Implementation Specification | Document ID | TDD-001 | |-------------|---------| @@ -13,7 +13,7 @@ ## Purpose -This document specifies **how** to implement the ThermalATE system. It contains technical details including architecture diagrams, code structures, interfaces, schemas, and specifications. +This document specifies **how** to implement the py_dvt_ate system. It contains technical details including architecture diagrams, code structures, interfaces, schemas, and specifications. For **what** the system must do, see `01_requirements.md`. For **why** decisions were made, see `03_architecture_decisions.md`. @@ -885,7 +885,7 @@ All instruments implement these standard commands: **Example Session**: ``` > *IDN? -< ThermalATE,VirtualChamber,SN001,1.0.0 +< py_dvt_ate,VirtualChamber,SN001,1.0.0 > TEMP:SETPOINT 85.0 > TEMP:SETPOINT? < 85.0 @@ -914,7 +914,7 @@ All instruments implement these standard commands: **Example Session**: ``` > *IDN? -< ThermalATE,VirtualPSU,SN002,1.0.0 +< py_dvt_ate,VirtualPSU,SN002,1.0.0 > INST:SEL CH1 > VOLT 5.0 > CURR 0.5 @@ -944,7 +944,7 @@ All instruments implement these standard commands: **Example Session**: ``` > *IDN? -< ThermalATE,VirtualDMM,SN003,1.0.0 +< py_dvt_ate,VirtualDMM,SN003,1.0.0 > CONF:VOLT:DC AUTO > SENS:VOLT:DC:NPLC 10 > MEAS:VOLT:DC? diff --git a/docs/03_architecture_decisions.md b/docs/03_architecture_decisions.md index cee7f09..ccf0db6 100644 --- a/docs/03_architecture_decisions.md +++ b/docs/03_architecture_decisions.md @@ -1,5 +1,5 @@ # Architecture Decision Record -## ThermalATE: Technical Architecture Decisions +## py_dvt_ate: Technical Architecture Decisions | Document ID | ARD-001 | |-------------|---------| diff --git a/docs/04_development_plan.md b/docs/04_development_plan.md index aa24e11..82ccea0 100644 --- a/docs/04_development_plan.md +++ b/docs/04_development_plan.md @@ -1,541 +1,571 @@ -# Development Plan -## Phase 1: Vertical Slice (MVP) +# Phase 1 Development Plan: py-dvt-ate MVP | Document ID | DEV-001 | |-------------|---------| -| Version | 1.0.0 | -| Status | Active | +| Version | 2.0.0 | +| Status | Approved | | Author | Kai Chappell | | Created | 2025-12-01 | +| Last Updated | 2025-12-01 | --- -## Approach +## Purpose -This plan follows an **iterative, stub-first development** strategy optimised for incremental progress: +This document defines **when** to build each component of py-dvt-ate Phase 1. It provides an iterative sprint breakdown with atomic tasks optimised for incremental development. -1. **Interfaces First** - Define protocols/interfaces before implementations -2. **Stubs Before Logic** - Create skeleton classes that pass type checks before adding behaviour -3. **Bottom-Up Construction** - Build foundational layers before dependent layers -4. **Frequent Commits** - Small, atomic commits after each meaningful change -5. **Minimal Context** - Each iteration should be completable with minimal codebase knowledge +For **what** the system must do, see `01_requirements.md`. +For **how** to implement the system, see `02_technical_specification.md`. +For **why** decisions were made, see `03_architecture_decisions.md`. + +--- + +## Design Principles + +1. **Small, Focused Commits** - Each task = 1 commit, ~50-150 lines changed +2. **Stubs First** - Define interfaces/types before implementation +3. **Vertical Slice First** - Get something visual early, then build infrastructure +4. **Minimal Context** - Each task completable with knowledge of 1-3 files +5. **Test Alongside** - Write tests immediately after implementation +6. **Iterative Refinement** - Get something working, then improve --- ## Sprint Structure -Each sprint represents ~2-4 hours of focused work. Sprints are designed to be self-contained with clear deliverables. +Each sprint is ~1-2 days of work, producing demonstrable progress. + +**Vertical Slice Strategy:** +- Sprints 1-3: Foundation + Physics Engine (the core simulation) +- Sprint 4: Dashboard (see the physics working!) +- Sprints 5-11: Infrastructure/Plumbing (SCPI, TCP, HAL) +- Sprints 12-17: Test Framework, CLI, Polish --- -## Sprint 1: Project Scaffolding +## Sprint 1: Project Foundation -**Goal:** Create project structure and build configuration. +**Goal:** Establish project structure and build system. -### Tasks +### Task 1.1: Create pyproject.toml +- Create minimal pyproject.toml with project metadata +- Package name: `py_dvt_ate` +- Include only core dependencies initially +- **Commit:** "Add pyproject.toml with core dependencies" -| # | Task | Commit Message | -|---|------|----------------| -| 1.1 | Create `pyproject.toml` with project metadata and dependencies | `chore: add pyproject.toml with dependencies` | -| 1.2 | Create `src/thermaulate/__init__.py` with version | `chore: create package structure` | -| 1.3 | Create empty subpackage `__init__.py` files for all modules | `chore: add subpackage stubs` | -| 1.4 | Create `py.typed` marker file | `chore: add py.typed marker for PEP 561` | -| 1.5 | Create `config/default.yaml` with basic structure | `chore: add default configuration file` | +### Task 1.2: Create directory structure (empty) +- Create src/py_dvt_ate/ with __init__.py and py.typed +- Create empty subpackage directories with __init__.py +- Create tests/ directory structure +- Create config/ directory +- **Commit:** "Add package directory structure" -### Deliverables -- `pip install -e .` works -- All imports resolve (empty packages) -- Type checker can be run +### Task 1.3: Add development tooling config +- Add ruff configuration to pyproject.toml +- Add mypy configuration to pyproject.toml +- Add pytest configuration to pyproject.toml +- **Commit:** "Configure development tooling (ruff, mypy, pytest)" + +### Task 1.4: Create basic CLI entry point +- Create src/py_dvt_ate/cli/__init__.py +- Create src/py_dvt_ate/cli/main.py with Typer app stub +- Add version command only +- **Commit:** "Add CLI entry point with version command" --- -## Sprint 2: Configuration System +## Sprint 2: Physics Engine Core (Stubs) -**Goal:** Load and validate configuration. +**Goal:** Define physics interfaces and data structures. -### Tasks +### Task 2.1: Define thermal state dataclasses +- Create src/py_dvt_ate/physics/__init__.py +- Create src/py_dvt_ate/physics/models.py +- Define ThermalState (frozen dataclass) +- Define ElectricalState (frozen dataclass) +- **Commit:** "Add physics state dataclasses" -| # | Task | Commit Message | -|---|------|----------------| -| 2.1 | Create `config/models.py` with Pydantic config classes | `feat(config): add Pydantic configuration models` | -| 2.2 | Create `config/loader.py` to load YAML and return AppConfig | `feat(config): add configuration loader` | -| 2.3 | Add unit tests for config loading | `test(config): add configuration tests` | +### Task 2.2: Define DUT base protocol +- Create src/py_dvt_ate/physics/dut/__init__.py +- Create src/py_dvt_ate/physics/dut/base.py +- Define DUTModel Protocol with method signatures +- **Commit:** "Add DUT model protocol" -### Deliverables -- Can load `config/default.yaml` into typed Python objects -- Invalid configs raise clear errors +### Task 2.3: Create physics engine stub +- Create src/py_dvt_ate/physics/engine.py +- Define PhysicsEngine class with stub methods +- Methods return placeholder values +- **Commit:** "Add physics engine stub" + +### Task 2.4: Add physics unit tests (for stubs) +- Create tests/unit/test_physics_models.py +- Test dataclass creation and immutability +- **Commit:** "Add physics model unit tests" --- -## Sprint 3: Transport Layer (Stubs) +## Sprint 3: Physics Engine Implementation -**Goal:** Define transport abstractions. +**Goal:** Implement working physics simulation. -### Tasks +### Task 3.1: Implement thermal calculations +- Create src/py_dvt_ate/physics/thermal.py +- Implement first-order thermal response calculations +- Pure functions, no state +- **Commit:** "Implement thermal calculation functions" -| # | Task | Commit Message | -|---|------|----------------| -| 3.1 | Create `transport/base.py` with `Transport` Protocol | `feat(transport): add Transport protocol` | -| 3.2 | Create `transport/tcp.py` with `TCPTransport` stub class | `feat(transport): add TCPTransport stub` | +### Task 3.2: Implement LDO DUT model +- Create src/py_dvt_ate/physics/dut/ldo.py +- Implement LDOModel class +- Temperature-dependent Vout, Iq calculations +- Power dissipation calculation +- **Commit:** "Implement LDO DUT model" -### Deliverables -- Transport interface defined -- TCPTransport class exists with NotImplementedError methods +### Task 3.3: Implement physics engine step() +- Update engine.py with working step() method +- Integrate thermal calculations +- Integrate DUT model +- **Commit:** "Implement physics engine stepping" + +### Task 3.4: Add physics integration tests +- Create tests/unit/test_physics_engine.py +- Test thermal settling behaviour +- Test self-heating effects +- **Commit:** "Add physics engine tests" --- -## Sprint 4: Transport Layer (Implementation) +## Sprint 4: Streamlit Dashboard (Early Visual!) -**Goal:** Implement TCP transport. +**Goal:** Visualise physics engine directly - see something working! -### Tasks +### Task 4.1: Create dashboard app skeleton +- Create src/py_dvt_ate/dashboard/__init__.py +- Create src/py_dvt_ate/dashboard/app.py +- Basic Streamlit page with title +- **Commit:** "Add Streamlit dashboard skeleton" -| # | Task | Commit Message | -|---|------|----------------| -| 4.1 | Implement `TCPTransport.connect()` and `disconnect()` | `feat(transport): implement TCP connect/disconnect` | -| 4.2 | Implement `TCPTransport.write()` and `read()` | `feat(transport): implement TCP read/write` | -| 4.3 | Implement `TCPTransport.query()` | `feat(transport): implement TCP query` | -| 4.4 | Add unit tests with mock socket | `test(transport): add TCP transport tests` | +### Task 4.2: Add physics visualisation panel +- Create direct connection to PhysicsEngine (no HAL yet) +- Display chamber temperature, DUT temperature +- Real-time updating chart +- **Commit:** "Add physics visualisation panel" -### Deliverables -- Can connect to TCP server and exchange messages -- Handles connection errors gracefully +### Task 4.3: Add interactive controls +- Temperature setpoint slider +- Input voltage control +- Load current control +- Start/Stop simulation button +- **Commit:** "Add interactive physics controls" + +### Task 4.4: Add self-heating demonstration +- Show junction temperature vs case temperature +- Demonstrate thermal coupling visually +- **Commit:** "Add self-heating visualisation" + +**Milestone:** Working "Virtual Lab Bench" toy to play with! --- -## Sprint 5: SCPI Parser +## Sprint 5: SCPI Foundation -**Goal:** Parse SCPI command strings. +**Goal:** Create SCPI parsing infrastructure. -### Tasks +### Task 5.1: Define SCPI command dataclass +- Create src/py_dvt_ate/instruments/__init__.py +- Create src/py_dvt_ate/instruments/scpi_parser.py +- Define SCPICommand dataclass +- **Commit:** "Add SCPI command dataclass" -| # | Task | Commit Message | -|---|------|----------------| -| 5.1 | Create `instruments/scpi_parser.py` with `SCPICommand` dataclass | `feat(scpi): add SCPICommand dataclass` | -| 5.2 | Implement `SCPIParser.parse()` method | `feat(scpi): implement SCPI parser` | -| 5.3 | Add comprehensive parser tests | `test(scpi): add parser tests` | +### Task 5.2: Implement SCPI parser +- Implement SCPIParser.parse() method +- Handle queries, commands with arguments +- Handle IEEE 488.2 common commands (*IDN?, *RST) +- **Commit:** "Implement SCPI parser" -### Deliverables -- Can parse `*IDN?`, `VOLT 3.3`, `TEMP:SETPOINT?`, etc. -- Returns structured command objects +### Task 5.3: Add SCPI parser tests +- Create tests/unit/test_scpi_parser.py +- Test various command formats +- Test edge cases +- **Commit:** "Add SCPI parser tests" --- -## Sprint 6: Physics Engine (Stubs) +## Sprint 6: Instrument Base & Thermal Chamber Simulator -**Goal:** Define physics simulation interfaces. +**Goal:** Create first virtual instrument. -### Tasks +### Task 6.1: Define instrument base class +- Create src/py_dvt_ate/instruments/base.py +- Define BaseInstrument with common functionality +- Command dispatch mechanism +- **Commit:** "Add base instrument class" -| # | Task | Commit Message | -|---|------|----------------| -| 6.1 | Create `physics/engine.py` with state dataclasses | `feat(physics): add ThermalState and ElectricalState` | -| 6.2 | Create `PhysicsEngine` class with stub methods | `feat(physics): add PhysicsEngine stub` | -| 6.3 | Create `physics/dut/base.py` with `DUTModel` Protocol | `feat(physics): add DUT model protocol` | +### Task 6.2: Create thermal chamber simulator stub +- Create src/py_dvt_ate/instruments/thermal_chamber.py +- Define ThermalChamberSim class +- Stub SCPI command handlers +- **Commit:** "Add thermal chamber simulator stub" -### Deliverables -- Physics interfaces defined -- State objects can be instantiated +### Task 6.3: Implement thermal chamber commands +- Implement TEMP:SETPOINT, TEMP:ACTUAL?, TEMP:STAB? +- Connect to physics engine reference +- **Commit:** "Implement thermal chamber SCPI commands" + +### Task 6.4: Add thermal chamber tests +- Create tests/unit/test_thermal_chamber.py +- Test SCPI command responses +- **Commit:** "Add thermal chamber simulator tests" --- -## Sprint 7: Physics Engine (Thermal) +## Sprint 7: Power Supply & DMM Simulators -**Goal:** Implement thermal simulation. +**Goal:** Complete instrument simulators. -### Tasks +### Task 7.1: Create power supply simulator +- Create src/py_dvt_ate/instruments/power_supply.py +- Implement PSU SCPI commands +- VOLT, CURR, OUTP, MEAS commands +- **Commit:** "Add power supply simulator" -| # | Task | Commit Message | -|---|------|----------------| -| 7.1 | Implement `PhysicsEngine.step()` thermal calculations | `feat(physics): implement thermal step` | -| 7.2 | Implement `PhysicsEngine.set_chamber_setpoint()` | `feat(physics): implement chamber setpoint` | -| 7.3 | Implement `PhysicsEngine.get_thermal_state()` | `feat(physics): implement thermal state getter` | -| 7.4 | Add thermal simulation tests | `test(physics): add thermal simulation tests` | +### Task 7.2: Add power supply tests +- Create tests/unit/test_power_supply.py +- **Commit:** "Add power supply simulator tests" -### Deliverables -- Chamber temperature ramps toward setpoint -- Case temperature follows with time constant +### Task 7.3: Create DMM simulator +- Create src/py_dvt_ate/instruments/multimeter.py +- Implement DMM SCPI commands +- MEAS:VOLT:DC?, CONF commands +- **Commit:** "Add multimeter simulator" + +### Task 7.4: Add DMM tests +- Create tests/unit/test_multimeter.py +- **Commit:** "Add multimeter simulator tests" --- -## Sprint 8: LDO DUT Model +## Sprint 8: TCP Server -**Goal:** Implement LDO electrical model. +**Goal:** Expose instruments over network. -### Tasks +### Task 8.1: Create async TCP server foundation +- Create src/py_dvt_ate/server/__init__.py +- Create src/py_dvt_ate/server/tcp_server.py +- Define InstrumentServer class with asyncio +- **Commit:** "Add async TCP server foundation" -| # | Task | Commit Message | -|---|------|----------------| -| 8.1 | Create `physics/dut/ldo.py` with `LDOModel` class | `feat(physics): add LDO model stub` | -| 8.2 | Implement temperature-dependent output voltage | `feat(physics): implement LDO Vout vs temperature` | -| 8.3 | Implement power dissipation calculation | `feat(physics): implement LDO power dissipation` | -| 8.4 | Implement quiescent current model | `feat(physics): implement LDO quiescent current` | -| 8.5 | Add LDO model tests | `test(physics): add LDO model tests` | +### Task 8.2: Implement client connection handling +- Handle multiple concurrent connections +- Line-based SCPI protocol (newline terminated) +- **Commit:** "Implement TCP client handling" -### Deliverables -- LDO output voltage varies with temperature (TempCo) -- Power dissipation calculated correctly +### Task 8.3: Create server main entry point +- Create src/py_dvt_ate/server/main.py +- Wire up physics engine and instruments +- Add CLI command to start server +- **Commit:** "Add simulation server entry point" + +### Task 8.4: Add server integration tests +- Create tests/integration/test_tcp_server.py +- Test connection and basic commands +- **Commit:** "Add TCP server integration tests" --- -## Sprint 9: Physics Engine (Electrical Coupling) +## Sprint 9: Transport Layer (Client Side) -**Goal:** Connect electrical and thermal domains. +**Goal:** Create client-side communication. -### Tasks +### Task 9.1: Define transport protocol +- Create src/py_dvt_ate/transport/__init__.py +- Create src/py_dvt_ate/transport/base.py +- Define Transport Protocol class +- **Commit:** "Add transport protocol definition" -| # | Task | Commit Message | -|---|------|----------------| -| 9.1 | Integrate LDO model into PhysicsEngine | `feat(physics): integrate DUT model` | -| 9.2 | Implement self-heating feedback loop | `feat(physics): implement self-heating` | -| 9.3 | Implement `get_electrical_state()` | `feat(physics): implement electrical state getter` | -| 9.4 | Add coupled physics tests | `test(physics): add thermal-electrical coupling tests` | +### Task 9.2: Implement TCP transport +- Create src/py_dvt_ate/transport/tcp.py +- Implement TCPTransport class +- connect(), write(), read(), query() methods +- **Commit:** "Implement TCP transport" -### Deliverables -- Higher load current causes self-heating -- Junction temperature affects output voltage +### Task 9.3: Add transport tests +- Create tests/unit/test_transport.py +- Test with mock socket +- **Commit:** "Add transport layer tests" --- -## Sprint 10: Virtual Instruments (Stubs) +## Sprint 10: SCPI Drivers -**Goal:** Define virtual instrument classes. +**Goal:** Create instrument drivers using transport. -### Tasks +### Task 10.1: Define driver base class +- Create src/py_dvt_ate/drivers/__init__.py +- Create src/py_dvt_ate/drivers/base.py +- Define BaseDriver with transport dependency +- **Commit:** "Add driver base class" -| # | Task | Commit Message | -|---|------|----------------| -| 10.1 | Create `instruments/base.py` with `VirtualInstrument` base class | `feat(instruments): add VirtualInstrument base` | -| 10.2 | Create `instruments/thermal_chamber.py` stub | `feat(instruments): add ThermalChamberSim stub` | -| 10.3 | Create `instruments/power_supply.py` stub | `feat(instruments): add PowerSupplySim stub` | -| 10.4 | Create `instruments/multimeter.py` stub | `feat(instruments): add MultimeterSim stub` | +### Task 10.2: Implement thermal chamber driver +- Create src/py_dvt_ate/drivers/thermal_chamber.py +- Methods map to SCPI commands +- **Commit:** "Add thermal chamber driver" -### Deliverables -- All instrument classes exist -- Common SCPI commands stubbed (IDN, RST) +### Task 10.3: Implement PSU and DMM drivers +- Create src/py_dvt_ate/drivers/power_supply.py +- Create src/py_dvt_ate/drivers/multimeter.py +- **Commit:** "Add PSU and DMM drivers" + +### Task 10.4: Add driver tests +- Create tests/unit/test_drivers.py +- Test command formatting +- **Commit:** "Add driver unit tests" --- -## Sprint 11: Thermal Chamber Simulator +## Sprint 11: Hardware Abstraction Layer -**Goal:** Implement thermal chamber SCPI commands. +**Goal:** Create HAL interfaces and implementations. -### Tasks +### Task 11.1: Define HAL protocols +- Create src/py_dvt_ate/hal/__init__.py +- Create src/py_dvt_ate/hal/interfaces.py +- Define IThermalChamber, IPowerSupply, IMultimeter +- **Commit:** "Add HAL protocol definitions" -| # | Task | Commit Message | -|---|------|----------------| -| 11.1 | Implement `TEMP:SETPOINT` command | `feat(instruments): implement chamber TEMP:SETPOINT` | -| 11.2 | Implement `TEMP:ACTUAL?` query | `feat(instruments): implement chamber TEMP:ACTUAL?` | -| 11.3 | Implement `TEMP:STAB?` query | `feat(instruments): implement chamber stability query` | -| 11.4 | Add thermal chamber tests | `test(instruments): add thermal chamber tests` | +### Task 11.2: Implement HAL wrappers +- Create src/py_dvt_ate/hal/impl/__init__.py +- Create HAL implementation classes +- Wrap drivers with HAL interface +- **Commit:** "Add HAL implementations" -### Deliverables -- Chamber responds to SCPI commands -- Reads from physics engine state +### Task 11.3: Create instrument factory +- Create src/py_dvt_ate/hal/factory.py +- InstrumentSet dataclass +- InstrumentFactory.create() method +- **Commit:** "Add instrument factory" + +### Task 11.4: Add HAL tests +- Create tests/unit/test_hal.py +- Test factory creates correct types +- **Commit:** "Add HAL unit tests" --- -## Sprint 12: Power Supply Simulator +## Sprint 12: Configuration System -**Goal:** Implement power supply SCPI commands. +**Goal:** YAML-based configuration. -### Tasks +### Task 12.1: Define config models +- Create src/py_dvt_ate/config/__init__.py +- Create src/py_dvt_ate/config/models.py +- Pydantic models for all config sections +- **Commit:** "Add configuration Pydantic models" -| # | Task | Commit Message | -|---|------|----------------| -| 12.1 | Implement `VOLT`, `CURR`, `OUTP` commands | `feat(instruments): implement PSU control commands` | -| 12.2 | Implement `MEAS:VOLT?`, `MEAS:CURR?` queries | `feat(instruments): implement PSU measurements` | -| 12.3 | Add power supply tests | `test(instruments): add power supply tests` | +### Task 12.2: Implement config loader +- Create src/py_dvt_ate/config/loader.py +- Load YAML, validate with Pydantic +- Environment variable overrides +- **Commit:** "Implement configuration loader" -### Deliverables -- PSU responds to voltage/current/output commands -- Measurements reflect physics state +### Task 12.3: Create default config file +- Create config/default.yaml +- Document all options +- **Commit:** "Add default configuration file" + +### Task 12.4: Add config tests +- Create tests/unit/test_config.py +- **Commit:** "Add configuration tests" --- -## Sprint 13: Multimeter Simulator +## Sprint 13: Data Persistence -**Goal:** Implement DMM SCPI commands. +**Goal:** Store test results. -### Tasks +### Task 13.1: Define data models +- Create src/py_dvt_ate/data/__init__.py +- Create src/py_dvt_ate/data/models.py +- TestRun, TestResult, Measurement dataclasses +- **Commit:** "Add data persistence models" -| # | Task | Commit Message | -|---|------|----------------| -| 13.1 | Implement `MEAS:VOLT:DC?` query | `feat(instruments): implement DMM voltage measurement` | -| 13.2 | Implement `SENS:VOLT:DC:NPLC` command | `feat(instruments): implement DMM NPLC setting` | -| 13.3 | Add multimeter tests | `test(instruments): add multimeter tests` | +### Task 13.2: Create SQLite repository +- Create src/py_dvt_ate/data/repository.py +- Implement test run and result storage +- **Commit:** "Implement SQLite repository" -### Deliverables -- DMM returns DUT output voltage from physics -- Integration time configurable +### Task 13.3: Add Parquet measurement storage +- Extend repository for Parquet files +- Batch measurement writing +- **Commit:** "Add Parquet measurement storage" + +### Task 13.4: Add data persistence tests +- Create tests/unit/test_repository.py +- **Commit:** "Add data persistence tests" --- -## Sprint 14: TCP Server +## Sprint 14: Test Executive Framework -**Goal:** Create async TCP server for instruments. +**Goal:** Test execution orchestration. -### Tasks +### Task 14.1: Define test interface and models +- Create src/py_dvt_ate/executive/__init__.py +- Create src/py_dvt_ate/executive/models.py +- TestStatus enum, TestContext, ITest protocol +- **Commit:** "Add test executive models" -| # | Task | Commit Message | -|---|------|----------------| -| 14.1 | Create `server/tcp_server.py` with async server class | `feat(server): add async TCP server` | -| 14.2 | Implement connection handling and command dispatch | `feat(server): implement command dispatch` | -| 14.3 | Create `server/main.py` entry point | `feat(server): add server entry point` | -| 14.4 | Add server integration tests | `test(server): add TCP server tests` | +### Task 14.2: Implement test logger +- Create src/py_dvt_ate/executive/logger.py +- Log measurements and events +- **Commit:** "Implement test logger" -### Deliverables -- Server listens on configured ports -- Routes commands to correct instrument -- Runs physics engine in background +### Task 14.3: Implement limit checker +- Create src/py_dvt_ate/executive/limits.py +- Evaluate pass/fail against limits +- **Commit:** "Implement limit checker" + +### Task 14.4: Implement test sequencer +- Create src/py_dvt_ate/executive/sequencer.py +- Run tests, collect results +- **Commit:** "Implement test sequencer" --- -## Sprint 15: HAL Interfaces +## Sprint 15: TempCo Characterisation Test -**Goal:** Define hardware abstraction protocols. +**Goal:** First complete DVT test. -### Tasks +### Task 15.1: Define test base class +- Create src/py_dvt_ate/tests/__init__.py +- Create src/py_dvt_ate/tests/base.py +- Common test utilities +- **Commit:** "Add DVT test base class" -| # | Task | Commit Message | -|---|------|----------------| -| 15.1 | Create `hal/interfaces.py` with all Protocol classes | `feat(hal): add HAL protocol definitions` | -| 15.2 | Create `hal/factory.py` with `InstrumentSet` and stub factory | `feat(hal): add instrument factory stub` | +### Task 15.2: Implement TempCo test +- Create src/py_dvt_ate/tests/tempco.py +- Temperature sweep logic +- Vout measurement at each temperature +- TempCo calculation +- **Commit:** "Implement TempCo characterisation test" -### Deliverables -- IThermalChamber, IPowerSupply, IMultimeter defined -- Factory interface established +### Task 15.3: Add TempCo test integration tests +- Create tests/integration/test_tempco.py +- Full end-to-end test with simulator +- **Commit:** "Add TempCo integration tests" --- -## Sprint 16: SCPI Drivers +## Sprint 16: CLI Enhancement -**Goal:** Create client-side SCPI drivers. +**Goal:** Complete CLI for test execution. -### Tasks +### Task 16.1: Add server commands to CLI +- start-server command +- Configure ports via options +- **Commit:** "Add server CLI commands" -| # | Task | Commit Message | -|---|------|----------------| -| 16.1 | Create `drivers/base.py` with common driver functionality | `feat(drivers): add driver base class` | -| 16.2 | Create `drivers/thermal_chamber.py` | `feat(drivers): add thermal chamber driver` | -| 16.3 | Create `drivers/power_supply.py` | `feat(drivers): add power supply driver` | -| 16.4 | Create `drivers/multimeter.py` | `feat(drivers): add multimeter driver` | +### Task 16.2: Add test execution commands +- run-test command +- List available tests +- **Commit:** "Add test execution CLI commands" -### Deliverables -- Drivers send SCPI commands via transport -- Parse responses into Python types +### Task 16.3: Add instrument query commands +- Direct instrument query/command +- Useful for debugging +- **Commit:** "Add instrument CLI commands" --- -## Sprint 17: HAL Implementations +## Sprint 17: Dashboard Enhancement & Polish -**Goal:** Implement HAL using drivers. +**Goal:** Connect dashboard to full stack + end-to-end verification. -### Tasks +### Task 17.1: Update dashboard to use HAL +- Replace direct physics connection with HAL +- Add instrument status panels +- **Commit:** "Update dashboard to use HAL" -| # | Task | Commit Message | -|---|------|----------------| -| 17.1 | Create `hal/impl/thermal_chamber.py` | `feat(hal): implement ThermalChamberHAL` | -| 17.2 | Create `hal/impl/power_supply.py` | `feat(hal): implement PowerSupplyHAL` | -| 17.3 | Create `hal/impl/multimeter.py` | `feat(hal): implement MultimeterHAL` | -| 17.4 | Implement `InstrumentFactory.create()` | `feat(hal): implement instrument factory` | -| 17.5 | Add HAL integration tests | `test(hal): add HAL integration tests` | +### Task 17.2: Add test execution page +- Run tests from dashboard +- Progress display +- **Commit:** "Add test execution dashboard page" -### Deliverables -- HAL classes wrap drivers -- Factory creates connected instrument set +### Task 17.3: Add results viewer page +- Historical results display +- Basic charts +- **Commit:** "Add results viewer dashboard page" + +### Task 17.4: End-to-end integration test +- Create tests/integration/test_e2e.py +- Full workflow: start server, run test, check results +- **Commit:** "Add end-to-end integration test" + +### Task 17.5: Update README with usage +- Quick start guide +- Example commands +- Screenshots +- **Commit:** "Update README with usage instructions" + +### Task 17.6: Verify test coverage +- Run coverage report +- Add tests for gaps +- **Commit:** "Improve test coverage to 80%+" --- -## Sprint 18: Test Executive (Core) +## File Dependencies Map -**Goal:** Create test execution framework. +``` +physics/models.py → (none) +physics/dut/base.py → models.py +physics/dut/ldo.py → base.py, models.py +physics/thermal.py → models.py +physics/engine.py → models.py, thermal.py, dut/base.py -### Tasks +dashboard/app.py → physics/engine.py (Sprint 4, direct connection) -| # | Task | Commit Message | -|---|------|----------------| -| 18.1 | Create `executive/models.py` with domain models | `feat(executive): add test domain models` | -| 18.2 | Create `executive/context.py` with TestContext | `feat(executive): add test context` | -| 18.3 | Create `executive/logger.py` with test logger | `feat(executive): add test logger` | -| 18.4 | Create `executive/limits.py` with limit checker | `feat(executive): add limit checker` | +instruments/scpi_parser.py → (none) +instruments/base.py → scpi_parser.py +instruments/*_sim.py → base.py, physics/engine.py -### Deliverables -- Can create test contexts -- Can log measurements -- Can evaluate limits +transport/base.py → (none) +transport/tcp.py → base.py + +drivers/base.py → transport/base.py +drivers/*.py → base.py + +hal/interfaces.py → (none) +hal/impl/*.py → interfaces.py, drivers/*.py +hal/factory.py → interfaces.py, impl/*.py + +config/models.py → (none) +config/loader.py → models.py + +data/models.py → (none) +data/repository.py → models.py + +executive/models.py → hal/interfaces.py +executive/*.py → models.py, data/repository.py + +tests/*.py → executive/models.py, hal/interfaces.py + +dashboard/app.py → hal/factory.py (Sprint 17, upgraded) +``` --- -## Sprint 19: Test Executive (Sequencer) +## Milestone Summary -**Goal:** Implement test sequencer. - -### Tasks - -| # | Task | Commit Message | -|---|------|----------------| -| 19.1 | Create `executive/sequencer.py` with TestSequencer class | `feat(executive): add test sequencer` | -| 19.2 | Create `tests/base.py` with ITest protocol | `feat(tests): add test base class` | -| 19.3 | Add sequencer tests | `test(executive): add sequencer tests` | - -### Deliverables -- Sequencer runs test instances -- Manages context lifecycle - ---- - -## Sprint 20: TempCo Test Implementation - -**Goal:** Implement temperature coefficient characterisation test. - -### Tasks - -| # | Task | Commit Message | -|---|------|----------------| -| 20.1 | Create `tests/tempco.py` with TempCoTest class | `feat(tests): add TempCo test stub` | -| 20.2 | Implement temperature sweep logic | `feat(tests): implement TempCo temperature sweep` | -| 20.3 | Implement TempCo calculation | `feat(tests): implement TempCo calculation` | -| 20.4 | Add TempCo test tests | `test(tests): add TempCo test coverage` | - -### Deliverables -- Complete TempCo characterisation test -- Calculates ppm/°C result - ---- - -## Sprint 21: Data Persistence (Schema) - -**Goal:** Set up data storage. - -### Tasks - -| # | Task | Commit Message | -|---|------|----------------| -| 21.1 | Create `data/models.py` with data models | `feat(data): add data models` | -| 21.2 | Create `data/migrations/001_initial.sql` | `feat(data): add initial schema migration` | -| 21.3 | Create `data/repository.py` with repository interface | `feat(data): add repository interface` | - -### Deliverables -- SQLite schema defined -- Repository interface established - ---- - -## Sprint 22: Data Persistence (Implementation) - -**Goal:** Implement data repository. - -### Tasks - -| # | Task | Commit Message | -|---|------|----------------| -| 22.1 | Implement SQLite repository for test runs | `feat(data): implement test run persistence` | -| 22.2 | Implement Parquet writer for measurements | `feat(data): implement measurement persistence` | -| 22.3 | Add repository tests | `test(data): add repository tests` | - -### Deliverables -- Test runs persisted to SQLite -- Measurements saved as Parquet files - ---- - -## Sprint 23: CLI (Basic) - -**Goal:** Create command-line interface. - -### Tasks - -| # | Task | Commit Message | -|---|------|----------------| -| 23.1 | Create `cli/main.py` with Typer app | `feat(cli): add CLI application` | -| 23.2 | Add `server start` command | `feat(cli): add server start command` | -| 23.3 | Add `test run` command | `feat(cli): add test run command` | -| 23.4 | Add `test list` command | `feat(cli): add test list command` | - -### Deliverables -- `thermaulate server start` launches simulation -- `thermaulate test run tempco` executes test - ---- - -## Sprint 24: Streamlit Dashboard (Basic) - -**Goal:** Create real-time monitoring dashboard. - -### Tasks - -| # | Task | Commit Message | -|---|------|----------------| -| 24.1 | Create `dashboard/app.py` with main Streamlit app | `feat(dashboard): add Streamlit app` | -| 24.2 | Create instruments status page | `feat(dashboard): add instruments page` | -| 24.3 | Add real-time temperature chart | `feat(dashboard): add temperature chart` | - -### Deliverables -- Dashboard shows instrument status -- Temperature updates in real-time - ---- - -## Sprint 25: Integration & Polish - -**Goal:** End-to-end testing and refinement. - -### Tasks - -| # | Task | Commit Message | -|---|------|----------------| -| 25.1 | Run full TempCo test end-to-end | `test: add end-to-end TempCo test` | -| 25.2 | Fix any integration issues discovered | `fix: resolve integration issues` | -| 25.3 | Add demo script | `docs: add demo script` | -| 25.4 | Update README with usage instructions | `docs: update README with usage` | -| 25.5 | Verify 80% test coverage on core modules | `test: ensure coverage targets met` | - -### Deliverables -- Complete working vertical slice -- Demo-able system -- Documentation updated - ---- - -## Sprint Summary - -| Sprint | Focus | Estimated Tasks | -|--------|-------|-----------------| -| 1 | Project scaffolding | 5 | -| 2 | Configuration | 3 | -| 3-4 | Transport layer | 7 | -| 5 | SCPI parser | 3 | -| 6-9 | Physics engine | 16 | -| 10-13 | Virtual instruments | 14 | -| 14 | TCP server | 4 | -| 15-17 | HAL layer | 10 | -| 18-19 | Test executive | 7 | -| 20 | TempCo test | 4 | -| 21-22 | Data persistence | 6 | -| 23 | CLI | 4 | -| 24 | Dashboard | 3 | -| 25 | Integration | 5 | - -**Total: 25 sprints, ~91 tasks, ~91 commits** - ---- - -## LLM Optimisation Notes - -Each sprint is designed for LLM execution with: - -1. **Minimal Context Required** - Each sprint focuses on 1-2 files -2. **Clear Boundaries** - Interfaces defined before implementations -3. **Testable Increments** - Each sprint has verification criteria -4. **Atomic Commits** - Small, focused changes that are easy to review -5. **Stub-First Approach** - Type-safe placeholders before full logic - -When starting a sprint: -1. Read only the relevant module's existing code -2. Reference interfaces/protocols, not implementations -3. Complete all tasks before moving to next sprint -4. Commit after each task +| Sprint | Milestone | What You Can Demo | +|--------|-----------|-------------------| +| 3 | Physics Working | Unit tests prove thermal coupling | +| 4 | **Visual Demo!** | Interactive Streamlit showing physics | +| 7 | Instruments Done | SCPI simulators respond to commands | +| 8 | Network Ready | TCP server accepts connections | +| 11 | HAL Complete | Abstraction layer swappable | +| 15 | First Test | TempCo characterisation runs | +| 17 | **MVP Complete** | Full end-to-end workflow | ---