Skip to content

feat: per-connection AI rules#1081

Merged
datlechin merged 1 commit into
mainfrom
feat/per-connection-ai-rules
May 7, 2026
Merged

feat: per-connection AI rules#1081
datlechin merged 1 commit into
mainfrom
feat/per-connection-ai-rules

Conversation

@datlechin

Copy link
Copy Markdown
Member

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.

  • New aiRules: String? on DatabaseConnection. Codable via decodeIfPresent for forward compatibility, encoded with encodeIfPresent. Round-trips through the existing keychain-paired UserDefaults storage.
  • New AI Rules pane in the connection form sidebar (next to General / SSH / SSL / Customization / Advanced). Multiline editor with placeholder examples for what to write.
  • AISchemaContext.buildSystemPrompt accepts an optional connectionRules; when non-empty, appends a ## Connection-Specific Rules section to the system prompt. AIChatViewModel.PromptContext carries the rules through.

Out of scope: schema-aware rule suggestions, .tableprorules files on disk, AI-generated rule suggestions, per-table or per-column rules, sync/export.

Test plan

  • Add a connection, open AI Rules in the form sidebar, type rules, save. Reopen the connection: rules persist.
  • Open AI Chat against that connection. Confirm the system prompt includes a ## Connection-Specific Rules section with the rules text (verifiable by inspecting the prompt or via the included tests).
  • On a connection without rules, the system prompt has no rules section.
  • xcodebuild -project TablePro.xcodeproj -scheme TablePro test -skipPackagePluginValidation -only-testing:TableProTests/DatabaseConnectionAIRulesTests passes.
  • swiftlint lint --strict passes for changed files.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@datlechin datlechin merged commit 6267b0b into main May 7, 2026
2 checks passed
@datlechin datlechin deleted the feat/per-connection-ai-rules branch May 7, 2026 12:37
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