Dashboard › cli › Distillation
1f90d112-7dbf-4b67-9435-9a5bef3bfc2f["lore_tm_v1__x3OJYiZIMTrkK48YLQiJj30ugY-SUyt_MD3x0JuDBA"]
🔴 (09:28) User stated org view and project view mirror gh repo view: they work from DSN-derived context or with an explicit argument.
🔴 (09:28) User stated <project> searches for a project by name across all accessible organizations.
🔴 (09:28) User requires using the ContextError class for missing-context errors.
🔴 (09:28) User stated commands run from packages/cli, or from the repository root via pnpm --filter sentry run <script>.
🔴 (09:28) User stated the type-check command is pnpm run typecheck, which runs tsc.
🔴 (09:28) User specified Node.js standard-library patterns: read files with await readFile(path, "utf-8") from node:fs/promises; write with await writeFile(path, content) from node:fs/promises; check existence with existsSync(path) from node:fs; spawn processes with spawn() / execFile() from node:child_process; shell commands with execSync() from node:child_process; find executables with the which helper in src/lib/which.ts; use the scanner in src/lib/scan/ for glob patterns; sleep with await setTimeout(ms) from node:timers/promises; parse JSON files with JSON.parse(await readFile(path, "utf-8")).
🔴 (09:28) User stated automatic command aliases are: list → ls; view → show; delete → remove, rm; create → new.
🔴 (09:28) User identified span/list.ts, trace/view.ts, and event/view.ts as reference implementations.
🔴 (09:28) User identified formatters/trace.ts (formatAncestorChain) and formatters/human.ts (plainSafeMuted) as formatter references.
🔴 (09:28) User specified mutation commands should import DRY_RUN_FLAG and DRY_RUN_ALIASES from ../../lib/mutate-command.js.
🔴 (09:28) User specified manual pagination flow: build a key with buildPaginationContextKey("entity", \${org}/${project}`, { sort: flags.sort, q: flags.query }); call resolveCursor(flags.cursor, PAGINATION_KEY, contextKey); request data with the resolved cursor; call advancePaginationState(PAGINATION_KEY, contextKey, direction, nextCursor); derive previous-page availability with hasPreviousPage(PAGINATION_KEY, contextKey)and more-page availability with!!nextCursor. 🔴 (09:28) User stated dispatchOrgScopedListwith overrides is automatic for most project/issue list modes, while the custom"org-all"override manually callsresolveCursor, advancePaginationState, and paginationHint. 🔴 (09:28) User stated normalized inputs are lowercase and invalid input must throw ValidationError. 🔴 (09:28) User specified Valibot schema imports including InferOutput, object, string, optional, and number. 🔴 (09:28) User requires using the upsert()helper fromsrc/lib/db/utils.tsto reduce SQL boilerplate. 🔴 (09:28) User stated exit-code ranges are1xauthentication,2xinput/configuration,3xAPI/network,4xfeature/billing,5xoperations, and6xcommand-specific; the full references areEXITinsrc/lib/errors.tsandhttps://cli.sentry.dev/exit-codes/. 🔴 (09:28) User identified resolveDashboardId()insrc/commands/dashboard/resolve.tsas a reference implementation. 🔴 (09:28) User specified an authentication operation sequence:const token = await getAuthToken();, then const isAuth = await isAuthenticated();, then await setAuthToken(token, expiresIn);. 🔴 (09:28) User specified command-building imports: object, string, and optionalfromvalibot; buildCommandfrom../../lib/command.js; SentryContextfrom../../context.js; and getAuthTokenfrom../../lib/db/auth.js. 🔴 (09:28) User allows inline comments only when code cannot express the information: business reasons/constraints/history (“why”), surprising non-obvious behavior, dependency or platform workarounds, and explanations of hardcoded values and what would break if changed. 🔴 (09:28) User specified test helpers should import useTestConfigDirfrom../helpers.js. 🔴 (09:28) User stated property-based tests should express invariants that always hold regardless of input; examples include symmetry (myFunction(a, b)equalsmyFunction(b, a)) and round-trip behavior (decode(encode(input))equalsinput), using fcAssert, property, and { numRuns: DEFAULT_NUM_RUNS }. 🔴 (09:28) User specified model-based tests may define commands implementing AsyncCommand<DbModel, RealDb>, such as SetCommand, and should verify that the real system matches the model with expect(realValue).toBe(expectedValue). 🔴 (09:28) User requires isolated database test contexts via const cleanup = createIsolatedDbContext();with test work intryandcleanup()infinally`.
🔴 (09:28) User requires that when property tests are added for a function already covered by unit tests, redundant unit tests be removed and the unit-test file receive a header comment identifying which invariants live in the property-test file.
🔴 (09:28) User stated automated bug-fix PRs such as Cursor BugBot PRs must avoid duplication and staleness; this policy arose after five overlapping PRs accumulated.