Skip to content

Allow imports of system C modules (e.g. SQLite3) in AGENTS.md - #28

Merged
buggerman merged 1 commit into
mainfrom
sqlite-system-module-carveout
Apr 25, 2026
Merged

Allow imports of system C modules (e.g. SQLite3) in AGENTS.md#28
buggerman merged 1 commit into
mainfrom
sqlite-system-module-carveout

Conversation

@buggerman

Copy link
Copy Markdown
Owner

Summary

  • Tighten the Pure Swift rule so it actually says what it means: the ban is on third-party C source, bridging headers, and .m files. Importing system modules that ship with the macOS SDK (SQLite3, os.log, Network, UserNotifications, …) is fine — those are how Swift exposes the OS, not "C interop" in the pejorative sense.
  • Required cover for the upcoming FTS5-powered scrollback search work, which uses import SQLite3. Without this clarification a reviewer could reasonably flag that PR as a violation; with it, the policy is explicit.
  • Adds the wrapping rule that protects the rest of the codebase from the C-API ergonomics: any UnsafeMutablePointer<OpaquePointer?> / sqlite3_* call must live inside a small actor and not appear in any public API.

Changes

  • AGENTS.md — two consistent edits:
    • Architecture invariants → Pure Swift bullet rewritten to define "C interop" precisely, allow system-module imports, and require actor-wrapped unsafe surfaces. @objc rules unchanged.
    • What not to do bullet updated to match the carveout (third-party C still banned; system modules fine).

Test plan

  • N/A, docs only.

Risk / rollback

  • Pure documentation; no behavior change. CLAUDE.md is a symlink to AGENTS.md, so both surfaces update in one commit.
  • Revert: this single commit.

@buggerman
buggerman merged commit 3b9319e into main Apr 25, 2026
@buggerman
buggerman deleted the sqlite-system-module-carveout branch April 25, 2026 14:44
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