Skip to content

docs(review): split code-design from code-quality - #129

Merged
kyle-sexton merged 2 commits into
mainfrom
docs/review-code-design-split
Jul 16, 2026
Merged

docs(review): split code-design from code-quality#129
kyle-sexton merged 2 commits into
mainfrom
docs/review-code-design-split

Conversation

@kyle-sexton

Copy link
Copy Markdown
Contributor

Summary

Introduces the design-judgment review tier as its own slice, resolving the taxonomy question of where "code design" belongs relative to code-quality.

  • New conventions/review/code-design.md — cohesion, coupling, responsibility assignment, abstraction fit, substitutability, and pattern application. Sits between architecture.md (cross-unit structure/contracts) and code-quality.md (surface hygiene).
  • Relocated the design-judgment bullets out of code-quality.md (god class, missing abstractions, Law of Demeter / Hollywood, duplicated-structure/rule-of-three); code-quality.md now owns local design, shape, style, and authoring hygiene.
  • Added the Fowler design smells code-quality.md lacked (feature envy, shotgun surgery, divergent change, insider trading, refused bequest, speculative generality, middle man, temporary field, anemic domain object), the LSP/ISP bars, and pattern-misuse smells (premature patternization, singleton-as-global-state, needless indirection).
  • Named the abstraction-fit tension explicitly — DIP/"missing abstractions" pushes toward more interfaces; speculative generality + shallow modules push toward fewer; they resolve on need, not count (grounded in architecture-and-design.md).
  • README index updated; the moved Large Class cite dropped from code-quality.md.

Design decisions folded in

  • Absorbs the roadmap's "Fowler/GoF smells" item — those are design-tier, so they land here rather than in code-quality.md (as we discussed).
  • Dropped two candidate smells by the diff-reviewable bar: Message Chains (would contradict architecture-and-design.md's explicit allowance of within-aggregate/fluent chains; the cross-boundary case is already Law of Demeter) and Parallel Inheritance Hierarchies (removed in Refactoring 2nd ed; not single-diff-visible).
  • Every criterion is written diff-anchored (what a reviewer flags in a changed hunk/file); the intro notes that a few (shotgun surgery, divergent change) need whole-diff/whole-file visibility.

Test plan

  • Local lefthook pre-commit — typos, editorconfig, gitleaks, markdownlint pass
  • CI lychee will validate the new source URLs
  • Held for your review (hybrid policy: new-content PR, you merge)

🤖 Generated with Claude Code

Add conventions/review/code-design.md — the design-judgment tier
(cohesion, coupling, responsibility, abstraction fit, substitutability,
pattern application) between architecture.md and code-quality.md.

- Relocate the design-judgment bullets out of code-quality.md — god
  class, missing abstractions, Law of Demeter / Hollywood Principle, and
  duplicated-structure (rule of three) — into code-design.md, leaving
  code-quality.md to local design, shape, style, and authoring hygiene.
- Add the Fowler design smells code-quality.md lacked (feature envy,
  shotgun surgery, divergent change, insider trading, refused bequest,
  speculative generality, middle man, temporary field, anemic domain
  object), the LSP/ISP bars, and pattern-misuse smells (premature
  patternization, singleton-as-global-state, needless indirection).
- State the abstraction-fit tension explicitly: DIP pushes toward more
  interfaces, speculative generality and shallow modules toward fewer —
  resolve on need, not count.
- Update the review README index; drop the moved Large Class cite.

Smells verified against the Refactoring 2nd-ed catalog, GoF, Martin's
SOLID, and Ousterhout.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V1x1KNkkjSe2CjbuTb4Gis
@claude

claude Bot commented Jul 15, 2026

Copy link
Copy Markdown

Claude finished @kyle-sexton's task in 0s —— View job


I'll analyze this and get back to you.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0bf4f83ccb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread conventions/review/code-design.md Outdated
… propagation

The example (add a field → DTO, mapper, validator, migration, handlers)
described required boundary/schema propagation, which reviewers could
misread as a blockable smell. Reframe the trigger to scattered duplicated
*logic* and add an explicit carve-out for necessary per-layer plumbing.

Addresses the codex-connector finding on #129.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V1x1KNkkjSe2CjbuTb4Gis
@claude

claude Bot commented Jul 15, 2026

Copy link
Copy Markdown

Claude finished @kyle-sexton's task in 0s —— View job


I'll analyze this and get back to you.

@kyle-sexton
kyle-sexton merged commit 42bace0 into main Jul 16, 2026
39 checks passed
@kyle-sexton
kyle-sexton deleted the docs/review-code-design-split branch July 16, 2026 02:53
kyle-sexton added a commit that referenced this pull request Jul 16, 2026
## Summary

New `conventions/review/multi-tenancy.md` — diff-time review bars for a
multi-tenant (SaaS) system, organized around **horizontal
authorization**: keeping an already-authenticated request confined to
its own tenant. `security.md` owns the vertical boundary (authn,
sanitization, injection); this file owns everything downstream of "we
know who is calling."

Criteria (all diff-anchored; a cross-tenant read/write defaults to
**Critical**):
- **Tenant-scoped data access** — missing tenant predicate; fetch-by-id
without ownership; conditional per-tenant key selection.
- **Tenant identity and trust** — client-supplied tenant used for
scoping; enumerable cross-tenant identifiers (BOLA).
- **Shared state and configuration** — cache key omits the tenant;
global flag driving a tenant decision.
- **Asynchronous work** — tenant context lost across the queue/job/event
boundary.
- **Fairness** — unbounded tenant-triggerable work with no per-tenant
quota (noisy neighbor).
- **Tenant lifecycle** — offboarding that misses a data store;
provisioning defaults.
- **Boundaries** section delimiting ownership vs `security.md` /
`performance.md` / `concurrency.md` / `observability.md`.

Registered in the review README (placed by `security.md`, away from the
code-design row in #129 to avoid a README merge conflict between the two
held PRs).

## Sourcing

Verified against **AWS Well-Architected SaaS Lens** (isolation mindset),
**OWASP** (API1:2023 Broken Object Level Authorization + Authorization
Cheat Sheet), and the **Azure multitenant architecture** guides. Dropped
non-diff-reviewable candidates (tenancy-model choice, capacity planning,
cost metering) by design; per-tenant encryption kept as an explicitly
conditional bar.

## Test plan

- [x] Local `lefthook` pre-commit — typos, editorconfig, gitleaks,
markdownlint pass
- [ ] CI `lychee` will validate the source URLs
- [ ] Held for your review (hybrid policy)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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