Enhance test infrastructure and configuration for JWKS and Docker setup
ci/woodpecker/push/build-arm Pipeline was successful

- Updated Azaion.Missions.csproj to exclude test sources from service compilation, preventing build failures due to test project dependencies.
- Modified docker-compose.test.yml to preload the pg_stat_statements extension for testing and adjusted JWT refresh intervals for better test execution timing.
- Enhanced Dockerfile to install wget for health checks and ensure proper initialization of the container.
- Introduced a test-only endpoint for JWKS refresh to facilitate end-to-end testing without relying on the default refresh intervals.
- Updated DTOs in ApiDtos.cs to reflect camelCase naming conventions for consistency with service responses.
- Improved test cases to handle JWKS rotation and refresh scenarios effectively, ensuring robust validation of JWT handling.

This commit lays the groundwork for more reliable and efficient testing of the Azaion.Missions project.
This commit is contained in:
Oleksandr Bezdieniezhnykh
2026-05-16 10:20:38 +03:00
parent 001e80fe96
commit 3398ec49a0
29 changed files with 785 additions and 111 deletions
@@ -0,0 +1,59 @@
# FINAL Report — `02-baseline-cleanup`
**Date**: 2026-05-16
**Mode**: automatic
**Workflow**: quick-assessment (phases 0 → 2 only)
**Epic**: [AZ-587](https://denyspopov.atlassian.net/browse/AZ-587)
**Tasks**: [AZ-588](https://denyspopov.atlassian.net/browse/AZ-588) (1 SP)
## Why this was a quick-assessment run
The 2026-05-14 architecture-compliance baseline scan flagged 4 findings (F1F4). By the time this refactor pass started:
- F1, F2 (High Architecture) — resolved 2026-05-14 by a doc retag in `_docs/02_document/module-layout.md`.
- F3 (Low Maintainability) — resolved by the missions/vehicles rename; the file in question (`Flight.cs``Mission.cs`) no longer carries the dead `using`.
- F4 (Low Maintainability) — partial: 2 of the 3 originally-empty scaffolding directories (`Entities/`, `DTOs/Requests/`) remain; `Infrastructure/` is now legitimately used.
That left **a single actionable change**: delete two empty directories. The user explicitly chose **B (quick-assessment, phases 02 only)** at the Phase 0 BLOCKING gate, then **E (no hardening tracks)** at the Phase 1 + 2b combined gate. Phases 37 (safety net, execution, test-sync, verification, documentation) are intentionally not run by this skill — the actual change lands through `/implement` in the Phase B feature cycle alongside any other Phase B work, picked up from the task ticket created here.
## Phases Executed
| Phase | Status | Output |
|-------|--------|--------|
| 0 — Baseline | Done | `baseline_metrics.md` |
| 1 — Discovery | Done (1a + 1b skipped, 1c done, 1d done) | `discovery/logical_flow_analysis.md`, `list-of-changes.md` |
| 2a — Deep Research | Done (no library replacement → no `context7` / MVE) | `analysis/research_findings.md` |
| 2b — Hardening Tracks | Done | User chose E (None) |
| 2c — Create Epic | Done | AZ-587 |
| 2d — Task Decomposition | Done | AZ-588, `_docs/tasks/todo/AZ-588_refactor_remove_empty_scaffolding_dirs.md` |
| 3 — Safety Net | Cancelled | Quick-assessment scope |
| 4 — Execution | Cancelled | Quick-assessment scope |
| 5 — Test Sync | Cancelled | Quick-assessment scope |
| 6 — Verification | Cancelled | Quick-assessment scope |
| 7 — Documentation | Cancelled | Quick-assessment scope |
## Baseline vs Final Metrics
Quick-assessment runs do not produce post-change metrics — Phase 6 (Verification) is the comparison step, and it is cancelled by definition. The baseline captured in `baseline_metrics.md` carries forward as the reference point for the next refactor run or for the implement skill when AZ-588 is picked up.
## Changes Summary
| ID | Status | Tracker | Description |
|----|--------|---------|-------------|
| C01 | Selected, decomposed, queued for `/implement` | AZ-588 | Remove `Entities/` and `DTOs/Requests/` |
## Remaining Items
Recorded for visibility in `list-of-changes.md` ("Out of Scope") — none of these are refactor work:
| Item | Where it belongs |
|------|------------------|
| Add `docker-cli` to e2e-consumer image (would unlock the 30 environment-skipped tests) | Phase B `New Task` (test-infrastructure improvement, not a refactor) |
| Reconcile AC-1.4 carry-forward (NFT-RES-08) | Phase B `New Task` (product/spec decision) |
| Reconcile AC-4.6 carry-forward (NFT-RES-02) | Phase B `New Task` (product/spec decision) |
| Test/source compilation separation (`Compile Remove="tests/**"`) | Already landed in the prior `/test-run` cycle |
## Lessons Learned
- The architecture-baseline scan was 2 days old at the start of this refactor. By the time the run began, 3 of the 4 findings had already been resolved through other workflows (rename PRs and doc retags). For small projects on rapid cycles, a refactor pass should always re-validate baseline-scan findings against the current tree before committing to a full 8-phase workflow.
- The skill's `Phase 1 → Skip condition (Targeted mode)` clause covers the case where docs already exist; quick-assessment + automatic mode benefits from the same skip when the only finding is structural cleanup with zero new code paths. Followed it pragmatically here; could be promoted to an explicit "structural-cleanup mode" in a future skill revision if this pattern recurs.
@@ -0,0 +1,61 @@
# Refactoring Roadmap — `02-baseline-cleanup`
**Date**: 2026-05-16
**Mode**: automatic (quick-assessment, phases 02 only)
**Hardening tracks selected**: E (None) — explicit user choice
## Weak Points Assessment
| Location | Description | Impact | Proposed Solution |
|----------|-------------|--------|-------------------|
| `Entities/` (empty dir at repo root) | Placeholder from pre-rename layout that was never used. Suggests an alternate entity tree that doesn't exist | Documentation drift; misleading to new readers | Remove the directory |
| `DTOs/Requests/` (empty dir at repo root) | Placeholder from pre-rename layout that was never used. Suggests a "Requests" sub-grouping that doesn't exist; actual request DTOs live directly under `DTOs/*.cs` | Documentation drift; misleading to new readers | Remove the directory |
## Gap Analysis
| Acceptance criterion | Current state | Gap | Closed by this run? |
|----------------------|---------------|-----|---------------------|
| All AC and NFR coverage as of `implementation_report_tests.md` (56/56 ACs traced; 48/0/30 test outcome) | Met | None | N/A — already met before this run |
| Architecture Vision § "layer-organized at repo root, ownership by file-path glob" | Mostly met; two placeholder directories carry no owner | Two empty directories don't fit any glob in `module-layout.md` | Yes |
| Architecture-compliance baseline § F1, F2 (High Architecture) | Resolved 2026-05-14 by doc retag | None | N/A — already resolved |
| Architecture-compliance baseline § F3 (Low Maintainability — dead `using`) | Resolved by rename | None | N/A — already resolved |
| Architecture-compliance baseline § F4 (Low Maintainability — empty dirs) | Partial: `Infrastructure/` is now used; `Entities/` and `DTOs/Requests/` remain empty | 2 of 3 dirs still empty | Yes — by C01 |
## Phased Plan
### Phase 1 — Quick Wins (this run, single ticket)
| ID | Item | Constraint Fit | Status |
|----|------|----------------|--------|
| C01 | Remove `Entities/` and `DTOs/Requests/` from the repo | Strengthens Architecture Vision; no AC/restriction touched (verified by full reference scan) | **Selected** |
### Phase 2 — Major Improvements
None for this run. The baseline is small (37 files / 1,306 LOC), all tests green, no coupling/cycles/duplication detected.
### Phase 3 — Enhancements
None for this run. Items recorded as out-of-scope in `list-of-changes.md` ("Out of Scope (Recorded for Visibility)") are tracked for the Phase B feature cycle, not for this refactor pass:
- Add `docker-cli` to e2e-consumer image (would activate the 30 environment-skipped tests).
- Reconcile AC-1.4 carry-forward (NFT-RES-08).
- Reconcile AC-4.6 carry-forward (NFT-RES-02).
## Selected Hardening Tracks
**E — None.** User explicitly chose option E in the Phase 1 + 2b combined gate.
## Applicability Gate
| Item | Constraint fit | Mismatches | Required evidence | Status |
|------|----------------|------------|-------------------|--------|
| C01 | Strengthens Architecture Vision; pure `git rm -r`; zero `.cs` content | None | Reference scan complete (zero matches outside `_docs/`); test suite green pre-change | **Selected** |
All items are `Selected`. No `Rejected`, no `Experimental only`, no `Needs user decision`. The applicability gate passes.
## Tracker Plan
- **Epic**: AZ-XXX — `02-baseline-cleanup` (refactor run for residual baseline F4 cleanup)
- **Task** (1): AZ-XXX — `refactor_remove_empty_scaffolding_dirs` (Task, 1 SP, no dependencies)
Tracker IDs assigned during Phase 2c/2d execution.
@@ -0,0 +1,52 @@
# Research Findings — `02-baseline-cleanup`
**Date**: 2026-05-16
**Mode**: automatic (quick-assessment)
**Scope**: residual baseline-scan F4 partial — two empty scaffolding directories at the repo root
## Project Constraint Matrix
Extracted from `_docs/00_problem/problem.md`, `_docs/02_document/architecture.md` (incl. `## Architecture Vision`), `_docs/02_document/module-layout.md`, and the .NET 10 / Sdk.Web build constraints.
| Constraint | Source | Impact on this run |
|------------|--------|--------------------|
| Source layout is layer-organized at repo root (no `src/`); component ownership is by file-path glob per `module-layout.md` | `architecture.md` § Architecture Vision | Removing two empty directories aligns layout with this principle (no component owns them) |
| `Sdk.Web` recursive `**/*.cs` glob picks up everything not under `bin/`, `obj/`, or `tests/` (the latter excluded by `Compile Remove="tests/**"` in csproj) | `Azaion.Missions.csproj` | Empty directories contribute zero `.cs` files; removal is a pure no-op for the compile graph |
| Test suite must pass after any structural change | `_docs/02_document/tests/environment.md`, autodev existing-code Step 7 gate | Verified pre-change baseline (48 pass / 0 fail / 30 env-skip on 2026-05-15 14:03); will re-run post-change |
| Functional contracts (HTTP, DB schema, JWT) are preserved | `_docs/02_document/architecture.md` § 7, FT-P-* and NFT-SEC-* tests | No contract is touched; pure on-disk cleanup |
## Current State Analysis
The codebase has already converged on its target layout following the May 14 missions/vehicles rename:
- Entities live under `Database/Entities/*.cs` (6 files: Vehicle, Mission, Waypoint, MapObject, Annotation, Detection, Media).
- Request DTOs live directly under `DTOs/*.cs` (Create/Update/Get… per resource).
- Cross-cutting infrastructure lives under `Infrastructure/` (now populated with `ConfigurationResolver.cs` and `CorsConfigurationValidator.cs`).
- Auth, middleware, controllers, services follow established `Auth/`, `Middleware/`, `Controllers/`, `Services/` directories.
**Strengths**: small (37 files / 1,306 LOC / avg 35 LOC per file), no cycles, no cross-component public-API bypass, all tests green, baseline scan was PASS_WITH_WARNINGS.
**Weaknesses (this run's scope only)**: two empty placeholder directories (`Entities/`, `DTOs/Requests/`) survived the rename and now masquerade as alternate trees that don't exist. Misleading for new readers.
## Alternative Approaches Considered
No library / framework / SDK / service replacement is being proposed.
**Per-mode API capability verification (`context7` / MVE) is therefore N/A** — the SKILL.md and Phase 2a both gate that requirement on "replaces (or adds) a library/SDK/framework/service". Pure directory removal does not.
| Option | Pros | Cons | Verdict |
|--------|------|------|---------|
| Remove the directories outright (`git rm -r`) | Simplest; aligns with Architecture Vision; zero risk (no `.cs` content) | None for the actual files | **Selected** |
| Repurpose the directories with `.gitkeep` + a `README.md` explaining intent | Preserves the placeholder for future use | Speculative — no documented intent to use either path; the existing layout works | Rejected — speculative scaffolding violates "don't keep dead code" |
| Move existing `Database/Entities/*` up to `Entities/` and reorganize | Could collapse two trees into one | Touches every entity file, every `using` directive, every test reference; risks the green test suite for cosmetic gain; contradicts the Architecture Vision principle that persistence owns its own subtree | Rejected — out of scope for a quick-assessment cleanup; would weaken constraint fit |
## Constraint-Fit Table
| Recommendation | Pinned mode/config | Constraints checked | API capability evidence (MVE) | Evidence | Mismatches/disqualifiers | Status |
|----------------|--------------------|---------------------|-------------------------------|----------|--------------------------|--------|
| C01 — Delete `Entities/` and `DTOs/Requests/` | N/A (no library; pure `git rm -r`) | Architecture Vision § layer-organized at repo root; csproj Sdk.Web glob; full test suite gate | N/A — no library; no MVE required per SKILL.md gate | `architecture_compliance_baseline.md` F4; `logical_flow_analysis.md` (zero references); `report.csv` 48/0/30 baseline | None | **Selected** |
## References
- `_docs/02_document/architecture_compliance_baseline.md` — F4 source.
- `_docs/04_refactoring/02-baseline-cleanup/discovery/logical_flow_analysis.md` — flow-by-flow impact verification.
- `_docs/02_document/architecture.md` § Architecture Vision — confirmed structural intent.
- `_docs/03_implementation/implementation_report_tests.md` — baseline test outcomes (48 pass / 0 fail / 30 skip).
@@ -0,0 +1,111 @@
# Baseline Metrics — `02-baseline-cleanup`
**Date**: 2026-05-16
**Mode**: automatic
**Scope**: missions service production code (post-rename `Azaion.Missions.*`, net10.0)
**Inputs**: `architecture_compliance_baseline.md` (2026-05-14 PASS_WITH_WARNINGS) + `implementation_report_tests.md` (Step 6 outcomes) + Step 7 test results (`test-results/report.csv`)
## Goals
Address the residual Maintainability findings the architecture-baseline scan surfaced, now that the missions/vehicles rename and the test cycle have landed.
| Source | Original finding | Status today |
|--------|------------------|--------------|
| F1 (High Architecture) | `Database/Entities/Aircraft.cs` imports feature-component enums | **Resolved 2026-05-14** by doc retag — enums re-owned by `04_persistence` |
| F2 (High Architecture) | `Database/Entities/Waypoint.cs` imports feature-component enums | **Resolved 2026-05-14** by same doc retag |
| F3 (Low Maintainability) | Dead `using Azaion.Flights.Enums;` in `Database/Entities/Flight.cs` | **Resolved by rename**`Mission.cs` has no such using; verified |
| F4 (Low Maintainability) | Three empty scaffolding dirs at repo root | **Partial**: `Infrastructure/` is now populated (2 files); `Entities/` and `DTOs/Requests/` remain empty |
**Net actionable scope for this run**: 2 empty directories (`Entities/`, `DTOs/Requests/`).
## Coverage
| Suite | Tests | Pass | Fail | Skip | Source |
|-------|-------|------|------|------|--------|
| E2E (functional + NFT) | 78 | 48 | 0 | 30 | `test-results/report.csv` (2026-05-15 14:03 UTC) |
| Unit | 0 | | | | No unit-test project today (`scripts/run-tests.sh --unit-only` is a no-op) |
All 30 skips are environment-mismatch (`COMPOSE_RESTART_ENABLED!=1` and/or `MissionsContainerHelper.Enabled=false` — the e2e-consumer image deliberately lacks docker-CLI primitives). Each carries an explicit `Skip` reason. AC trace coverage (per implementation report): 56/56 ACs traced.
Line coverage / branch coverage: not measured. The project does not configure `coverlet` or any other coverage collector. **N/A — out of scope for this run.**
## Complexity
| Metric | Value |
|--------|-------|
| Production `.cs` files (excl. `bin/`, `obj/`, `tests/`, `_docs/`) | 37 |
| Production LOC (incl. blank lines & comments) | 1,306 |
| Avg LOC per production file | 35.3 |
| Largest 5 files (LOC) | `Services/VehicleService.cs` 134 · `Program.cs` 120 · `Database/DatabaseMigrator.cs` 119 · `Auth/JwtExtensions.cs` 112 · `Services/MissionService.cs` 107 |
| Test LOC (excl. `bin/`, `obj/`) | 6,511 |
Cyclomatic complexity: not measured. No Roslyn analyzer (`dotnet format analyzers`, `Roslynator`, `SonarAnalyzer.CSharp`) is configured. **N/A — measurement infrastructure absent; out of scope.**
Note on size: 1,306 LOC across 37 files (avg 35 LOC/file, max 134) is well within the simplicity envelope this codebase aims for. There are no hot files calling out for decomposition.
## Code Smells
From `architecture_compliance_baseline.md` only (no static analyzer configured):
| Severity | Count | Open today |
|----------|-------|------------|
| Critical | 0 | 0 |
| High (Architecture) | 2 (F1, F2) | 0 — resolved 2026-05-14 |
| Low (Maintainability) | 2 (F3, F4) | 1 partial (F4: 2 of 3 empty dirs remain); F3 resolved by rename |
## Performance
Per `test-results/report.csv` 2026-05-15 14:03, the 4 NFT-PERF tests (`PerformanceTests.NFT_PERF_01..04`) all passed against thresholds defined in `_docs/02_document/tests/performance-tests.md`. Per-scenario p50/p95/p99 captured by the test harness.
This refactor run does not target performance — **N/A as a baseline-vs-final gate.**
## Dependencies
`Azaion.Missions.csproj` (Sdk.Web, net10.0):
| Package | Version |
|---------|---------|
| linq2db | 6.2.0 |
| Microsoft.AspNetCore.Authentication.JwtBearer | 10.0.5 |
| Npgsql | 10.0.2 |
| Swashbuckle.AspNetCore | 10.1.5 |
Outdated / vulnerable: not measured (would require `dotnet list package --outdated --vulnerable` against a configured NuGet source). Out of scope for this run.
## Build
| Metric | Value | Source |
|--------|-------|--------|
| Test suite wall-clock (last successful run) | ~ minutes (Docker compose up + 78 tests) | `test-results/results.trx` mtime 2026-05-15 14:03 |
| Docker build (cold, prior failed run) | ~42 min ended in CS0246 | terminal log `451778.txt` |
| Docker build (after csproj `Compile Remove="tests/**"` fix) | known-good per prior session | implicit from the green `report.csv` |
## Functionality Inventory
Components and ownership (from `_docs/02_document/module-layout.md` § Per-Component Mapping, post-rename):
| # | Component | Owns | Routes | Tests |
|---|-----------|------|--------|-------|
| 01 | vehicle_catalog | `DTOs/*Vehicle*`, `Database/Entities/Vehicle.cs`, `Enums/{VehicleType,FuelType}.cs`, `Controllers/VehiclesController.cs`, `Services/VehicleService.cs` | `/vehicles`, `/vehicles/{id}/default` | FT-P-01..06, FT-N-01..04, NFT-RES-08 |
| 02 | mission_planning | `DTOs/*Mission*`, `Database/Entities/Mission.cs`, `Controllers/MissionsController.cs`, `Services/MissionService.cs` | `/missions` | FT-P-07..12, FT-N-05..06, NFT-RES-01 |
| 04 | persistence | `Database/{AppDataConnection,DatabaseMigrator}.cs`, all `Database/Entities/*.cs` (excl. domain), `Enums/{ObjectStatus,WaypointSource,WaypointObjective}.cs` | | NFT-RES-03..04 |
| 05 | authentication | `Auth/JwtExtensions.cs`, JWT-bearer config in `Program.cs` | | NFT-SEC-* (14 ACs) |
| 06 | infrastructure | `Infrastructure/{ConfigurationResolver,CorsConfigurationValidator}.cs`, `Middleware/ErrorHandlingMiddleware.cs`, `Program.cs` composition | `/health`, `/swagger` | FT-P-13..18, NFT-SEC-13 (CORS), NFT-RES-05..07 |
Empty scaffolding directories (no component owns them): `Entities/`, `DTOs/Requests/`.
## Self-verification
- [x] RUN_DIR created with correct auto-incremented prefix (`02-baseline-cleanup`)
- [x] Coverage measured (E2E only; unit + line coverage marked N/A with reason)
- [x] Complexity measured (file count, LOC, top-5; cyclomatic marked N/A with reason)
- [x] Code smells measured (from baseline scan; static analyzer N/A)
- [x] Performance noted (perf tests green; not a baseline-vs-final gate)
- [x] Dependencies enumerated (outdated/vulnerable scan N/A)
- [x] Build noted (test wall-clock + Docker build status)
- [x] Functionality inventory complete (6 components + 2 empty dirs)
- [x] Measurements reproducible (commands inline in this file or sourced from named artifacts)
## Scope warning for the user (BLOCKING)
The actionable surface is **two empty directories**. Everything else the original baseline scan flagged is already resolved (F1/F2 by doc retag, F3 by rename, F4 partial). Running the full 8-phase refactor for this is heavyweight; quick-assessment (phases 02 only) is plausible. See the BLOCKING choice block presented to the user.
@@ -0,0 +1,48 @@
# Logical Flow Analysis — `02-baseline-cleanup`
**Date**: 2026-05-16
**Mode**: automatic (quick-assessment)
**Scope**: residual baseline-scan findings (F4 partial: empty scaffolding directories)
## Inputs Reviewed
| Source | Notes |
|--------|-------|
| `_docs/02_document/system-flows.md` | 273 lines — all documented flows verified against current code by the test suite (78 E2E tests, 48 pass / 30 env-skip / 0 fail) |
| `_docs/02_document/architecture.md` (incl. `## Architecture Vision`) | 369 lines — Vision section is user-confirmed; layering rules apply |
| `_docs/02_document/module-layout.md` | Per-component file ownership, post-rename |
| `_docs/02_document/glossary.md` | Confirmed terminology |
| `_docs/02_document/architecture_compliance_baseline.md` | Source of F1F4 |
| `_docs/03_implementation/implementation_report_tests.md` | Step 6 outcomes + 4 carry-forward tags |
## Components Documentation Reuse Note
Phase 1 sub-steps **1a (Document Components)** and **1b (Synthesize Solution & Flows)** are intentionally skipped for this run. The `/document` skill produced complete, current per-component documentation in `_docs/02_document/components/` and the synthesis files (`solution.md`, `system-flows.md`) on 2026-05-14. Re-generating them for a structural cleanup with no new code paths would produce identical output and burn the user's context budget. The user-confirmed quick-assessment choice (B) authorizes this skip.
## Flow-by-Flow Scan
For each system flow documented in `system-flows.md`, the question asked is: **does removing `Entities/` (empty) or `DTOs/Requests/` (empty) silently affect this flow?**
| Flow | Touches `Entities/` ? | Touches `DTOs/Requests/` ? | Verdict |
|------|----------------------|----------------------------|---------|
| Vehicle CRUD (FT-P-01..06) | No — uses `DTOs/CreateVehicleRequest.cs`, `DTOs/UpdateVehicleRequest.cs`, `Database/Entities/Vehicle.cs` | No | Unaffected |
| Mission CRUD (FT-P-07..12) | No — uses `DTOs/CreateMissionRequest.cs`, `DTOs/UpdateMissionRequest.cs`, `Database/Entities/Mission.cs` | No | Unaffected |
| Waypoint CRUD (FT-P-13..18) | No — uses `DTOs/CreateWaypointRequest.cs`, `DTOs/UpdateWaypointRequest.cs`, `Database/Entities/Waypoint.cs` | No | Unaffected |
| `/health` + startup composition | No — `Program.cs` + `Infrastructure/*` | No | Unaffected |
| JWT auth (NFT-SEC-01..14) | No — `Auth/JwtExtensions.cs` + `Program.cs` | No | Unaffected |
| Cascade deletes (NFT-RES-01..02) | No — `Database/Entities/*` (all under `Database/Entities/`, not the empty `Entities/`) | No | Unaffected |
| Migrator (NFT-RES-03..04) | No — `Database/DatabaseMigrator.cs` | No | Unaffected |
**Reference scan**: searched the entire workspace (excluding `_docs/`) for any path-based reference to `Entities/` or `DTOs/Requests/`. Zero matches.
## Findings
| # | Type | Severity | Location | Notes |
|---|------|----------|----------|-------|
| L01 | Documentation drift | Low | `Entities/`, `DTOs/Requests/` | Two empty directories at the repo root. Originally created as scaffolding placeholders before the actual layout solidified under `Database/Entities/` and `DTOs/`. Carry no source today, no path-based references anywhere. Misleading for new readers (suggests two parallel persistence/DTO trees that don't exist). |
No logic bugs, no performance waste, no design contradictions, no silent data loss were discovered for this scope.
## Architecture Vision compatibility
`architecture.md` § Architecture Vision specifies the persistence component owns `Database/Entities/*` and the request DTO surface lives directly under `DTOs/`. The two empty directories are not part of the Vision — removing them strengthens, not weakens, alignment with the user-confirmed structural intent. No `Architecture Vision` principle is contradicted.
@@ -0,0 +1,37 @@
# List of Changes
**Run**: 02-baseline-cleanup
**Mode**: automatic (quick-assessment)
**Source**: self-discovered (architecture_compliance_baseline.md F4)
**Date**: 2026-05-16
## Summary
Remove the two residual empty scaffolding directories at the repo root that the 2026-05-14 architecture-baseline scan flagged under F4. Originally placeholders for an early layout that solidified elsewhere (`Database/Entities/`, `DTOs/`). They carry no source files and no path-based references in the codebase.
## Changes
### C01: Delete unused scaffolding directories `Entities/` and `DTOs/Requests/`
- **File(s)**: `Entities/` (directory, 0 files), `DTOs/Requests/` (directory, 0 files)
- **Problem**: Both directories exist under the repo root but contain no source. They were created as scaffolding placeholders before the actual layout settled under `Database/Entities/*` (entities) and `DTOs/*.cs` (request shapes). They are misleading to new readers (suggesting two parallel persistence/DTO trees that don't exist) and create noise in the post-rename architecture-compliance baseline (F4).
- **Change**: Remove both directories from the repository (`git rm -r Entities/ DTOs/Requests/`). Verify the repo builds (`dotnet build`) and the test suite still passes (`scripts/run-tests.sh`).
- **Rationale**: Dead-folder removal aligns the on-disk layout with the user-confirmed Architecture Vision (`architecture.md` § Architecture Vision: persistence owns `Database/Entities/*`; request DTOs live directly under `DTOs/`). Closes the only remaining open item from the architecture-baseline scan.
- **Constraint Fit**:
- `architecture.md` § Architecture Vision — strengthens, does not violate.
- `acceptance_criteria.md` — no functional or NFR criterion references either path; verified by full-suite reference scan (zero matches outside `_docs/`).
- `restrictions.md` — N/A; restrictions cover behavior, not directory layout.
- `module-layout.md` — neither directory is owned by any component (verified).
- **Risk**: low — directories are empty; no path-based reference outside `_docs/`; the .NET SDK glob picks up `*.cs` recursively but neither directory contains any.
- **Dependencies**: None.
## Out of Scope (Recorded for Visibility)
These were considered but explicitly excluded from this run; they belong in the Phase B feature cycle, not in a refactor pass:
| Item | Source | Reason for exclusion |
|------|--------|----------------------|
| Add `docker-cli` to e2e-consumer image (would activate 30 skipped tests) | `implementation_report_tests.md` follow-up #1 | Infrastructure addition (test image), not a code refactor; better as a New Task in Phase B |
| Reconcile AC-1.4 carry-forward (NFT-RES-08) | `implementation_report_tests.md` follow-up #3 | Product/spec decision required, not a code refactor |
| Reconcile AC-4.6 carry-forward (NFT-RES-02) | `implementation_report_tests.md` follow-up #4 | Product/spec decision required, not a code refactor |
| Test/source compilation separation (`Compile Remove="tests/**"`) | `implementation_report_tests.md` follow-up #2 | Already addressed (csproj fix landed in the prior /test-run cycle) |
+6 -6
View File
@@ -2,16 +2,16 @@
## Current Step
flow: existing-code
step: 7
name: Run Tests
status: not_started
step: 9
name: New Task
status: in_progress
sub_step:
phase: 0
name: awaiting-invocation
phase: 1
name: gather-feature-description
detail: ""
retry_count: 0
cycle: 1
tracker: jira
## Last Updated
2026-05-15
2026-05-16
+22
View File
@@ -69,3 +69,25 @@ Recommended dependency-aware batches for `/implement`:
2. **Batch 2 (parallel, fan-out from AZ-576)**: AZ-577..AZ-586 in any order. Independent test classes within a single xUnit assembly; no inter-task ordering needed.
CSV report sorting at suite end: by `Category` (Blackbox / Sec / Res / ResLim / Perf), then by test ID within category.
---
## Refactor: `02-baseline-cleanup` (2026-05-16)
**Run**: `_docs/04_refactoring/02-baseline-cleanup/` (quick-assessment, phases 02)
**Epic**: AZ-587 — Refactor 02-baseline-cleanup: remove residual empty scaffolding dirs
**Total Tasks**: 1
**Total Complexity Points**: 1
| Task | Name | Complexity | Dependencies | Epic |
|------|------|-----------|-------------|------|
| AZ-588 | refactor_remove_empty_scaffolding_dirs | 1 | None | AZ-587 |
### Cross-Task Consistency Checks
| Check | Result |
|-------|--------|
| Every change in `02-baseline-cleanup/list-of-changes.md` has a corresponding task | PASS — C01 → AZ-588 |
| No task exceeds 5 complexity points | PASS |
| No circular dependencies | PASS — single task, no dependencies |
| All tasks linked to the run's epic | PASS — AZ-588 → AZ-587 |
@@ -0,0 +1,77 @@
# Refactor 02-baseline-cleanup C01 — Remove empty scaffolding dirs
**Task**: AZ-588_refactor_remove_empty_scaffolding_dirs
**Name**: Remove empty scaffolding dirs `Entities/` and `DTOs/Requests/`
**Description**: Delete the two empty placeholder directories at the repo root that survived the May 14 missions/vehicles rename. Closes the only remaining open item from the architecture-compliance baseline scan (F4 partial).
**Complexity**: 1 point
**Dependencies**: None
**Component**: refactor — `02-baseline-cleanup`
**Tracker**: [AZ-588](https://denyspopov.atlassian.net/browse/AZ-588)
**Epic**: [AZ-587](https://denyspopov.atlassian.net/browse/AZ-587)
## Problem
Two empty scaffolding directories at the repo root survive from the pre-rename layout. Neither is owned by any component per `_docs/02_document/module-layout.md`. They suggest alternate persistence/DTO trees that don't exist.
- `Database/Entities/*.cs` is the actual entity location.
- `DTOs/*.cs` (flat, no `Requests/` sub-grouping) is the actual request DTO location.
Recorded as F4 (Low Maintainability, partial) in `_docs/02_document/architecture_compliance_baseline.md`. The third originally-empty dir (`Infrastructure/`) is now legitimately used.
## Outcome
- `Entities/` no longer present in the repository.
- `DTOs/Requests/` no longer present in the repository.
- `dotnet build` still succeeds.
- `scripts/run-tests.sh` returns the same baseline (48 pass / 0 fail / 30 env-skip).
## Scope
### Included
- `git rm -r Entities/`
- `git rm -r DTOs/Requests/`
- Verify build + test suite.
### Excluded
- Any reorganization of existing entities or DTOs.
- Any change to `Infrastructure/` (now in use).
- Any rename / namespace change.
## Acceptance Criteria
**AC-1: Directories removed**
Given the repository at HEAD
When `git ls-tree -r HEAD -- Entities/ DTOs/Requests/` is run
Then the output is empty.
**AC-2: Build still passes**
Given the repository after the change
When `dotnet build` is run from the repo root
Then it exits 0.
**AC-3: Test suite still green**
Given the repository after the change
When `scripts/run-tests.sh` is run
Then `test-results/report.csv` shows 48 pass / 0 fail / 30 skip (same skips, no new failures).
## Non-Functional Requirements
None — this is a structural cleanup with no behavior change.
## Blackbox Tests
| AC Ref | Initial Data/Conditions | What to Test | Expected Behavior | NFR References |
|--------|-------------------------|--------------|-------------------|----------------|
| AC-3 | Repo state after `git rm -r Entities/ DTOs/Requests/` | Full E2E suite via `scripts/run-tests.sh` | Same outcome as the 2026-05-15 14:03 baseline (48/0/30) | none |
## Constraints
- Architecture Vision (`_docs/02_document/architecture.md`) — strengthens, does not violate.
- No `.cs` content moves; pure directory removal.
- Reference scan confirmed zero path-based references outside `_docs/` (see `_docs/04_refactoring/02-baseline-cleanup/discovery/logical_flow_analysis.md`).
## Risks & Mitigation
**Risk 1: Hidden reference**
- *Risk*: A path-based reference exists somewhere not caught by the initial grep (e.g., a CI script, an editor config, an IDE workspace file).
- *Mitigation*: Pre-execution `rg -F 'Entities/' -F 'DTOs/Requests/'` repo-wide. Post-execution `dotnet build` + `scripts/run-tests.sh` are the regression nets.