Gitea
An open-source self-hosted Git service, written in Go. It provides repositories, issues, pull requests, organizations, CI actions and package registries. Maintained by the Gitea project.
Rules cover the models and services packages (620 Go files).
Business rules, traced to source lines.
These 12 rules are a sample of the 4,010 CoreStory V3 extracted from Gitea (scoped to the models and services packages). Each one links to the exact lines on GitHub at commit a25d1d7. The statement is CoreStory V3’s wording; the code excerpt is the source it cites.
A user can push to a protected branch only if CanPush is enabled. If the whitelist is not enabled, the user needs write permission on the code unit. If it is enabled, the user must be in the whitelist user IDs or in a whitelisted team; with no whitelist teams, or on a team lookup error, push is denied.
If the approvals whitelist is not enabled, a user is an official reviewer (counts toward required approvals) if they have write access to the code unit. If enabled, the user must be in the approvals whitelist user IDs or in a whitelisted team.
When the protected branch has BlockOnRejectedReviews enabled, merge is blocked if there exists an official, non-dismissed review of type Reject on the pull request. If the lookup errors, merge is blocked. If the setting is disabled, merge is not blocked by this rule.
- true — required official flag on blocking reject review
- false — required dismissed flag on blocking reject review
When dependencies are enabled for the repository, closing an issue fails with ErrDependenciesLeft if the issue still has unsatisfied dependencies. The check is only done on close, not on reopen.
Unless the repo allows closing issues via commits in any branch, a commit closes/reopens an issue only if: the issue has a specific Ref and the commit's branch matches it, or the issue has no Ref and the commit branch is the repo's default branch.
A doer can create a repository in an owner only if both doer and owner have IDs greater than 0 (fake users like Ghost or Actions are refused). Admins are always allowed; otherwise a limit of -1 means unlimited, and any other limit requires the owner's NumRepos to be below the limit.
- 0 — IDs at or below this are fake users and cannot create repos
- -1 — noLimit sentinel for repository creation limit
A viewer can see a user's profile if the viewer is an admin or the user themself. Otherwise public users are visible to everyone; limited users are visible only to non-restricted signed-in viewers; private users are visible only to non-restricted signed-in viewers who follow/are followed or share an organization with the user.
Also cited: L1461–L1463
A team list grants admin access to all repositories if any team is the owner team or has Owner access mode, or if any team includes all repositories and has an access mode at or above Admin.
Approval is never needed if the run is not a fork PR or the trigger event is pull_request_target. Otherwise approval is always needed for restricted users; not needed if the user can write to Actions in the repo; not needed if the user has a merged pull request in the repo; otherwise approval is needed.
- pull_request_target — trigger event exempt from approval
Also cited: L538
For Basic password authentication when two-factor is not skipped, if the user has TOTP enrolled, the OTP from the X-Gitea-OTP header must be valid and is atomically consumed to prevent replay; an invalid OTP records a two-factor failure audit event and returns an invalid argument error. Users without 2FA enrollment pass.
- X-Gitea-OTP — request header carrying the OTP
Also cited: L166–L168
Default token permissions are determined by TokenPermissionMode: restricted yields the restricted permission set, permissive yields write access (AccessModeWrite) for all unit types, and any other mode yields empty permissions. MaxTokenPermissions is not applied here.
- restricted — mode yielding restricted permissions
- permissive — mode yielding write access for all units
- AccessModeWrite — access mode for permissive default
Granted approvals counted for a pull request are reviews of type Approve that are official and not dismissed. When the protected branch ignores stale approvals, stale reviews are excluded as well. On a database error the count is 0.
- true — required value of the official flag
- false — required value of the dismissed flag
- false — required value of the stale flag when IgnoreStaleApprovals is set
What the application does
12 capabilities and 222 features, as described by an earlier CoreStory V3 ingest of the same commit. These are descriptions, not the cited rules above.
APIs, Integrations, and Realtime Events
The system integrates with external services and embedded frontends through APIs, webhooks, HTTP actions, messaging, and resilient event streams.
- Client Event Subscription and Delivery: Clients can subscribe to an event source and receive user and worker events, then unsubscribe when no longer needed.
- Event Delivery: Enables user-generated events to be received and dispatched to subscribers.
- External Content Iframe Display: Displays externally rendered content in an iframe with appropriate background styling and safe link handling.
- External Frontend Rendering: Enables frontend content to be rendered through an externally initialized rendering capability, including string, byte, and Base64-encoded content inputs.
- Fetch Action Execution: Users can trigger asynchronous actions from links or global action triggers, with confirmation, loading feedback, redirects, and success or error handling.
- Frontend Rendering: Renders the frontend interface for users to observe.
- Gitea API Viewer: Provides a viewer for interacting with or observing the Gitea API.
- HTTP Request Execution: Enables another system to issue HTTP requests using standard GET, POST, PUT, PATCH, and DELETE methods.
- Iframe Link Navigation: Enables users to safely navigate links from iframe-rendered content.
- Iframe Messaging: Enables messages to be sent to an embedded iframe for cross-context communication.
- Resilient WebSocket Event Streaming: WebSocket-based event streaming supports connection lifecycle management, automatic reconnection, and fallback signaling.
- Response-Driven UI Updates: Successful action responses can drive structured interface commands and refresh outdated page elements.
- Scheduled Fetch Actions: Fetch actions can run repeatedly on an interval to provide automatically refreshed behavior.
- Shared Worker Messaging Simulation: Provides a simulated shared-worker messaging environment with message delivery, event subscriptions, port startup, and connection closure for dependent systems and tests.
- Swagger API Documentation: Provides an interactive Swagger UI for users to explore API documentation.
- Webhook Editing: Users can edit webhook configurations through a dedicated editor form.
- Webhook History: Users can view the history associated with webhook configurations.
Accessible and Personalized User Experience
The system delivers accessible, keyboard-friendly, responsive, themeable, localized, and state-aware interactions across forms, dialogs, navigation, and notifications.
- Accessible Dropdown Interaction: Provides accessible dropdown behavior, including ARIA-aware menu updates, selection labeling, event handling, and filtered-menu presentation.
- Accessible Form Labeling: Automatically associates labels with form inputs and applies ARIA labeling to improve interface accessibility.
- Accessible Modal Dialogs: Displays and dismisses modal dialogs with approval and pre-hide lifecycle handling plus ARIA accessibility support.
- Asynchronous Form Submission: Forms can be submitted asynchronously with field-level error presentation and reset behavior.
- Automatic Element Sizing: Automatically resizes an element to accommodate its content.
- Automatic Input Direction: Automatically adjusts input direction for user-entered content.
- Automatic Input Focus: Automatically manages focus for applicable user input elements.
- Before-Unload Protection: Allows clients to observe whether leaving or reloading the page is being prevented.
- Confirmation Modal: Displays a configurable confirmation modal and enables users to confirm or cancel an action.
- Dark Mode Synchronization: Keeps the interface theme synchronized with dark mode state.
- Dark and Light Theme: Enables the page to initialize and display an appropriate dark or light visual theme.
- Dropdown Interaction: Provides interactive dropdown controls across the interface.
- Enter Key Quick Submit: Users can quickly submit content using the Enter key.
- Enter-Key Button Activation: Users can activate global buttons with the Enter key.
- Footer Language Selection: Enables users to select a language from the footer menu.
- Footer Theme Selection: Enables users to select the interface theme from the footer.
- Form Creation and Field Management: Enables forms to be created and their fields populated or updated.
- Full-Screen Display: Allows users to toggle content between normal and full-screen display modes.
- Global Error Notifications: Displays user-facing error messages in response to application-wide window error events.
- Local User Settings Persistence: Users can save and retrieve settings through local storage, with storage errors handled as part of the capability.
- Localized Date Display: Presents translated day and month names according to the current locale.
- Modal Display: Users can open modal interfaces through global button interactions.
- Relative Time Display: Presents timestamps as human-readable relative time text.
- Sidebar Toggle: Users can show or hide the interface sidebar.
- Sortable Interactions: Enables users to reorder items through sortable interactions.
- Tab Switching: Enables users to switch between interface tabs.
- Table Sorting: Users can initialize and apply sorting to table content.
- Toast Notifications: Displays success, error, warning, and informational toast notifications and allows individual or grouped notifications to be dismissed.
- Unsaved Form Changes Warning: Tracks form changes and prompts users for confirmation before leaving a form with unsaved changes.
CI/CD and Workflow Automation
The system configures, executes, monitors, and visualizes builds, actions, artifacts, permissions, and automated workflows.
- Action Run Log Viewing: Enables users to view action runs as parent-child jobs with decoded log lines and interpreted log commands.
- Action Run Status Favicon: Displays action run status in the browser favicon and restores the default favicon when appropriate.
- Action Status Icon Display: Displays a visual icon representing an action's current status.
- Actions Artifact Tracking: Users can observe artifacts produced by automation and their availability status.
- Actions Permissions Management: Users can view and configure Actions permissions at owner and repository scopes, including repository overrides of owner settings.
- Actions Run Monitoring: Users can observe automation runs, retry attempts, jobs, summaries, and execution statuses.
- Artifact Tooltip Display: Displays artifact details to users in an HTML tooltip.
- Build Branch Selection: Users can choose which branch is used when preparing the build environment.
- Build Path Configuration: Users can change the default paths used by the build workflow.
- Config File Generation: Generates configuration files for the Gitea mixin.
- Cross Build: Users can produce builds for target environments other than the current host environment.
- Project Build: Users can build the project, including preparing the required build environment.
- Release Notes Generation: Users can generate release notes using a previously identified release tag as the comparison point.
- Repository Actions: Users can access and run repository automation workflows.
- Repository Actions View: Users can view repository action runs and job queues through the repository Actions interface.
- Scoped Workflow Required Row Synchronization: Keeps required rows synchronized with matched contexts within a scoped workflow.
- Workflow Badge Configuration: Users can configure workflow badge settings through a form with dynamically updated fields.
- Workflow Graph Display: Displays workflow jobs, dependencies, matrix groups, statuses, and routed connectors as a laid-out visual graph.
- Workflow Graph Highlighting: Highlights related workflow graph nodes and edges based on graph adjacency.
Collaborative Content Authoring
The system provides rich Markdown-based authoring with attachments, mentions, reactions, task lists, formatting assistance, and editable conversations.
- Attachment Markdown Link: Uploaded attachments can be represented as Markdown links for insertion into content.
- Attachment Preview: Uploaded attachments are presented with a decorated preview in the upload interface.
- Attachment Upload: Users can upload file attachments through a dropzone-based interface and receive uploaded-file metadata.
- Component Reaction Selection: Provides a selector for choosing component reactions.
- Conversation Content Editing: Users can initiate and handle editing of repository issue comments and conversation content.
- Editor File Attachments: Users can upload and refresh files associated with the Markdown editor through a dropzone.
- Editor Text Expansion: Users can use text expansion while composing content in the editor.
- Emoji Recognition: Recognizes emoji references within content.
- Emoji Rendering: Provides emoji output in both HTML and plain string forms.
- HTML to Markdown Conversion: Converts HTML content into Markdown through element-processing workflows.
- Interactive Task List Checkboxes: Users can interact with and toggle task-list checkboxes in rendered markup.
- Markdown Attachment Upload: Users can upload files, including images pasted into Markdown editors, with temporary placeholders replaced as uploads complete across CodeMirror and textarea editing modes.
- Markdown Editing: Users can compose and edit Markdown content through an initialized editor interface.
- Markdown Editor Toolbar Actions: Provides user-triggerable toolbar actions for the EasyMDE Markdown editor.
- Markdown Smart Indentation: Supports interactive indentation of selected text and indentation-aware newline handling in a Markdown textarea.
- Markdown Table Insertion: Users can generate and insert Markdown tables from the editor toolbar.
- Ordered List Renumbering: Reformats Markdown list numbers as textarea content is edited.
- Paired Character Editing: Provides paired-character editing behavior while users type in the Markdown textarea.
- Quote Reply: Users can extract selected Markdown and quote it in a conversation reply.
- Safe HTML Generation: Generates HTML content with support for escaped values and explicitly raw markup.
- User Mention Recognition: Detects and retrieves user mentions for observable mention handling in content.
Identity, Access, and Organizations
The system supports account authentication, strong authentication methods, user profiles, account administration, and organization/team governance.
- Account Authentication and Registration: Users can sign in to an existing account or register a new account.
- CAPTCHA Challenge: Provides a CAPTCHA challenge that can be initialized for user interaction.
- External User Login: Users can access initialized external login options for authentication.
- Key Registration: Users or integrating systems can register a key.
- Organization Management: Organizations can be created and deleted.
- Organization Team Setup: Enables initialization of an organization team together with its settings.
- Passkey Login: Users can authenticate with a WebAuthn passkey when their client supports it.
- Passkey Registration: Users can register a WebAuthn authenticator for future authentication.
- Password Sign-In: Users can authenticate using a password.
- SSH Key Form Submission: Enables SSH key data to be accepted through a form submission.
- Two-Factor Authentication: Users can complete a two-factor authentication login flow.
- User Account Management: User accounts can be created and deleted.
- User Authentication: Users can sign in and out of application sessions.
- User Dashboard: Users can access a personalized dashboard.
- User Profiles: Users can view user profile pages.
Issue Tracking and Project Planning
The system combines issue tracking, dependencies, scheduling, labels, milestones, time tracking, and board-based project planning.
- Automatic Pull Request Labeling: Derives and applies labels to pull requests based on their titles and scopes.
- Issue Comment Management: Users can create, reply to, edit, cancel, and delete comments on repository issues.
- Issue Content History Viewing: Users can initialize, browse, and inspect detailed content history for repository issues.
- Issue Dependency Management: Users can view or manage issue dependencies from the issue sidebar.
- Issue Due Date: Users can view or manage an issue due date from the issue sidebar.
- Issue Label Filtering: Users can filter repository issues by selecting issue labels.
- Issue Management: Issues can be created and closed.
- Issue Pin Management: Users can reorder pinned issues, move them to the end, and remove pins.
- Issue Reference Recognition: Recognizes issue references within content.
- Issue Referencing: Users can reference another issue from a repository issue.
- Issue Suggestions: Provides issue suggestions for users to discover or select relevant issues.
- Issue Title Editing: Users can edit repository issue titles.
- Issue Tracking: Users can track and manage issues within repositories.
- Issue Work-in-Progress Status: Users can toggle an issue's work-in-progress status with corresponding title updates.
- Project Board Management: Projects and their columns can be created.
- Project Column Editing: Users can edit columns within a repository project board.
- Project Fullscreen View: Users can toggle a repository project board into and out of fullscreen mode.
- Project Issue Movement: Users can move issues within a project board while associated issue counts are updated.
- Project Item Reordering: Users can reorder sortable items on a repository project board.
- Repository Projects View: Users can view repository project boards and their contents.
- Time Tracking: Users can start a stopwatch to track time.
Media, Document, and Data Visualization
The system renders and inspects documents, diagrams, images, structured output, repository analytics, and visual comparisons.
- ANSI Line Rendering: Renders text lines with ANSI colors and styles for terminal-style display.
- Heatmap Visualization: Provides heatmap data and initialization for a user-observable heatmap visualization.
- Image Conversion: Converts image files and produces data URI representations for downstream display or transfer.
- Image Information Inspection: Provides access to inspect image information.
- In-Place PDF Viewing: Displays PDF documents within the current interface using a plugin-based viewer.
- Math Markup Display: Initializes mathematical markup for display in a target element.
- Mermaid Diagram Display: Enables Mermaid markup to be initialized and presented through a dedicated diagram view.
- Overlay Image Comparison: Displays image differences using an overlay comparison mode.
- PNG Chunk Inspection: Provides access to enumerate and inspect PNG chunks.
- Repository Activity: Users can view activity associated with a repository.
- Repository Code Frequency: Enables initialization of repository code-frequency analysis for users.
- Repository Top Authors Chart: Displays a repository activity chart highlighting its top authors.
- SVG Display: Supports displaying SVG content, including raw SVG and parsed outer/inner SVG representations.
- Side-by-Side Image Comparison: Displays images next to each other for visual comparison.
- Swipe Image Comparison: Provides an interactive swipe control for comparing overlapping images.
- Workflow Graph Display: Displays workflow jobs, dependencies, matrix groups, statuses, and routed connectors as a laid-out visual graph.
Pull Request Review and Diffs
The system supports pull-request collaboration, merging, status checks, and detailed navigation and management of code differences.
- Commit Status Checks Toggle: Users can toggle commit status checks in the pull request interface.
- Commit Status Display: Users can view status information associated with commits.
- Diff Commit Selection: Enables users to select a commit for a diff view.
- Diff Extension Statistics: Users can observe file counts and extension-based statistics for a diff.
- Diff File Tree Filtering: Users can filter files in a diff tree, including sharing or restoring extension filters through URL state.
- Diff File View Toggle: Users can toggle how files are presented within a diff.
- Diff File Viewed State: Users can mark diff files as viewed and have that state reflected in the diff tree.
- Diff File Viewed Tracking: Users can mark diff files as viewed and observe an updated summary of viewed files.
- Diff Header Actions Menu: Users can access contextual actions from a popup menu in the diff header.
- Diff Location Navigation: Users can navigate directly to diff locations through location-hash changes.
- Expand and Collapse Diff Files: Users can expand or collapse files in the diff view.
- Progressive Diff Loading: Users can observe diff loading progress and request additional files through a show-more control.
- Pull Request Maintainer Editing: Pull request authors can control whether maintainers are allowed to edit their contribution.
- Pull Request Management: Users can submit and manage repository pull requests.
- Pull Request Merge: Users can interact with and refresh pull request merge controls and submit merge actions.
- Pull Request Review: Pull requests can be created and reviewed.
- Pull Request Title Linting: Checks pull request titles against expected commit-title conventions.
- Repository Diff Conversations: Users can navigate and participate in conversations associated with a repository diff.
- Repository Diff Viewing: Users can view repository differences with file contents loaded progressively as needed.
Repository Lifecycle Management
The system provides repository hosting and administration across initialization, migration, collaboration, branches, releases, settings, and distribution.
- New Repository Initialization: Users can initialize a new repository, including locating a template for its setup.
- Repository Archive Download: Provides repository archive download links and handles archive download requests.
- Repository Branch Drag-and-Drop: Users can use drag-and-drop interactions for branches in repository settings.
- Repository Branch Management: Users can initialize controls to create and rename repository branches.
- Repository Branch and Tag Discovery: Loads and presents repository branches and tags associated with a commit or diff.
- Repository Branch and Tag Selection: Users can select repository branches or tags through a tabbed selector interface.
- Repository Clone Options: Provides a clone panel with buttons, combined clone choices, and repository open-with links.
- Repository Collaboration: Collaborators can be added and teams created for collaborative work.
- Repository Hosting: Users can create, access, and work with hosted code repositories.
- Repository Management: Repositories can be created and deleted.
- Repository Migration Status Checking: Monitors repository migration status and retries migration checks when necessary.
- Repository Milestone Initialization: Enables initialization of a milestone for a repository.
- Repository Release Creation: Users can create a new repository release and configure its release tag.
- Repository Settings: Users can access and interact with repository settings for branches, collaboration, Git hooks, options, and team search.
- Repository Watching: Enables monitoring of repository changes.
- Repository Wiki Initialization: Users can access and submit a form to initialize a repository wiki.
Search, Discovery, and Navigation
The system offers global and contextual discovery through search, dashboards, command navigation, shortcuts, repository switching, and reference-aware links.
- Admin User List Search: Administrators can initialize and use search criteria for the user list.
- Clickable URL Navigation: Detects URLs in content and enables navigation from the URL at a selected position.
- Command Palette: Provides a command palette that presents available commands and their formatted keyboard shortcuts.
- Content Exploration: Users can explore available content across the service.
- Dashboard Repository List: Displays an initialized list of repositories on the dashboard.
- Header Navigation Content Toggle: Allows users to show or hide content through the header navigation.
- Issue List Quick Goto: Enables quick navigation to issue lists by initializing common destinations and interpreting quick-goto links.
- Keyboard Shortcut Help: Users can view help that presents available keyboard shortcuts in a readable form.
- Keyboard Shortcuts: Users can trigger registered application actions through keyboard shortcuts.
- Markup Anchor Navigation: Enables initialized markup anchors to navigate and scroll users to targeted content locations.
- Navigation Capture: Captures navigation activity for observation or testing.
- Referenced Issue Context Popup: Users can view contextual issue information in a popup for a referenced issue.
- Remote User Search: Users can search for users remotely through a dropdown interface.
- Repository Overflow Menu: Users can access additional repository actions through an ellipsis menu.
- Repository Search: Enables users to search repositories and observe repository search results.
- Repository Switching: Enables users to search for and switch between repositories through a repository selector.
- Repository Topic Search: Users can interact with a repository topic bar backed by topic search results.
- Search Interface: Provides an interactive search box and displays structured search results.
- User Search: Users can search for other users through a search interface and receive matching user results.
Source Code Exploration and Editing
The system enables users to browse, inspect, navigate, search, and edit repository source code with language-aware tooling.
- Code Copy: Enables users to copy displayed markup code using a dedicated copy button.
- Code Editor: Provides an interactive CodeMirror-based editor for viewing and editing code.
- Code Line Range Selection: Users can select line ranges in a repository code view, reveal line-specific controls, and preserve the selection in the URL hash.
- Commit File History Across Renames: Users can follow a file’s commit history across renames.
- File Folding Control: Users can set or toggle the folded state of files.
- File Tree View: Provides a hierarchical file tree for users to browse files and directories.
- Git Repository Graph Initialization: Initializes a repository graph from Git data.
- Go to Definition: Navigates from a selected position to the corresponding definition.
- Language-Aware Editing: Supports configuring the editor for different programming languages, including language descriptions and linting extensions.
- Repository File Creation: Files can be created in repositories.
- Repository File Search: Searches and filters repository files using substring matching and weighted relevance ranking.
- Repository File Tree Display: Users can view a repository's files as a tree within the repository interface.
- Repository File Viewing: Displays repository files in place using supported renderers, with raw file content rendered into the view when needed.
- Repository Recent Commits: Provides recent commit information for a repository.
- Symbol Context Menu: Displays an interactive context menu built from collected symbols.
System Administration and Operations
The system supports installation, configuration, administrative access, user and runner operations, diagnostics, notices, and security controls.
- Active Page Timed Refresh: Schedules and refreshes timed activity while coordinating timer lifecycle with the active page.
- Admin Authentication: Administrators can manage authentication settings, including responding to security protocol changes.
- Admin Notices: Administrators can access notice-related capabilities in the administration interface.
- Admin Self-Check: Provides an administrative self-check capability for assessing system status.
- Admin User List Search: Administrators can initialize and use search criteria for the user list.
- Admin User Management: Administrators can manage users through the administration interface.
- Bulk Runner Administration: Administrators can access bulk runner capabilities.
- Error Display: Displays error information to the user.
- Fallback Signaling: Provides an observable fallback signal when normal event handling cannot proceed.
- Global Initialization Hooks: Enables consumers to register and invoke application-wide initialization callbacks.
- Installation Lifecycle: Supports initialization across pre-install, install, and post-install lifecycle stages.
- Notification Count Updates: Maintains and propagates notification count updates for users to observe.
- OAuth2 Disable Setting: Provides a settings control for disabling OAuth2.
- Security Vulnerability Reporting: Users can securely report security vulnerabilities and review guidance on supported versions and protecting sensitive security information.
- System Configuration Form Editing: Administrators can view and edit system configuration values through a form that is populated from existing settings and collects updated values for submission.
What was analyzed
- Go · 3,140 files · 390,025 lines
- JSON · 55 files · 173,455 lines
- TypeScript · 269 files · 19,565 lines
- YAML · 184 files · 18,406 lines
- CSS · 92 files · 12,053 lines
- JavaScript · 4 files · 6,125 lines
- Vuejs Component · 23 files · 5,205 lines
- Markdown · 26 files · 1,913 lines
- SVG · 535 files · 1,029 lines
- Bourne Shell · 21 files · 566 lines
- make · 2 files · 525 lines
- Other (14 languages) · 48 files · 1,215 lines
Whole repository: 6,361 files. cloc 2.06 counts 630,082 lines of code in 4,399 of them (764,208 lines with comments and blanks). The rules run covered 620 Go files (the models and services packages).
Where this came from
Business rules extracted by CoreStory V3 from the public repository at commit a25d1d7 on 2026-11-11. Business rules were extracted from the models and services packages (620 Go files). Capability descriptions from an earlier CoreStory V3 ingest of the same commit (2026-10-17).
- Repository go-gitea/gitea
- Commit a25d1d77eb1ca24ae1c7b60f6b5c66166664c669
- Line counts cloc 2.06
- Rule citations The 4,900 evidence quotes behind the 4,010 rules were compared with the repository source at this commit.
Code excerpts are from the upstream repository and remain under its MIT license. CoreStory is not affiliated with or endorsed by the Gitea project.
Want this for your own codebase?
Talk to us about mapping the business rules in your repositories.