Skip to content

review-bot-rules: no test/debug seam in production Swift Sources - #6455

Merged
azooz2003-bit merged 2 commits into
mainfrom
feat-botrule-test-debug-placement
Jun 19, 2026
Merged

azooz2003-bit merged 2 commits into
mainfrom
feat-botrule-test-debug-placement

Conversation

@azooz2003-bit

@azooz2003-bit azooz2003-bit commented Jun 19, 2026 •

Copy link
Copy Markdown
Collaborator

Propagates a saved human review lesson into the CodeRabbit + Greptile review rules.

Owner review comment (Aziz): "if you're going to extend anything for tests, put it in the tests target. If you're going to extend anything for debugging, put it in its own debug folder if possible."

Context: a #if DEBUG test-observability accessor (debugQueuedRequestCount()) was added to production CmuxMobileRPC sources so a test could read the actor's private writer-queue state. The correct fix (#6452, commit 350dda4) removed the production seam, widened the queue state private -> internal, and observed it from the test target via @testable import.

What's here

New rule .github/review-bot-rules/no-test-debug-seam-in-production-source.md: for Swift files under a production Sources/ path (not Tests/), flag test-only/debug-only seams added inline — #if DEBUG (or other test-build-guarded) accessors with no production caller, members named debug…/…ForTesting/…ForTests/testOnly…/…TestHook, or visibility widened plus a wrapper accessor "so the test can call it". Preferred fix: observe internal state from the test target via @testable import after widening private -> internal; isolate a genuinely debug-only facility in a dedicated debug file/folder.

Mirrored into both bots:

  • CodeRabbit: reviews.path_instructions scoped to **/Sources/**/*.swift + blocking custom check cmux no test or debug seam in production source.
  • Greptile: rule id cmux-no-test-debug-seam-in-production-source (scope **/Sources/**/*.swift) in config.json, plus files.json entry and a rules.md section.

Review-config and docs only. No app/runtime code, so no tagged reload.


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.


Summary by cubic

Adds a blocking review rule that prevents test-only or debug-only seams in production Swift Sources/ files. Enforced via CodeRabbit and Greptile; docs/config only, no runtime changes.

  • New rule .github/review-bot-rules/no-test-debug-seam-in-production-source.md; scope **/Sources/**/*.swift (not Tests/).
  • Flags #if DEBUG accessors; members named debug…, …ForTesting, …ForTests, testOnly…, …TestHook, …TestSeam, _test…; or visibility widened plus a wrapper added for tests. Preferred fix: use @testable import with private -> internal, or isolate debug code in a dedicated file/folder.
  • Updates .coderabbit.yaml with path instructions and a blocking check "cmux no test or debug seam in production source"; syncs _test… and …TestSeam patterns to match the rule.
  • Updates .greptile/config.json, .greptile/files.json, and .greptile/rules.md with rule id cmux-no-test-debug-seam-in-production-source and the same patterns; lists the rule in .github/review-bot-rules/README.md.

Written for commit 093643e. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Chores
    • Added automated review checks to detect and prevent test-only or debug-only “seams” from being introduced into Swift production source code.
    • Expanded review bot rule documentation and shared rule listings, including a dedicated rule description and associated configuration for targeted scanning and enforcement.

Add a focused review rule flagging test-only/debug-only seams added inline
to production Swift under Sources/ (not Tests/): #if DEBUG accessors,
debug…/…ForTesting/…ForTests/testOnly… members, or visibility widened plus
a wrapper accessor so a test can call it. Preferred fix is to observe
internal state from the test target via @testable import after widening
private to internal, or to isolate a genuinely debug-only facility in a
dedicated debug file/folder.

Mirrors the rule into CodeRabbit (path_instructions + blocking custom check
"cmux no test or debug seam in production source") and Greptile
(rule id cmux-no-test-debug-seam-in-production-source + files.json + rules.md).
Cites #6452 as the reference fix.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 19, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cmux Ready Ready Preview, Comment Jun 19, 2026 8:31pm
cmux-staging Building Building Preview, Comment Jun 19, 2026 8:31pm

@coderabbitai

coderabbitai Bot commented Jun 19, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Ignoring CodeRabbit configuration file changes. For security, only the configuration from the base branch is applied for open source repositories.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 3fbcf300-409d-438d-bfa3-37c84b9554ec

📥 Commits

Reviewing files that changed from the base of the PR and between 3bf5062 and 093643e.

📒 Files selected for processing (3)
  • .coderabbit.yaml
  • .greptile/config.json
  • .greptile/rules.md

📝 Walkthrough

Walkthrough

A new review rule, "No Test or Debug Seam in Production Source," is added across three tooling systems. The rule's canonical definition is authored as a markdown doc, then registered in the review-bot README, Greptile's config and files JSON plus rules summary, and CodeRabbit's path instructions and pre-merge checks—all targeting Swift files under **/Sources/**.

Changes

No Test/Debug Seam in Production Source Rule

Layer / File(s) Summary
Rule definition and docs
.github/review-bot-rules/no-test-debug-seam-in-production-source.md, .github/review-bot-rules/README.md
Introduces the full 27-line rule markdown with scope, explicit fail/pass criteria, and reporting template; registers the file in the review-bot README's "Current rules" list.
Greptile wiring
.greptile/rules.md, .greptile/config.json, .greptile/files.json
Adds a summary bullet to rules.md, inserts a high-severity rule object into config.json, and adds a file-rule mapping entry to files.json, all scoped to **/Sources/**/*.swift.
CodeRabbit path instruction and pre-merge check
.coderabbit.yaml
Adds a reviews.path_instructions entry for Swift Sources/ files and a pre_merge_checks.custom_checks entry in mode: error enforcing the same seam-detection criteria.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • manaflow-ai/cmux#5111: Both PRs address preventing test/debug seams from leaking into production Swift Sources/—this PR via new review-bot failure rules, the referenced PR via CLAUDE.md guidance to remove global/static test hooks.

Poem

🐇 Hoppity-hop through the source code I go,
No debug seams hiding where prod callers won't show!
#if DEBUG? Not here in my Sources/ burrow,
Move hooks to the test target, keep the prod clean and thorough.
With Greptile and CodeRabbit watching the gate,
No sneaky test scaffolding shall slip past of late! 🎉

🚥 Pre-merge checks | ✅ 22
✅ Passed checks (22 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: adding a new review bot rule to prevent test/debug seams in production Swift sources.
Description check ✅ Passed The description is comprehensive and addresses most required sections, including context (the motivation), what was changed, and how it's implemented across review bots.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Cmux Swift Actor Isolation ✅ Passed PR modifies only configuration and documentation files (.coderabbit.yaml, .greptile/, .github/review-bot-rules/). No production Swift code changes introduced; custom check requires "production Swif...
Cmux Swift Blocking Runtime ✅ Passed PR contains only configuration and documentation changes (review bot rules); no production Swift source files modified, so blocking runtime check doesn't apply.
Cmux Expensive Synchronous Load ✅ Passed PR contains only review bot configuration and documentation changes with no production Swift source code modifications, so the check for expensive synchronous loaders is not applicable.
Cmux Cache Substitution Correctness ✅ Passed PR makes only review bot configuration and documentation changes (.coderabbit.yaml, .greptile/, .github/review-bot-rules/), with no production code modifications; cache substitution correctness che...
Cmux No Hacky Sleeps ✅ Passed The check "cmux no hacky sleeps" applies only to production non-Swift app/runtime changes in TypeScript, JavaScript, shell, or build scripts. This PR modifies only configuration (YAML, JSON) and do...
Cmux Algorithmic Complexity ✅ Passed PR contains only configuration and documentation changes (.coderabbit.yaml, .greptile/.json, .github/review-bot-rules/.md). Algorithmic complexity check applies only to production Swift/TypeScrip...
Cmux Swift Concurrency ✅ Passed PR modifies only review-bot configuration and documentation files (no Swift source code added to Sources/), so no legacy async patterns could be introduced.
Cmux Swift @Concurrent ✅ Passed PR contains only configuration and documentation changes (YAML, JSON, Markdown). No Swift source code is modified, so the @concurrent annotation rule does not apply.
Cmux Swift File And Package Boundaries ✅ Passed PR contains only review configuration and documentation changes (e.g., .coderabbit.yaml, .greptile files, .github/review-bot-rules/*.md). No production Swift code is modified, so the swift-file-pac...
Cmux Swiftpm Lockfiles ✅ Passed This PR only modifies review bot configuration files (.coderabbit.yaml, .greptile/config.json, etc.) and adds a new review rule document. It does not involve SwiftPM package changes, Xcode project...
Cmux Swift Logging ✅ Passed PR contains only configuration and documentation changes (.coderabbit.yaml, .greptile/*.json, .github/review-bot-rules/); zero production Swift source files modified. Logging check not applic...
Cmux User-Facing Error Privacy ✅ Passed This PR modifies only review bot configuration and documentation files, not production code. The check applies only to "production changes" which add user-facing errors/alerts. This PR contains no...
Cmux Full Internationalization ✅ Passed PR contains only review bot configuration and documentation files (.coderabbit.yaml, .github/review-bot-rules/, .greptile/) with no user-facing text, string catalogs, Info.plist, or web UI changes...
Cmux Swiftui State Layout ✅ Passed This PR contains only review bot configuration and documentation changes, with no Swift application code modifications. The custom check for SwiftUI state layout violations is not applicable.
Cmux Architecture Rethink ✅ Passed PR contains only review bot configuration and documentation updates with no Swift application code changes; swift-architectural-rethink rule applies only to Swift code.
Cmux Swift Auxiliary Window Close Shortcuts ✅ Passed This PR adds review-bot configuration and documentation files only (swift-auxiliary-window-close-shortcuts.md rule, .coderabbit.yaml, .greptile config updates); it contains no production Swift code...
Cmux Source Artifacts ✅ Passed All 6 changed files are hand-written configuration, documentation, and review rules: .coderabbit.yaml, review-bot-rules additions, and .greptile files. These are legitimate, intentional source arti...

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat-botrule-test-debug-placement

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.coderabbit.yaml:
- Line 24: The rule patterns for detecting test seams in the
no-test-debug-seam-in-production-source rule are inconsistent between the path
instruction and the pre-merge check, allowing seam names to slip through
enforcement. Update both the instruction at line 24 and the check at line 141 to
uniformly reference the canonical seam name patterns `…TestSeam` and `_test…` so
that naming pattern detection is consistent across both locations and no
violations can be missed.

In @.greptile/config.json:
- Line 83: The rule string in the "rule" field is missing the `_test…` pattern
from the canonical definition, which creates detection drift. Add `_test…` as an
additional naming pattern to the list of member names being checked for
test-only or debug-only seams. This pattern should be included alongside the
existing patterns like debug…, …ForTesting, …ForTests, testOnly…, …TestHook, and
…TestSeam to ensure the configuration matches the canonical definition and
prevents drift between the rule enforcement and documentation.

In @.greptile/rules.md:
- Around line 67-70: Add the missing `_test…` naming pattern to the list of
test-observability accessor patterns in the rule that fails `#if DEBUG`
extensions or members exposing internal state. The pattern list currently
includes `debug…`, `…ForTesting`, `…ForTests`, `testOnly…`, `…TestHook`, and
`…TestSeam`, but is missing `_test…` which exists in the canonical
source-of-truth rule. Insert this pattern into the enumerated list of naming
conventions to maintain complete pattern parity and prevent false negatives in
debug/test seam detection.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 0998cd1b-435b-495a-a766-bbf9de92395b

📥 Commits

Reviewing files that changed from the base of the PR and between d98e997 and 3bf5062.

📒 Files selected for processing (6)
  • .coderabbit.yaml
  • .github/review-bot-rules/README.md
  • .github/review-bot-rules/no-test-debug-seam-in-production-source.md
  • .greptile/config.json
  • .greptile/files.json
  • .greptile/rules.md

Comment thread .coderabbit.yaml Outdated
Comment thread .greptile/config.json Outdated
Comment thread .greptile/rules.md Outdated
@greptile-apps

greptile-apps Bot commented Jun 19, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR is a docs/config-only change that propagates a new "no test or debug seam in production source" review rule into both CodeRabbit and Greptile. No app or runtime code is modified.

  • Adds .github/review-bot-rules/no-test-debug-seam-in-production-source.md as the canonical rule: scoped to **/Sources/**/*.swift, flags #if DEBUG test-observability accessors, the seven named patterns (debug…/…ForTesting/…ForTests/testOnly…/…TestHook/…TestSeam/_test…), and visibility-widened wrapper accessors added for tests.
  • Mirrors the rule into .coderabbit.yaml (both path_instructions and a blocking custom_checks entry) and into .greptile/config.json, .greptile/files.json, and .greptile/rules.md, with all seven naming patterns consistently present in every location.

Confidence Score: 5/5

Docs and review-config only — no production Swift or runtime code is touched, so there is no risk of runtime regression.

All six changed files are documentation or bot-configuration files. The canonical rule file is well-formed, and all seven naming patterns (including …TestSeam and _test… that were flagged in earlier review rounds) are now consistently present across every propagated location. The scope glob and pass/fail conditions are correctly aligned between the rule file and both bot configs.

No files require special attention.

Important Files Changed

Filename Overview
.github/review-bot-rules/no-test-debug-seam-in-production-source.md New canonical rule file; clear Fail/Pass/Report sections, all seven naming patterns listed, scope and recommended fix are correct.
.coderabbit.yaml Adds both a path_instructions block and a custom_checks entry for the new rule; all seven naming patterns and _test… present in both locations, scope correctly limited to /Sources//*.swift.
.greptile/config.json New rule entry cmux-no-test-debug-seam-in-production-source with correct scope and all seven naming patterns including _test….
.greptile/files.json New entry correctly points to the canonical rule file with scope /Sources//*.swift.
.greptile/rules.md Bullet added to the top-level review checklist and a full No Test or Debug Seam in Production Source section added; all seven naming patterns correctly propagated, including …TestSeam and _test….
.github/review-bot-rules/README.md New rule file registered in the index in correct alphabetical position.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["PR diff contains Swift file\nmatching **/Sources/**/*.swift"] --> B{Under **/Tests/**?}
    B -- Yes --> PASS["PASS — test scaffolding is fine"]
    B -- No --> C{Adds #if DEBUG / test-build-guarded\nmember with no production caller?}
    C -- Yes --> FAIL["FAIL — test-observability seam\nin production source"]
    C -- No --> D{"Member name matches\ndebug… / …ForTesting / …ForTests /\ntestOnly… / …TestHook /\n…TestSeam / _test…?"}
    D -- Yes --> FAIL
    D -- No --> E{Visibility widened AND\nwrapper accessor added for test?}
    E -- Yes --> FAIL
    E -- No --> PASS
    FAIL --> FIX["Preferred fix:\nwiden private → internal,\nread from test target via\n@testable import\n(ref: cmux PR 6452)"]
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A["PR diff contains Swift file\nmatching **/Sources/**/*.swift"] --> B{Under **/Tests/**?}
    B -- Yes --> PASS["PASS — test scaffolding is fine"]
    B -- No --> C{Adds #if DEBUG / test-build-guarded\nmember with no production caller?}
    C -- Yes --> FAIL["FAIL — test-observability seam\nin production source"]
    C -- No --> D{"Member name matches\ndebug… / …ForTesting / …ForTests /\ntestOnly… / …TestHook /\n…TestSeam / _test…?"}
    D -- Yes --> FAIL
    D -- No --> E{Visibility widened AND\nwrapper accessor added for test?}
    E -- Yes --> FAIL
    E -- No --> PASS
    FAIL --> FIX["Preferred fix:\nwiden private → internal,\nread from test target via\n@testable import\n(ref: cmux PR 6452)"]
Loading

Reviews (2): Last reviewed commit: "review-bot-rules: sync _test… and …TestS..." | Re-trigger Greptile

Comment thread .coderabbit.yaml Outdated
Comment on lines +22 to +24
- path: "**/Sources/**/*.swift"
instructions: |
Apply `.github/review-bot-rules/no-test-debug-seam-in-production-source.md` during review. For Swift files under a production `Sources/` path (not under `Tests/`), flag added test-only or debug-only seams: `#if DEBUG` (or other test-build-guarded) extensions/members that expose internal state for tests or a debugger with no production caller, members named like `debug…`/`…ForTesting`/`…ForTests`/`testOnly…`/`…TestHook`, or visibility widened plus a wrapper accessor added "so the test can call it". Prefer reaching internal state from the test target via `@testable import` after widening `private` to `internal`; isolate genuinely debug-only facilities in a dedicated debug file or folder. Pass for `#if DEBUG` blocks gating real product behavior and existing seams not worsened.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 The path_instructions block for **/Sources/**/*.swift is missing two naming patterns that appear in the canonical rule file (.github/review-bot-rules/no-test-debug-seam-in-production-source.md line 14): …TestSeam and _test…. The same file's custom_checks block already includes …TestSeam, so this creates an internal inconsistency within .coderabbit.yaml as well. A member named _testAccessQueue or _testWriterQueue would slip past both the path instruction and the custom check as written.

Suggested change
- path: "**/Sources/**/*.swift"
instructions: |
Apply `.github/review-bot-rules/no-test-debug-seam-in-production-source.md` during review. For Swift files under a production `Sources/` path (not under `Tests/`), flag added test-only or debug-only seams: `#if DEBUG` (or other test-build-guarded) extensions/members that expose internal state for tests or a debugger with no production caller, members named like `debug…`/`…ForTesting`/`…ForTests`/`testOnly…`/`…TestHook`, or visibility widened plus a wrapper accessor added "so the test can call it". Prefer reaching internal state from the test target via `@testable import` after widening `private` to `internal`; isolate genuinely debug-only facilities in a dedicated debug file or folder. Pass for `#if DEBUG` blocks gating real product behavior and existing seams not worsened.
- path: "**/Sources/**/*.swift"
instructions: |
Apply `.github/review-bot-rules/no-test-debug-seam-in-production-source.md` during review. For Swift files under a production `Sources/` path (not under `Tests/`), flag added test-only or debug-only seams: `#if DEBUG` (or other test-build-guarded) extensions/members that expose internal state for tests or a debugger with no production caller, members named like `debug…`/`…ForTesting`/`…ForTests`/`testOnly…`/`…TestHook`/`…TestSeam`/`_test…`, or visibility widened plus a wrapper accessor added "so the test can call it". Prefer reaching internal state from the test target via `@testable import` after widening `private` to `internal`; isolate genuinely debug-only facilities in a dedicated debug file or folder. Pass for `#if DEBUG` blocks gating real product behavior and existing seams not worsened.

Comment thread .greptile/config.json Outdated
},
{
"id": "cmux-no-test-debug-seam-in-production-source",
"rule": "Flag Swift files under a production Sources path (matching **/Sources/** and not under **/Tests/**) that add a test-only or debug-only seam: a #if DEBUG (or other test-build-guarded) extension/member exposing internal state only for tests or a debugger with no production caller, a member named like debug…/…ForTesting/…ForTests/testOnly…/…TestHook/…TestSeam, or visibility widened together with a wrapper accessor added so a test can call it. Prefer observing internal state from the test target via @testable import after widening private to internal, or isolating a genuinely debug-only facility in a dedicated debug file or folder (canonical fix: cmux PR 6452). Pass for #if DEBUG blocks that gate real product behavior, scaffolding inside Tests/ or a test-support module, and existing seams not worsened by the PR.",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 The _test… naming pattern defined in the canonical rule file (.github/review-bot-rules/no-test-debug-seam-in-production-source.md line 14) is absent from all propagated versions. It is missing here in config.json, as well as in .coderabbit.yaml's custom_checks block (which otherwise includes …TestSeam) and in .greptile/rules.md. A method like _testQueueDepth() in a production Sources/ file would not be caught by any bot as currently configured.

Suggested change
"rule": "Flag Swift files under a production Sources path (matching **/Sources/** and not under **/Tests/**) that add a test-only or debug-only seam: a #if DEBUG (or other test-build-guarded) extension/member exposing internal state only for tests or a debugger with no production caller, a member named like debug…/…ForTesting/…ForTests/testOnly…/…TestHook/…TestSeam, or visibility widened together with a wrapper accessor added so a test can call it. Prefer observing internal state from the test target via @testable import after widening private to internal, or isolating a genuinely debug-only facility in a dedicated debug file or folder (canonical fix: cmux PR 6452). Pass for #if DEBUG blocks that gate real product behavior, scaffolding inside Tests/ or a test-support module, and existing seams not worsened by the PR.",
"rule": "Flag Swift files under a production Sources path (matching **/Sources/** and not under **/Tests/**) that add a test-only or debug-only seam: a #if DEBUG (or other test-build-guarded) extension/member exposing internal state only for tests or a debugger with no production caller, a member named like debug…/…ForTesting/…ForTests/testOnly…/…TestHook/…TestSeam/_test…, or visibility widened together with a wrapper accessor added so a test can call it. Prefer observing internal state from the test target via @testable import after widening private to internal, or isolating a genuinely debug-only facility in a dedicated debug file or folder (canonical fix: cmux PR 6452). Pass for #if DEBUG blocks that gate real product behavior, scaffolding inside Tests/ or a test-support module, and existing seams not worsened by the PR.",

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in the latest commit: added _test… (and …TestSeam where missing) to the CodeRabbit path_instructions and custom_check, plus the Greptile config.json rule and rules.md, so all propagated copies match the canonical .md source.

— Claude Code

Comment thread .greptile/rules.md Outdated

For Swift files under a production `Sources/` path (matching `**/Sources/**` and not under `**/Tests/**`), flag added test-only or debug-only seams.

Fail a `#if DEBUG` (or other test-build-guarded) extension or member that exposes internal/private state for tests or a debugger with no production caller, a member named like `debug…`/`…ForTesting`/`…ForTests`/`testOnly…`/`…TestHook`/`…TestSeam`, or visibility widened together with a wrapper accessor added so a test can call it. The compiled-out `#if DEBUG` guard does not make a test-observability accessor acceptable in shipping source.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Same _test… omission: the rules section here does not include the _test… naming pattern that the canonical .md source lists. This copy should stay in sync with the source rule file.

Suggested change
Fail a `#if DEBUG` (or other test-build-guarded) extension or member that exposes internal/private state for tests or a debugger with no production caller, a member named like `debug…`/`…ForTesting`/`…ForTests`/`testOnly…`/`…TestHook`/`…TestSeam`, or visibility widened together with a wrapper accessor added so a test can call it. The compiled-out `#if DEBUG` guard does not make a test-observability accessor acceptable in shipping source.
Fail a `#if DEBUG` (or other test-build-guarded) extension or member that exposes internal/private state for tests or a debugger with no production caller, a member named like `debug…`/`…ForTesting`/`…ForTests`/`testOnly…`/`…TestHook`/`…TestSeam`/`_test…`, or visibility widened together with a wrapper accessor added so a test can call it. The compiled-out `#if DEBUG` guard does not make a test-observability accessor acceptable in shipping source.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed: .greptile/rules.md now lists _test… in the fail-member naming list, matching the canonical rule file.

— Claude Code

CodeRabbit/Greptile flagged that the propagated bot-instruction copies
dropped the `_test…` fail-pattern (and CodeRabbit path_instructions also
dropped `…TestSeam`) that the canonical rule .md enumerates. Add them back
so the bot instructions match the source-of-truth rule file.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@azooz2003-bit
azooz2003-bit merged commit a43b7ed into main Jun 19, 2026
26 checks passed
@azooz2003-bit
azooz2003-bit deleted the feat-botrule-test-debug-placement branch June 19, 2026 20:55

This branch was successfully deployed

1 active deployment
Preview – cmux — 093643ed Deployed Jun 19, 2026 by vercel[bot]
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