Dashboard › cli › Distillation
e298760d-1284-4831-a830-8aa77f2fc798["lore_tm_v1_9a6PDfyvQdDIIIIIqap7dTwA-S8zGTq4ENUsBF3n9jc","lore_tm_v1_1fhNKjcsFXgQI2W5j4GQHtuQLtgonHuTN1WeNvkoccM","lore_tm_v1__Gbif-gYqiNBZpFh1GCo2X4XHURmEYZ9nu1lWLcQ5tg"]
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/release-notes.ts, which parses stable GitHub Release bodies and nightly conventional commits into ChangelogSummary; only features, fixes, and performance categories are retained and displayed in that order.packages/cli/src/lib/release-notes.ts, extractSections(body) uses marked.lexer() and recognizes only depth-3 headings normalized to new features, bug fixes, or performance; it retains intervening tokens, including depth-4 scope headings and lists, and reconstructs source via each tokenβs raw property in tokensToMarkdown().packages/cli/src/lib/release-notes.ts, EMOJI_RE strips Unicode ranges \u{2000}-\u{2BFF}, \u{FE00}-\u{FE0F}, and \u{1F000}-\u{1FFFF} during heading matching; AUTHOR_SUFFIX_RE strips list-item suffixes such as by @author in [#123](url) or by @author in #123.packages/cli/src/lib/release-notes.ts, countListItems(tokens) counts only top-level Tokens.List.items, not nested sublists; countMarkdownListItems(md) first parses markdown with marked.lexer().packages/cli/src/lib/release-notes.ts, truncateSectionMarkdown(md, maxItems) preserves non-list token raw markdown, removes whole lists after the budget is exhausted, and truncates a partially retained list using each kept itemβs raw markdown so nested content and inline formatting survive.applySectionTruncation() mutates the sections array in place, replacing markdown with truncated versions when the total item count exceeds maxItems.packages/cli/src/lib/release-notes.ts, applySectionTruncation() distributes maxItems proportionally across sections; non-final sections use Math.max(1, Math.floor((sectionItems / originalCount) * maxItems)) capped by remaining budget, while the final section receives the remaining nonnegative budget. It reports truncated when the retained totalItems is below originalCount.packages/cli/src/lib/release-notes.ts, buildSummaryFromSections() returns null for no sections; otherwise it returns fromVersion, toVersion, mutated sections, retained totalItems, truncated, and pre-truncation originalCount.packages/cli/src/lib/release-notes.ts, stable summaries include releases where the normalized tag version is strictly greater than fromVersion and less than or equal to toVersion; source-specific builds require source.tagPrefix and strip it before comparison, while legacy buildChangelogSummary() accepts unprefixed tags.packages/cli/src/lib/release-notes.ts, mergeSectionsByCategory() strips author/PR attributions, concatenates markdown across releases, and emits merged sections in exact order: 1. features, 2. fixes, 3. performance.packages/cli/src/lib/release-notes.ts, nightly versions must match ^[\d.]+(?:-\w+)?-dev\.(\d+)$; extractNightlyTimestamp(version) returns the parsed Unix-seconds suffix or null.packages/cli/src/lib/release-notes.ts, parseCommitMessages() uses only the first line, excludes any message containing #skip-changelog, accepts conventional commits matching type(scope): description, maps only feat β features, fix β fixes, and perf β performance, and serializes descriptions as - ${description} list items.packages/cli/src/lib/release-notes.ts, CHANGELOG_MAX_RELEASES = 30; fetchReleasesForChangelog(source) requests ${getGitHubReleasesUrl(source)}?per_page=30 with getGitHubHeaders(), returning [] for fetch failure, non-OK status, invalid JSON, or a non-array response.packages/cli/src/lib/release-notes.ts, fetchStableChangelog() reuses prefetchedReleases when supplied to avoid a duplicate API call; otherwise it fetches up to 30 releases and returns null when none are available.packages/cli/src/lib/release-notes.ts, fetchNightlyChangelog() derives dates from nightly Unix timestamps, uses since = fromTs + 1s because GitHubβs since is inclusive, uses until = toTs + 1s because GitHubβs until is exclusive, and requests https://api.github.com/repos/${source.githubRepo}/commits?sha=main&since=${sinceDate}&until=${untilDate}&per_page=100.packages/cli/src/lib/release-notes.ts, nightly changelog fetching returns null for invalid nightly versions, network failure, non-OK response, invalid JSON, a non-array response, or zero commits.packages/cli/src/lib/release-notes.ts, fetchChangelog(opts) defaults source to PRIMARY_UPGRADE_SOURCE, dispatches channel === "nightly" to fetchNightlyChangelog() and stable otherwise to fetchStableChangelog(), catches every error, logs Changelog fetch failed:, and returns null; it is best-effort and designed to run in parallel with binary download with zero added latency./home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/version-check.ts, where both CHECK_INTERVAL_MS and NOTIFICATION_INTERVAL_MS equal 24 * 60 * 60 * 1000, and probabilistic checking uses JITTER_FACTOR = 0.2.packages/cli/src/lib/version-check.ts, shouldCheckForUpdate() checks immediately when lastChecked === null; otherwise it applies Β±20% jitter and computes probability as 1 - Math.exp(-elapsed / effectiveInterval), approximately 0% at 0 intervals, 63% at 1 interval, and 86% at 2 intervals.packages/cli/src/lib/version-check.ts, update notifications are suppressed when any argument is one of upgrade, --version, -V, --json, token, or init, and for cli setup or cli fix.packages/cli/src/lib/version-check.ts, suppression parsing supports global flags before cli and between cli and its subcommand, skips spaced values consumed by value-taking entries in GLOBAL_FLAGS, respects inline --flag=value, and stops command-path scanning at --.packages/cli/src/lib/version-check.ts, maybePrefetchPatches() runs only when latestVersion is newer than CLI_VERSION, dispatches nightly to prefetchNightlyPatches(latestVersion, signal, source) and stable to prefetchStablePatches(latestVersion, signal, source), catches prefetch errors, and then separately performs best-effort cleanupPatchCache().packages/cli/src/lib/version-check.ts, checkForUpdateInBackgroundImpl() catches database errors from shouldCheckForUpdate() with Sentry.captureException(), creates pendingAbortController, reads the persisted release channel, and starts a detached manual Sentry span named version-check with op: "version.check" and forceTransaction: true.packages/cli/src/lib/version-check.ts, background discovery uses fetchLatestNightlyVersionWithSource(signal) for nightly and fetchLatestFromGitHubWithSource(signal) for stable, stores the result through setVersionCheckInfo(latestVersion), and prefetches delta patches so sentry cli upgrade can apply them offline.packages/cli/src/lib/version-check.ts, expected AbortError failures are not reported; other background failures are stored as span attributes version_check.error and version_check.error_type rather than sent to the Sentry Issues feed, the span receives status code 2, and pendingAbortController is cleared before span.end(). Success sets span status code 1.packages/cli/src/lib/version-check.ts, update banners are human-only and require process.stderr.isTTY; non-TTY contexts such as scripts, CI, pipes, and editor captures receive null.notifiedThisProcess gates repeat notification reads in one process, while database-backed lastNotified enforces a 24-hour cross-process interval.getUpdateNotificationWithCopy() never throwsβerrors are caught and reported to Sentry. It also returns null for non-TTY stderr, an already-notified process, missing cached version data, a version not newer than CLI_VERSION, or an active 24-hour rate limit.packages/cli/src/lib/version-check.ts, after formatting a banner, getUpdateNotificationWithCopy() calls markUpdateNotified() before setting notifiedThisProcess = true; a persistence failure is reported with Sentry.captureException() but does not suppress the banner.packages/cli/src/lib/version-check.ts, the standard banner labels nightly updates New nightly available: and stable updates Update available:, displays ${CLI_VERSION} -> ${latestVersion}, and directs the user to run "sentry cli upgrade".packages/cli/src/lib/version-check.ts, the contextual non-user-error banner says A new version of sentry-cli is available (${latestVersion}). Upgrading may resolve this β we fix a lot of bugs in every release. Run "sentry cli upgrade" to update.packages/cli/src/lib/version-check.ts, getErrorUpdateNotification(error, args) first applies command suppression; user errors receive the standard neutral banner, non-user errors receive the contextual upgrade nudge, and both paths share TTY, rate-limit, and once-per-process gates so they never double-emit.packages/cli/src/lib/version-check.ts, SENTRY_CLI_NO_UPDATE_CHECK === "1" disables both maybeCheckForUpdateInBackground() and normal update notifications; resetUpdateNotificationState() exists only for tests to reset notifiedThisProcess, and abortPendingVersionCheck() aborts and clears an active controller to permit process exit.