Files
git.stella-ops.org/docs/implplan-blocked/audits/csproj-standards/remediation-plan.md

2.5 KiB

CSProj Remediation Plan

Goals

  • Apply safe, deterministic fixes first, then expand to reviewed automation and manual refactors.
  • Maintain offline posture and preserve build/test determinism.
  • Use staged scope expansion (file -> project -> module -> repo) with validation gates.

Tier Mapping

Tier 0 (safe automation)

  • UsingNotSorted: sort using directives alphabetically (global using first, then using).
  • UsingInsideNamespace: move using directives to top-level only when a single namespace is present.
  • Using directives inside conditional preprocessor blocks are skipped for manual review.

Tier 1 (reviewed automation)

  • NamespaceNotFileScoped: convert to file-scoped only with single-namespace files and a validated transform plan.
  • PrivateFieldNaming: symbol-aware rename to _camelCase.
  • ConstNaming: symbol-aware rename to PascalCase.
  • AsyncNaming: symbol-aware rename to *Async suffix.
  • ConfigureAwaitMissing: add ConfigureAwait(false) for library-like projects only, with review.

Tier 2 (manual remediation)

  • FileLength>100: refactor/split files.
  • NamespaceMissing: determine correct StellaOps namespace and add.
  • NamespaceNotStellaOps: update namespace with module/domain decision.
  • BlockingAsync: remove .Result/.Wait/GetAwaiter().GetResult() usage.
  • ServiceLocator: replace with constructor injection/composition root.
  • AssemblyLoadFrom: replace with approved plugin loader paths.
  • Test gaps: add missing layers per TEST_COVERAGE_MATRIX.md.

Guardrails

  • No new dependencies unless BUSL-compatible and license-gated.
  • Deterministic, offline tooling only.
  • AST or symbol-aware edits for renames; avoid regex-only renames.
  • Each change must log: file path, action, outcome, and before/after issue counts.

Scope Ramp Gates

  • Stage 0 (single file): project builds; re-audit shows zero new issues and at least one issue reduced.
  • Stage 1 (5-10 files in same project): project builds; re-audit deltas positive; no new issue categories introduced.
  • Stage 2 (single project): build + existing project tests (if any) pass; re-audit deltas positive.
  • Stage 3 (module-wide): module build/tests pass; re-audit deltas positive.
  • Stage 4 (repo-wide): only after Stage 3 is stable; full re-audit required.

Logging Schema

  • CSV log under docs/implplan/audits/csproj-standards/remediation/:
    • timestamp_utc, scope, file_path, project_path, issues_before, actions, status, notes
  • Markdown summary per run with:
    • scope, files touched, issue deltas, skipped reasons, validation results