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:
@@ -282,7 +282,7 @@ const extractSessionMemory = sequential(async function (
|
||||
|
||||
// Check gate lazily when hook runs (cached, non-blocking)
|
||||
if (!isSessionMemoryGateEnabled()) {
|
||||
// Log gate failure once per session (ant-only)
|
||||
// Log gate failure once per session (internal-only)
|
||||
if (process.env.USER_TYPE === 'ant' && !hasLoggedGateFailure) {
|
||||
hasLoggedGateFailure = true
|
||||
logEvent('tengu_session_memory_gate_disabled', {})
|
||||
@@ -359,7 +359,7 @@ export function initSessionMemory(): void {
|
||||
// Session memory is used for compaction, so respect auto-compact settings
|
||||
const autoCompactEnabled = isAutoCompactEnabled()
|
||||
|
||||
// Log initialization state (ant-only to avoid noise in external logs)
|
||||
// Log initialization state (internal-only to avoid noise in external logs)
|
||||
if (process.env.USER_TYPE === 'ant') {
|
||||
logEvent('tengu_session_memory_init', {
|
||||
auto_compact_enabled: autoCompactEnabled,
|
||||
|
||||
@@ -711,7 +711,7 @@ export class FirstPartyEventLoggingExporter implements LogRecordExporter {
|
||||
eventMetadata,
|
||||
)
|
||||
|
||||
// _PROTO_* keys are PII-tagged values meant only for privileged BQ
|
||||
// _PROTO_* keys are PII-tagged values meinternal only for privileged BQ
|
||||
// columns. Hoist known keys to proto fields, then defensively strip any
|
||||
// remaining _PROTO_* so an unrecognized future key can't silently land
|
||||
// in the general-access additional_metadata blob. sink.ts applies the
|
||||
|
||||
@@ -202,7 +202,7 @@ export function hasGrowthBookEnvOverride(feature: string): boolean {
|
||||
}
|
||||
|
||||
/**
|
||||
* Local config overrides set via /config Gates tab (ant-only). Checked after
|
||||
* Local config overrides set via /config Gates tab (internal-only). Checked after
|
||||
* env-var overrides — env wins so eval harnesses remain deterministic. Unlike
|
||||
* getEnvOverrides this is not memoized: the user can change overrides at
|
||||
* runtime, and getGlobalConfig() is already memory-cached (pointer-chase)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// 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
|
||||
/**
|
||||
* Shared event metadata enrichment for analytics systems
|
||||
*
|
||||
@@ -490,9 +490,9 @@ export type EventMetadata = {
|
||||
teamName?: string // Team name for swarm agents (from env var or AsyncLocalStorage)
|
||||
subscriptionType?: string // OAuth subscription tier (max, pro, enterprise, team)
|
||||
rh?: string // Hashed repo remote URL (first 16 chars of SHA256), for joining with server-side data
|
||||
kairosActive?: true // KAIROS assistant mode active (ant-only; set in main.tsx after gate check)
|
||||
skillMode?: 'discovery' | 'coach' | 'discovery_and_coach' // Which skill surfacing mechanism(s) are gated on (ant-only; for BQ session segmentation)
|
||||
observerMode?: 'backseat' | 'skillcoach' | 'both' // Which observer classifiers are gated on (ant-only; for BQ cohort splits on tengu_backseat_* events)
|
||||
kairosActive?: true // KAIROS assistant mode active (internal-only; set in main.tsx after gate check)
|
||||
skillMode?: 'discovery' | 'coach' | 'discovery_and_coach' // Which skill surfacing mechanism(s) are gated on (internal-only; for BQ session segmentation)
|
||||
observerMode?: 'backseat' | 'skillcoach' | 'both' // Which observer classifiers are gated on (internal-only; for BQ cohort splits on tengu_backseat_* events)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -62,7 +62,7 @@ function logEventImpl(eventName: string, metadata: LogEventMetadata): void {
|
||||
|
||||
if (shouldTrackDatadog()) {
|
||||
// Datadog is a general-access backend — strip _PROTO_* keys
|
||||
// (unredacted PII-tagged values meant only for the 1P privileged column).
|
||||
// (unredacted PII-tagged values meinternal only for the 1P privileged column).
|
||||
void trackDatadogEvent(eventName, stripProtoFields(metadataWithSampleRate))
|
||||
}
|
||||
|
||||
|
||||
@@ -463,7 +463,7 @@ function configureEffortParams(
|
||||
outputConfig.effort = effortValue
|
||||
betas.push(EFFORT_BETA_HEADER)
|
||||
} else if (process.env.USER_TYPE === 'ant') {
|
||||
// Numeric effort override - ant-only (uses anthropic_internal)
|
||||
// Numeric effort override - internal-only (uses anthropic_internal)
|
||||
const existingInternal =
|
||||
(extraBodyParams.anthropic_internal as Record<string, unknown>) || {}
|
||||
extraBodyParams.anthropic_internal = {
|
||||
@@ -1195,7 +1195,7 @@ async function* queryModel(
|
||||
// Determine if cached microcompact is enabled for this model.
|
||||
// Computed once here (in async context) and captured by paramsFromContext.
|
||||
// The beta header is also captured here to avoid a top-level import of the
|
||||
// ant-only CACHE_EDITING_BETA_HEADER constant.
|
||||
// internal-only CACHE_EDITING_BETA_HEADER constant.
|
||||
let cachedMCEnabled = false
|
||||
let cacheEditingBetaHeader = ''
|
||||
if (feature('CACHED_MICROCOMPACT')) {
|
||||
|
||||
@@ -75,7 +75,7 @@ const FOREGROUND_529_RETRY_SOURCES = new Set<QuerySource>([
|
||||
'side_question',
|
||||
// Security classifiers — must complete for auto-mode correctness.
|
||||
// yoloClassifier.ts uses 'auto_mode' (not 'yolo_classifier' — that's
|
||||
// type-only). bash_classifier is ant-only; feature-gate so the string
|
||||
// type-only). bash_classifier is internal-only; feature-gate so the string
|
||||
// tree-shakes out of external builds (excluded-strings.txt).
|
||||
'auto_mode',
|
||||
...(feature('BASH_CLASSIFIER') ? (['bash_classifier'] as const) : []),
|
||||
@@ -88,7 +88,7 @@ function shouldRetry529(querySource: QuerySource | undefined): boolean {
|
||||
)
|
||||
}
|
||||
|
||||
// CLAUDE_CODE_UNATTENDED_RETRY: for unattended sessions (ant-only). Retries 429/529
|
||||
// CLAUDE_CODE_UNATTENDED_RETRY: for unattended sessions (internal-only). Retries 429/529
|
||||
// indefinitely with higher backoff and periodic keep-alive yields so the host
|
||||
// environment does not mark the session idle mid-wait.
|
||||
// TODO(ANT-344): the keep-alive via SystemAPIErrorMessage yields is a stopgap
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// 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
|
||||
// Background memory consolidation. Fires the /dream prompt as a forked
|
||||
// subagent when time-gate passes AND enough sessions have accumulated.
|
||||
//
|
||||
|
||||
@@ -86,7 +86,7 @@ export function getAPIContextManagement(options?: {
|
||||
})
|
||||
}
|
||||
|
||||
// Tool clearing strategies are ant-only
|
||||
// Tool clearing strategies are internal-only
|
||||
if (process.env.USER_TYPE !== 'ant') {
|
||||
return strategies.length > 0 ? { edits: strategies } : undefined
|
||||
}
|
||||
|
||||
@@ -188,7 +188,7 @@ export async function shouldAutoCompact(
|
||||
|
||||
// Reactive-only mode: suppress proactive autocompact, let reactive compact
|
||||
// catch the API's prompt-too-long. feature() wrapper keeps the flag string
|
||||
// out of external builds (REACTIVE_COMPACT is ant-only).
|
||||
// out of external builds (REACTIVE_COMPACT is internal-only).
|
||||
// Note: returning false here also means autoCompactIfNeeded never reaches
|
||||
// trySessionMemoryCompaction in the query loop — the /compact call site
|
||||
// still tries session memory first. Revisit if reactive-only graduates.
|
||||
|
||||
@@ -49,7 +49,7 @@ const COMPACTABLE_TOOLS = new Set<string>([
|
||||
FILE_WRITE_TOOL_NAME,
|
||||
])
|
||||
|
||||
// --- Cached microcompact state (ant-only, gated by feature('CACHED_MICROCOMPACT')) ---
|
||||
// --- Cached microcompact state (internal-only, gated by feature('CACHED_MICROCOMPACT')) ---
|
||||
|
||||
// Lazy-initialized cached MC module and state to avoid importing in external builds.
|
||||
// The imports and state live inside feature() checks for dead code elimination.
|
||||
|
||||
@@ -419,7 +419,7 @@ export function shouldUseSessionMemoryCompaction(): boolean {
|
||||
)
|
||||
const shouldUse = sessionMemoryFlag && smCompactFlag
|
||||
|
||||
// Log flag states for debugging (ant-only to avoid noise in external logs)
|
||||
// Log flag states for debugging (internal-only to avoid noise in external logs)
|
||||
if (process.env.USER_TYPE === 'ant') {
|
||||
logEvent('tengu_sm_compact_flag_check', {
|
||||
tengu_session_memory: sessionMemoryFlag,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Mock rate limits for testing [ANT-ONLY]
|
||||
// Mock rate limits for testing [internal-only]
|
||||
// This allows testing various rate limit scenarios without hitting actual limits
|
||||
//
|
||||
// ⚠️ WARNING: This is for internal testing/demo purposes only!
|
||||
|
||||
Reference in New Issue
Block a user