SpyBara
Go Premium

Documentation 2026-11-12 22:58 UTC to 2026-11-13 23:58 UTC

7 files changed +130 −90. View all changes and history on the product overview
2026
Thu 26 23:00 Wed 25 23:02 Tue 24 23:01 Mon 23 23:58 Fri 20 23:59 Thu 19 23:02 Wed 18 22:59 Tue 17 22:59 Mon 16 23:00 Sun 15 23:01 Sat 14 23:01 Fri 13 23:58 Thu 12 22:58 Wed 11 23:00 Tue 10 23:57 Mon 9 23:02 Fri 6 23:02 Thu 5 23:03 Wed 4 23:02 Tue 3 23:57 Mon 2 23:02
Details

15As a developer, you can use the Browser Annotation API to provide context or controls specific to your application. For15As a developer, you can use the Browser Annotation API to provide context or controls specific to your application. For

16example, you can attach previews for component variants in a design system preview for developers to know how to update the components on a website.16example, you can attach previews for component variants in a design system preview for developers to know how to update the components on a website.

17 17 

18The examples use TypeScript. Save a copied example as `annotations.ts` and compile it for the browser:

19 

20```bash

21npm install --save-dev esbuild

22npx esbuild annotations.ts --format=esm --outfile=annotations.js

23```

24 

25 

26Load the compiled module after adding the example's HTML elements to your page:

27 

28```html snippet=setup reason="Load the compiled example module on a page with the documented HTML elements."

29<script type="module" src="./annotations.js"></script>

30```

31 

32 

33If your application already builds TypeScript, include the example in that build instead.

34 

18To get help understanding the Browser Annotation API or adding annotation support to your website, install the Annotations Extensibility plugin.35To get help understanding the Browser Annotation API or adding annotation support to your website, install the Annotations Extensibility plugin.

19 36 

20[Install the Annotations Extensibility plugin](https://chatgpt.com/plugins/Plugin_94f13f4285908191bb882d31b1ffc59e)37[Install the Annotations Extensibility plugin](https://chatgpt.com/plugins/Plugin_94f13f4285908191bb882d31b1ffc59e)


237```254```

238 255 

239 256 

240```javascript257```typescript

241const summary = /** @type {HTMLElement} */ (258const summary = document.getElementById("delivery-summary") as HTMLElement;

242 document.getElementById("delivery-summary")259const button = document.getElementById("discuss-delivery") as HTMLButtonElement;

243);

244const button = /** @type {HTMLButtonElement} */ (

245 document.getElementById("discuss-delivery")

246);

247 260 

248button.hidden = typeof document.oai?.annotation?.request !== "function";261button.hidden = typeof document.oai?.annotation?.request !== "function";

249 262 


338 351 

339Run this script after both elements exist:352Run this script after both elements exist:

340 353 

341```javascript354```typescript

342const passage = /** @type {HTMLElement} */ (355const passage = document.getElementById("draft-passage") as HTMLElement;

343 document.getElementById("draft-passage")356const button = document.getElementById("discuss-passage") as HTMLButtonElement;

344);

345const button = /** @type {HTMLButtonElement} */ (

346 document.getElementById("discuss-passage")

347);

348 357 

349button.hidden = typeof document.oai?.annotation?.request !== "function";358button.hidden = typeof document.oai?.annotation?.request !== "function";

350 359 


466 475 

467Run this script after creating the preview:476Run this script after creating the preview:

468 477 

469```javascript478```typescript

470const preview = /** @type {HTMLElement} */ (479const preview = document.getElementById("component-preview") as HTMLElement;

471 document.getElementById("component-preview")

472);

473const annotation = document.oai?.annotation;480const annotation = document.oai?.annotation;

474 481 

475/** @param {CustomEvent<{ callback: string; value: number | string }>} event */482function previewSpacing(event: Event) {

476function previewSpacing(event) {483 const { callback, value } = (

477 const { callback, value } = event.detail;484 event as CustomEvent<{ callback: string; value: number | string }>

485 ).detail;

478 if (callback === "setCardPadding") {486 if (callback === "setCardPadding") {

479 preview.style.setProperty("--card-padding", `${value}px`);487 preview.style.setProperty("--card-padding", `${value}px`);

480 }488 }

481}489}

482 490 

483/** @type {{ dispose(): void } | undefined} */491let registration: { dispose(): void } | undefined;

484let registration;

485if (typeof annotation?.registerControls === "function") {492if (typeof annotation?.registerControls === "function") {

486 preview.addEventListener("oaiannotationcontrolchange", previewSpacing);493 preview.addEventListener("oaiannotationcontrolchange", previewSpacing);

487 registration = annotation.registerControls({494 registration = annotation.registerControls({


561```568```

562 569 

563 570 

564```javascript571```typescript

565const draft = /** @type {HTMLElement} */ (572const draft = document.getElementById("email-draft") as HTMLElement;

566 document.getElementById("email-draft")

567);

568const registration = document.oai?.annotation?.registerControls?.({573const registration = document.oai?.annotation?.registerControls?.({

569 targets: draft,574 targets: draft,

570 controlsHeading: "Email options",575 controlsHeading: "Email options",


772```777```

773 778 

774 779 

775```javascript780```typescript

776const canvas = /** @type {HTMLCanvasElement} */ (781const canvas = document.getElementById("revenue-canvas") as HTMLCanvasElement;

777 document.getElementById("revenue-canvas")782const context = canvas.getContext("2d") as CanvasRenderingContext2D;

778);

779const context = /** @type {CanvasRenderingContext2D} */ (

780 canvas.getContext("2d")

781);

782const bar = { x: 40, y: 60, width: 320, height: 100 };783const bar = { x: 40, y: 60, width: 320, height: 100 };

783 784 

784context.fillStyle = "#2563eb";785context.fillStyle = "#2563eb";


906For the canvas above, define this function and add907For the canvas above, define this function and add

907`renderSelection: renderRevenueSelection` to the `registerSurface()` options:908`renderSelection: renderRevenueSelection` to the `registerSurface()` options:

908 909 

909```javascript910```typescript

910/** @param {{ hoveredId: string | null; selectedId: string | null }} selection */911function renderRevenueSelection({

911function renderRevenueSelection({ hoveredId, selectedId }) {912 hoveredId,

913 selectedId,

914}: {

915 hoveredId: string | null;

916 selectedId: string | null;

917}) {

912 context.clearRect(0, 0, canvas.width, canvas.height);918 context.clearRect(0, 0, canvas.width, canvas.height);

913 context.fillStyle = "#2563eb";919 context.fillStyle = "#2563eb";

914 context.fillRect(bar.x, bar.y, bar.width, bar.height);920 context.fillRect(bar.x, bar.y, bar.width, bar.height);


959```965```

960 966 

961 967 

962```javascript968```typescript

963const button = /** @type {HTMLButtonElement} */ (969const button = document.getElementById(

964 document.getElementById("toggle-annotations")970 "toggle-annotations"

965);971) as HTMLButtonElement;

966const annotation = document.oai?.annotation;972const annotation = document.oai?.annotation;

967 973 

968/** @param {boolean} active */974function renderMode(active: boolean) {

969function renderMode(active) {

970 button.textContent = active975 button.textContent = active

971 ? "Exit annotation mode"976 ? "Exit annotation mode"

972 : "Enter annotation mode";977 : "Enter annotation mode";

973}978}

974 979 

975/** @param {CustomEvent<{ active: boolean }>} event */980const onModeChange = (event: Event) =>

976const onModeChange = (event) => renderMode(event.detail.active);981 renderMode((event as CustomEvent<{ active: boolean }>).detail.active);

977const onClick = () => annotation?.toggle(!annotation.isActive());982const onClick = () => annotation?.toggle(!annotation.isActive());

978 983 

979if (984if (

Details

336 336 

337## API organizations using data residency337## API organizations using data residency

338 338 

339Projects created with [data residency](https://help.openai.com/en/articles/9903489-data-residency-and-inference-residency-for-chatgpt) enabled can create a model provider to update the `base_url` with the [correct prefix](https://developers.openai.com/api/docs/guides/your-data#which-models-and-features-are-eligible-for-data-residency). For ChatGPT workspaces with data residency, a custom provider isn't required; Codex respects workspace residency settings when you sign in with ChatGPT.339Projects created with [data residency](https://help.openai.com/en/articles/9903489-data-residency-and-inference-residency-for-chatgpt) enabled can create a model provider to update the `base_url` with the [correct prefix](https://developers.openai.com/api/docs/guides/data-residency#which-models-and-features-are-eligible-for-data-residency). For ChatGPT workspaces with data residency, a custom provider isn't required; Codex respects workspace residency settings when you sign in with ChatGPT.

340 340 

341```toml341```toml

342model_provider = "openaidr"342model_provider = "openaidr"

Details

336 336 

337## API organizations using data residency337## API organizations using data residency

338 338 

339Projects created with [data residency](https://help.openai.com/en/articles/9903489-data-residency-and-inference-residency-for-chatgpt) enabled can create a model provider to update the `base_url` with the [correct prefix](https://developers.openai.com/api/docs/guides/your-data#which-models-and-features-are-eligible-for-data-residency). For ChatGPT workspaces with data residency, a custom provider isn't required; Codex respects workspace residency settings when you sign in with ChatGPT.339Projects created with [data residency](https://help.openai.com/en/articles/9903489-data-residency-and-inference-residency-for-chatgpt) enabled can create a model provider to update the `base_url` with the [correct prefix](https://developers.openai.com/api/docs/guides/data-residency#which-models-and-features-are-eligible-for-data-residency). For ChatGPT workspaces with data residency, a custom provider isn't required; Codex respects workspace residency settings when you sign in with ChatGPT.

340 340 

341```toml341```toml

342model_provider = "openaidr"342model_provider = "openaidr"

Details

2 2 

3> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL.3> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL.

4 4 

5Find and fix vulnerabilities in your code.5Cybersecurity guides for finding and fixing vulnerabilities in your code.

6 6 

7Use Codex to investigate security risks in your code and dependencies, then7Use Codex to investigate cyber risks in your code and dependencies, then

8develop and test fixes. Start with a repository, a code change, or findings from8develop and test fixes. Start with a repository, a code change, or findings from

9tools you already use.9tools you already use.

10 10 

Details

2 2 

3> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL.3> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL.

4 4 

5Find and fix vulnerabilities in your code.5Cybersecurity guides for finding and fixing vulnerabilities in your code.

6 6 

7Use Codex to investigate security risks in your code and dependencies, then7Use Codex to investigate cyber risks in your code and dependencies, then

8develop and test fixes. Start with a repository, a code change, or findings from8develop and test fixes. Start with a repository, a code change, or findings from

9tools you already use.9tools you already use.

10 10 

Details

128 128 

129The service receives an `order.created` webhook, writes an order, and records that the event has been processed. During an incident, a retry appears to create a second order. The team has already stabilized the service and wants a patch for review.129The service receives an `order.created` webhook, writes an order, and records that the event has been processed. During an incident, a retry appears to create a second order. The team has already stabilized the service and wants a patch for review.

130 130 

131The sample uses JavaScript, Node.js's test runner, and PostgreSQL. Its disposable fixture has an `event_receipts` table with non-null identity columns and a non-deferrable unique key on `(provider, account_id, event_id)`.131The sample uses TypeScript, Node.js's test runner, and PostgreSQL. Its disposable fixture has an `event_receipts` table with non-null identity columns and a non-deferrable unique key on `(provider, account_id, event_id)`.

132 132 

133The schema permits a receipt claim before the order exists and retains the canonical payload fingerprint needed to detect conflicting reuse of the same event key.133The schema permits a receipt claim before the order exists and retains the canonical payload fingerprint needed to detect conflicting reuse of the same event key.

134 134 


150 150 

151```bash151```bash

152docker compose -p codex-incident-rehearsal up -d --wait postgres152docker compose -p codex-incident-rehearsal up -d --wait postgres

153docker compose -p codex-incident-rehearsal run --rm runner node main.mjs baseline153docker compose -p codex-incident-rehearsal run --rm runner node --experimental-strip-types main.ts baseline

154docker compose -p codex-incident-rehearsal run --rm runner node main.mjs regression154docker compose -p codex-incident-rehearsal run --rm runner node --experimental-strip-types main.ts regression

155docker compose -p codex-incident-rehearsal run --rm runner155docker compose -p codex-incident-rehearsal run --rm runner

156docker compose -p codex-incident-rehearsal down --volumes156docker compose -p codex-incident-rehearsal down --volumes

157```157```


164 164 

165### Inspect the transaction handler165### Inspect the transaction handler

166 166 

167This excerpt comes from `main.mjs` in the download. Run the complete files after extracting the ZIP; the tests and fixture setup are included there.167This excerpt comes from `main.ts` in the download. Run the complete files after extracting the ZIP; the tests and fixture setup are included there.

168 168 

169<details>169<details>

170 <summary>Receipt claim and order transaction</summary>170 <summary>Receipt claim and order transaction</summary>

171```javascript171```typescript

172async function fixed(client, input, hook = async (_boundary) => {}) {172import type { Client } from "pg";

173 

174type IncidentEvent = {

175 provider: string;

176 accountId: string;

177 eventId: string;

178 payload: { type: string; orderId: string; amountCents: number };

179};

180 

181async function fixed(

182 client: Client,

183 input: IncidentEvent,

184 hook = async (_boundary: string) => {}

185) {

173 await assertNotHeld(client, input);186 await assertNotHeld(client, input);

174 await hook("beforeClaim");187 await hook("beforeClaim");

175 await client.query("BEGIN ISOLATION LEVEL READ COMMITTED");188 await client.query("BEGIN ISOLATION LEVEL READ COMMITTED");


295 308 

296Coordinate concurrency with barriers/latches and bounded timeouts, not sleeps or a bare pair of promises. Release blocked workers in test cleanup and use disposable fixtures. An exception test alone does not prove abrupt process death, transport loss, or production concurrency behavior.309Coordinate concurrency with barriers/latches and bounded timeouts, not sleeps or a bare pair of promises. Release blocked workers in test cleanup and use disposable fixtures. An exception test alone does not prove abrupt process death, transport loss, or production concurrency behavior.

297 310 

298The sample uses `node main.mjs baseline`, `node main.mjs regression`, and `node main.mjs` inside the pinned runner. Its structured output records transaction boundaries, committed row counts, acknowledgment status/body, and observed blocking backend IDs.311The sample uses `node --experimental-strip-types main.ts baseline`, `node --experimental-strip-types main.ts regression`, and `node --experimental-strip-types main.ts` inside the pinned runner. Its structured output records transaction boundaries, committed row counts, acknowledgment status/body, and observed blocking backend IDs.

299 312 

300When adapting the workflow, use the commands actually defined by your repository and report their real results. A skipped check or unavailable dependency belongs in the handoff, with its impact on confidence.313When adapting the workflow, use the commands actually defined by your repository and report their real results. A skipped check or unavailable dependency belongs in the handoff, with its impact on confidence.

301 314 

Details

120 120 

121Choose a feature with a written contract and a clear stopping point: a new API endpoint, a validation rule, or a small addition to an existing service. The issue should fit in one pull request and have checks that can run without production access.121Choose a feature with a written contract and a clear stopping point: a new API endpoint, a validation rule, or a small addition to an existing service. The issue should fit in one pull request and have checks that can run without production access.

122 122 

123The example adds pagination to a project's activity feed. The runnable Node.js sample includes authentication, project access, signed cursors, and an existing project-detail route. It uses fixed test records in memory, so you can check the pagination contract without a database or external service.123The example adds pagination to a project's activity feed. The runnable TypeScript sample includes authentication, project access, signed cursors, and an existing project-detail route. It uses fixed test records in memory, so you can check the pagination contract without a database or external service.

124 124 

125## Try the runnable sample125## Try the runnable sample

126 126 


128 128 

129```bash129```bash

130node --version130node --version

131node api.mjs131node --experimental-strip-types api.ts

132node test.mjs --seeded132node --experimental-strip-types test.ts --seeded

133node test.mjs133node --experimental-strip-types test.ts

134node reproduce.mjs ./evidence134node --experimental-strip-types reproduce.ts ./evidence

135```135```

136 136 

137`node api.mjs` starts a local HTTP server, requests the first page, prints its public IDs, and closes the server.137`node --experimental-strip-types api.ts` starts a local HTTP server, requests the first page, prints its public IDs, and closes the server.

138 138 

139The `--seeded` test run deliberately exits nonzero: its timestamp-only continuation skips two events tied at the first page boundary. The same tests pass with the corrected timestamp-and-ID tuple continuation.139The `--seeded` test run deliberately exits nonzero: its timestamp-only continuation skips two events tied at the first page boundary. The same tests pass with the corrected timestamp-and-ID tuple continuation.

140 140 


156 156 

157To verify your environment, put the files in your selected repository, prepare and publish an environment with a supported Node runtime, then run the commands in a new Cloud task and record its results.157To verify your environment, put the files in your selected repository, prepare and publish an environment with a supported Node runtime, then run the commands in a new Cloud task and record its results.

158 158 

159`reproduce.mjs` saves `red.log`, `green.log`, `observed-http.json`, and `run-manifest.json` in the requested evidence directory. The manifest identifies the runtime, commands, exit codes, seeded defect, correction, and SHA-256 source hashes.159`reproduce.ts` saves `red.log`, `green.log`, `observed-http.json`, and `run-manifest.json` in the requested evidence directory. The manifest identifies the runtime, commands, exit codes, seeded defect, correction, and SHA-256 source hashes.

160 160 

161It does not record session tokens or the signing key. Read `README.md` and `openapi.json` for the sample's setup and public contract.161It does not record session tokens or the signing key. Read `README.md` and `openapi.json` for the sample's setup and public contract.

162 162 


166 166 

167<details>167<details>

168 <summary>Cursor and ordering implementation</summary>168 <summary>Cursor and ordering implementation</summary>

169```javascript169```typescript

170import { createFixtures } from "./fixtures.ts";

171type Fixtures = ReturnType<typeof createFixtures>;

172type EventKey = { created_at: string; id: string };

173 

170export function createApi({174export function createApi({

171 sessions,175 sessions,

172 projects,176 projects,

173 events,177 events,

174 signingKey,178 signingKey,

175 seededBug = false,179 seededBug = false,

176}) {180}: Fixtures & { seededBug?: boolean }) {

177 return createServer((request, response) => {181 return createServer((request, response) => {

178 const send = (status, body) => {182 const send = (status: number, body: unknown) => {

179 response.writeHead(status, { "content-type": "application/json" });183 response.writeHead(status, { "content-type": "application/json" });

180 response.end(JSON.stringify(body));184 response.end(JSON.stringify(body));

181 };185 };

182 const fail = (code) => {186 const fail = (code: string) => {

183 const [status, message] = errors[code];187 const [status, message] = errors[code];

184 send(status, { error: { code, message } });188 send(status, { error: { code, message } });

185 };189 };


200 const project = projectId ? projects.get(projectId) : undefined;204 const project = projectId ? projects.get(projectId) : undefined;

201 if (205 if (

202 request.method !== "GET" ||206 request.method !== "GET" ||

207 !route ||

203 !project ||208 !project ||

204 project.tenant_id !== tenantId209 project.tenant_id !== tenantId

205 ) {210 ) {


219 ) {224 ) {

220 return fail("invalid_limit");225 return fail("invalid_limit");

221 }226 }

222 let cursor;227 let cursor: EventKey | undefined;

223 if (url.searchParams.has("cursor")) {228 if (url.searchParams.has("cursor")) {

224 try {229 try {

225 if (url.searchParams.getAll("cursor").length !== 1)230 if (url.searchParams.getAll("cursor").length !== 1)


259 }));264 }));

260 const nextCursor =265 const nextCursor =

261 matching.length > limit266 matching.length > limit

262 ? encodeCursor(selected.at(-1), tenantId, projectId, signingKey)267 ? encodeCursor(

268 selected[selected.length - 1],

269 tenantId,

270 projectId,

271 signingKey

272 )

263 : null;273 : null;

264 return send(200, { items, next_cursor: nextCursor });274 return send(200, { items, next_cursor: nextCursor });

265 });275 });

266}276}

267 277 

268export async function startApi(fixtures, options = {}) {278export async function startApi(

279 fixtures: Fixtures,

280 options: { seededBug?: boolean } = {}

281) {

269 const server = createApi({ ...fixtures, ...options });282 const server = createApi({ ...fixtures, ...options });

270 await new Promise((resolve, reject) => {283 await new Promise((resolve, reject) => {

271 server.once("error", reject);284 server.once("error", reject);


288 301 

289<details>302<details>

290 <summary>Seeded records and project access fixtures</summary>303 <summary>Seeded records and project access fixtures</summary>

291```javascript304```typescript

292export function createFixtures() {305export function createFixtures() {

293 const tokenA = randomBytes(24).toString("base64url");306 const tokenA = randomBytes(24).toString("base64url");

294 const tokenB = randomBytes(24).toString("base64url");307 const tokenB = randomBytes(24).toString("base64url");


305 ["other", { tenant_id: "tenant_a", name: "Another project" }],318 ["other", { tenant_id: "tenant_a", name: "Another project" }],

306 ["private", { tenant_id: "tenant_b", name: "Private project" }],319 ["private", { tenant_id: "tenant_b", name: "Private project" }],

307 ]);320 ]);

308 const event = (id, created_at, project_id, tenant_id = "tenant_a") => ({321 const event = (

322 id: string,

323 created_at: string,

324 project_id: string,

325 tenant_id = "tenant_a"

326 ) => ({

309 id,327 id,

310 created_at,328 created_at,

311 project_id,329 project_id,


357 375 

358<details>376<details>

359 <summary>HTTP contract and regression tests</summary>377 <summary>HTTP contract and regression tests</summary>

360```javascript378```typescript

361test("five-event traversal crosses a timestamp tie and replays the same continuation", async () => {379test("five-event traversal crosses a timestamp tie and replays the same continuation", async () => {

362 const expected = ["evt_105", "evt_104", "evt_103", "evt_102", "evt_101"];380 const expected = ["evt_105", "evt_104", "evt_103", "evt_102", "evt_101"];

363 const pages = await traverse("feed", 2, expected);381 const pages = await traverse("feed", 2, expected);


416 [{}, 25],434 [{}, 25],

417 [{ limit: "1" }, 1],435 [{ limit: "1" }, 1],

418 [{ limit: "100" }, 100],436 [{ limit: "100" }, 100],

419 ]) {437 ] as [Record<string, string>, number][]) {

420 const result = await request("large", parameters);438 const result = await request("large", parameters);

421 assert.equal(result.status, 200);439 assert.equal(result.status, 200);

422 assert.equal(result.body.items.length, expected);440 assert.equal(result.body.items.length, expected);


501 { cursor: "broken" },519 { cursor: "broken" },

502 { cursor: privateCursor },520 { cursor: privateCursor },

503 { limit: "0", cursor: "broken" },521 { limit: "0", cursor: "broken" },

504 ]) {522 ] as Record<string, string>[]) {

505 const result = await request("feed", parameters, token);523 const result = await request("feed", parameters, token);

506 assert.equal(result.status, 401);524 assert.equal(result.status, 401);

507 assert.deepEqual(result.body, unauthenticated);525 assert.deepEqual(result.body, unauthenticated);


517 { cursor: "broken" },535 { cursor: "broken" },

518 { cursor: ownCursor },536 { cursor: ownCursor },

519 { limit: "0", cursor: "broken" },537 { limit: "0", cursor: "broken" },

520 ]) {538 ] as Record<string, string>[]) {

521 const result = await request(project, parameters);539 const result = await request(project, parameters);

522 assert.equal(result.status, 404);540 assert.equal(result.status, 404);

523 assert.deepEqual(result.body, notFound);541 assert.deepEqual(result.body, notFound);


574 created_at: "2026-01-15T12:00:02.123456Z",592 created_at: "2026-01-15T12:00:02.123456Z",

575 id: "evt_104",593 id: "evt_104",

576 };594 };

577 const missing = { ...valid };595 const missing: Partial<typeof valid> = { ...valid };

578 delete missing.id;596 delete missing.id;

579 const cases = [597 const cases: [string, unknown][] = [

580 ["missing ID", missing],598 ["missing ID", missing],

581 ["number ID", { ...valid, id: 104 }],599 ["number ID", { ...valid, id: 104 }],

582 ["empty ID", { ...valid, id: "" }],600 ["empty ID", { ...valid, id: "" }],


689 const operation = specification.paths["/v1/projects/{project_id}/events"].get;707 const operation = specification.paths["/v1/projects/{project_id}/events"].get;

690 assert.equal(operation.operationId, "listProjectEvents");708 assert.equal(operation.operationId, "listProjectEvents");

691 const limit = operation.parameters.find(709 const limit = operation.parameters.find(

692 (parameter) => parameter.name === "limit"710 (parameter: { name: string }) => parameter.name === "limit"

693 ).schema;711 ).schema;

694 assert.deepEqual(limit, {712 assert.deepEqual(limit, {

695 type: "integer",713 type: "integer",


714 732 

715<details>733<details>

716 <summary>Evidence capture</summary>734 <summary>Evidence capture</summary>

717```javascript735```typescript

718mkdirSync(output, { recursive: true });736mkdirSync(output, { recursive: true });

719const states = [];737const states = [];

720for (const [name, arguments_] of [738for (const [name, arguments_] of [


723]) {741]) {

724 const result = spawnSync(742 const result = spawnSync(

725 process.execPath,743 process.execPath,

726 [resolve(directory, "test.mjs"), ...arguments_],744 [

745 "--experimental-strip-types",

746 resolve(directory, "test.ts"),

747 ...arguments_,

748 ],

727 {749 {

728 cwd: directory,750 cwd: directory,

729 encoding: "utf8",751 encoding: "utf8",


736 );758 );

737 states.push({759 states.push({

738 name,760 name,

739 command: `node test.mjs${arguments_.length ? " --seeded" : ""}`,761 command: `node --experimental-strip-types test.ts${arguments_.length ? " --seeded" : ""}`,

740 exit_code: result.status,762 exit_code: result.status,

741 signal: result.signal,763 signal: result.signal,

742 error: result.error?.message ?? null,764 error: result.error?.message ?? null,


783 red_exit: states[0].exit_code,805 red_exit: states[0].exit_code,

784 green_exit: states[1].exit_code,806 green_exit: states[1].exit_code,

785 green_pages: observed.green.pages.map((page) =>807 green_pages: observed.green.pages.map((page) =>

786 page.body.items.map((item) => item.id)808 page.body.items.map((item: { id: string }) => item.id)

787 ),809 ),

788 evidence_directory: output,810 evidence_directory: output,

789 },811 },


800An issue link is useful only if Codex can read it. Paste or attach the relevant content when the source is unavailable. Include the following information with the starter prompt.822An issue link is useful only if Codex can read it. Paste or attach the relevant content when the source is unavailable. Include the following information with the starter prompt.

801 823 

802| Input | Sample issue |824| Input | Sample issue |

803| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |825| ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

804| Issue and outcome | `API-142`: Add `GET /v1/projects/{project_id}/events` so customers can page through an activity feed. |826| Issue and outcome | `API-142`: Add `GET /v1/projects/{project_id}/events` so customers can page through an activity feed. |

805| Repository and base | Put the sample folder in your chosen repository, then record the branch and exact commit selected for the task. |827| Repository and base | Put the sample folder in your chosen repository, then record the branch and exact commit selected for the task. |

806| Relevant code | The sample's `api.mjs`, `fixtures.mjs`, `test.mjs`, and `openapi.json`, plus your repository's `AGENTS.md`. |828| Relevant code | The sample's `api.ts`, `fixtures.ts`, `test.ts`, and `openapi.json`, plus your repository's `AGENTS.md`. |

807| Existing patterns | Keep authentication and project authorization before pagination validation. Use signed cursors and the documented public error envelope. When adapting the issue, follow your repository's existing helpers. |829| Existing patterns | Keep authentication and project authorization before pagination validation. Use signed cursors and the documented public error envelope. When adapting the issue, follow your repository's existing helpers. |

808| Test setup | Fixed in-memory test projects for two tenants, six tenant-A projects, a timestamp tie split across a page boundary, timestamps with fractional precision, empty and exactly full final pages, and 105 events for limit checks. |830| Test setup | Fixed in-memory test projects for two tenants, six tenant-A projects, a timestamp tie split across a page boundary, timestamps with fractional precision, empty and exactly full final pages, and 105 events for limit checks. |

809| Validation | `node test.mjs --seeded` (expected failure), `node test.mjs` (corrected state), and `node reproduce.mjs ./evidence`. Run `node --check` for each `.mjs` file. For your own service, add its actual type, lint, regression, and CI commands. |831| Validation | `node --experimental-strip-types test.ts --seeded` (expected failure), `node --experimental-strip-types test.ts` (corrected state), and `node --experimental-strip-types reproduce.ts ./evidence`. For your own service, add its actual type, lint, regression, and CI commands. |

810| Scope | Endpoint, focused tests, and its OpenAPI documentation. No new dependencies, database migration, frontend, deployment, or auth redesign. |832| Scope | Endpoint, focused tests, and its OpenAPI documentation. No new dependencies, database migration, frontend, deployment, or auth redesign. |

811| Handoff | A draft PR when the available repository integration supports it and you have authorized creation; otherwise a diff and draft PR description. |833| Handoff | A draft PR when the available repository integration supports it and you have authorized creation; otherwise a diff and draft PR description. |

812 834 


8572. **Run the starter prompt.** Replace its bracketed inputs with your repository, issue packet, boundaries, and checks. Choose whether Codex should return a diff or create an authorized draft PR. The starter prompt on this page contains the full handoff instructions.8792. **Run the starter prompt.** Replace its bracketed inputs with your repository, issue packet, boundaries, and checks. Choose whether Codex should return a diff or create an authorized draft PR. The starter prompt on this page contains the full handoff instructions.

8583. **Establish the baseline.** Codex should read repository instructions and run the approved baseline checks before editing.8803. **Establish the baseline.** Codex should read repository instructions and run the approved baseline checks before editing.

859 881 

860 For the sample, run `node test.mjs` and the syntax checks in `README.md`; `--seeded` is a separate deliberate failure demonstration.882 For the sample, run `node --experimental-strip-types test.ts`; `--seeded` is a separate deliberate failure demonstration.

861 883 

862 For your own service, run its existing regression, type, and lint checks. A new endpoint's focused test file may not exist yet; record that as a test to create. Resolve failing existing checks or unavailable test services before attributing later results to the feature.884 For your own service, run its existing regression, type, and lint checks. A new endpoint's focused test file may not exist yet; record that as a test to create. Resolve failing existing checks or unavailable test services before attributing later results to the feature.

863 885 


913 935 

914### Existing behavior936### Existing behavior

915 937 

916The sample checks the existing project-detail route with authorized, unauthorized, and inaccessible-project requests. Run syntax checks for its `.mjs` files. In your service, run its established regression suite, type check, and lint.938The sample checks the existing project-detail route with authorized, unauthorized, and inaccessible-project requests. In your service, run its established regression suite, type check, and lint.

917 939 

918### Public response schema940### Public response schema

919 941