From 6902aba99c9348ac074f36ff4476da8251159079 Mon Sep 17 00:00:00 2001 From: Neil Date: Tue, 10 Nov 2026 20:18:22 -0800 Subject: [PATCH] test(cloud): glossary lint scans every copy literal + vm-*.ts copy tables; Claude not Claude Code in MCP panel; Dev Container; recipe 'VM is running until you choose' (design-squad rulings) --- .../cloud-environment/EnvironmentForm.tsx | 2 +- .../cloud-mcp/CloudMcpSyncPanel.tsx | 3 +- .../worktree-creation/VmBuildFailureCard.tsx | 4 +- .../src/i18n/en-runtime-required.json | 4 + src/renderer/src/i18n/locales/en.json | 3 +- .../orca-cloud/cloud-glossary-allowlist.json | 133 +++++++++++++++++- .../orca-cloud/cloud-glossary-lint.test.ts | 69 ++++++++- 7 files changed, 204 insertions(+), 14 deletions(-) diff --git a/src/renderer/src/components/cloud-environment/EnvironmentForm.tsx b/src/renderer/src/components/cloud-environment/EnvironmentForm.tsx index fc7fb97d2fc..c31b1d202ec 100644 --- a/src/renderer/src/components/cloud-environment/EnvironmentForm.tsx +++ b/src/renderer/src/components/cloud-environment/EnvironmentForm.tsx @@ -124,7 +124,7 @@ export function EnvironmentForm({ {t( 'cloudEnvironment.form.importHint', - 'Reads Conductor and dev container setup from a local project.' + 'Reads Conductor and Dev Container setup from a local project.' )} {importProjects.map((project) => ( diff --git a/src/renderer/src/components/settings/runtime-environments/cloud-mcp/CloudMcpSyncPanel.tsx b/src/renderer/src/components/settings/runtime-environments/cloud-mcp/CloudMcpSyncPanel.tsx index ef2ecb15032..d6ffb508ff8 100644 --- a/src/renderer/src/components/settings/runtime-environments/cloud-mcp/CloudMcpSyncPanel.tsx +++ b/src/renderer/src/components/settings/runtime-environments/cloud-mcp/CloudMcpSyncPanel.tsx @@ -22,7 +22,8 @@ import { mcpSyncTimeLabel } from './cloud-mcp-sync-copy' -const AGENT_LABEL = { claude: 'Claude Code', codex: 'Codex' } as const +// Glossary: the catalog name is "Claude", never "Claude Code". +const AGENT_LABEL = { claude: 'Claude', codex: 'Codex' } as const export type CloudMcpSyncPanelProps = { status: McpSyncStatus diff --git a/src/renderer/src/components/worktree-creation/VmBuildFailureCard.tsx b/src/renderer/src/components/worktree-creation/VmBuildFailureCard.tsx index dc7e71887db..68b455047af 100644 --- a/src/renderer/src/components/worktree-creation/VmBuildFailureCard.tsx +++ b/src/renderer/src/components/worktree-creation/VmBuildFailureCard.tsx @@ -133,8 +133,8 @@ export function VmBuildFailureCard({ ) : (

{t( - 'auto.components.worktree.creation.VmBuildFailureCard.stillRunningLocal', - 'The VM is running and using hours until you choose.' + 'auto.components.worktree.creation.VmBuildFailureCard.stillRunningLocal2', + 'The VM is running until you choose.' )}

) diff --git a/src/renderer/src/i18n/en-runtime-required.json b/src/renderer/src/i18n/en-runtime-required.json index 501157fa702..181e3d98c3e 100644 --- a/src/renderer/src/i18n/en-runtime-required.json +++ b/src/renderer/src/i18n/en-runtime-required.json @@ -1357,6 +1357,7 @@ "checksCountTitleVm_other": "The VM is up, but {{count}} environment checks failed", "memberLimitBodyCount_one": "You can run {{count}} sandbox at once. Put it to sleep or delete it, then try again. Nothing was created, and you weren’t charged.", "memberLimitBodyCount_other": "You can run {{count}} sandboxes at once. Put one to sleep or delete it, then try again. Nothing was created, and you weren’t charged.", + "stillRunningLocal": "The VM is running and using hours until you choose.", "teamLimitBodyCount_one": "Your team can run {{count}} sandbox at once ({{value1}} per seat). Put it to sleep or delete it, then try again. Nothing was created, and you weren’t charged.", "teamLimitBodyCount_other": "Your team can run {{count}} sandboxes at once ({{value1}} per seat). Put one to sleep or delete it, then try again. Nothing was created, and you weren’t charged." }, @@ -1513,6 +1514,9 @@ } }, "cloudEnvironment": { + "form": { + "importHint": "Reads Conductor and dev container setup from a local project." + }, "staleness": { "branchMovedInRepo_one": "{{branch}} in {{repo}} is {{count}} commit ahead of build #{{number}}", "branchMovedInRepo_other": "{{branch}} in {{repo}} is {{count}} commits ahead of build #{{number}}", diff --git a/src/renderer/src/i18n/locales/en.json b/src/renderer/src/i18n/locales/en.json index aa4242fd021..b1a84bc6961 100644 --- a/src/renderer/src/i18n/locales/en.json +++ b/src/renderer/src/i18n/locales/en.json @@ -4313,7 +4313,8 @@ "startAgain": "Start again", "cloudUnusableTitle": "This sandbox can’t open your workspace", "cloudUnusableDeletedBody": "The sandbox was deleted. Start again to try a new one.", - "cloudUnusableBody": "Start again on a new sandbox, or delete this one." + "cloudUnusableBody": "Start again on a new sandbox, or delete this one.", + "stillRunningLocal2": "The VM is running until you choose." }, "VmBuildLog": { "jumpToError": "Jump to first error", diff --git a/src/renderer/src/lib/orca-cloud/cloud-glossary-allowlist.json b/src/renderer/src/lib/orca-cloud/cloud-glossary-allowlist.json index d1541f22e7c..5f7f7951cc3 100644 --- a/src/renderer/src/lib/orca-cloud/cloud-glossary-allowlist.json +++ b/src/renderer/src/lib/orca-cloud/cloud-glossary-allowlist.json @@ -1,9 +1,128 @@ [ - { "path": "src/renderer/src/components/cloud-environment/EnvironmentForm.tsx", "line": 127, "term": "container", "reason": "\"dev container\" is the Dev Containers spec name (an import source), not the sandbox." }, - { "path": "src/renderer/src/components/settings/virtual-machines/runtimes/CloudVmSetupGuide.tsx", "line": 20, "term": "VM", "reason": "BYOC / recipe-VM settings (Custom environments), where the glossary allows VM." }, - { "path": "src/renderer/src/components/worktree-creation/VmBuildFailureActions.tsx", "line": 365, "term": "VM", "reason": "Recipe-VM branch; the Orca Cloud branch says \"Delete sandbox\"." }, - { "path": "src/renderer/src/components/worktree-creation/VmBuildFailureCard.tsx", "line": 143, "term": "VM", "reason": "Recipe-VM branch; Orca Cloud renders BlockedSandboxHoursNote instead." }, - { "path": "src/renderer/src/components/worktree-creation/VmDeleteConfirmDialog.tsx", "line": 38, "term": "VM", "reason": "Recipe-VM branch; the Orca Cloud branch says \"Delete this sandbox?\"." }, - { "path": "src/renderer/src/components/worktree-creation/VmDeleteConfirmDialog.tsx", "line": 49, "term": "VM", "reason": "Recipe-VM branch; the Orca Cloud branch says the sandbox is deleted." }, - { "path": "src/renderer/src/components/worktree-creation/VmDeleteConfirmDialog.tsx", "line": 63, "term": "VM", "reason": "Recipe-VM branch; the Orca Cloud branch says \"Delete sandbox\"." } + { + "path": "src/renderer/src/components/cloud-environment/EnvironmentForm.tsx", + "line": 127, + "term": "container", + "reason": "Dev Containers spec name" + }, + { + "path": "src/renderer/src/components/settings/virtual-machines/runtimes/CloudVmSetupGuide.tsx", + "line": 20, + "term": "VM", + "reason": "BYOC recipe VMs (experimental), not Orca Cloud" + }, + { + "path": "src/renderer/src/components/worktree-creation/VmBuildFailureActions.tsx", + "line": 365, + "term": "VM", + "reason": "recipe-VM branch; cloud branch says sandbox" + }, + { + "path": "src/renderer/src/components/worktree-creation/VmBuildFailureCard.tsx", + "line": 143, + "term": "VM", + "reason": "recipe-VM branch; cloud branch says sandbox" + }, + { + "path": "src/renderer/src/components/worktree-creation/VmDeleteConfirmDialog.tsx", + "line": 38, + "term": "VM", + "reason": "recipe-VM branch; cloud branch says sandbox" + }, + { + "path": "src/renderer/src/components/worktree-creation/VmDeleteConfirmDialog.tsx", + "line": 49, + "term": "VM", + "reason": "recipe-VM branch; cloud branch says sandbox" + }, + { + "path": "src/renderer/src/components/worktree-creation/VmDeleteConfirmDialog.tsx", + "line": 63, + "term": "VM", + "reason": "recipe-VM branch; cloud branch says sandbox" + }, + { + "path": "src/renderer/src/components/worktree-creation/vm-build-failure-copy.ts", + "line": 85, + "term": "VM", + "reason": "recipe-VM branch; cloud branch says sandbox" + }, + { + "path": "src/renderer/src/components/worktree-creation/vm-build-failure-copy.ts", + "line": 89, + "term": "VM", + "reason": "recipe-VM branch; cloud branch says sandbox" + }, + { + "path": "src/renderer/src/components/worktree-creation/vm-build-failure-copy.ts", + "line": 92, + "term": "VM", + "reason": "recipe-VM branch; cloud branch says sandbox" + }, + { + "path": "src/renderer/src/components/worktree-creation/vm-build-recipe-failure-copy.ts", + "line": 15, + "term": "VM", + "reason": "recipe-VM branch; cloud branch says sandbox" + }, + { + "path": "src/renderer/src/components/worktree-creation/vm-build-recipe-failure-copy.ts", + "line": 19, + "term": "VM", + "reason": "recipe-VM branch; cloud branch says sandbox" + }, + { + "path": "src/renderer/src/components/worktree-creation/vm-build-recipe-failure-copy.ts", + "line": 25, + "term": "VM", + "reason": "recipe-VM branch; cloud branch says sandbox" + }, + { + "path": "src/renderer/src/components/worktree-creation/vm-build-recipe-failure-copy.ts", + "line": 29, + "term": "VM", + "reason": "recipe-VM branch; cloud branch says sandbox" + }, + { + "path": "src/renderer/src/components/worktree-creation/vm-build-sheet-copy.ts", + "line": 10, + "term": "VM", + "reason": "recipe-VM branch; cloud branch says sandbox" + }, + { + "path": "src/renderer/src/components/worktree-creation/vm-build-sheet-copy.ts", + "line": 69, + "term": "VM", + "reason": "recipe-VM branch; cloud branch says sandbox" + }, + { + "path": "src/renderer/src/components/worktree-creation/vm-build-sheet-copy.ts", + "line": 74, + "term": "VM", + "reason": "recipe-VM branch; cloud branch says sandbox" + }, + { + "path": "src/renderer/src/components/worktree-creation/vm-build-sheet-copy.ts", + "line": 79, + "term": "VM", + "reason": "recipe-VM branch; cloud branch says sandbox" + }, + { + "path": "src/renderer/src/components/worktree-creation/vm-build-sheet-copy.ts", + "line": 84, + "term": "VM", + "reason": "recipe-VM branch; cloud branch says sandbox" + }, + { + "path": "src/renderer/src/components/orca-cloud/use-cloud-terminal-error-override.ts", + "line": 13, + "term": "VM", + "reason": "Matcher for older builds' saved terminal errors so they stay hidden; never displayed" + }, + { + "path": "src/renderer/src/components/orca-cloud/use-cloud-terminal-error-override.ts", + "line": 14, + "term": "VM", + "reason": "Matcher for older builds' saved terminal errors so they stay hidden; never displayed" + } ] diff --git a/src/renderer/src/lib/orca-cloud/cloud-glossary-lint.test.ts b/src/renderer/src/lib/orca-cloud/cloud-glossary-lint.test.ts index 25f028b1897..f89e041067f 100644 --- a/src/renderer/src/lib/orca-cloud/cloud-glossary-lint.test.ts +++ b/src/renderer/src/lib/orca-cloud/cloud-glossary-lint.test.ts @@ -15,6 +15,8 @@ const SCOPE = [ 'src/renderer/src/components/settings/**/{OrcaCloud,Cloud,PlanBilling,AgentAccounts,Accounts}*.tsx', 'src/renderer/src/components/worktree-creation/Vm*.tsx', 'src/renderer/src/components/worktree-creation/*Cloud*.tsx', + // Copy tables behind the Vm* components (design-squad scope fix). + 'src/renderer/src/components/worktree-creation/vm-*.ts', 'src/renderer/src/lib/*cloud*.ts', 'mobile/src/**/*{Cloud,cloud}*.tsx' ] @@ -82,6 +84,58 @@ function stringValue(node: ts.Node): string | null { return null } +const SKIP_ATTRIBUTES = /^(className|class|id|key|testId|data-.*|href|src|role|type|name|variant|size|side|align)$/ +const SKIP_PROPERTIES = /^(className|id|key|testId|kind|type|variant|status|state|icon|href|path|url|pane|section|sectionId)$/ + +/** A string literal that could be user-visible copy: has a space, isn't a key, import or styling. */ +function isCopyLiteral(node: ts.Node): boolean { + if ( + !ts.isStringLiteral(node) && + !ts.isNoSubstitutionTemplateLiteral(node) && + !ts.isTemplateExpression(node) + ) { + return false + } + const text = stringValue(node) ?? '' + if (!/\s/.test(text.trim()) || !/[A-Za-z]/.test(text)) { + return false // pure identifiers, ids and paths + } + const parent = node.parent + if ( + ts.isImportDeclaration(parent) || + ts.isExportDeclaration(parent) || + ts.isExternalModuleReference(parent) || + ts.isLiteralTypeNode(parent) + ) { + return false + } + if (ts.isPropertyAssignment(parent) && parent.name === node) { + return false // object keys + } + if (ts.isPropertyAssignment(parent) && SKIP_PROPERTIES.test(parent.name.getText().replace(/['"]/g, ''))) { + return false + } + const attr = ts.isJsxAttribute(parent) + ? parent + : ts.isJsxExpression(parent) && ts.isJsxAttribute(parent.parent) + ? parent.parent + : null + if (attr && SKIP_ATTRIBUTES.test(attr.name.getText())) { + return false + } + // cn()/clsx() class lists and translation keys (the first argument of t()). + if (ts.isCallExpression(parent)) { + const callee = parent.expression.getText() + if (/^(cn|clsx|cva|twMerge)$/.test(callee)) { + return false + } + if (TRANSLATE_CALLEES.has(callee.split('.').pop() ?? '') && parent.arguments[0] === node) { + return false + } + } + return true +} + /** User-visible strings in one file, with their 1-based lines. */ export function visibleStrings(file: string, source: string): { line: number; text: string }[] { const sf = ts.createSourceFile(file, source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TSX) @@ -92,7 +146,10 @@ export function visibleStrings(file: string, source: string): { line: number; te } } const visit = (node: ts.Node): void => { - if (ts.isJsxText(node)) { + if (isCopyLiteral(node)) { + // Copy tables, object-literal values and template parts: anywhere these terms can hide. + push(node, stringValue(node)) + } else if (ts.isJsxText(node)) { push(node, node.text.trim()) } else if (ts.isJsxAttribute(node) && node.initializer) { const name = node.name.getText(sf) @@ -130,7 +187,15 @@ export function visibleStrings(file: string, source: string): { line: number; te ts.forEachChild(node, visit) } visit(sf) - return out + const seen = new Set() + return out.filter((entry) => { + const key = `${entry.line}:${entry.text}` + if (seen.has(key)) { + return false + } + seen.add(key) + return true + }) } function scopeFiles(): string[] {