4.8 KiB
4.8 KiB
CBDDC Fix Plan
Goal
Address all remaining issues identified in the architecture/quality audit after EntityFramework removal and persistence merge.
Current State
- All GitHub workflows/pipelines have been removed from this repository.
- Build and tests pass locally on
CBDDC.slnx. - Remaining issues are architecture, warning debt, style drift, dependency deprecations, security hardening, and missing automated fitness gates.
Issue Inventory
- Core framework coupling (CA-02)
CorereferencesMicrosoft.Extensions.*and contains DI composition extension classes.
- Static analysis and warning debt (BP-05)
- Nullable warnings in persistence (
CS8618,CS8604). NU1510warning in network (System.Threading.Channels).
- Nullable warnings in persistence (
- Formatting drift (BP-06)
dotnet format --verify-no-changesfails with widespread whitespace issues (mostly test files).
- Dependency deprecations (BP-07)
- Deprecated
Microsoft.AspNetCore.Http.Abstractions2.2.0. - Legacy
xunit2.9.3in test projects.
- Deprecated
- Security baseline gaps (BP-08)
- Insecure default auth token in default node config.
JwtOAuth2Validatoris explicitly demo/basic and does not perform signature/JWKS verification.
- No architecture fitness enforcement (BP-09)
- No architecture rule tests.
- No active pipeline to enforce build/test/format/package/security checks.
Execution Plan
Phase 1: Stabilize and Clean Baseline
- Fix nullable/event warnings in persistence:
- Make
ChangesAppliednullable or initialize safely. - Guard null snapshot values before constructing
OplogEntry.
- Make
- Resolve
NU1510:- Remove
System.Threading.Channelsif unused; otherwise document explicit need.
- Remove
- Apply formatting once repo-wide:
- Run
dotnet format CBDDC.slnx. - Commit mechanical formatting separately.
- Run
Exit criteria
dotnet build CBDDC.slnxhas zero warnings (or only documented, explicitly accepted warnings).dotnet format CBDDC.slnx --verify-no-changespasses.
Phase 2: Dependency and Package Modernization
- Replace deprecated AspNet package:
- Remove
Microsoft.AspNetCore.Http.Abstractions 2.2.0. - Use current ASP.NET shared framework-compatible references.
- Remove
- Upgrade tests from xUnit 2 to xUnit 3 (or pin with explicit temporary rationale).
- Re-run package audits:
dotnet package list --project CBDDC.slnx --deprecateddotnet package list --project CBDDC.slnx --include-transitive --vulnerable --format json
Exit criteria
- No unapproved deprecated packages.
- No known vulnerabilities.
Phase 3: Security Hardening
- Remove insecure token default behavior:
- Require explicit token provisioning for production paths.
- Keep development fallback only behind clear dev-only opt-in.
- Replace
JwtOAuth2Validatorwith production-grade validator:- Signature validation (JWKS retrieval/rotation).
- Issuer/audience/lifetime validation.
- Clock skew handling and structured failure reasons.
- Add unit and integration tests for auth failure/success paths.
Exit criteria
- Auth path rejects unsigned/invalid JWTs.
- No default cluster token in production defaults.
Phase 4: Architecture Boundary Cleanup
- Move DI composition out of
Coreinto outer adapters/host packages. - Keep
Corelimited to domain/application contracts and logic. - Validate no framework namespace leakage into
Core.
Exit criteria
Coreno longer references DI/logging framework packages except where explicitly approved.- Architecture tests enforce the boundary.
Phase 5: Fitness Functions and Automation Reintroduction
- Add architecture tests:
- Rule:
Coremust not depend onNetwork,Persistence,AspNet, or host frameworks. - Rule: layer graph must remain acyclic.
- Rule:
- Reintroduce a new minimal CI workflow (after review/approval):
dotnet restore,dotnet build,dotnet testdotnet format --verify-no-changes- package vulnerable/deprecated checks
- Add fail-fast quality gates on pull requests.
Exit criteria
- Every architecture/quality rule is automatically enforced on PRs.
Verification Commands
Run from /Users/dohertj2/Desktop/CBDDC:
dotnet restore CBDDC.slnx
dotnet build CBDDC.slnx
dotnet test CBDDC.slnx
dotnet format CBDDC.slnx --verify-no-changes
dotnet package list --project CBDDC.slnx --include-transitive --vulnerable --format json
dotnet package list --project CBDDC.slnx --deprecated
Suggested Order of Delivery
- Phase 1 (stability/style baseline)
- Phase 2 (dependencies)
- Phase 3 (security)
- Phase 4 (architecture cleanup)
- Phase 5 (fitness automation)
Notes for Review
- I split mechanical formatting from behavioral/security changes to keep diffs reviewable.
- Reintroducing CI is intentionally deferred to Phase 5 so it enforces the cleaned baseline, not current debt.