perf(apex-debugger): shrink bundle via esbuild ESM resolution of effect - W-23313202#7692
Merged
mshanemc merged 5 commits intoJul 8, 2026
Conversation
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Node dist/index.js: 5,655,306B -> 4,424,609B (-21.8%). fast-check bytesInOutput: 236,897B -> 47,642B (-79.9%). effect resolves dist/esm/* (was dist/cjs/*); output stays CJS. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Matches the exclusion every other metafile-producing package has; prevents the 1.75MB dist/node-metafile.json from shipping in the VSIX. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Contributor
Author
|
/ai-auto approve |
peternhale
approved these changes
Jul 8, 2026
peternhale
left a comment
Contributor
There was a problem hiding this comment.
Peer-approved on behalf of @mshanemc per /ai-auto approve
mshanemc
added a commit
that referenced
this pull request
Jul 9, 2026
* refactor(apex): migrate langServer namespace read to ProjectService - W-23291527 (#7677) * refactor(apex): read project namespace via ProjectService not SalesforceProjectConfig - W-23291527 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * docs(skills): rescan external + core-extension-api consumers - W-23291527 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * refactor(core): remove dead SalesforceProjectConfig export + class - W-23291527 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * refactor(core): remove orphaned error_parsing_sfdx_project_file i18n key Sole consumer (SalesforceProjectConfig.handleError) was deleted in this branch. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com> * perf(ci): background npm install during release-artifact download - W-23195719 (#7681) * chore: plan for W-23195719 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * perf(ci): background npm install during release download in publish workflows - W-23195719 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * refactor: address review findings - W-23195719 - revert stray package-lock.json drift unrelated to the CI-workflow change - compress verbose validate-vsix rationale bullet in plan doc Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com> * fix: get rid of old broken command SFDX: Execute Anonymous Apex with Currently Selected Text + rename debug command to SFDX: Debug Anonymous Apex with Editor's Selected Text for consistency - W-23329171 (#7680) * fix: get rid of old broken commands SFDX: Execute Anonymous Apex with Currently Selected Text and SFDX: Debug Anonymous Apex in salesforcedx-vscode-apex-replay-debugger because this is already handled in Apex Log extension * fix: restore SFDX: Debug Anonymous Apex command because it's used by the Debug code lens * fix: rename debug command for consistency * fix: map debug Anonymous Apex command to sf.anon.apex.debug.delegate for code lens * fix: can debug highlighted text in Anonymous Apex files * refactor(org): migrate sf.org.logout.all to services - W-23069610 (#7624) * chore: plan for W-23069610 Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> * chore: plan for W-23069610 Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> * refactor(org): migrate sf.org.logout.all to services - W-23069610 Replace the SfCommandlet/ParametersGatherer orgLogoutAll with an Effect orgLogoutAllCommand registered via registerCommandWithLayer. The picker + confirm fold inline; AuthRemover.removeAuth wraps in Effect.tryPromise (typed OrgLogoutError) and already covers alias/config unset, so the redundant all-path helpers are dropped. Config/state refresh composes as an Effect (updateConfigAndStateAggregatorsEffect) instead of bouncing through the async wrapper. Default path keeps its shared helpers with a follow-up TODO. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * test(org): cover orgLogoutAllCommand effect - W-23069610 Rewrite the selected-logout suite (renamed orgLogoutAll.test.ts) around the new Effect command: picker selection drives removeAuth per username + config refresh; empty selection and declined confirm are caught as no-op success; no-project fails the precondition; removeAuth rejection surfaces OrgLogoutError. Drop the stale selectOrgsForLogout mock from the default-path suite. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * test(org): e2e real logout removes auth via throwaway org - W-23069610 Add a real-logout step to orgPickers.desktop: confirm the modal (not Escape) for a dedicated throwaway org and assert removal durably via `sf org list --json`, plus a secondary UI check that the picker no longer lists it. The cancel steps keep MINIMAL_ORG_ALIAS authed. New createThrowawayOrg helper mirrors createMinimalOrg (fixed pre-seeded alias so requireOrgInCI is never reached); orgE2E.yml pre-seeds + reaps logoutThrowawayOrg. Fixture opts into window.dialogStyle custom so the confirm button is clickable. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(org): apply review findings to orgLogout - W-23069610 - hoist AuthRemover.create() out of the per-org forEach (one shared instance; each create() reloads ConfigAggregator + reads all org files) - wrap showQuickPick in Effect.tryPromise -> typed OrgLogoutError, not a defect - remove redundant removeOrgAliases/checkIsCurrentTargetOrg/doUnsetTargetOrg block + helpers from OrgLogoutDefault (removeAuth already unsets config+aliases) - jest: add scratch-confirm success + fail-fast short-circuit tests - e2e: expectOrgLoggedOut uses explicit Date.now() deadline loop with clear timeout Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * docs(org): apply concise findings to W-23069610 plan - W-23069610 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(org): fix TS errors in orgLogout tests and playwright spec - W-23069610 - OrgLogoutDefault constructor is now no-arg; rewrite orgLogout.test.ts to match - Move Effect.Effect cast outside .pipe() in orgLogoutAll.test.ts - Use literal 'Logout' instead of missing packageNls.org_logout_scratch_logout key Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(org): update orgUtil.test.ts for Effect-based updateConfigAndStateAggregators - W-23069610 setUsernameOrAlias now delegates to updateConfigAndStateAggregators() which routes through getOrgRuntime().runPromise(Effect). Assert runPromise called + write-before-runPromise ordering instead of testing internal effect steps that run inside the mocked runtime. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(e2e): recreate consumed throwaway logout org on CI retry - W-23069610 The real-logout step removes auth for logoutThrowawayOrg, so any Playwright retry or the sequential --last-failed step re-runs setup with the org already gone, tripping requireOrgInCI. Drop the CI gate from createThrowawayOrg so a miss recreates the org (CI has dev-hub auth); the pre-seed only saves attempt 1 a create. Also bump the secondary 'picker no longer lists throwaway org' assertion timeout to 15s to absorb picker-refresh lag after logout. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(e2e): capture sf org create scratch failure body for throwaway org - W-23069610 The throwaway-org create failed on CI with a bare 'Command failed: sf org create scratch …' and no diagnostic — execAsync drops the CLI --json error body (scratch limit, dev-hub auth, timeout). Add runScratchOrgCreate in shared.ts: on failure it persists raw stdout/stderr to ~/.sf/vscode-spans/org-create-failure-<ts>.txt (CI copies that dir into test-results) and rethrows an error including the body. Wire it into the throwaway setup (the only create that actually runs on CI). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(e2e): create force-app dir for throwaway org create - W-23069610 sf org create scratch validates packageDirectories paths exist on disk; sfdx-project.json declared force-app but it was never created, causing MissingPackageDirectoryError on CI when the org is re-created on retry. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(services): clear StateAggregator before listAllAuthorizations - W-23069610 AuthInfo.listAllAuthorizations reads via a cached StateAggregator whose orgs.readAll only adds to its configs map and never evicts entries for auth files deleted out of process. A logged-out org therefore lingered in the cache and the org pickers kept listing it (orgPickers e2e: throwaway org still listed after logout). Reset the instance to force a fresh disk read. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(org): unset local target-org on logout via AuthRemover projectPath + skipCache - W-23069610 Logout left the local target-org set because AuthRemover.init resolved local config from process.cwd() and trusted a stale process-cached ConfigAggregator, so removeAuth's unsetConfigValues never matched the current target-org. Pass projectPath (from the workspace) + skipCache: true at both AuthRemover.create sites (orgLogoutAllCommand and OrgLogoutDefault) so config is resolved dir-explicitly and re-read from disk before unset. Requires forcedotcom/sfdx-core#1309 (adds those options); CI will fail until a @salesforce/core release includes it. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * fix(org): clear defaultOrgRef in-process on default-org logout - W-23069610 OrgLogoutDefault.run relied on the async config-file watcher to clear the in-process defaultOrgRef after removeAuth. Span evidence from the failing apex-testing clearOnLogout e2e (all desktop platforms) shows no getConnection/clearDefaultOrgRef fires post-logout within the 60s window, so TargetOrgRef keeps the logged-out org and the apex-testing tree never clears. removeAuth (authRemover.js) only writes config.json on disk; it never touches the in-process ref. Restore the deterministic in-process clear (present on develop as doUnsetTargetOrg, dropped when this path was migrated) by calling ConfigService.unsetTargetOrg() after removeAuth — it unsets local target-org, invalidates the aggregator, and clears defaultOrgRef synchronously. Test: restore the org-runtime layer harness and assert unsetTargetOrg runs on success and is skipped when removeAuth rejects. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * fix(org): only clear target-org ref when logged-out org was the target - W-23069610 Review feedback: the previous commit cleared defaultOrgRef unconditionally, which would wipe the current target-org even when logging out a different, non-target org (logout picks any authed org). Restore develop's guard: check ConfigService.isCurrentTargetOrg(username, aliases) BEFORE removeAuth (afterward the config key is already unset), and only clearTargetOrgRef() when the logged-out org was the target. Thread the resolved aliases into OrgLogoutDefault so alias-matching works. Add a jest case asserting the non-target path leaves the ref intact. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com> * docs(flakiness-review): scan all branches, not just develop (#7682) * fix(flakiness-review): scan all branches, not just develop The primary E2E suites (coreE2E.yml + every "* E2E (Playwright)" workflow) use `push: branches-ignore: [main, develop]`, so they NEVER run on develop — only on PR/feature branches. The scan's `gh run list --branch develop` filter therefore excluded the entire coreE2E signal: a 5-day scan saw 11 runs when ~1300 E2E runs (100+ failures) actually existed across 17 workflows. Changes: - Enumerate E2E workflows via `gh workflow list`, then query each separately. A single `gh run list --limit N | filter` truncates: this repo produces ~1000 runs/5d and bot workflows dominate the cap before the name filter runs. - Bound the window server-side with `--created >=CUTOFF` (macOS/GNU date). - All run filtering is deterministic jq in ONE pipeline (drop develop/main startup-failure noise, compute hadRetries, keep only failures + retry-masked passes): 1300 raw -> ~140 actionable. The scan agent returns the output verbatim instead of reasoning over 1300 rows (which stalled it at ~1M tokens). - Capture `headBranch` per run (RUNS_SCHEMA) to attribute failures to branch. - Relabel metrics Part-1 counts as "actionable runs" since successes are now filtered upstream. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * chore(review-diff): denylist backlog-grooming, work-item-sequencing, dependabot-alerts These are operational/planning skills, not code-review lenses. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> * chore(deps): bump @salesforce/core from 8.32.0 to 8.32.2 W-23349530 (#7684) * chore(deps): bump @salesforce/core from 8.32.0 to 8.32.2 * chore(deps): pin @salesforce/core to ^8.32.2 across packages * docs(flakiness-review): parse real Playwright artifacts, cap retryRate, thread runIds - W-23334955 (#7685) * chore: plan for W-23334955 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * fix(flakiness-review): parse playwright report.json via jq; retryRate as retried/total Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * fix(flakiness-review): thread runIds from parse through testMetrics to clusters Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * fix(flakiness-review): per-leg grouping, distinct-run counts, shared report.json decode Group metrics by (testName, workflowName) so OS/suite matrix legs stay distinct; count distinct runIds for totalRuns/retry/fail so per-report duplicates (and <run-id>-extra dirs) cannot inflate counts. Make retried mutually exclusive with unexpected failures. Extract a single shared decode_report recipe reused by Collect metrics / Cluster failures / Download artifacts, replacing the dead results.json globs and the python3 span-parse heredoc with jq. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com> * fix: correct handling of log levels to be able to debug Anonymous Apex - W-23339705 (#7683) * fix: explicit debug levels in DebuggingHeader + fix regex to handle cases where Visualforce is the last category * test: add a new E2E test for debugging Anonymous Apex * fix: remove dead getOrgApiVersion + FlagParameter exports from utils-vscode - W-23355254 (#7697) * chore: plan for W-23355254 Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> * fix: remove dead getOrgApiVersion + FlagParameter exports from utils-vscode - W-23355254 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com> * perf(apex-debugger): shrink bundle via esbuild ESM resolution of effect - W-23313202 (#7692) * chore: plan for W-23313202 Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> * docs(adr): scope effect-esm esbuild condition override - W-23313202 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * refactor(bundling): share effect-esm conditions constant - W-23313202 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * perf(apex-debugger): resolve effect ESM to shrink bundle - W-23313202 Node dist/index.js: 5,655,306B -> 4,424,609B (-21.8%). fast-check bytesInOutput: 236,897B -> 47,642B (-79.9%). effect resolves dist/esm/* (was dist/cjs/*); output stays CJS. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * fix: exclude dist/*-metafile.json from apex-debugger VSIX Matches the exclusion every other metafile-producing package has; prevents the 1.75MB dist/node-metafile.json from shipping in the VSIX. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com> * chore(soql): @salesforce/core devDependency (type-only) - W-23354450 (#7688) * chore: plan for W-23354450 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * chore(soql): @salesforce/core devDependency (type-only) - W-23354450 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com> * refactor(replay-debugger): remove direct dependency on salesforcedx-vscode-core - W-23336192 (#7693) * chore: plan for W-23336192 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * refactor(replay-debugger): remove direct dependency on salesforcedx-vscode-core - W-23336192 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * refactor: apply medium/low review findings - W-23336192 - fix misleading RED/GREEN test comments; describe actual _doInitialize id-gating - dedupe WorkspaceContextUtil stub via shared factory - trim plan prose to fragments - drop stale apex-replay-debugger row from external-consumers skill Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * fix(e2e): drop core from replay-debugger fixture extension dirs - W-23336192 Core is no longer an extensionDependency and its VSIX is no longer built by wireit, so VSIX resolution failed with "Expected exactly 1 VSIX in packages/salesforcedx-vscode-core/ but found 0". The metadata extension's own fixtures deploy via useMetadataExtensionCommands without core installed, so it is not needed at runtime. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com> * ci: run check:knip in validatePR - W-23277534 (#7691) * chore: plan for W-23277534 Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> * ci: run check:knip in validatePR - W-23277534 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * refactor: apply review findings - W-23277534 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com> * refactor(apex-testing): extract execution service from ApexTestController - W-23165784 (#7637) * chore: plan for W-23165783 Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> * refactor(apex-testing): add ApexTestTreeService skeleton (Refs + typed errors + layer) - W-23165783 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * refactor(apex-testing): discovery/restore/populate -> ApexTestTreeService - W-23165783 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * refactor(apex-testing): delegate ApexTestController state to tree service - W-23165783 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * test(apex-testing): add ApexTestTreeService fresh-layer tests - W-23165783 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(apex-testing): apply review findings to discovery service - W-23165783 - discoverTests: catchAll -> mapError (keep typed error channel) - restore path: catchAll -> catchTag -> RestoreResultsError; flatten inline gen - restore scan: sequential for/tryPromise -> Effect.forEach; use FsService.stat - populate: Promise.all -> Effect.all unbounded; drop mutable counter via flat forEach - reset: drop Effect.all/flatMap indirection; for-loop -> forEach - sessionMethodIds delete loop -> forEach - reorder restoreResultsBody before restorePreviousResults - narrow service surface: drop dead Refs + populate sub-steps from return - inline sortByMtimeAscending; remove dead wrappers + testController export - clearResults: add withSpan tracing Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * test(apex-testing): apply review findings to tests + plan - W-23165783 - move sortUrisByMtimeAscending test to sortHelpers.test.ts (live helper) - drop redundant getters test (covered by reset identity assertion) - assert exact error message in discovery-failure test - plan: trim duplicated TrySubjectIdError/skills prose (concise) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(apex-testing): widen run helper R type in ApexTestTreeService tests - W-23165783 The service internally yields ExtensionProviderService (via restoreResultsBody) but declares dependencies:[] so TypeScript infers the full R union. The run helper type was too narrow (ApexTestTreeService only); cast to satisfy the provided layer. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * chore: plan for W-23165783 Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> * refactor(apex-testing): restore apply-loop -> Effect.forEach + per-item URI - W-23165783 Replace the for...await inside a single outer tryPromise with Effect.forEach (concurrency:1, oldest-first) and per-item tryPromise so a failing URI surfaces in its own RestoreResultsError. Add uri:Schema.String to RestoreResultsError and populate it at every scan/apply construction site; annotate the restore logWarning with uri. Add fresh-layer test asserting the offending URI surfaces and ordering is preserved. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(apex-testing): apply critical/high review findings - W-23165783 - RestoreResultsError.uri now optional; drop empty-string placeholder on the pre-scan NoDefaultOrgError catch (no file URI to attribute) - migrate surviving console.debug/error in shell catch branches to Effect.logWarning/logDebug/logError via the package runtime - clearResults: replace Effect.catchAll with catchTags over the typed error union instead of erasing the error types - notifyDiscoveryFailure/restore notification: use vscode.window.show*Message directly instead of the legacy notificationService wrapper Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * refactor(apex-testing): apply medium/low review findings - W-23165783 - test: spy on vscode.window.show*Message (notification migration); drop the notificationHelpers mock - test: comment baseLayer fresh-instance isolation and why the restore test builds its own layerWithFs - plan: trim duplicated Context/Template prose per concise style Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * refactor(apex-testing): address PR review on discovery service extraction - W-23165783 - reuse getMessageFromError from effect-ext-utils; drop local errorToString - drop over-wide DiscoveryFailure union; narrow notifyDiscoveryFailure param - collapse SuiteRetrievalError construct-then-catch into a single catchAll - doDiscover catchTags -> catchAll; fix latent leak of ServicesExtensionNotFoundError/ InvalidServicesApiError/NoWorkspaceOpenError from the restore path (now non-fatal catchAll) - convert tree-map getters + getTestClassName/clearAllSuiteChildren to module-level functions, removing 6 class-methods-use-this suppressions; update callers + tests - add JSDoc to ApexTestDiscoveryService; drop redundant layer-merge narration comments Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * docs(doc-maintenance): cut per-item list/merge narration, prefer JSDoc on definition - W-23165783 Codifies the extensionProvider Layer.mergeAll review finding: one-line-per-arg narration that restates a referenced symbol belongs in a JSDoc on the symbol's own definition (hover surfaces it), not as a line comment at the use site. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * docs(skills): add i18n-messages skill - placeholder semantics + style guide - W-23234337 (#7633) * chore: plan for W-23234337 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * docs(skills): add i18n-messages skill - placeholder semantics + style guide - W-23234337 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * refactor: medium/low review findings - concise SKILL.md scope bullets, reuse + per-surface phrasing - note bare-string skips format() (message.ts:37 guard) - sync plan line refs to actual i18n.ts (placeholder 72/78, Delete 74, Logout 75, tree 103) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> * refactor(org): migrate sf.org.delete.username to services - W-23069611 (#7619) * chore: plan for W-23069611 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * refactor(org): migrate sf.org.delete.username to Effect + TerminalService - W-23069611 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * test(org): cover orgDeleteUsernameCommand service migration - W-23069611 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * test(org): e2e orgDeleteUsername asserts real delete + picker refresh - W-23069611 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(org): cancellation aborts delete loop; hoist services; export OrgDeleteFailedError - W-23069611 Apply review findings to orgDeleteUsernameCommand: - only TerminalServiceError is caught per-org (Either.left); UserCancellationError from withCancellableProgress now propagates and aborts the loop instead of being swallowed by Effect.either and surfacing a spurious error toast. Fixes the inverted deleteOne doc comment. - resolve PromptService/TerminalService once, capture deleteOne by closure (no per-org re-yield) - channel.showChannel (Effect-native) instead of legacy channelService singleton - Effect.forEach over results uses { discard: true } - subcommand uses org.orgType directly; orgTypeLabel helper removes duplicated mapping - export OrgDeleteFailedError + @ExportTaggedError - new jest test exercises cancellation-aborts-loop (was untested: stub was identity passthrough) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * test(org): fix orgDeleteUsername e2e timeout budget + backoff - W-23069611 - reduce waitForOrgGone to 120s (delete completes in seconds) so create -w 10 (600s) + this no longer exceed test.setTimeout; bump setTimeout to 900s for headroom - exponential backoff (1s->10s) in waitForOrgGone instead of fixed 5s poll Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * docs(plan): tighten W-23069611 wording; note src+test co-modification exception - W-23069611 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * refactor(org): accumulate org-delete failures with Effect.partition - W-23069611 Replace hand-rolled Either-wrapping + catchTag + re-loop accumulation with Effect.partition. Move the cancellable progress to wrap the whole loop so a Cancel interrupts (and aborts) rather than being bucketed per-org as a typed failure; partition's per-element Effect.either passes the interrupt through. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * fix(apex-testing): correct @ExportTaggedError knip tags - W-23069611 NoDefaultOrgError is only used in-package (TS4023 export) so it needs the tag; the four codeCoverageService errors are imported by colorizer.test.ts so their tags were redundant. Resolves knip Unused-exports + Tag-hints failures. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * docs(effect): add error-accumulation (partition/validateAll) guidance to skill Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> * chore: plan for W-23165784 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * refactor(apex-testing): typed errors for payload + temp-folder failures - W-23165784 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * refactor(apex-testing): extract execution service from ApexTestController - W-23165784 Move run/debug/result-processing region (runTests/debugTests/executeTests/ updateTestResults/clearStaleTagsForTests/onResultFileCreate + cacheSingleSelection/ getTempFolder) into ApexTestExecutionService. lastProcessedResultFile becomes a service-owned Ref<Option<URI>>. ChannelService/FsService reached via api.services (class values are type-only exports cross-package; ChannelService runtime instance is ChannelServiceLayer('Apex Testing'), not .Default). Sentinel emitted on run path only. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * test(apex-testing): unit tests for ApexTestExecutionService - W-23165784 Add apexTestExecutionService.test.ts (sentinel emit once on run path / none on debug, runAllTestsInOrg branch, PayloadBuildError + TestTempFolderError surfaces, stale-tag clear, lastProcessedResultFile Ref dedupe, empty-suite path, debug org-only filter). Rewire testController.test.ts mock runtime to provide ApexTestExecutionService.Default + a stub ChannelService; move debug-path coverage into the service suite. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * test(apex-testing): e2e gate Explorer run-path sentinel - W-23165784 Gate the net-new Explorer run-path 'Ended SFDX: Run Apex Tests' sentinel in the testExplorer tree-item class-run step (clear Apex Testing channel before the run, assert the sentinel after). Also harden apexTestExecutionService.test.ts types so it compiles under test/tsconfig (ts-jest isolatedModules had masked the casts). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix: critical/high review findings - W-23165784 - testController.incrementalUpdate: log non-fatal error, not bare catch - runTests: extract debug/execute branch to named Effect.fn (runTestPipeline) for span visibility; forEach+push -> Array.from spread - testController.clearResults: Effect.fn over Effect.gen+withSpan Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * refactor: medium/low review findings - W-23165784 - i18n apex_test_results_restored_message: %s -> %d for count slot; drop String() wrapper at call site - restorePreviousResults: Effect.promise for showInformationMessage response (acted on) instead of Effect.sync + floating .then - constants RESULT_MAX_AGE_MS: derive from Duration.days(1), no raw ms - doDiscover: catchTags(DiscoveryError, PackageResolutionError) over catchAll - docs/skill/plan: tighten run-on sentences (concise style) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(e2e): selectOutputChannel ensures output panel is open - W-23165784 Intervening UI (test run, maximized panel toggle) can collapse the output panel between selectOutputChannel calls. The bare 5s waitFor for visibility then timed out at testExplorer.headless.spec.ts:129. Reuse ensureOutputPanelOpen to (re)open the panel instead of assuming it is visible. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(e2e): restore Test Results tab after sentinel check to unblock method-run step - W-23165784 The class-run step selects the Apex Testing output channel to assert the run-path sentinel, which swaps the bottom panel away from Test Results. The following single-method step then asserts /Pass Rate/i (rendered in Test Results) without re-activating the tab, so on the slower ubuntu/windows runners it hung the full TEST_RUN_TIMEOUT (10m) and pushed the job past the 60m limit. Restore the Test Results tab after the sentinel assertion. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * fix(e2e): confirm suite quick-pick with Enter so run-suite executes - W-23165784 selectSuiteInQuickPick relied on selectQuickInputOptionByTyping's synthetic DOM click to accept the pick. On slower CI runners (ubuntu/windows) that click only highlights the row without accepting it, so the Run/Add Apex Test Suite command never fires. The Apex Testing output channel then stays empty until the 600s TEST_RUN_TIMEOUT, and three such retries blow the 60m job budget -> job cancelled. Trace confirmed: sf.apex.test.suite.run span never emitted on ubuntu. Press Enter to confirm the pick, guarded so it only fires while still on the suite prompt. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * fix(e2e): gate suite-run output on progress toast, not empty channel - W-23165784 The async org run appends nothing to the Apex Testing channel until it completes, so polling channel content burned the whole test budget on an empty channel while the run was still healthy — timing out on slower ubuntu/windows runners. Wait for the run progress toast to appear then clear before asserting output, mirroring the passing testExplorer path. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * fix: move apex test execution errors out of views layer - W-23165784 High review finding: utils/payloadBuilder.ts imported error schemas from views/, the only utils->views edge. Errors are pure Schema.TaggedError with no vscode/view dependency; relocate to utils/ so the dependency direction is views->utils like the rest of the package. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * refactor: apply medium/low apex-testing review findings - W-23165784 - payloadBuilder: buildAsyncPayload via Effect.tryPromise (typed failure, not a defect) and flatten the async IIFE into per-branch Effects; empty payload fails with PayloadBuildError via filterOrFail (no optional payload field). - executeTests span: wrap the actual debug/execute work in withSpan('apexTestRun') instead of the trailing annotate-only (dead) span. - getTempFolder: catchTags(NoDefaultOrgError, NoWorkspaceOpenError) instead of catchAll, matching apexTestRunCodeAction. - testController: route incremental-update catch through Effect.logWarning instead of console.warn; revert clearResults Effect.fn IIFE back to Effect.gen + withSpan (effectFnIife). - trim verbose ExecutionContext/service doc comments; numerals in plan doc. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * fix(e2e): gate single-method Explorer run on output channel - W-23165784 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * fix(e2e): gate Explorer single-method run on sentinel + Passed decoration - W-23165784 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * refactor(apex-testing): consolidate stale-tag helpers + split runTests - W-23165784 Address PR #7637 review comments: - Consolidate inverse stale-tag ops into ApexTestTreeService: markStaleTags (add + propagate) and clearStaleTags (remove + propagate), sharing the classHasStaleMethod/suiteHasStaleClass propagation predicates. Deletes the shell applyStaleTags and the execution service clearStaleTagsForTests. - DiscoveryContext: drop applyStaleTags callback; add staleTag + getSuiteToClasses. - Split runTests scope-narrowing/suite loops into pure helpers (narrowToStaleMethods, resolveUnloadedSuites, expandSuitesToMethods, coveredClassNames). - Reframe the ChannelService/FsService api.services-bridge comment as the apex-testing convention (not a workaround). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * refactor(apex-testing): address PR review comments - write* helpers → Effects surfacing FsServiceError (drop console.error swallow + tryPromise wrappers); callers catchAll/logError so a write failure stays non-fatal, matching writeAndOpenTestReport - affectedClasses derivation → functional map/flatMap/filter + effect/HashSet (clearStaleTags, restoreResultsBody); mutation sweep stays a forEach - executeTests + runTestPipeline 8 positional params → options objects Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com> * perf(review-plan): speed up plan-adversary via warm-start prompt + evidence budget - W-23355256 (#7696) * chore: plan for W-23355256 Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> * perf(review-plan): prime plan-adversary with plan-referenced code pointers Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * perf(plan-adversary): cap redundant evidence greps Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * refactor: apply review findings — drop prime agent + diff machinery Fold plan-adversary warm-start into a prompt directive; remove the redundant haiku prime pass, PRIME_SCHEMA, `base` arg, and diff/truncation plumbing (the adversary sees plan citations on its own first Read; the pre-Build diff is always empty and pointers to to-be-created files were dead Reads). Tighten plan doc to concise style. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com> * ci: change closePendingReleaseIssues.yml to grab issues from the changelog instead of checking the "pending release" tag - W-23236874 (#7704) * refactor(org): add ConfigService.getTargetOrg, migrate org-ext off OrgConfigProperties - W-23354710 (#7695) * chore: plan for W-23354710 Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> * feat(services): add ConfigService.getTargetOrg - W-23354710 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * refactor(org): migrate org-ext off OrgConfigProperties to ConfigService.getTargetOrg - W-23354710 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * fix: add getTargetOrg to ConfigService mocks to fix test compile break - W-23354710 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * refactor: address review findings - dedupe config reads, add coverage - W-23354710 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * fix: add getTargetOrg to org-browser ConfigService mock - W-23354710 Interface now requires getTargetOrg since Phase 1 added it to ConfigService. --------- Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com> * chore(deps): bump json-stream-stringify from 3.1.6 to 3.1.7 (#7700) Bumps [json-stream-stringify](https://github.com/Faleij/json-stream-stringify) from 3.1.6 to 3.1.7. - [Commits](Faleij/json-stream-stringify@v3.1.6...v3.1.7) --- updated-dependencies: - dependency-name: json-stream-stringify dependency-version: 3.1.7 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump @salesforce/types from 1.7.1 to 1.8.0 (#7699) Bumps [@salesforce/types](https://github.com/forcedotcom/wsdl) from 1.7.1 to 1.8.0. - [Commits](https://github.com/forcedotcom/wsdl/commits) --- updated-dependencies: - dependency-name: "@salesforce/types" dependency-version: 1.8.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump @vscode/test-web from 0.0.78 to 0.0.81 (#7698) Bumps [@vscode/test-web](https://github.com/microsoft/vscode-test-web) from 0.0.78 to 0.0.81. - [Release notes](https://github.com/microsoft/vscode-test-web/releases) - [Changelog](https://github.com/microsoft/vscode-test-web/blob/main/CHANGELOG.md) - [Commits](microsoft/vscode-test-web@v0.0.78...v0.0.81) --- updated-dependencies: - dependency-name: "@vscode/test-web" dependency-version: 0.0.81 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * refactor(org): migrate sf.org.logout.default to services - W-23069609 (#7689) * chore: plan for W-23069609 Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> * refactor(org): migrate sf.org.logout.default to services - W-23069609 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * test(org): cover orgLogoutDefaultCommand effect - W-23069609 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * test(org): e2e default-org logout removes auth - W-23069609 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * fix: review findings for org logout default - W-23069609 - no-default-org branch uses vscode.window.showInformationMessage (void) instead of legacy notificationService - extract shared createAuthRemover helper; both logout commands delegate - inline checkIsCurrentTargetOrg/clearTargetOrgRef single-call wrappers - fix stale removeAuth doc comment Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * docs(plan): apply concise style to W-23069609 plan Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com> * feat(org): gate orgDisplay sensitive-info behind modal confirm - W-23230633 (#7690) * chore: plan for W-23230633 Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> * feat(org): gate orgDisplay sensitive-info behind modal confirm - W-23230633 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * test(org): drive orgDisplay modal confirm in e2e - W-23230633 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * test(org): reuse shared clickModalDialogButton in e2e specs Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * docs(org): fix stale orgDisplay modal-gate comments and plan numeral Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * fix(org): split orgDisplay warning into message + detail for line breaks - W-23230633 VSCode modal collapses newlines in the message param; only the detail param preserves line breaks. Add optional detail to PromptService.confirmOrThrow and split the sensitive-info warning into a short headline plus a multi-paragraph detail. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com> * docs(apex): add ADR to migrate telemetry to Effect spans/logs - W-23348766 (#7694) * chore: plan for W-23348766 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * docs(apex): add ADR to migrate telemetry to Effect spans/logs - W-23348766 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * refactor: fix review findings (citation line range, plan wording) Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * docs(apex): trim ADR-0002 to decision-record altitude - W-23348766 Cut per-event call-site line numbers, allowlist internals, and downstream attribute-key constraints (all downstream-WI material) per ADR-FORMAT.md. Kept decision, spans-only rationale, annotateRootSpan export rule, and the load-bearing apexLSPLog span-vs-attribute choice. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com> * perf(apex-oas): shrink bundle via esbuild ESM resolution of effect - W-23313204 (#7707) * chore: plan for W-23313204 Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> * perf(apex-oas): resolve effect ESM to shrink bundle - W-23313204 * fix: apply medium/low review findings for apex-oas bundle - add dist/*-metafile.json to .vscodeignore (exclude 1MB debug metafile from VSIX) - add ../../scripts/bundling/effect.mjs to wireit vscode:bundle files (cache invalidation) - trim repeated caveats and multi-sentence bullets in plan doc Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com> * perf(apex-log): shrink bundle via esbuild ESM resolution of effect - W-23313203 (#7703) * chore: plan for W-23313203 Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> * perf(apex-log): resolve effect ESM to shrink bundle - W-23313203 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * refactor: apply review findings (wireit files, concise plan) Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com> * perf(apex): resolve effect ESM to shrink bundle - W-23313207 * fix: review findings - add effect.mjs to apex vscode:bundle wireit files Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * refactor: review findings - dedupe vscode-uri blast-radius prose in plan Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com> Co-authored-by: Daphne Yang <139700604+daphne-sfdc@users.noreply.github.com> Co-authored-by: Release Bot <svc_idee_bot@salesforce.com> Co-authored-by: Jonny Hork <jhork@salesforce.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
6 tasks
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.
What does this PR do?
Summary
salesforcedx-vscode-apex-debugger'sesbuild.config.mjs, so esbuild resolveseffect's ESM build and tree-shakes most of the unused fast-check dependency pulled in viaeffect/Schema.effectEsmConditionsconstant intoscripts/bundling/effect.mjsand refactorssalesforcedx-vscode-org-browserto consume it too, removing the duplicated literal (kept opt-in per package, not baked intonodeConfig— see ADR).docs/adr/0021-effect-esm-condition-override-scope.mdrecording the shared-opt-in-constant decision and the promotion criterion for folding it intonodeConfiglater.dist/index.js5,655,306B -> 4,424,609B (-21.8%); fast-checkbytesInOutput236,897B -> 47,642B (-79.9%). Output stays CJS; effect now resolvesdist/esm/*instead ofdist/cjs/*.Plan
.claude/plans/W-23313202.md
Reviewer notes
effectEsmConditionsextraction is correctly wired into both packages' wireitfileslists. No violation found, no code change needed.Test plan
salesforcedx-vscode-apex-debuggerhas no Playwright/e2e suite (jest only, which CI already runs). Runtime confidence for the effect CJS->ESM resolution change rests on org-browser's existing Playwright coverage of the identical mechanism (PR perf(org-browser): resolve effect ESM to shrink bundle (POC) - W-23293744 #7675) plus this package's jest suite.dist/index.json desktop: launch an Apex debug session and confirm the extension activates without module-resolution errors (effectManagedRuntime/Schemapaths load correctly).What issues does this PR fix or reference?
@W-23313202@
Functionality Before
Apex debugger's desktop bundle resolved
effect's CJS build, pulling in the fullfast-checkdependency viaeffect/Schema's unconditionalrequire.Functionality After
Apex debugger's desktop bundle resolves
effect's ESM build (via sharedeffectEsmConditions), letting esbuild tree-shake ~80% offast-checkout;dist/index.jsshrinks ~21.8%.🤖 Generated by auto-build pipeline. Original WI: https://gus.lightning.force.com/lightning/r/ADM_Work__c/a07EE00002dxZMaYAM/view