# Step 1: analysis-state-core ## Read First Read these files before editing: - `/AGENTS.md` - `/docs/PLAN.md` - `/docs/PROGRESS.md` - `/docs/WORKNOTE.md` - `/docs/AGENT_RULES.md` - `/docs/ADR.md` - `/docs/ARCHITECTURE.md` - `/docs/implementation-plans/analysis-state-analysis-base-implementation-plan.md` - `/include/fesa/core/ModelTypes.hpp` - `/include/fesa/core/Domain.hpp` - `/CMakeLists.txt` ## Task Add `fesa::core::AnalysisState`. Candidate files: - Create `/include/fesa/core/AnalysisState.hpp` - Create `/src/core/AnalysisState.cpp` - Create `/tests/core/analysis_state_test.cpp` - Modify `/CMakeLists.txt` Required initial contract: - `AnalysisState()` starts with zero DOFs and empty vectors. - `explicit AnalysisState(std::size_t dof_count)` allocates zero-filled vectors. - `dofCount()` returns the current vector size. - `displacement()`, `externalForce()`, `internalForce()`, `residual()`, and `reaction()` return const vector references. - All state vectors have the same size as `dofCount()`. - State is mutable analysis data only. Do not store node ids, element ids, equation ids, sparse data, solver handles, writer handles, or references to `Domain`. ## Tests To Write First Write tests in `/tests/core/analysis_state_test.cpp` before creating production code: - default state has zero DOFs and all vectors empty. - sized state creates zero-filled displacement, external force, internal force, residual, and reaction vectors. - `dofCount()` matches vector sizes. Run the targeted test and confirm it fails because `AnalysisState` does not exist: ```powershell ctest --test-dir build/msvc-debug --output-on-failure -C Debug -R analysis ``` Then implement the minimum code needed to pass. ## Acceptance Criteria Run: ```powershell ctest --test-dir build/msvc-debug --output-on-failure -C Debug -R analysis python scripts/validate_workspace.py ``` Update `/phases/analysis-state-analysis-base/index.json` step 1 with `completed`, `error`, or `blocked`. ## Do Not - Do not implement `AnalysisModel`, `DofManager`, assembly, solver, or result output. - Do not add mutable solver state to `Domain`, `Node`, `Element`, `Material`, `Property`, `Load`, or `BoundaryCondition`.