Hide custom rules from users behind a feature gate#533
Merged
Conversation
Custom natural-language rules can't be honored on the current engines: the Open Source path runs base models with no instruction-following, and on every engine the rule text tends to leak into the suggestion (#340, #292) while nothing measures adherence. Gate the feature off behind a single CustomRulesCatalog.isUserFacingEnabled flag instead of deleting it. - Stop injecting rules at the sole request constructor (SuggestionRequestFactory), covering both the llama and Foundation Models paths. - Hide the Rules section in the Writing settings pane and adjust the personalization caption. - Skip the writing-style onboarding step; progress counts and back/next routing branch on the flag. Stored rules in cotabbyCustomRules are never touched and the editor and renderer code is kept, so re-enabling is a one-line flip once rules are measured to actually influence output. Refs #340, #292
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
Hide the custom natural-language "rules" feature from users behind a single
CustomRulesCatalog.isUserFacingEnabledflag (currentlyfalse), rather thandeleting it. The feature can't be honored on the current engines: the Open
Source path now runs base models that have no instruction-following channel, and
on every engine the rule text tends to leak verbatim into suggestions (#340,
#292) while nothing measures adherence, so showing it sets a promise we can't
keep. Gating it off (instead of removing the code) keeps re-enabling to a
one-line flip once rules are measured to actually influence output.
This is only the free-text style rules. The per-app and per-site disable rules
are a separate, deterministic subsystem and are untouched.
Validation
CustomRulesTestsstays green because it constructsSuggestionRequestdirectlyand asserts normalization plus prompt placement, so the factory-level gate does
not touch those paths (which is also what keeps the kept code valid for a future
re-enable).
Not click-tested in a running app: the Settings pane hiding the Rules section and
onboarding skipping the writing-style step are control-flow changes verified by
the build only. They are guarded by the same compile-time flag, so behavior is
deterministic.
Linked issues
Refs #340 (rule / scaffolding text leaking into suggestions)
Refs #292 (rules have no effect on the Apple Intelligence backend)
Linked, not closed: this removes the feature from the user surface so neither
symptom can reach users today, but the intent is to bring rules back once they
measurably bind, so the issues stay open to track that.
Risk / rollout notes
shows the Rules section (and its caption drops "and rules"), and first-run
onboarding drops the "Your writing style" step (progress indicator goes from 5
steps to 4; back/next routing and the step counts branch on the flag).
cotabbyCustomRulesUserDefaults keyare never deleted and the only writer (the editor) is hidden, so a user's saved
rules survive intact and re-apply automatically if the flag is flipped back.
path, and the style instructions are no longer added on the Foundation Models
path.
CustomRulesEditor,CustomRulesCatalog(palette/ normalize), the settings model rule methods, and both renderers' rule
handling all remain; they are simply unreferenced from the UI and receive an
empty list from the request factory.
CustomRulesCatalog.isUserFacingEnabledtotrue.Suggested bar before doing so: a rule-adherence eval (extend the Foundation
Models drift eval with a compliance + scaffolding-leak category) showing
measurable adherence and near-zero leak on the target engine.
Greptile Summary
Gates the custom free-text rules feature behind
CustomRulesCatalog.isUserFacingEnabled = falserather than deleting it, preserving stored user data and all supporting code so re-enabling is a one-line change. The flag is applied at the three necessary sites: prompt injection inSuggestionRequestFactory, the Writing settings pane, and the onboarding wizard navigation.CustomRulesCataloggainsisUserFacingEnabled = falsewith a detailed doc-comment explaining the rationale and exact re-enable path; no model data is deleted.SuggestionRequestFactory.buildRequestreplacessettings.customRuleswith[]when the flag is off, so rule text cannot reach either the llama or Foundation Models prompt regardless of stored state.WelcomeViewcorrectly skips the.writingStyleonboarding step in both forward and back navigation and adjuststotalProgressStepsandkeybind.progressIndexto show "Step 4 of 4" instead of "Step 5 of 5".Confidence Score: 4/5
Safe to merge; the gate is applied at all three enforcement sites with no path that can bypass it.
The change is a clean feature-flag hide: no stored data is modified, no model is altered, and the navigation routing is consistent in both flag states. The only gap worth noting is that
SuggestionRequestFactory.buildRequesthas no test asserting that rules from settings are suppressed (or forwarded) based on the flag — so when the flag is later flipped back totrue, the injection behavior won't be regression-protected by the factory test suite.No files require special attention; the test gap in
SuggestionRequestFactoryTestsis a follow-up concern, not a blocker.Important Files Changed
isUserFacingEnabled = falseas the single compile-time toggle for the feature gate, with thorough doc-comment describing the three enforcement sites and re-enable path.settings.customRulesto[]at the prompt-injection layer when the flag is off; stored rules are unaffected. Factory-level gate behavior is not covered by any existingbuildRequesttest.Sectionbased on the flag; logic is clean and symmetric with the onboarding change..writingStylein both forward and back directions;totalProgressStepsandkeybind.progressIndexboth adjust for the 4-step flow. All paths are consistent when the flag isfalse.Reviews (1): Last reviewed commit: "Hide custom rules from users behind a fe..." | Re-trigger Greptile