Dashboard › cli › Session 0QgiM1u5lFCd
0QgiM1u5lFCdQQED1Your prior result was empty and cannot satisfy the security merge gate. Resume the same read-only review now and return a substantive evidence-based report. The repository remains unchanged: base bd065083c3b82677747b97a6cc7f5cf57532d3bc, head fc5d50e2324e2b6bb2067976bf1515dab45224fb, triple-dot patch SHA-256 03c5772e78b393b3979c44754709d7f401bb37a71e5679b34c50a9cc8334c2d0, clean worktree. Re-verify those values before and after. Inspect every changed file and the relevant security boundaries identified in the original prompt. You must return either: (1) findings with PASS/FAIL/CONCERN/MUST-FIX, exact file:line evidence, attack path, fix, and deterministic regression; (2) explicit PASS statements with exact file:line evidence and residual risks if no defects; or (3) BLOCKED with the exact tool/error that prevents review. Never return empty output. End exactly MERGE or DO-NOT-MERGE. Do not modify anything.
<path>/home/byk/Code/getsentry/cli-pr-1558</path> <type>directory</type> <entries> .craft.yml .git .github/ .gitignore .lore.md .nojekyll .npmrc AGENTS.md apps/ CHANGELOG.md codemods/ docs/ LICENSE.md node_modules/ package.json packages/ pnpm-lock.yaml pnpm-workspace.yaml README.md (19 entries) </entries>
<path>/home/byk/Code/getsentry/cli-pr-1558/AGENTS.md</path> <type>file</type> <content> 1: # Jared (Outpost agent) 2: 3: Autonomous GitHub coding agent. Work in `/workspace/repo`. 4: 5: ## Model tiers 6: 7: The primary model is chosen per event (see `src/agents/models.ts`): heavy for 8: code-producing situations, cheaper for lightweight ones. 9: 10: | Role | Subagent | Model | 11: | --- | --- | --- | 12: | Triage / plan / review (heavy) | (primary Jared) | Claude Opus 4.8 | 13: | Triage / plan / review (light) | (primary Jared) | xAI Grok 4.3 | 14: | Explore | `explore` | OpenAI gpt-5-mini | 15: | Implement | `implement` | Moonshot kimi-k2.7-code | 16: | Ship (commit/push/PR) | `ship` | xAI Grok (`grok-build-0.1`) | 17: 18: Pipeline: triage → explore → plan → implement → review → ship. 19: (`worker` is a deprecated alias of `implement`.) 20: 21: Operators also talk to Jared directly from the Outpost dashboard. ...
/home/byk/Code/getsentry/cli-pr-1558/AGENTS.md /home/byk/Code/getsentry/cli-pr-1558/packages/cli/AGENTS.md
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/AGENTS.md</path> <type>file</type> <content> 1: # AGENTS.md 2: 3: Guidelines for AI agents working in this codebase. 4: 5: ## Project Overview 6: 7: **Sentry CLI** is a command-line interface for [Sentry](https://sentry.io), built with Node.js, [pnpm](https://pnpm.io), and [Stricli](https://bloomberg.github.io/stricli/). It lives in `packages/cli` of a pnpm workspace; the docs site lives in `apps/cli-docs`. 8: 9: ### Goals 10: 11: - **Zero-config experience** - Auto-detect project context from DSNs in source code and env files 12: - **AI-powered debugging** - Integrate Seer AI for root cause analysis and fix plans 13: - **Developer-friendly** - Follow `gh` CLI conventions for intuitive UX 14: - **Agent-friendly** - JSON output and predictable behavior for AI coding agents 15: - **Fast** - Native binaries via Node SEA (fossilize), SQLite caching for API responses 16: 17: ### Key Features 18: 19: - **DSN Auto-Detection** - ...
/home/byk/Code/getsentry/cli-pr-1558 fc5d50e2324e2b6bb2067976bf1515dab45224fb bd065083c3b82677747b97a6cc7f5cf57532d3bc fc5d50e2324e2b6bb2067976bf1515dab45224fb
(no output)
03c5772e78b393b3979c44754709d7f401bb37a71e5679b34c50a9cc8334c2d0 -
M .github/workflows/pr-risk.yml M apps/cli-docs/src/fragments/commands/agent-conversation.md M packages/cli/plugins/sentry-cli/skills/sentry-cli/SKILL.md M packages/cli/plugins/sentry-cli/skills/sentry-cli/references/agent-conversation.md M packages/cli/plugins/sentry-cli/skills/sentry-cli/references/alert.md M packages/cli/plugins/sentry-cli/skills/sentry-cli/references/cli.md M packages/cli/plugins/sentry-cli/skills/sentry-cli/references/explore.md M packages/cli/plugins/sentry-cli/skills/sentry-cli/references/feedback.md M packages/cli/plugins/sentry-cli/skills/sentry-cli/references/init.md M packages/cli/plugins/sentry-cli/skills/sentry-cli/references/issue.md M packages/cli/plugins/sentry-cli/skills/sentry-cli/references/monitor.md M packages/cli/plugins/sentry-cli/skills/sentry-cli/references/org.md M packages/cli/plugins/sentry-cli/skills/sentry-cli/references/project.md M packages/cli/plugins/sentry-cli/skills/sentry-cli/references/release.md M packages/cli/plugins/sentry-cli/s...
.github/workflows/pr-risk.yml | 2 +- .../src/fragments/commands/agent-conversation.md | 33 ---------- .../plugins/sentry-cli/skills/sentry-cli/SKILL.md | 46 +++++++------- .../sentry-cli/references/agent-conversation.md | 13 ++-- .../skills/sentry-cli/references/alert.md | 6 +- .../sentry-cli/skills/sentry-cli/references/cli.md | 4 +- .../skills/sentry-cli/references/explore.md | 2 +- .../skills/sentry-cli/references/feedback.md | 2 +- .../skills/sentry-cli/references/init.md | 2 +- .../skills/sentry-cli/references/issue.md | 2 +- .../skills/sentry-cli/references/monitor.md | 2 +- .../sentry-cli/skills/sentry-cli/references/org.md | 2 +- .../skills/sentry-cli/references/project.md | 4 +- .../skills/sentry-cli/references/release.md | 4 +- .../skills/sentry-cli/references/replay.md | 2 +- .../skills/sentry-cli/references/repo.md | 2 +- ...
fc5d50e23 fix(ci): skip risk labels for fork PRs 285a589de fix(docs): derive command references from metadata 92dc1dab2 fix(docs): correct agent conversation argument syntax
...output truncated...
Full output saved to: /home/byk/.local/share/opencode/tool-output/tool_086ffafaa001mpC6CU5SMeUB34
readonly output?: OutputConfig<any>;
/**
* Whether the command requires authentication. Defaults to `true`.
*
* When `true` (the default), the command throws `AuthError("not_authenticated")`
* before executing if no credentials exist at all (no token or refresh token
* in the DB or env vars). Expired tokens with a valid refresh token pass the
* guard — the API client handles silent refresh. The auto-auth middleware in
* `cli.ts` catches the error and triggers the login flow.
*
* Set to `false` for commands that intentionally work without a token
* (e.g. `auth login`, `auth logout`, `auth status`, `help`, `cli upgrade`).
*
* Set to `"dsn"` for commands that authenticate via a Sentry DSN instead of
* a Bearer token (e.g. `event send`). These commands skip
* the token guard and the `.sentryclirc` URL trust ...
<path>/home/byk/Code/getsentry/cli-pr-1558/.github/workflows/pr-risk.yml</path>
<type>file</type>
<content>
1: name: PR Risk Experiment
2:
3: on:
4: pull_request:
5: types: [opened, synchronize, reopened, ready_for_review]
6:
7: permissions:
8: contents: read
9: pull-requests: write
10: issues: write
11:
12: concurrency:
13: group: pr-risk-${{ github.event.pull_request.number }}
14: cancel-in-progress: true
15:
16: jobs:
17: risk:
18: name: Score PR risk
19: runs-on: ubuntu-latest
20: if: github.event.pull_request.draft == false
21:
22: steps:
23: - name: Score current PR
24: uses: getsentry/pr-risk-action@v0
25: with:
26: repo: ${{ github.repository }}
27: pr-number: ${{ github.event.pull_request.number }}
28: result-path: risk-pr-result.json
29: skip-reviews: "true"
30: apply-label: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
31:
32: - ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/command.ts</path> <type>file</type> <content> 1: /** 2: * Command builder with telemetry, global flag injection, and output modes. 3: * 4: * Provides `buildCommand` — the standard command builder for all Sentry CLI 5: * commands. It wraps Stricli's `buildCommand` with: 6: * 7: * 1. **Automatic flag/arg telemetry** — captures flag values and positional 8: * arguments as Sentry span context for observability. 9: * 10: * 2. **Hidden global logging flags** — injects `--log-level` and `--verbose` 11: * into every command's parameters. These are intercepted before the original 12: * `func` runs: the logger level is set, and the injected flags are stripped 13: * so the original function never sees them. If a command already defines its 14: * own `--verbose` flag (e.g. `api` uses it for HTTP output), the injected 15: * one is skipped and the command's own value is used for both purposes. ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/introspect.ts</path>
<type>file</type>
<content>
1: /**
2: * Route Tree Introspection
3: *
4: * Shared module for extracting structured metadata from Stricli's route tree.
5: * Used at runtime by `sentry help --json` and at build time by `generate-skill.ts`.
6: *
7: * While @stricli/core exports RouteMap and Command types, they require complex
8: * generic parameters (CommandContext) and don't export internal types like
9: * RouteMapEntry or FlagParameter. These simplified types are purpose-built
10: * for introspection and documentation generation.
11: */
12:
13: import type { CommandExample } from "./command.js";
14: import {
15: extractSchemaFields,
16: type SchemaFieldInfo,
17: } from "./formatters/output.js";
18: import { fuzzyMatch } from "./fuzzy.js";
19:
20: // ---------------------------------------------------------------------------
21: // Stricli Runtime Types (simplified for introspection)
22: ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/script/generate-command-docs.ts</path>
<type>file</type>
<content>
1: #!/usr/bin/env tsx
2: /**
3: * Generate Command Reference & Configuration Documentation
4: *
5: * Introspects the CLI's route tree and env var registry to generate
6: * accurate reference pages for the documentation website. Flags, arguments,
7: * aliases, and environment variables are extracted directly from source code,
8: * preventing documentation drift.
9: *
10: * Each generated page combines:
11: * 1. Auto-generated reference and examples from CLI metadata or env registry
12: * 2. Hand-written guides and tips from docs/src/fragments/
13: *
14: * The generated output is gitignored. Fragment files are the committed
15: * source of truth for content that cannot live in command definitions.
16: *
17: * Usage:
18: * tsx script/generate-command-docs.ts
19: *
20: * Output:
21: * docs/src/content/docs/commands/{route}.md (one per ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/script/generate-skill-markdown.ts</path>
<type>file</type>
<content>
1: /**
2: * Markdown parsing helpers shared by the skill generator and its tests.
3: */
4:
5: /** Matches a generated command heading and stops before positional usage. */
6: const COMMAND_HEADING_RE =
7: /^`sentry\s+([^<[`\s]+(?:\s+[^<[`\s]+)*)(?:\s*(?:<|\[)[^`]*)?`$/;
8:
9: /** Extract the literal command path from a generated command heading. */
10: export function extractCommandPathFromHeading(
11: heading: string
12: ): string | undefined {
13: const match = COMMAND_HEADING_RE.exec(heading);
14: return match?.[1] ? `sentry ${match[1]}` : undefined;
15: }
16:
17: /** Find the command whose literal path appears in a loose example block. */
18: export function matchExampleToCommand(
19: code: string,
20: commandPaths: readonly string[],
21: groupFallback: string,
22: defaultCommandPath?: string
23: ): string | undefined {
24: // Prefer ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/script/check-fragments.ts</path>
<type>file</type>
<content>
1: #!/usr/bin/env tsx
2: /**
3: * Validate doc fragment files.
4: *
5: * Ensures fragment files stay consistent with the CLI route tree:
6: * 1. Every route has a corresponding fragment file (+ index.md)
7: * 2. Every fragment file corresponds to an existing route (or is index.md)
8: * 3. Fragment files don't accidentally contain frontmatter or the generated marker
9: * 4. Top-level fragments (e.g., configuration.md) exist
10: * 5. Fragment content covers all subcommands in a route (warnings only)
11: *
12: * Usage:
13: * tsx script/check-fragments.ts # Warnings for missing subcommands
14: * tsx script/check-fragments.ts --strict # Errors for missing subcommands
15: */
16:
17: import { mkdirSync, readdirSync } from "node:fs";
18: import { access, readFile, writeFile } from "node:fs/promises";
19: import type { RouteInfo, RouteMap ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/script/generate-skill.ts</path>
<type>file</type>
<content>
1: #!/usr/bin/env tsx
2: /**
3: * Generate Skill Files from Stricli Command Metadata and Docs
4: *
5: * Introspects the CLI's route tree and merges with documentation
6: * to generate structured documentation for AI agents.
7: *
8: * Produces:
9: * - SKILL.md: compact index with agent guidance + command summaries
10: * - references/*.md: full per-route command documentation
11: * - index.json: skill discovery manifest for .well-known
12: *
13: * Usage:
14: * tsx script/generate-skill.ts
15: *
16: * Output:
17: * plugins/sentry-cli/skills/sentry-cli/SKILL.md
18: * plugins/sentry-cli/skills/sentry-cli/references/*.md
19: * docs/public/.well-known/skills/index.json
20: */
21:
22: import { existsSync, mkdirSync, rmSync, writeFileSync } from "node:fs";
23: import { access, readFile, writeFile } from "node:fs/promises";
24: import type { Token ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/script/generate-skill.ts</path>
<type>file</type>
<content>
801: const routeInfos = await extractRoutes(routeMap);
802: const prerequisites = await loadPrerequisites();
803: const supplementary = await generateSupplementarySections();
804: const agentGuidance = await loadAgentGuidance();
805:
806: // Map each route to its own reference file (1:1)
807: const routeGroups = groupRoutesByReference(routeInfos);
808:
809: // Generate reference files
810: const referenceFileNames = new Map<string, string>();
811: for (const [refName, groupRoutes] of routeGroups) {
812: const fileName = `${refName}.md`;
813: referenceFileNames.set(refName, fileName);
814: const content = generateReferenceFile(refName, groupRoutes, version);
815: files.set(`references/${fileName}`, content);
816: }
817:
818: // Generate SKILL.md (compact index)
819: const indexSections = [
820: // YAML frontmatter
821: ...
diff --git a/packages/cli/script/check-fragments.ts b/packages/cli/script/check-fragments.ts
index 36db22e1d..6384a649d 100644
--- a/packages/cli/script/check-fragments.ts
+++ b/packages/cli/script/check-fragments.ts
@@ -226,80 +226,83 @@ function findDefaultInRouteMap(target: RouteMap): string | undefined {
return;
}
for (const sub of target.getAllEntries()) {
if (sub.target === defaultCmd) {
return sub.name.original;
}
}
return;
}
/**
* Extract the default command name for a route by inspecting the Stricli route map.
* Returns the default command name (e.g., "serve" for `local`) or undefined.
*/
function getDefaultCommandName(routeName: string): string | undefined {
for (const entry of routeMap.getAllEntries()) {
if (entry.name.original !== routeName) {
continue;
}
return findDefaultInRouteMap(entry.target as RouteMap);
}
return;
}
const multiCommandRoutes = getMultiCommandRoutes();
for (const ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/agent-conversation/list.ts</path>
<type>file</type>
<content>
1: /**
2: * sentry agent-conversation list
3: *
4: * List recent agent conversations from Sentry projects.
5: */
6:
7: import type { SentryContext } from "../../context.js";
8: import { listConversations } from "../../lib/api-client.js";
9: import { validateLimit } from "../../lib/arg-parsing.js";
10: import {
11: advancePaginationState,
12: buildPaginationContextKey,
13: hasPreviousPage,
14: resolveCursor,
15: } from "../../lib/db/pagination.js";
16: import { ContextError } from "../../lib/errors.js";
17: import { formatConversationTable } from "../../lib/formatters/conversation.js";
18: import { filterFields } from "../../lib/formatters/json.js";
19: import { CommandOutput } from "../../lib/formatters/output.js";
20: import { getPositionalString } from "../../lib/introspect.js";
21: import {
22: buildListCommand,
23: ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/agent-conversation/view.ts</path>
<type>file</type>
<content>
1: /**
2: * sentry agent-conversation view
3: *
4: * View the transcript of a specific agent conversation.
5: */
6:
7: import type { SentryContext } from "../../context.js";
8: import { getConversationSpans } from "../../lib/api-client.js";
9: import { buildCommand } from "../../lib/command.js";
10: import { ContextError, validationError } from "../../lib/errors.js";
11: import {
12: buildTranscriptResult,
13: formatTranscriptResult,
14: type TranscriptResult,
15: } from "../../lib/formatters/conversation.js";
16: import { CommandOutput } from "../../lib/formatters/output.js";
17: import {
18: applyFreshFlag,
19: FRESH_ALIASES,
20: FRESH_FLAG,
21: } from "../../lib/list-command.js";
22: import { withProgress } from "../../lib/polling.js";
23: import { resolveOrg } from "../../lib/resolve-target.js";
24:
25: type ViewFlags = {
26: ...
Found 9 matches
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/agent-conversation/view.ts:
Line 8: import { getConversationSpans } from "../../lib/api-client.js";
Line 135: () => getConversationSpans(org, conversationId)
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/agent-conversation/list.ts:
Line 8: import { listConversations } from "../../lib/api-client.js";
Line 195: listConversations(org, {
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/api/conversations.ts:
Line 42: * Internal helper used by {@link listConversations} for both single-page and
Line 101: export async function listConversations(
Line 119: export async function getConversationSpans(
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/api-client.ts:
Line 42: getConversationSpans,
Line 43: listConversations,
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/api/conversations.ts</path>
<type>file</type>
<content>
1: /**
2: * Agent conversations API functions
3: *
4: * Functions for listing and retrieving agent conversation data from the Sentry
5: * Explore agent conversations endpoints.
6: *
7: * The `/organizations/{org}/agents/conversations/` endpoints are PRIVATE and not
8: * yet in `@sentry/api` (getsentry/sentry-api-schema). Call them via
9: * `apiRequestToRegion` with local Valibot schemas (same pattern as `logs.ts` /
10: * `traces.ts`). Details response shape is documented on
11: * `AgentConversationDetailsSchema`. Pagination uses `parseLinkHeader`. Revisit
12: * once these endpoints land in `@sentry/api`.
13: */
14:
15: import { array } from "valibot";
16:
17: import {
18: type AgentConversationDetails,
19: AgentConversationDetailsSchema,
20: type AgentConversationSpan,
21: type ConversationListItem,
22: ConversationListItemSchema,
23: } from ...
diff --git a/packages/cli/src/commands/agent-conversation/list.ts b/packages/cli/src/commands/agent-conversation/list.ts
index 009809093..806842e71 100644
--- a/packages/cli/src/commands/agent-conversation/list.ts
+++ b/packages/cli/src/commands/agent-conversation/list.ts
@@ -1,203 +1,223 @@
/**
* sentry agent-conversation list
*
* List recent agent conversations from Sentry projects.
*/
import type { SentryContext } from "../../context.js";
import { listConversations } from "../../lib/api-client.js";
import { validateLimit } from "../../lib/arg-parsing.js";
import {
advancePaginationState,
buildPaginationContextKey,
hasPreviousPage,
resolveCursor,
} from "../../lib/db/pagination.js";
import { ContextError } from "../../lib/errors.js";
import { formatConversationTable } from "../../lib/formatters/conversation.js";
import { filterFields } from "../../lib/formatters/json.js";
import { CommandOutput } from "../../lib/formatters/output.js";
+import { ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/test/lib/command.test.ts</path>
<type>file</type>
<content>
1: /**
2: * Command Builder Tests
3: *
4: * Tests for the buildCommand wrapper that adds automatic flag telemetry.
5: * Uses Stricli's run() to invoke commands end-to-end, verifying the wrapper
6: * captures flags/args and calls the original function.
7: */
8:
9: import { setTimeout as sleep } from "node:timers/promises";
10: // biome-ignore lint/performance/noNamespaceImport: needed for spyOn mocking
11: import * as Sentry from "@sentry/node-core/light";
12: import {
13: buildApplication,
14: type CommandContext,
15: run,
16: text_en,
17: } from "@stricli/core";
18: import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
19: import {
20: applyLoggingFlags,
21: applyOrgProjectFlags,
22: buildCommand,
23: FIELDS_FLAG,
24: JSON_FLAG,
25: LOG_LEVEL_FLAG,
26: numberParser,
27: VERBOSE_FLAG,
28: } from ...
diff --git a/packages/cli/test/lib/command.test.ts b/packages/cli/test/lib/command.test.ts
index a251151e5..9b1506cd6 100644
--- a/packages/cli/test/lib/command.test.ts
+++ b/packages/cli/test/lib/command.test.ts
@@ -179,50 +179,78 @@ describe("buildCommand", () => {
});
test("retains the primary custom usage line for introspection", () => {
const command = buildCommand<Record<string, never>, string[]>({
auth: false,
docs: {
brief: "Create things",
customUsage: ["<name>:<kind>..."],
},
parameters: {
positional: {
kind: "array",
parameter: { brief: "Name and kind pairs", parse: String },
},
},
async *func() {
yield null;
},
});
expect(
(command as unknown as { __primaryUsage?: string }).__primaryUsage
).toBe("<name>:<kind>...");
});
+ test("retains structured examples for introspection", () => {
+ const command = ...
diff --git a/apps/cli-docs/src/fragments/commands/agent-conversation.md b/apps/cli-docs/src/fragments/commands/agent-conversation.md index ca9b2b2e3..e69de29bb 100644 --- a/apps/cli-docs/src/fragments/commands/agent-conversation.md +++ b/apps/cli-docs/src/fragments/commands/agent-conversation.md @@ -1,33 +0,0 @@ - - - -## Examples - -### List conversations - -```bash -# List recent agent conversations -sentry agent-conversation list - -# Explicit organization -sentry agent-conversation list my-org - -# Show more, last 24 hours -sentry agent-conversation list --limit 50 --period 24h - -# Filter conversations -sentry agent-conversation list -q "has:errors" - -# Paginate through results -sentry agent-conversation list my-org -c next -``` - -### View a conversation transcript - -```bash -# View full transcript -sentry agent-conversation view my-org conv-123 - -# JSON output -sentry agent-conversation view my-org conv-123 --json -``` diff --git ...
No files found
Found 4 matches /home/byk/Code/getsentry/cli-pr-1558/packages/cli/.gitignore: Line 38: src/generated/ Line 41: !src/generated/banner-sixel.ts /home/byk/Code/getsentry/cli-pr-1558/.gitignore: Line 64: packages/cli/src/generated/ Line 70: !packages/cli/src/generated/banner-sixel.ts
name: PR Risk Action
description: Score a pull request as low, medium, or high risk.
inputs:
repo:
description: GitHub repository as owner/name.
required: true
pr-number:
description: Pull request number.
required: true
profile:
description: Profile directory under profiles/. Defaults to owner__repo.
required: false
default: ""
history:
description: Optional raw historical PR JSONL or JSONL.GZ path. Defaults to the selected profile history.
required: false
default: ""
model:
description: Optional saved model JSON path. Defaults to the selected profile model.
required: false
default: ""
result-path:
description: JSON result output path.
required: false
default: risk-pr-result.json
skip-reviews:
description: Skip fetching current PR reviews.
required: false
default: "true"
apply-label:
description: "Apply risk labels to the pull request. Requires issues: write in the caller workflow."
...
{
"sha": "f5126d7a979415ac5124b7c14919482b149382aa",
"url": "https://api.github.com/repos/getsentry/pr-risk-action/git/trees/f5126d7a979415ac5124b7c14919482b149382aa",
"tree": [
{
"path": ".github",
"mode": "040000",
"type": "tree",
"sha": "c9212beabe643036656b55873501db0e6b349f29",
"url": "https://api.github.com/repos/getsentry/pr-risk-action/git/trees/c9212beabe643036656b55873501db0e6b349f29"
},
{
"path": ".github/workflows",
"mode": "040000",
"type": "tree",
"sha": "bd502cb67b3837ce0b0efbf68ab222010b714c3f",
"url": "https://api.github.com/repos/getsentry/pr-risk-action/git/trees/bd502cb67b3837ce0b0efbf68ab222010b714c3f"
},
{
"path": ".github/workflows/test.yml",
"mode": "100644",
"type": "blob",
"sha": "442442ed48660d8e953d4e2c172fe1b528310e10",
"size": 401,
"url": ...
"""Small GitHub REST client for PR backfills."""
from __future__ import annotations
import json
import os
import socket
import time
import gzip
import http.client
import urllib.error
import urllib.parse
import urllib.request
from dataclasses import dataclass
from datetime import datetime, timezone
from typing import Any, Dict, Iterable, Iterator, List, Optional, Sequence
GITHUB_API = "https://api.github.com"
class GitHubError(RuntimeError):
"""Raised when the GitHub API returns an error."""
@dataclass(frozen=True)
class RepoRef:
owner: str
name: str
@classmethod
def parse(cls, value: str) -> "RepoRef":
parts = value.strip().split("/")
if len(parts) != 2 or not all(parts):
raise ValueError(f"repo must look like owner/name, got {value!r}")
return cls(parts[0], parts[1])
@property
def slug(self) -> str:
return f"{self.owner}/{self.name}"
@property
def path_slug(self) -> str:
return ...
"""Command line interface for the PR risk MVP."""
from __future__ import annotations
import argparse
import json
import os
import sys
from datetime import datetime, timedelta, timezone
from pathlib import Path
from typing import Any, Dict, List, Optional, Sequence
from .features import build_feature_rows, load_raw_dataset, write_feature_csv
from .git_history import build_git_pr_rows, collect_git_reverts_by_pr, survey_git_history
from .github import (
GitHubError,
GitHubClient,
RepoRef,
normalize_file,
normalize_pr,
normalize_review,
parse_github_time,
utc_now_iso,
write_jsonl,
)
from .modeling import (
DEFAULT_FEATURE_SET,
apply_serialized_logistic_model,
canonical_feature_set,
logistic_markdown_report,
train_logistic_baseline,
)
from .scoring import evaluate_predictions, markdown_report, score_feature_rows, write_json
DEFAULT_OUTCOMES = ["strong_outcome", "medium_outcome"]
RISK_LABELS = {
"low": {
"name": "risk: ...
# PR Risk Action
GitHub Action for scoring pull requests as `low`, `medium`, or `high` risk with the current deterministic/logistic PR risk MVP.
This repository intentionally holds the Action runtime so consumer repositories do not need to vendor the scorer. The first bundled profiles are for `getsentry/cli`, `getsentry/sentry`, `getsentry/sentry-mcp`, `getsentry/snuba`, `getsentry/junior`, `getsentry/dotagents`, and `getsentry/sentry-dotnet`.
## Usage
```yaml
name: PR Risk Experiment
on:
pull_request_target:
types: [opened, synchronize, reopened, ready_for_review]
permissions:
contents: read
pull-requests: write
issues: write
jobs:
risk:
name: Score PR risk
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
steps:
- name: Score PR risk
uses: getsentry/pr-risk-action@main
with:
repo: ${{ github.repository }}
pr-number: ${{ github.event.pull_request.number }}
```
The Action writes a ...
Found 38 matches
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/introspect.ts:
Line 55: * reads it to populate {@link CommandInfo.jsonFields}.
Line 102: export type CommandInfo = {
Line 131: commands: CommandInfo[];
Line 139: | { kind: "command"; info: CommandInfo }
Line 280: * Build a {@link CommandInfo} from a Stricli Command.
Line 286: export function buildCommandInfo(
Line 290: ): CommandInfo {
Line 324: ): CommandInfo[] {
Line 325: const commands: CommandInfo[] = [];
Line 336: commands.push(buildCommandInfo(subTarget, path, examples));
Line 356: export function extractAllRoutes(routeMap: RouteMap): RouteInfo[] {
Line 378: commands: [buildCommandInfo(target, path)],
Line 453: info: buildCommandInfo(target, `sentry ${entry.name.original}`),
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/command.ts:
Line 709: const { introspectCommand, formatHelpHuman } = await import("./help.js");
...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/help.ts</path>
<type>file</type>
<content>
1: /**
2: * Help Command
3: *
4: * Provides help information for the CLI.
5: * - `sentry help` or `sentry` (no args): Shows branded help with banner
6: * - `sentry help <command>`: Shows detailed help for that command
7: * - `sentry help --json`: Emits full command tree as structured JSON
8: * - `sentry help --json <command>`: Emits specific command/group metadata as JSON
9: */
10:
11: import type { SentryContext } from "../context.js";
12: import { buildCommand } from "../lib/command.js";
13: import { OutputError } from "../lib/errors.js";
14: import { CommandOutput } from "../lib/formatters/output.js";
15: import {
16: formatHelpHuman,
17: introspectAllCommands,
18: introspectCommand,
19: } from "../lib/help.js";
20:
21: export const helpCommand = buildCommand({
22: auth: false,
23: docs: {
24: brief: "Display help for a command",
25: ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/formatters/output.ts</path>
<type>file</type>
<content>
360: item?: ValibotSchemaNode;
361: /** Field schemas for object / loose_object. */
362: entries?: Record<string, ValibotSchemaNode>;
363: /**
364: * Pipe steps for a `SchemaWithPipe` (e.g. `pipe(string(), description(...))`
365: * or the `pipe(unknown(), transform(Number), number())` coercion pattern).
366: * Each step carries a `kind` of `"schema"`, `"validation"`, `"transformation"`,
367: * or `"metadata"`.
368: */
369: pipe?: Array<{ type: string; kind: string }>;
370: };
371:
372: /**
373: * Resolve a piped schema (`pipe(...)`) to the node whose `type` reflects its
374: * output — the last step with `kind === "schema"`. For the coercion pattern
375: * `pipe(unknown(), transform(Number), number())` this is `number()`, not the
376: * leading `unknown()`. Non-piped schemas are returned unchanged. ...
Found 15 matches
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/formatters/log.ts:
Line 463: a.type === "array" ? JSON.stringify(a.value) : String(a.value),
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/formatters/local.ts:
Line 20: * `JSON.stringify` only escapes C0 (U+0000–U+001F) per RFC 8259;
Line 30: * Used for JSON output where `JSON.stringify` escapes C0 controls but
Line 388: return sanitize(JSON.stringify(value));
Line 749: * Envelope payloads are untrusted, and `JSON.stringify()` does not escape C1
Line 777: return JSON.stringify(
Line 989: * the full `sanitize()`. `JSON.stringify()` escapes C0 control characters
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/formatters/output.ts:
Line 207: * Rendering context passed to {@link renderCommandOutput}.
Line 285: export function renderCommandOutput(
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/formatters/json.ts:
Line 170: ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/formatters/output.ts</path>
<type>file</type>
<content>
180: export class ClearScreen {
181: /** Brand field for instanceof checks — never read, just exists. */
182: readonly _brand = "ClearScreen" as const;
183: }
184:
185: /**
186: * Return type for command generators.
187: *
188: * Carries metadata that applies to the entire command invocation — not to
189: * individual yielded chunks. The `buildCommand` wrapper captures this from
190: * the generator's return value (the `done: true` result of `.next()`).
191: *
192: * `hint` is shown in human mode and suppressed in JSON mode.
193: */
194: export type CommandReturn = {
195: /**
196: * Hint line appended after all output (suppressed in JSON mode).
197: *
198: * When the renderer has a `finalize()` method, the hint is passed
199: * to it — the renderer decides how to render it alongside any
200: * cleanup output (e.g., table footer). ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/app.ts</path>
<type>file</type>
<content>
1: import {
2: type ApplicationText,
3: buildApplication,
4: text_en,
5: UnexpectedPositionalError,
6: UnsatisfiedPositionalError,
7: } from "@stricli/core";
8: import { conversationRoute } from "./commands/agent-conversation/index.js";
9: import { listCommand as conversationListCommand } from "./commands/agent-conversation/list.js";
10: import { alertRoute } from "./commands/alert/index.js";
11: import { apiCommand } from "./commands/api.js";
12: import { authRoute } from "./commands/auth/index.js";
13: import { whoamiCommand } from "./commands/auth/whoami.js";
14: import { bashHookCommand } from "./commands/bash-hook.js";
15: import { buildRoute } from "./commands/build/index.js";
16: import { cliRoute } from "./commands/cli/index.js";
17: import { codeMappingsRoute } from "./commands/code-mappings/index.js";
18: import { dartSymbolMapRoute } from ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/help.ts</path>
<type>file</type>
<content>
280: defaultValue?: string;
281: };
282:
283: /**
284: * Metadata for a common flag as exposed to JSON callers of `sentry help --json`.
285: */
286: export type HelpFlagInfo = {
287: /** Long flag name including `--` prefix (e.g. `"--json"`). */
288: long: string;
289: /** Short alias including `-` prefix (e.g. `"-f"`), or undefined if none. */
290: short?: string;
291: /** One-line description. */
292: description: string;
293: };
294:
295: /**
296: * Result of introspecting the CLI.
297: * Yielded as CommandOutput — JSON mode serializes directly, human mode
298: * passes through {@link formatHelpHuman}, which renders the branded banner for
299: * the full tree. ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/test/commands/agent-conversation/view.test.ts</path>
<type>file</type>
<content>
1: /**
2: * Conversation View Command Tests
3: *
4: * Tests for the `sentry agent-conversation view` command func() body, covering:
5: * - Resolving org + conversationId from a single `<org>/<conversation-id>` arg
6: * - Resolving org via resolveOrg when only the conversation-id is given
7: * - Throwing error when no args provided
8: * - Throwing ContextError when org cannot be resolved
9: * - Yielding CommandOutput with transcript result
10: * - Setting truncated flag from API response
11: *
12: * Uses spyOn mocking to avoid real HTTP calls or database access.
13: */
14:
15: import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
16: import { viewCommand } from "../../../src/commands/agent-conversation/view.js";
17:
18: vi.mock("../../../src/lib/api-client.js", async (importOriginal) => {
19: const actual =
20: ...
Found 9 matches /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/resolve-target.ts: Line 264: export async function resolveOrgFromDsn( Line 1298: export async function resolveOrgAndProject( Line 1653: export async function resolveOrgProjectOrGuide( Line 1673: export async function resolveOrg( Line 1877: export async function resolveOrgsForListing( Line 1951: export async function resolveOrgProjectTarget( Line 2086: export function resolveOrgProjectFromArg( Line 2385: export async function resolveOrgOptionalProjectTarget( Line 2424: export function resolveOrgOptionalProjectFromArg(
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/resolve-target.ts</path>
<type>file</type>
<content>
1640: }
1641: throw new ContextError("Organization and project", usageHint);
1642: }
1643:
1644: /**
1645: * Resolve an org/project target, guiding the user when auto-detection fails.
1646: *
1647: * Drop-in replacement for the `resolveOrgAndProject(...)` + "throw
1648: * `ContextError` on null" pattern, combining {@link resolveOrgAndProject} with
1649: * {@link guideOrgProjectFailure}.
1650: *
1651: * @throws {ContextError} When the target cannot be resolved or chosen.
1652: */
1653: export async function resolveOrgProjectOrGuide(
1654: options: ResolveOptions
1655: ): Promise<ResolvedTarget> {
1656: const resolved = await resolveOrgAndProject(options);
1657: return resolved ?? (await guideOrgProjectFailure(options));
1658: }
1659:
1660: /**
1661: * Resolve organization only from multiple sources.
1662: *
1663: * Resolution priority:
1664: * 1. ...
diff --git a/packages/cli/test/commands/agent-conversation/list.test.ts b/packages/cli/test/commands/agent-conversation/list.test.ts
index 21a26bd6c..e080697cc 100644
--- a/packages/cli/test/commands/agent-conversation/list.test.ts
+++ b/packages/cli/test/commands/agent-conversation/list.test.ts
@@ -253,60 +253,73 @@ describe("listCommand.func", () => {
resolveOrgSpy.mockResolvedValue({ org: "auto-org" });
listConversationsSpy.mockResolvedValue({
data: [],
nextCursor: undefined,
});
const { context } = createMockContext();
const func = await listCommand.loader();
await func.call(context, JSON_FLAGS, undefined);
expect(resolveOrgSpy).toHaveBeenCalledWith(
expect.objectContaining({ org: undefined })
);
expect(listConversationsSpy).toHaveBeenCalledWith(
"auto-org",
expect.any(Object)
);
});
test("throws error when org cannot be resolved", async () => {
...
Found 9 matches /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/introspect.ts: Line 111: examples: string[]; Line 289: examples: string[] = [] Line 304: examples: cmd.__examples?.length /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/formatters/local.ts: Line 270: * Output examples: /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/errors.ts: Line 520: examples: string[], Line 542: examples: string[], /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/agent-conversation/view.ts: Line 80: examples: [ /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/agent-conversation/list.ts: Line 117: examples: [ /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/dashboard/widget/index.ts: Line 47: "Row-filling examples:\n" +
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/formatters/json.ts</path>
<type>file</type>
<content>
130: const lookup = getNestedValue(data, field);
131: if (lookup.found) {
132: // Use literal key when the field name exists as a direct property
133: // (e.g., "gen_ai.usage.input_tokens" as a flat key)
134: const isLiteral =
135: typeof data === "object" && data !== null && Object.hasOwn(data, field);
136: setNestedValue(result, field, lookup.value, isLiteral);
137: }
138: }
139:
140: return result as Partial<T>;
141: }
142:
143: /**
144: * Parse a comma-separated fields string into a trimmed, deduplicated array. ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/package.json</path>
<type>file</type>
<content>
1: {
2: "name": "sentry",
3: "version": "0.45.0-dev.0",
4: "description": "Sentry CLI - A command-line interface for using Sentry built by robots and humans for robots and humans",
5: "repository": {
6: "type": "git",
7: "url": "git+https://github.com/getsentry/cli.git"
8: },
9: "main": "./dist/index.cjs",
10: "type": "module",
11: "types": "./dist/index.d.cts",
12: "exports": {
13: ".": {
14: "import": {
15: "types": "./dist/index.d.mts",
16: "default": "./dist/index.mjs"
17: },
18: "require": {
19: "types": "./dist/index.d.cts",
20: "default": "./dist/index.cjs"
21: }
22: }
23: },
24: "bin": {
25: "sentry": "./dist/bin.cjs"
26: },
27: "files": [
28: "dist/bin.cjs",
29: "dist/index.cjs",
30: "dist/index.mjs",
31: "dist/index.d.cts",
32: "dist/index.d.mts",
33: ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/.cursor/rules/ultracite.mdc</path>
<type>file</type>
<content>
1: ---
2: description: Ultracite Rules - AI-Ready Formatter and Linter
3: globs: "**/*.{ts,tsx,js,jsx,json,jsonc,html,vue,svelte,astro,css,yaml,yml,graphql,gql,md,mdx,grit}"
4: alwaysApply: false
5: ---
6:
7: # Ultracite Code Standards
8:
9: This project uses **Ultracite**, a zero-config Biome preset that enforces strict code quality standards through automated formatting and linting.
10:
11: ## Quick Reference
12:
13: - **Format code**: `npx ultracite fix`
14: - **Check for issues**: `npx ultracite check`
15: - **Diagnose setup**: `npx ultracite doctor`
16:
17: Biome (the underlying engine) provides extremely fast Rust-based linting and formatting. Most issues are automatically fixable.
18:
19: ---
20:
21: ## Core Principles
22:
23: Write code that is **accessible, performant, type-safe, and maintainable**. Focus on clarity and explicit intent over brevity. ...
DEPRECATED `test.poolOptions` was removed in Vitest 4. All previous `poolOptions` are now top-level options. Please, refer to the migration guide: https://vitest.dev/guide/migration#pool-rework RUN v4.1.10 /home/byk/Code/getsentry/cli-pr-1558/packages/cli [debug] [compat-flags] --org flag → SENTRY_ORG=my-org [debug] [compat-flags] --project flag → SENTRY_PROJECT=my-proj [debug] [compat-flags] --org flag → SENTRY_ORG=my-org [debug] [compat-flags] --project flag → SENTRY_PROJECT=my-proj [debug] [compat-flags] --org flag → SENTRY_ORG=new [debug] [compat-flags] --org flag → SENTRY_ORG=my-org [debug] [compat-flags] --project flag → SENTRY_PROJECT=my-proj [debug] [compat-flags] --org flag → SENTRY_ORG=my-org [debug] [compat-flags] --project flag → SENTRY_PROJECT=my-project [debug] [compat-flags] --org flag → SENTRY_ORG=new-org [debug] [compat-flags] --org flag → SENTRY_ORG=sentry [debug] [compat-flags] --project flag → SENTRY_PROJECT=cli [debug] [compat-flags] --org flag → ...
> sentry@0.45.0-dev.0 typecheck /home/byk/Code/getsentry/cli-pr-1558/packages/cli > pnpm run generate:docs && pnpm run generate:sdk && tsc --noEmit > sentry@0.45.0-dev.0 generate:docs /home/byk/Code/getsentry/cli-pr-1558/packages/cli > pnpm run generate:banner && pnpm run generate:parser && pnpm run generate:command-docs && pnpm run generate:skill && pnpm run generate:docs-sections > sentry@0.45.0-dev.0 generate:banner /home/byk/Code/getsentry/cli-pr-1558/packages/cli > pnpm tsx script/generate-banner-sixel.ts > sentry@0.45.0-dev.0 tsx /home/byk/Code/getsentry/cli-pr-1558/packages/cli > tsx --env-file-if-exists=.env.local --import ./script/require-shim.mjs script/generate-banner-sixel.ts Wrote /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/generated/banner-sixel.ts (640x155, sixel 4216 bytes) > sentry@0.45.0-dev.0 generate:parser /home/byk/Code/getsentry/cli-pr-1558/packages/cli > pnpm tsx script/generate-parser.ts > sentry@0.45.0-dev.0 tsx ...
(no output)
Unknown: ChildProcess.kill (pnpm run lint && pnpm run check:fragments -- --strict && pnpm run check:deps && pnpm run check:errors )
(no output)
> sentry@0.45.0-dev.0 lint /home/byk/Code/getsentry/cli-pr-1558/packages/cli > biome check --no-errors-on-unmatched --error-on-warnings --max-diagnostics=none ./ Checked 1030 files in 91s. No fixes applied.
> sentry@0.45.0-dev.0 check:fragments /home/byk/Code/getsentry/cli-pr-1558/packages/cli
> pnpm tsx script/check-fragments.ts -- --strict
.env.local not found. Continuing without it.
.env.local not found. Continuing without it.
> sentry@0.45.0-dev.0 tsx /home/byk/Code/getsentry/cli-pr-1558/packages/cli
> tsx --env-file-if-exists=.env.local --import ./script/require-shim.mjs script/check-fragments.ts -- --strict
Found 1 fragment validation error(s):
✗ Fragment missing subcommand coverage: ../../apps/cli-docs/src/fragments/commands/proguard.md
Not documented: upload
Hint: add a heading or code example for each (e.g., "sentry proguard upload")
ELIFECYCLE Command failed with exit code 1.
ELIFECYCLE Command failed with exit code 1.
> sentry@0.45.0-dev.0 check:deps /home/byk/Code/getsentry/cli-pr-1558/packages/cli > pnpm tsx script/check-no-deps.ts > sentry@0.45.0-dev.0 tsx /home/byk/Code/getsentry/cli-pr-1558/packages/cli > tsx --env-file-if-exists=.env.local --import ./script/require-shim.mjs script/check-no-deps.ts ✓ No runtime dependencies in package.json .env.local not found. Continuing without it. .env.local not found. Continuing without it.
> sentry@0.45.0-dev.0 check:errors /home/byk/Code/getsentry/cli-pr-1558/packages/cli > pnpm tsx script/check-error-patterns.ts > sentry@0.45.0-dev.0 tsx /home/byk/Code/getsentry/cli-pr-1558/packages/cli > tsx --env-file-if-exists=.env.local --import ./script/require-shim.mjs script/check-error-patterns.ts ✓ No error class anti-patterns found. .env.local not found. Continuing without it. .env.local not found. Continuing without it.
> sentry@0.45.0-dev.0 tsx /home/byk/Code/getsentry/cli-pr-1558/packages/cli
> tsx --env-file-if-exists=.env.local --import ./script/require-shim.mjs script/check-fragments.ts --strict
.env.local not found. Continuing without it.
.env.local not found. Continuing without it.
Found 1 fragment validation error(s):
✗ Fragment missing subcommand coverage: ../../apps/cli-docs/src/fragments/commands/proguard.md
Not documented: upload
Hint: add a heading or code example for each (e.g., "sentry proguard upload")
ELIFECYCLE Command failed with exit code 1.
DEPRECATED `test.poolOptions` was removed in Vitest 4. All previous `poolOptions` are now top-level options. Please, refer to the migration guide: https://vitest.dev/guide/migration#pool-rework
RUN v4.1.10 /home/byk/Code/getsentry/cli-pr-1558/packages/cli
·········
Test Files 1 passed (1)
Tests 9 passed (9)
Start at 17:34:28
Duration 4.85s (transform 3.02s, setup 103ms, import 4.39s, tests 105ms, environment 0ms)
DEPRECATED `test.poolOptions` was removed in Vitest 4. All previous `poolOptions` are now top-level options. Please, refer to the migration guide: https://vitest.dev/guide/migration#pool-rework
RUN v4.1.10 /home/byk/Code/getsentry/cli-pr-1558/packages/cli
·········
Test Files 1 passed (1)
Tests 9 passed (9)
Start at 17:34:35
Duration 3.86s (transform 2.52s, setup 92ms, import 3.46s, tests 93ms, environment 0ms)
DEPRECATED `test.poolOptions` was removed in Vitest 4. All previous `poolOptions` are now top-level options. ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/test/lib/introspect.property.test.ts</path>
<type>file</type>
<content>
1: /**
2: * Property-Based Tests for Route Tree Introspection
3: *
4: * Uses fast-check to verify invariants that should hold for any valid
5: * route tree structure.
6: */
7:
8: import {
9: array,
10: boolean,
11: constantFrom,
12: assert as fcAssert,
13: oneof,
14: property,
15: record,
16: string,
17: tuple,
18: } from "fast-check";
19: import { describe, expect, test } from "vitest";
20: import type {
21: Command,
22: FlagDef,
23: RouteMap,
24: RouteMapEntry,
25: } from "../../src/lib/introspect.js";
26: import {
27: extractAllRoutes,
28: extractFlags,
29: getPositionalString,
30: resolveCommandPath,
31: } from "../../src/lib/introspect.js";
32: import { DEFAULT_NUM_RUNS } from "../model-based/helpers.js";
33:
34: // ---------------------------------------------------------------------------
35: // Arbitraries
36: ...
Found 2 matches /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/project/create.ts: Line 609: customUsage: ["[<org>/]<name>:<platform>..."], /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/agent-conversation/view.ts: Line 75: customUsage: [USAGE],
ripgrep execution failed
No files found
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/node_modules/@stricli/core</path> <type>directory</type> <entries> dist/ package.json README.md (3 entries) </entries>
Found 100 matches (more matches available)
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/node_modules/@stricli/core/dist/index.cjs:
Line 958: brief: flag[1].brief
Line 990: brief: namedFlag[1].brief
Line 1007: brief: flag[1].brief
Line 1018: brief: text.briefs.argumentEscapeSequence
Line 1035: brief: param.brief
Line 1053: brief: positional.parameter.brief
Line 1068: brief: nextPositional.brief
Line 1096: brief: flag.brief
Line 1128: briefs: {
Line 1735: const brief = entry.target.brief;
Line 1739: brief
Line 1748: brief
Line 1904: const { keywords, briefs } = args.text;
Line 1955: brief: flag.brief,
Line 1963: brief: briefs.help
Line 1970: brief: briefs.helpAll,
Line 1978: brief: briefs.version
Line 1985: brief: briefs.argumentEscapeSequence
Line ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/node_modules/@stricli/core/dist/index.js</path>
<type>file</type>
<content>
1980: if (def.optional) {
1981: name = `[${name}]`;
1982: } else if (atLeastOneOptional) {
1983: name = ` ${name}`;
1984: }
1985: if (def.default) {
1986: const defaultKeyword = args.ansiColor ? `\x1B[2m${keywords.default}\x1B[22m` : keywords.default;
1987: suffix = `[${defaultKeyword} ${def.default}]`;
1988: }
1989: return [
1990: args.ansiColor ? `\x1B[1m${name}\x1B[22m` : name,
1991: args.ansiColor ? `\x1B[3m${def.brief}\x1B[23m` : def.brief,
1992: suffix ?? ""
1993: ];
1994: }),
1995: [" ", " "]
1996: );
1997: }
1998:
1999: // src/routing/command/documentation.ts
2000: function* generateCommandHelpLines(parameters, docs, args) {
2001: const { brief, fullDescription, customUsage } = docs;
2002: const { headers } = args.text;
2003: const ...
/**
* sentry agent-conversation view
*
* View the transcript of a specific agent conversation.
*/
import type { SentryContext } from "../../context.js";
import { getConversationSpans } from "../../lib/api-client.js";
import { buildCommand } from "../../lib/command.js";
import { ContextError } from "../../lib/errors.js";
import {
buildTranscriptResult,
formatTranscriptResult,
type TranscriptResult,
} from "../../lib/formatters/conversation.js";
import { CommandOutput } from "../../lib/formatters/output.js";
import {
applyFreshFlag,
FRESH_ALIASES,
FRESH_FLAG,
} from "../../lib/list-command.js";
import { withProgress } from "../../lib/polling.js";
import { resolveOrg } from "../../lib/resolve-target.js";
type ViewFlags = {
readonly json: boolean;
readonly fresh: boolean;
};
const USAGE_HINT = "sentry agent-conversation view [<org>/]<conversation-id>";
/**
* Split a `[<org>/]<conversation-id>` positional into its parts. ...
6: pr-number: ${{ github.event.pull_request.number }}
10:+ apply-label: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
13: uses: actions/upload-artifact@v4
85:@@ -411,12 +411,12 @@ Make an authenticated API request
105:-- `sentry cli completion <shell>` — Print the shell completion script
106:+- `sentry cli completion [<shell>]` — Print the shell completion script
111: - `sentry cli setup` — Configure shell integration
308:-### `sentry cli completion <shell>`
309:+### `sentry cli completion [<shell>]`
311: Print the shell completion script
553: import { mkdirSync, rmSync } from "node:fs";
554: import { access, readFile, writeFile } from "node:fs/promises";
823:+ /** Complete command line, including the `sentry` executable. */
1121:+ auth: false,
1236:@@ -4,8 +4,12 @@ import { readFile } from "node:fs/promises";
Found 5 matches /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/api/projects.ts: Line 212: const url = new URL(dsn); /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/api/preprod-artifacts.ts: Line 126: return new URL(url).origin === new URL(regionUrl).origin; /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/api/infrastructure.ts: Line 329: const searchParams = new URLSearchParams(); Line 489: export async function apiRequestToRegion<T>( Line 646: export async function apiRequestToRegionNoContent(
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/api/infrastructure.ts</path>
<type>file</type>
<content>
300: const data = unwrapResult<T>(result, context);
301: const { nextCursor, prevCursor } = parseLinkHeader(
302: response?.headers.get("link") ?? null
303: );
304: const out: PaginatedResponse<T> = { data };
305: if (nextCursor !== undefined) {
306: out.nextCursor = nextCursor;
307: }
308: if (prevCursor !== undefined) {
309: out.prevCursor = prevCursor;
310: }
311: return out;
312: }
313:
314: /**
315: * Build URLSearchParams from an options object, filtering out undefined values.
316: * Supports string arrays for repeated keys (e.g., { tags: ["a", "b"] } → tags=a&tags=b).
317: *
318: * @param params - Key-value pairs to convert to search params
319: * @returns URLSearchParams instance, or undefined if no valid params
320: * @internal Exported for testing
321: */
322: export function buildSearchParams(
323: params?: ...
Found 43 matches
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/test/lib/introspect.test.ts:
Line 250: __primaryUsage: "<name>:<kind>...",
Line 274: const cmd = makeCommand({ __examples: examples });
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/test/lib/command.test.ts:
Line 200: (command as unknown as { __primaryUsage?: string }).__primaryUsage
Line 222: expect((command as unknown as { __examples?: unknown }).__examples).toEqual(
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/test/script/generate-skill-markdown.test.ts:
Line 43: (listCommand as unknown as { __primaryUsage?: string }).__primaryUsage
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/test/commands/auth/default.test.ts:
Line 64: const loginCmd = loginCommand as unknown as { __rawFunc: unknown };
Line 65: const statusCmd = statusCommand as unknown as { __rawFunc: unknown };
Line 66: const prevLogin = loginCmd.__rawFunc;
Line 67: const ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/help.ts</path>
<type>file</type>
<content>
80: {
81: long: "--help",
82: description: "Show help for a command",
83: },
84: {
85: long: "--version",
86: description: "Show version",
87: },
88: ];
89:
90: /**
91: * Generate the commands list dynamically from Stricli's route structure.
92: * This ensures help text stays in sync with actual registered commands.
93: */
94: function generateCommands(): HelpCommand[] {
95: // Cast to our introspection types — Stricli's generic types are compatible
96: const routeMap = routes as unknown as RouteMap;
97: const entries = routeMap.getAllEntries();
98:
99: return entries
100: .filter((entry: RouteMapEntry) => !entry.hidden)
101: .map((entry: RouteMapEntry) => {
102: const routeName = entry.name.original;
103: const brief = entry.target.brief;
104:
105: if (isRouteMap(entry.target)) {
106: // Get visible ...
* 🔴 (18:04) In `/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/api/infrastructure.ts`, `buildSearchParams(params)` accepts `Record<string, string | number | boolean | string[] | undefined>`, skips `undefined`, appends array values as repeated keys, stringifies scalar values with `String(value)`, and returns `undefined` when no valid parameters remain. * 🔴 (18:04) Pagination constants…
* 🟡 (17:47) Ten consecutive Vitest `v4.1.10` runs in `/home/byk/Code/getsentry/cli-pr-1558/packages/cli` each passed exactly 1 test file and 9 tests. Start times/durations were: `17:34:28`/4.85s, `17:34:35`/3.86s, `17:34:41`/4.06s, `17:34:46`/3.93s, `17:34:52`/4.72s, `17:34:58`/5.07s, `17:35:05`/4.61s, `17:35:11`/5.19s, `17:35:18`/3.76s, and `17:35:23`/3.79s. * 🟡 (17:47) Most repeated Vitest ru…
Date: Sep 9, 2026 * 🔴 (17:04) User provided lines 130–219 of `/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/formatters/json.ts`; `parseFieldsList(input)` splits on commas, trims each field, removes empty segments, and deduplicates with `new Set(...)`. * 🔴 (17:04) In `src/lib/formatters/json.ts`, `formatJson<T>(data)` returns `JSON.stringify(data, null, 2)`, and `writeJson<T>(stream,…
* 🔴 (16:33) User provided `/home/byk/Code/getsentry/cli-pr-1558/packages/cli/script/generate-skill-markdown.ts` (48 lines), which exports `extractCommandPathFromHeading()`, `matchExampleToCommand()`, and `formatCommandExamples()`. * 🔴 (16:33) In `generate-skill-markdown.ts`, `COMMAND_HEADING_RE` is `/^`sentry\s+([^<[`\s]+(?:\s+[^<[`\s]+)*)(?:\s*(?:<|\[)[^`]*)?`$/`; `extractCommandPathFromHeadin…
* 🔴 (16:51) Search found exactly 9 matches for `examples` across 6 files: `/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/introspect.ts` at lines 111 (`examples: string[];`), 289 (`examples: string[] = []`), and 304 (`examples: cmd.__examples?.length`); `/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/formatters/local.ts` at line 270 (`* Output examples:`); `/home/byk/Code/g…
* 🟡 (16:48) `/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/resolve-target.ts` defines `resolveOrgProjectOrGuide(options)` as a drop-in replacement for `resolveOrgAndProject(...)` plus manual null handling: it returns `await resolveOrgAndProject(options)` or falls back to `await guideOrgProjectFailure(options)`, which throws `ContextError` when resolution/selection fails. * 🟡 (16:48)…
* 🟡 (16:45) `/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/app.ts` defines the top-level `routes` with `buildRouteMap()`, `defaultCommand: "help"`, brief `"A gh-like CLI for Sentry"`, and visible routes in this order: `help`, `alert`, `auth`, `build`, `cli`, `code-mappings`, `agent-conversation`, `dart-symbol-map`, `debug-files`, `dashboard`, `docs`, `org`, `platform`, `project`, `progua…
* 🟡 (16:42) `src/risk_pr_agent/cli.py` defines the `risk-pr` CLI (`argparse.ArgumentParser(prog="risk-pr", description="Offline PR risk dataset tooling")`) with 10 required subcommands: 1. `backfill`, 2. `git-backfill`, 3. `features`, 4. `score`, 5. `build`, 6. `survey`, 7. `combine`, 8. `train`, 9. `apply-model`, 10. `score-pr`. * 🟡 (16:42) `src/risk_pr_agent/cli.py` defines `DEFAULT_OUTCOMES …
* 🟡 (16:41) The `getsentry/pr-risk-action` repository tree at commit `f5126d7a979415ac5124b7c14919482b149382aa` was returned with `truncated: false`; top-level contents include `.github/workflows/test.yml`, `.gitignore`, `README.md`, `action.yml`, `profiles/`, `pyproject.toml`, `src/risk_pr_agent/`, and `tests/`. * 🟡 (16:41) The repository contains 7 bundled profiles: `profiles/getsentry__cli`,…
* 🟡 (16:40) Generated CLI documentation removed all 33 lines from `apps/cli-docs/src/fragments/commands/agent-conversation.md`, deleting the manually maintained list/view examples fragment. * 🟡 (16:40) Generated `packages/cli/plugins/sentry-cli/skills/sentry-cli/SKILL.md` corrected positional syntax to mark optional parameters: `sentry org view [<org>]`; `sentry project list [<org/project>]`; `…
* 🔴 (16:39) User stated `--log-level` is always stripped from a command function’s flags because it is owned by the CLI wrapper (“always stripped (it's ours)”); a command-defined `--verbose` remains available to the command, while `--log-level` takes priority for logging level. * 🟡 (16:39) `packages/cli/test/lib/command.test.ts` is 1,920 lines; the displayed section covers `buildCommand` intros…
* 🟡 (16:36) `packages/cli/script/check-fragments.ts` changed subcommand-coverage validation so commands with canonical metadata examples (`cmd.examples.length > 0`) are skipped; fragments are now required only for commands lacking canonical examples. * 🟡 (16:36) `packages/cli/script/generate-command-docs.ts` documentation now describes generated pages as combining: 1. auto-generated reference a…
* 🟡 (16:31) `packages/cli/src/lib/introspect.ts` is 496 lines and provides shared Stricli route-tree introspection for runtime `sentry help --json` and build-time `generate-skill.ts`. * 🟡 (16:31) `packages/cli/src/lib/introspect.ts` defines simplified introspection types because `@stricli/core` types require complex `CommandContext` generics and do not export internals such as `RouteMapEntry` o…
* 🔴 (16:30) User reaffirmed that `--fields` is always injected when `output: { human: ... }` is configured, including when the command already defines its own `json` flag. * 🔴 (16:30) User reaffirmed that flags in `ALWAYS_STRIP` are always stripped so the command never sees them; `ALWAYS_STRIP` is `new Set([LOG_LEVEL_KEY])`, and `LOG_LEVEL_KEY` is `"log-level"`. * 🔴 (16:30) [enforced-script-ch…
Date: Sep 9, 2026 * 🔴 (16:28) Tool result showed 3 commits in order: `fc5d50e23 fix(ci): skip risk labels for fork PRs`; `285a589de fix(docs): derive command references from metadata`; `92dc1dab2 fix(docs): correct agent conversation argument syntax`. * 🟡 (16:29) Truncated tool output was saved in full at `/home/byk/.local/share/opencode/tool-output/tool_086ffafaa001mpC6CU5SMeUB34`. * 🔴 (16:29…
* 🔴 (16:19) Tool result returned identifier `03c5772e78b393b3979c44754709d7f401bb37a71e5679b34c50a9cc8334c2d0` followed by `-`. * 🔴 (16:19) Repository working tree showed 35 modified files: `.github/workflows/pr-risk.yml`; `apps/cli-docs/src/fragments/commands/agent-conversation.md`; `packages/cli/plugins/sentry-cli/skills/sentry-cli/SKILL.md`; `packages/cli/plugins/sentry-cli/skills/sentry-cli…
* 🔴 (16:18) User stated the repository agent workflow is triage → explore → plan → implement → review → ship; `worker` is a deprecated alias of `implement`. * 🔴 (16:18) User stated model assignments: primary heavy triage/plan/review uses Claude Opus 4.8; primary light triage/plan/review uses xAI Grok 4.3; `explore` uses OpenAI `gpt-5-mini`; `implement` uses Moonshot `kimi-k2.7-code`; `ship` use…
Date: September 9, 2026 * 🟡 (16:17) Repository path `/home/byk/Code/getsentry/cli-pr-1558` was listed as a directory containing 19 entries: `.craft.yml`, `.git`, `.github/`, `.gitignore`, `.lore.md`, `.nojekyll`, `.npmrc`, `AGENTS.md`, `apps/`, `CHANGELOG.md`, `codemods/`, `docs/`, `LICENSE.md`, `node_modules/`, `package.json`, `packages/`, `pnpm-lock.yaml`, `pnpm-workspace.yaml`, and `README.md…
🔴 (16:16) User stated the prior review result was empty and could not satisfy the security merge gate. 🔴 (16:16) User stated the repository remains unchanged with base commit `bd065083c3b82677747b97a6cc7f5cf57532d3bc`, head commit `fc5d50e2324e2b6bb2067976bf1515dab45224fb`, triple-dot patch SHA-256 `03c5772e78b393b3979c44754709d7f401bb37a71e5679b34c50a9cc8334c2d0`, and a clean worktree. 🔴 (16:…