Reduce internal-only labeling noise in source comments (#355)
This pass rewrites comment-only ANT-ONLY markers to neutral internal-only language across the source tree without changing runtime strings, flags, commands, or protocol identifiers. The goal is to lower obvious internal prose leakage while keeping the diff mechanically safe and easy to review. Constraint: Phase B is limited to comments/prose only; runtime strings and user-facing labels remain deferred Rejected: Broad search-and-replace across strings and command descriptions | too risky for a prose-only pass Confidence: high Scope-risk: narrow Reversibility: clean Directive: Remaining ANT-ONLY hits are mostly runtime/user-facing strings and should be handled separately from comment cleanup Tested: bun run build Tested: bun run smoke Tested: bun run verify:privacy Tested: bun run test:provider Tested: bun run test:provider-recommendation Not-tested: Full repo typecheck (upstream baseline remains noisy) Co-authored-by: anandh8x <test@example.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { c as _c } from "react-compiler-runtime";
|
||||
// biome-ignore-all assist/source/organizeImports: ANT-ONLY import markers must not be reordered
|
||||
// biome-ignore-all assist/source/organizeImports: internal-only import markers must not be reordered
|
||||
import { feature } from 'bun:bundle';
|
||||
import { spawnSync } from 'child_process';
|
||||
import { snapshotOutputTokensForTurn, getCurrentTurnTokenBudget, getTurnOutputTokens, getBudgetContinuationCount, getTotalInputTokens } from '../bootstrap/state.js';
|
||||
@@ -101,7 +101,7 @@ const useVoiceIntegration: typeof import('../hooks/useVoiceIntegration.js').useV
|
||||
resetAnchor: () => { }
|
||||
});
|
||||
const VoiceKeybindingHandler: typeof import('../hooks/useVoiceIntegration.js').VoiceKeybindingHandler = feature('VOICE_MODE') ? require('../hooks/useVoiceIntegration.js').VoiceKeybindingHandler : () => null;
|
||||
// Frustration detection is ant-only (dogfooding). Conditional require so external
|
||||
// Frustration detection is internal-only (dogfooding). Conditional require so external
|
||||
// builds eliminate the module entirely (including its two O(n) useMemos that run
|
||||
// on every messages change, plus the GrowthBook fetch).
|
||||
const useFrustrationDetection: typeof import('../components/FeedbackSurvey/useFrustrationDetection.js').useFrustrationDetection = "external" === 'ant' ? require('../components/FeedbackSurvey/useFrustrationDetection.js').useFrustrationDetection : () => ({
|
||||
@@ -726,7 +726,7 @@ export function REPL({
|
||||
const [ideToInstallExtension, setIDEToInstallExtension] = useState<IdeType | null>(null);
|
||||
const [ideInstallationStatus, setIDEInstallationStatus] = useState<IDEExtensionInstallationStatus | null>(null);
|
||||
const [showIdeOnboarding, setShowIdeOnboarding] = useState(false);
|
||||
// Dead code elimination: model switch callout state (ant-only)
|
||||
// Dead code elimination: model switch callout state (internal-only)
|
||||
const [showModelSwitchCallout, setShowModelSwitchCallout] = useState(() => {
|
||||
if ("external" === 'ant') {
|
||||
return shouldShowAntModelSwitch();
|
||||
@@ -1161,7 +1161,7 @@ export function REPL({
|
||||
}
|
||||
}, [sessionStatus, waitingFor]);
|
||||
|
||||
// 3P default: off — OSC 21337 is ant-only while the spec stabilizes.
|
||||
// 3P default: off — OSC 21337 is internal-only while the spec stabilizes.
|
||||
// Gated so we can roll back if the sidebar indicator conflicts with
|
||||
// the title spinner in terminals that render both. When the flag is
|
||||
// on, the user-facing config setting controls whether it's active.
|
||||
@@ -1428,7 +1428,7 @@ export function REPL({
|
||||
// Ref instead of state to avoid triggering React re-renders on every
|
||||
// streaming text_delta. The spinner reads this via its animation timer.
|
||||
const responseLengthRef = useRef(0);
|
||||
// API performance metrics ref for ant-only spinner display (TTFT/OTPS).
|
||||
// API performance metrics ref for internal-only spinner display (TTFT/OTPS).
|
||||
// Accumulates metrics from all API requests in a turn for P50 aggregation.
|
||||
const apiMetricsRef = useRef<Array<{
|
||||
ttftMs: number;
|
||||
@@ -2044,10 +2044,10 @@ export function REPL({
|
||||
// Onboarding dialogs (special conditions)
|
||||
if (allowDialogsWithAnimation && showIdeOnboarding) return 'ide-onboarding';
|
||||
|
||||
// Model switch callout (ant-only, eliminated from external builds)
|
||||
// Model switch callout (internal-only, eliminated from external builds)
|
||||
if ("external" === 'ant' && allowDialogsWithAnimation && showModelSwitchCallout) return 'model-switch';
|
||||
|
||||
// Undercover auto-enable explainer (ant-only, eliminated from external builds)
|
||||
// Undercover auto-enable explainer (internal-only, eliminated from external builds)
|
||||
if ("external" === 'ant' && allowDialogsWithAnimation && showUndercoverCallout) return 'undercover-callout';
|
||||
|
||||
// Effort callout (shown once for Opus 4.6 users when effort is enabled)
|
||||
@@ -2814,7 +2814,7 @@ export function REPL({
|
||||
}
|
||||
queryCheckpoint('query_end');
|
||||
|
||||
// Capture ant-only API metrics before resetLoadingState clears the ref.
|
||||
// Capture internal-only API metrics before resetLoadingState clears the ref.
|
||||
// For multi-request turns (tool use loops), compute P50 across all requests.
|
||||
if ("external" === 'ant' && apiMetricsRef.current.length > 0) {
|
||||
const entries = apiMetricsRef.current;
|
||||
@@ -2938,7 +2938,7 @@ export function REPL({
|
||||
// can stop the spark animation and show post-turn UI.
|
||||
sendBridgeResultRef.current();
|
||||
|
||||
// Auto-hide tungsten panel content at turn end (ant-only), but keep
|
||||
// Auto-hide tungsten panel content at turn end (internal-only), but keep
|
||||
// tungstenActiveSession set so the pill stays in the footer and the user
|
||||
// can reopen the panel. Background tmux tasks (e.g. /hunter) run for
|
||||
// minutes — wiping the session made the pill disappear entirely, forcing
|
||||
@@ -2955,7 +2955,7 @@ export function REPL({
|
||||
});
|
||||
}
|
||||
|
||||
// Capture budget info before clearing (ant-only)
|
||||
// Capture budget info before clearing (internal-only)
|
||||
let budgetInfo: {
|
||||
tokens: number;
|
||||
limit: number;
|
||||
@@ -4901,7 +4901,7 @@ export function REPL({
|
||||
{postCompactSurvey.state !== 'closed' ? <FeedbackSurvey state={postCompactSurvey.state} lastResponse={postCompactSurvey.lastResponse} handleSelect={postCompactSurvey.handleSelect} inputValue={inputValue} setInputValue={setInputValue} onRequestFeedback={handleSurveyRequestFeedback} /> : memorySurvey.state !== 'closed' ? <FeedbackSurvey state={memorySurvey.state} lastResponse={memorySurvey.lastResponse} handleSelect={memorySurvey.handleSelect} handleTranscriptSelect={memorySurvey.handleTranscriptSelect} inputValue={inputValue} setInputValue={setInputValue} onRequestFeedback={handleSurveyRequestFeedback} message="How well did Claude use its memory? (optional)" /> : <FeedbackSurvey state={feedbackSurvey.state} lastResponse={feedbackSurvey.lastResponse} handleSelect={feedbackSurvey.handleSelect} handleTranscriptSelect={feedbackSurvey.handleTranscriptSelect} inputValue={inputValue} setInputValue={setInputValue} onRequestFeedback={didAutoRunIssueRef.current ? undefined : handleSurveyRequestFeedback} />}
|
||||
{/* Frustration-triggered transcript sharing prompt */}
|
||||
{frustrationDetection.state !== 'closed' && <FeedbackSurvey state={frustrationDetection.state} lastResponse={null} handleSelect={() => { }} handleTranscriptSelect={frustrationDetection.handleTranscriptSelect} inputValue={inputValue} setInputValue={setInputValue} />}
|
||||
{/* Skill improvement survey - appears when improvements detected (ant-only) */}
|
||||
{/* Skill improvement survey - appears when improvements detected (internal-only) */}
|
||||
{"external" === 'ant' && skillImprovementSurvey.suggestion && <SkillImprovementSurvey isOpen={skillImprovementSurvey.isOpen} skillName={skillImprovementSurvey.suggestion.skillName} updates={skillImprovementSurvey.suggestion.updates} handleSelect={skillImprovementSurvey.handleSelect} inputValue={inputValue} setInputValue={setInputValue} />}
|
||||
{showIssueFlagBanner && <IssueFlagBanner />}
|
||||
{ }
|
||||
|
||||
Reference in New Issue
Block a user