Skip to content
This repository was archived by the owner on Oct 23, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .lore.md
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,9 @@
<!-- lore:019f1e86-f3d5-74c8-84fd-1e38dd9c01d9 -->
* **Always challenge and correct review findings by asserting precise technical claims**: When a code review subagent reports findings (High/Medium/Low severity), the user consistently responds by asserting specific, precise technical corrections or confirmations marked with 🔴. These assertions clarify exact behavior (e.g., 'never aborts the surrounding upload', 'never returns (hang + unbounded memory)', 'chunks were never accepted — that is a failure'). The user expects the assistant to treat these 🔴 assertions as authoritative ground-truth corrections to the review output. When producing review findings, anticipate that the user will push back with precise behavioral claims and be prepared to update or refine findings accordingly. Do not over-hedge or soften findings in ways that obscure the actual severity.

<!-- lore:019f23ff-ca15-7870-827d-f9be2daea30f -->
* **Always check CI/PR status after opening or updating a pull request**: After creating or pushing changes to a pull request, the user consistently checks the CI check status (e.g., via 'gh pr checks' or similar tooling) to monitor pass/fail/pending state of automated checks such as lint, typecheck, unit tests, security scans, and bot code reviews (Cursor Bugbot, Seer Code Review). When assisting, proactively run or offer to run PR status checks after PR creation/updates, summarize pass/pending/fail counts, and flag any pending or failing checks that need attention before considering the PR ready to merge.

<!-- lore:019e6147-fc4d-750f-9eeb-8dc4e1261f21 -->
* **Always clarify that the repo uses plain git (not jj) when jj commands fail**: When a jj command fails with 'no jj repo in .', the user consistently clarifies that the repo is a plain git repo and that jj's 'never fails on conflict' behavior is being referenced conceptually — meaning conflicts should be recorded/resolved rather than aborting operations. The agent should: (1) fall back to git commands immediately without retrying jj, (2) handle merge conflicts by stashing, pulling, and resolving (e.g., \`git checkout --theirs\` for files like \`.lore.md\`), and (3) not attempt \`jj git init\` or any jj initialization. This pattern appears at the start of every build session.

Expand Down Expand Up @@ -615,6 +618,9 @@
<!-- lore:019f22cc-ecc8-74af-a0e8-6f393313fe2d -->
* **Request thorough codebase research before implementation**: User consistently works in the getsentry/cli TypeScript codebase (Sentry CLI, Bun/Stricli/pnpm/esbuild) and frequently requests deep, read-only research or code review tasks before making changes. This includes: (1) asking the assistant to search for and analyze specific files, functions, or patterns across the codebase or on GitHub (often listing 4-6 concrete targets like file paths, function names, or grep patterns), (2) evaluating architectural tradeoffs (e.g., native vs TypeScript parsing, WASM bundling across SEA binary and npm package forms), and (3) requesting critical, objective PR reviews scoped to specific concerns (behavior parity, error handling, memory management, type correctness). When starting a task, proactively search the codebase thoroughly for the specific items requested, provide detailed findings with file paths/line references, and treat these as read-only investigation tasks unless explicitly asked to implement changes.

<!-- lore:019f23ff-9d9e-703f-b591-6c75e8ea7973 -->
* **Require adversarial read-only subagent review for merged dependency/patch-bump PRs**: When a PR bumps patched dependencies or regenerates patches (e.g., @sentry/core, @sentry/node-core, @stricli/core version bumps with custom tree-shaking patches), after it's merged the user wants a separate, critical, adversarial, read-only review performed in an isolated git worktree checked out at the merged commit with a fresh install. The review must: (1) never modify source, patch, or lockfile files—builds/tests only writing to dist/; (2) verify checksums/git status to prove read-only discipline; (3) check for dangling references in both CJS and ESM builds after export stripping; (4) verify completeness of stripped exports vs new version's additions; (5) confirm no unintended lockfile/dependency changes; (6) validate PR description's numeric claims; (7) run check:patches/tsc and assess safety-net gaps. Use a subagent (or dedicated review pass) with a detailed, prioritized checklist and deliver a clear verdict (e.g., PASS / FOLLOW-UP NEEDED / BLOCKER) at the end.

<!-- lore:019f227c-66a2-7386-a719-d60a831d3bf9 -->
* **Require independent adversarial code review before merging PRs**: Before merging any PR, the user expects a thorough, critical, independent review of both the code changes and PR description — typically by spinning up a fresh subagent for objectivity rather than relying on self-review alone. The reviewer should verify: type checks pass (tsc clean), tests pass with no regressions, PR description accurately reflects the final code/commits, and prior identified issues (e.g., H1 peek-gate correctness, M2 oversized counting) are actually fixed correctly with end-to-end tracing through the call chain. Review should test edge cases/permutations (e.g., filter combinations) explicitly. Findings should be graded by severity (High/Medium) with concrete file:line references and fix options. The user only wants to merge after this adversarial pass confirms correctness; otherwise gaps should be fixed first. When asked, proactively suggest and launch a subagent for this final review step rather than just self-assessing.

Expand Down Expand Up @@ -642,6 +648,9 @@
<!-- lore:019f238a-db41-7adb-9546-f151f6b64e0e -->
* **Verify third-party library semantics by reading node\_modules source/type declarations directly**: When behavior of a dependency (e.g., @stricli/core flag definitions like \`variadic\`, \`optional\`, \`default\`) is ambiguous or needs confirmation, inspect the actual installed package's compiled type declarations (e.g., node\_modules/@stricli/core/dist/index.d.ts) and doc comments rather than relying on external documentation or assumptions. Cross-reference the exact type definitions (e.g., RequiredVariadicEnumFlagParameter, OptionalParsedFlagParameter) and their inline JSDoc to determine precise runtime behavior — such as whether a flag defaults to an empty array, whether optional flags can have defaults, or how variadic/optional interact. Cite exact line numbers and quote documentation text found in the source. Apply this same verification approach when auditing codebase usages of a library feature (grep for all call sites) to confirm consistent, correct usage patterns before making changes or drawing conclusions about behavior.

<!-- lore:019f240c-efdb-7e52-a124-cfd88da85ea0 -->
* **Verify TypeScript CLI ports against both legacy Rust source and live server implementation**: When reviewing or implementing a TypeScript port of a legacy Rust CLI feature (e.g., sentry-cli snapshots download), the user expects the assistant to cross-check three sources: (1) the legacy Rust implementation being ported from, (2) the actual live Sentry server-side API endpoint source code (permissions, rate limits, error responses, side effects), and (3) the new TypeScript client code under review. The user wants a rigorous, objective comparison — not just style review — that surfaces real behavioral discrepancies (e.g., streaming-to-disk vs buffering-in-memory, missing rate-limit handling, mismatched error codes, auth token leakage risks). When asked for a review, do not write code; produce findings organized by severity with file:line references and concrete fixes, grounded in actual source inspection rather than assumptions.

<!-- lore:019f23b8-5c43-7fbf-96be-e5e53a562182 -->
* **Verify TypeScript port matches legacy Rust sentry-cli behavior exactly**: When porting sentry-cli functionality from Rust to TypeScript, always cross-reference the legacy Rust implementation (e.g., collect\_git\_metadata, find\_head\_sha, find\_base\_sha, VcsInfo struct, CI/GitHub Actions env var handling, clap flag semantics like conflicts\_with) against the new TS code and tests. Actively look for behavioral discrepancies — such as flag conflict handling, error vs. silent-override behavior, and missing env var reads (e.g., GITHUB\_EVENT\_PATH) — and flag them as bugs/blockers rather than assuming the port is correct. Use probe tests to empirically confirm flag-parsing edge cases (single flag, combined flags, malformed flags) and compare results against Rust's documented behavior. Prioritize fidelity to legacy behavior unless an intentional deviation is explicitly decided upon.

Expand Down
18 changes: 14 additions & 4 deletions src/lib/banner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,15 @@ export const FULL_BANNER_LINES: BannerLine[] = colorize(BANNER_ROWS_FULL);
/**
* Widest display width (in code points) among a set of banner lines.
* Used to decide whether a pre-built banner fits the current terminal.
*
* Known limitation: width is counted in code points, which assumes each Block
* Elements glyph (U+2580–U+259F) occupies one terminal cell. Those glyphs have
* East Asian *Ambiguous* width, so a terminal configured to render ambiguous
* characters as wide (some CJK setups) draws them double-width and the banner
* can wrap. This is not portably detectable — and width libraries such as
* `string-width` also treat ambiguous characters as narrow by default, so they
* would report the same value — so it is an accepted limitation of the block-art
* banner. The plain ASCII text mark is unaffected.
*/
export function bannerLinesWidth(lines: readonly BannerLine[]): number {
let max = 0;
Expand All @@ -102,13 +111,14 @@ export function bannerLinesWidth(lines: readonly BannerLine[]): number {

/**
* Select the widest banner variant that fits within `columns`:
* - `>= 78` cols → full arch mark + wordmark
* - `>= 58` cols → wordmark only
* - `>= 66` cols → full arch mark + wordmark
* - `>= 52` cols → wordmark only
* - `>= 6` cols → compact "sentry" text mark
* - otherwise → no banner (empty)
*
* This guarantees the banner never exceeds the terminal width, so it never
* wraps into a broken layout on narrow or split-pane terminals.
* This guarantees the banner never exceeds the terminal width, so it never wraps
* into a broken layout on narrow or split-pane terminals (assuming single-width
* block glyphs — see the note on {@link bannerLinesWidth}).
*/
export function bannerLinesForWidth(columns: number): BannerLine[] {
if (columns >= FULL_WIDTH) {
Expand Down
Loading