feat: per-connection AI rules#1081
Merged
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This was referenced May 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PR G of the chat-roadmap-cdfg track. Adds a per-connection AI Rules field so users can pin connection-specific guidance (table conventions, PII columns, naming, business rules) that the assistant sees on every chat turn for that connection.
aiRules: String?onDatabaseConnection. Codable viadecodeIfPresentfor forward compatibility, encoded withencodeIfPresent. Round-trips through the existing keychain-paired UserDefaults storage.AISchemaContext.buildSystemPromptaccepts an optionalconnectionRules; when non-empty, appends a## Connection-Specific Rulessection to the system prompt.AIChatViewModel.PromptContextcarries the rules through.Out of scope: schema-aware rule suggestions,
.tableprorulesfiles on disk, AI-generated rule suggestions, per-table or per-column rules, sync/export.Test plan
## Connection-Specific Rulessection with the rules text (verifiable by inspecting the prompt or via the included tests).xcodebuild -project TablePro.xcodeproj -scheme TablePro test -skipPackagePluginValidation -only-testing:TableProTests/DatabaseConnectionAIRulesTestspasses.swiftlint lint --strictpasses for changed files.