# Step 3: analysis-base-interface ## 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/Domain.hpp` - `/include/fesa/core/AnalysisState.hpp` - `/CMakeLists.txt` ## Task Add `fesa::analysis::Analysis` as a minimal base interface for future analysis strategies. Candidate files: - Create `/include/fesa/analysis/Analysis.hpp` - Create `/tests/analysis/analysis_base_test.cpp` - Modify `/CMakeLists.txt` Required contract: - `Analysis` has a virtual destructor. - `Analysis` exposes `const char* name() const noexcept`. - `Analysis` exposes `void run(const fesa::core::Domain& domain, fesa::core::AnalysisState& state)`. - `run` delegates to a protected pure virtual `doRun(const fesa::core::Domain&, fesa::core::AnalysisState&)`. - `Domain` is passed as const; `AnalysisState` is mutable. - The base class must not own `Domain`, `AnalysisState`, solver objects, result writers, or reference artifacts. ## Tests To Write First Write tests in `/tests/analysis/analysis_base_test.cpp` before production changes: - a derived recording analysis can be used through `Analysis&`. - `run` forwards the const `Domain` and mutable `AnalysisState` to the derived implementation. - derived implementation can update `AnalysisState` without mutating `Domain`. - `Analysis` can be deleted through a base pointer. Run the targeted test and confirm it fails before implementation: ```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 3 with `completed`, `error`, or `blocked`. ## Do Not - Do not implement `LinearStaticAnalysis`. - Do not add template-method hook lists for assembly, solve, boundary conditions, or output until `AnalysisModel` and `DofManager` exist.