Skip to content

Audit Tier B third pass: PublishedCake and PlacedOrder, no role-word type suffixes - #11

Merged
erikshafer merged 1 commit into
mainfrom
chore/critter-audit-tier-b-3
Sep 5, 2026
Merged

erikshafer merged 1 commit into
mainfrom
chore/critter-audit-tier-b-3

Conversation

@erikshafer

Copy link
Copy Markdown
Owner

Summary

B2 from docs/critter-stack-audit.md. A rename only: JSON shape, routes, and the contract are untouched, and the contract suite never names these types. Remaining open items after this: B6, B7, B8, B10, B11 (all recommended as accepted divergences).

Changes

B2. HTTP response records are noun phrases. CakePublished is now PublishedCake and OrderPlaced is now PlacedOrder. Both were named like events while being neither events nor messages: the repo has no events at all (state-stored by design) and exactly one message, the command NotifyBaker. With the rename, (PlacedOrder, NotifyBaker) in PlaceOrderEndpoint.Post reads as response-plus-command at a glance, and past tense stays reserved for events.

Standing naming rule, now in CLAUDE.md. Never suffix a type with a role word such as Response, Request, Event, or Message when it can be avoided; name the type for what it is. The JasperFx sample style (TodoCreationResponse) was considered and declined for this repo.

Suffix scan of the solution. After twin clean except BakerTaskItem in GetBakerTasks.cs (flagged in the build log, not changed). The before twin's Command/Query/Dto/Request names are the Clean Architecture exhibit and stay by non-negotiable 1. The contract suite's private ...Item/...Envelope records are test-local deserialization shapes.

Bookkeeping. README code excerpt updated, build-log entry added, audit doc marks B2 done. Line counts unchanged (after twin 695 raw / 574 non-blank).

Verification

  • dotnet build: 0 warnings, 0 errors
  • dotnet test: contract suite 54 passed, unit tests 15 passed, 0 failed
  • grep for CakePublished / OrderPlaced outside history: none

…type suffixes

B2 from docs/critter-stack-audit.md. Rename only; JSON shape, routes, and
contract untouched.

- The two HTTP response records were named like events (CakePublished,
  OrderPlaced) while being neither events nor messages. The repo has no
  events (state-stored by design) and one message, the command NotifyBaker.
  Renamed to noun phrases, PublishedCake and PlacedOrder, so
  (PlacedOrder, NotifyBaker) reads as response-plus-command at a glance.
- Standing rule added to CLAUDE.md: never suffix a type with a role word
  such as Response, Request, Event, or Message when it can be avoided; name
  the type for what it is. The JasperFx sample style (TodoCreationResponse)
  was considered and declined.
- README code excerpt and build log updated. Suffix scan: after twin clean
  except BakerTaskItem (flagged, not changed); before twin's Command/Query/
  Dto/Request names are the Clean Architecture exhibit and stay.

Build 0 warnings. Contract suite 54/54, unit tests 15/15. Line counts
unchanged (after twin 695 raw / 574 non-blank).
@erikshafer erikshafer self-assigned this Sep 5, 2026
@erikshafer
erikshafer merged commit 9a1ed58 into main Sep 5, 2026
1 check passed
@erikshafer
erikshafer deleted the chore/critter-audit-tier-b-3 branch September 5, 2026 23:06
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