Skip to content

TWPA0004: universal #region Purpose enforcement; convention-analyzers wired repo-wide#269

Merged
StevenTCramer merged 2 commits into
masterfrom
dev
Jul 2, 2026
Merged

TWPA0004: universal #region Purpose enforcement; convention-analyzers wired repo-wide#269
StevenTCramer merged 2 commits into
masterfrom
dev

Conversation

@StevenTCramer

Copy link
Copy Markdown
Contributor

Summary

Completes kanban 084 (absorbs 082): the agent-context-regions convention gets its 080-style enforcement backstop.

The rule (maintainer-decided: universal, no triviality heuristic)

  • TWPA0004 — every compiled, non-generated .cs file requires #region Purpose. Trivial files satisfy it with one honest line instead of an exemption, so the analyzer needs no threshold to tune. #region Design is deliberately not enforced (judgment, governed by AGENTS.md).
  • Trivia-only files (fully commented out, #if false) have no first token and are structurally exempt.

Architecture

  • Assembly renamed timewarp-architecture-contract-analyzerstimewarp-architecture-convention-analyzers (hosts contract rules TWPA0002/0003 + repo-wide convention rules).
  • Wired once in source/Directory.Build.props (self-excluded, IsAspireProjectResource="false"), replacing the per-csproj reference — every source project is enforced, and generated apps inherit all three rules from the template. This absorbs task 082's scope.

Backfill + finds

  • Coverage 304/304: 51 formulaic files scripted, 88 small files via agent fan-out (dead-code reference files now say why they're kept).
  • The broadened TWPA0003 caught a real violation outside web-contracts: sample-options.cs = string.Empty with a NotEmpty() options validator → = null! (the options-validation teaching sample, copied by generated apps).
  • Analyzer defect found via the test framework's hidden suppression pass: reporting at TextSpan(0,0) made the diagnostic unsuppressable by a leading #pragma. Fixed by anchoring on the file's first token.

Verification

  • dev build green (0 warnings / 0 errors), analyzer tests 21/21 (5 new), sourcegen 14/14, web-server integration 11 passed.
  • Skill (agent-context-regions) updated to the universal rule in timewarp-flow and synced.

🤖 Generated with Claude Code

StevenTCramer and others added 2 commits July 2, 2026 16:47
…0004)

Maintainer design decision: universal rule, not a non-trivial heuristic —
trivial files get a one-line Purpose instead of an exemption, so the analyzer
is exact (no threshold, no misclassification, no suppression management).
Includes assembly rename to convention-analyzers + single Directory.Build.props
wiring, which absorbs 082 and flows enforcement into generated apps.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…analyzers wired repo-wide

Rule is universal by design (maintainer): every compiled, non-generated .cs
file requires #region Purpose — trivial files get a one-line region instead of
an exemption, so the analyzer needs no triviality heuristic. #region Design is
deliberately not enforced (judgment, governed by AGENTS.md).

- Assembly renamed timewarp-architecture-contract-analyzers ->
  timewarp-architecture-convention-analyzers; wired ONCE in
  source/Directory.Build.props (self-excluded, IsAspireProjectResource=false),
  replacing the per-csproj web-contracts reference. Absorbs task 082:
  TWPA0002/0003 now reach every source project — and generated apps inherit
  all three rules from the template.
- Backfill to 304/304 coverage: 51 formulaic files scripted (markers,
  global-usings), 88 small files via 8-agent fan-out (one-line Purpose;
  Design only where genuine).
- Broadened TWPA0003 caught a real one: sample-options.cs SampleOption
  = string.Empty with a NotEmpty() options validator -> = null!.
- Analyzer defect found by the test framework's suppression pass: reporting at
  TextSpan(0,0) made the diagnostic unsuppressable by a leading #pragma.
  Fixed: anchor on the file's first token; trivia-only files exempt.

Verified: dev build 0/0; analyzer tests 21/21; sourcegen 14/14; web-server
integration 11 passed. Skill updated (universal Purpose) in timewarp-flow
25e288b and synced. Tasks 084 done, 082 closed as absorbed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@StevenTCramer StevenTCramer merged commit 4edee21 into master Jul 2, 2026
1 check passed
@StevenTCramer StevenTCramer deleted the dev branch July 2, 2026 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant