Skip to content

Conversation

@8471919
Copy link
Contributor

@8471919 8471919 commented Feb 1, 2026

This pull request significantly enhances the database design documentation and review prompts for authentication/authorization and general schema normalization in the agent package. The changes clarify critical normalization rules, automate detection of common schema patterns, and strengthen guidance on proper actor/session separation and parent-child table relationships. These improvements aim to prevent common mistakes, enforce best practices, and make the prompts more actionable for both table design and review.

Major improvements include:

Authentication & Authorization Table Design

  • Added a new "CRITICAL: Actor vs Session Field Separation" section in DATABASE_AUTHORIZATION.md, detailing which fields belong in actor (identity) vs. session (connection context) tables, with explicit schema patterns and anti-patterns for guests and members. This prevents mixing session data into identity tables, which is a frequent normalization error.
  • Updated descriptions of guest tables to reinforce the separation of identity and session data, and expanded the checklist to require this separation in both schema and documentation. [1] [2]

Database Normalization Principles

  • Added comprehensive normalization rules (1NF, 2NF, 3NF) to both DATABASE_AUTHORIZATION.md and DATABASE_COMPONENT.md, including examples of violations and correct patterns. This ensures all contributors understand and apply normalization rigorously. [1] [2]
  • Introduced a mandatory pattern detection checklist in DATABASE_COMPONENT.md that maps requirement keywords (e.g., "question", "review", "attachment") to required table patterns, with explicit instructions to add missing tables immediately.

Automated Schema Review and Pattern Detection

  • Overhauled the pattern detection section in DATABASE_COMPONENT_REVIEW.md to an "Automatic Pattern Detection Rules" matrix, requiring reviewers to scan for keywords and verify or create corresponding tables. Special rules for Q&A, polymorphic entities, and separate entity patterns are now explicit.
  • Added a new guideline to DATABASE_SCHEMA_REVIEW.md to detect and reject parent-child field duplication (3NF violation), with a scenario demonstrating detection and correction of redundant fields in child tables. [1] [2]

Documentation and Process Improvements

  • Improved section organization and numbering in review prompts, added more detailed checklists, and clarified output expectations for reviewers. [1] [2] [3]

These changes collectively enforce stricter normalization, automate error detection, and make the prompts more robust for both design and review phases.


References:
Authentication/Authorization separation and normalization [1] [2] [3] [4]
Pattern detection and normalization checklists [1] [2] [3]
Parent-child field duplication detection [1] [2]
Process and documentation improvements [1] [2] [3]

@8471919 8471919 self-assigned this Feb 1, 2026
@8471919 8471919 added the enhancement New feature or request label Feb 1, 2026
@8471919 8471919 added this to WrtnLabs Feb 1, 2026
@8471919 8471919 merged commit 2672be9 into main Feb 3, 2026
4 checks passed
@8471919 8471919 deleted the fix/db_nf branch February 3, 2026 03:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants