Skip to content

chore: set a 2,000-line custom-code budget - #924

Merged
apcha-oai merged 1 commit into
mainfrom
apcha/custom-code-budget
Aug 21, 2026
Merged

chore: set a 2,000-line custom-code budget#924
apcha-oai merged 1 commit into
mainfrom
apcha/custom-code-budget

Conversation

@apcha-oai

@apcha-oai apcha-oai commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Set a 2,000-line ceiling on additions plus deletions in the remaining custom patch against verified generated output. This is the budget-only foundation for the same rollout approved in Python #3714 and Python #3715.

The ceiling is based on the upcoming compatible WebSocket event regeneration: +1,158 / −181 = 1,339 lines, leaving 661 lines of headroom. Current public main still carries the old large event customization; seeding a temporary 55k allowance would retain that accident as the policy.

This policy-only PR can merge now. Its tooling companion will remain draft and must not merge until the fixed generation reaches public main.

Only .castiron-ratchet.json changes here. The stacked tooling PR will use the base-branch allowance, so a PR cannot raise its own budget. Future increases require a separate budget-only PR, explicit justification, and a human approving review; agents cannot approve them.

No workflow, CODEOWNERS, or ruleset changes are included. Ruleset enforcement is a separate, later decision.

Tooling companion: #925

@apcha-oai
apcha-oai requested a review from a team as a code owner August 21, 2026 16:14
@apcha-oai apcha-oai added the custom-code-burndown Behavior-preserving cleanup of custom code in generated SDK files label Aug 21, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 21, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-21T16:15:43.462927Z f5bb930 PR opened
🔒 Security Review Completed 2026-08-21T16:15:57.565891Z f5bb930 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown
Contributor

Castiron custom code

✅ No new custom-code files detected.

57 mixed files remain; 0 existing customizations changed.

Compared 085ea7d5f9c8f5bb93045e5a. Generated baselines verified.

57 existing customizations unchanged
  • openai-java-core/src/main/kotlin/com/openai/models/audio/AudioResponseFormat.kt
  • openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponsesServerEvent.kt
  • openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionCreateParams.kt
  • openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionMessageFunctionToolCall.kt
  • openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionToolMessageParam.kt
  • openai-java-core/src/main/kotlin/com/openai/models/embeddings/Embedding.kt
  • openai-java-core/src/main/kotlin/com/openai/models/embeddings/EmbeddingCreateParams.kt
  • openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseCreateParams.kt
  • openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseFunctionToolCall.kt
  • openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseFunctionWebSearch.kt
  • openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseInputItem.kt
  • openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseTextConfig.kt
  • openai-java-core/src/main/kotlin/com/openai/models/responses/ResponsesServerEvent.kt
  • openai-java-core/src/main/kotlin/com/openai/models/videos/Video.kt
  • openai-java-core/src/main/kotlin/com/openai/services/async/BetaServiceAsync.kt
  • openai-java-core/src/main/kotlin/com/openai/services/async/BetaServiceAsyncImpl.kt
  • openai-java-core/src/main/kotlin/com/openai/services/async/ResponseServiceAsync.kt
  • openai-java-core/src/main/kotlin/com/openai/services/async/ResponseServiceAsyncImpl.kt
  • openai-java-core/src/main/kotlin/com/openai/services/async/WebhookServiceAsync.kt
  • openai-java-core/src/main/kotlin/com/openai/services/async/WebhookServiceAsyncImpl.kt
  • openai-java-core/src/main/kotlin/com/openai/services/async/audio/TranscriptionServiceAsyncImpl.kt
  • openai-java-core/src/main/kotlin/com/openai/services/async/beta/ResponseServiceAsyncImpl.kt
  • openai-java-core/src/main/kotlin/com/openai/services/async/chat/ChatCompletionServiceAsync.kt
  • openai-java-core/src/main/kotlin/com/openai/services/async/finetuning/checkpoints/PermissionServiceAsyncImpl.kt
  • openai-java-core/src/main/kotlin/com/openai/services/blocking/BetaService.kt
  • openai-java-core/src/main/kotlin/com/openai/services/blocking/BetaServiceImpl.kt
  • openai-java-core/src/main/kotlin/com/openai/services/blocking/ResponseService.kt
  • openai-java-core/src/main/kotlin/com/openai/services/blocking/ResponseServiceImpl.kt
  • openai-java-core/src/main/kotlin/com/openai/services/blocking/WebhookService.kt
  • openai-java-core/src/main/kotlin/com/openai/services/blocking/WebhookServiceImpl.kt
  • openai-java-core/src/main/kotlin/com/openai/services/blocking/audio/TranscriptionServiceImpl.kt
  • openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/ResponseServiceImpl.kt
  • openai-java-core/src/main/kotlin/com/openai/services/blocking/chat/ChatCompletionService.kt
  • openai-java-core/src/main/kotlin/com/openai/services/blocking/finetuning/checkpoints/PermissionServiceImpl.kt
  • openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponsesServerEventTest.kt
  • openai-java-core/src/test/kotlin/com/openai/models/responses/ResponsesServerEventTest.kt
  • openai-java-core/src/test/kotlin/com/openai/services/async/CompletionServiceAsyncTest.kt
  • openai-java-core/src/test/kotlin/com/openai/services/async/ImageServiceAsyncTest.kt
  • openai-java-core/src/test/kotlin/com/openai/services/async/ResponseServiceAsyncTest.kt
  • openai-java-core/src/test/kotlin/com/openai/services/async/WebhookServiceAsyncTest.kt

17 more in the full report.

A changed generated baseline means this report cannot reliably identify which handwritten lines changed.

Inspect the custom-code diff

Download the exact patch produced by this run (requires repository access):

gh run download 32501931551 --repo openai/openai-java \
  --name castiron-custom-code-32501931551-1 --dir /tmp/castiron-custom-code-32501931551-1
git apply --stat /tmp/castiron-custom-code-32501931551-1/custom-code.patch
cat /tmp/castiron-custom-code-32501931551-1/custom-code.patch

Or reproduce it from an SDK checkout containing the vendored reporter:

git fetch --no-tags origin 085ea7d5f9c863aaeb6698f2c5f7efdc283bc01e f5bb93045e5a34d1c08f30f7ec54705d18d99130
python3 scripts/castiron/custom_code_report.py report \
  --base 085ea7d5f9c863aaeb6698f2c5f7efdc283bc01e \
  --head f5bb93045e5a34d1c08f30f7ec54705d18d99130 --fetch --require-head-hash --public \
  --out /tmp/castiron-custom-code-f5bb93045e5a
cat /tmp/castiron-custom-code-f5bb93045e5a/custom-code.patch

This is the current full custom patch for mixed files, not an attribution of only the handwritten lines changed by this PR.

Full report and patch

@openai-sdks

openai-sdks Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

OkTest Summary

237/237 SDK tests passed in 17.15s for Java SDK PR #924.

Test results — 42 files
Test Result Time
tests/chat-completions-complex-body.test.ts ✅ Passed 175ms
tests/chat-completions-create.test.ts ✅ Passed 940ms
tests/chat-completions-stream.test.ts ✅ Passed 312ms
tests/files-content-binary.test.ts ✅ Passed 311ms
tests/files-create-multipart.test.ts ✅ Passed 351ms
tests/files-list-pagination.test.ts ✅ Passed 264ms
tests/initialize-config.test.ts ✅ Passed 192ms
tests/instance-isolation.test.ts ✅ Passed 302ms
tests/models-list.test.ts ✅ Passed 186ms
tests/responses-background-lifecycle.test.ts ✅ Passed 409ms
tests/responses-body-method-errors.test.ts ✅ Passed 511ms
tests/responses-cancel-timeout.test.ts ✅ Passed 201ms
tests/responses-cancel.test.ts ✅ Passed 480ms
tests/responses-compact-retries.test.ts ✅ Passed 398ms
tests/responses-compact.test.ts ✅ Passed 300ms
tests/responses-create-advanced-stream.test.ts ✅ Passed 358ms
tests/responses-create-advanced.test.ts ✅ Passed 1.23s
tests/responses-create-disconnect.test.ts ✅ Passed 1.029s
tests/responses-create-errors.test.ts ✅ Passed 327ms
tests/responses-create-malformed-api-responses.test.ts ✅ Passed 269ms
tests/responses-create-retries.test.ts ✅ Passed 672ms
tests/responses-create-stream-failures.test.ts ✅ Passed 239ms
tests/responses-create-stream-timeout.test.ts ✅ Passed 293ms
tests/responses-create-stream-wire.test.ts ✅ Passed 6.708s
tests/responses-create-stream.test.ts ✅ Passed 97ms
tests/responses-create-terminal-states.test.ts ✅ Passed 229ms
tests/responses-create-timeout.test.ts ✅ Passed 249ms
tests/responses-create.test.ts ✅ Passed 323ms
tests/responses-delete.test.ts ✅ Passed 290ms
tests/responses-input-items-errors.test.ts ✅ Passed 321ms
tests/responses-input-items-list.test.ts ✅ Passed 296ms
tests/responses-input-items-options.test.ts ✅ Passed 600ms
tests/responses-input-tokens-count-timeout.test.ts ✅ Passed 291ms
tests/responses-input-tokens-count.test.ts ✅ Passed 430ms
tests/responses-malformed-inputs.test.ts ✅ Passed 5.498s
tests/responses-not-found-errors.test.ts ✅ Passed 402ms
tests/responses-parse.test.ts ✅ Passed 640ms
tests/responses-retrieve-retries.test.ts ✅ Passed 430ms
tests/responses-retrieve.test.ts ✅ Passed 393ms
tests/responses-stored-method-errors.test.ts ✅ Passed 1.009s
tests/retry-behavior.test.ts ✅ Passed 3.58s
tests/sdk-error-shape.test.ts ✅ Passed 514ms

View OkTest run #32501934281

SDK merge (023328ff08d7) · head (f5bb93045e5a) · base (085ea7d5f9c8) · OkTest (2b1bdfd25e98)

@jbeckwith-oai jbeckwith-oai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved after two independent reviews. The schema-v1 2,000-line policy seed is currently inert; projected compatible-WebSocket-regeneration usage is 1,339 lines, rising to 1,732 with tooling and leaving 268 lines of headroom. The enforcement companion must remain draft/inactive until the compatible WebSocket regeneration has actually landed on public main.

@apcha-oai
apcha-oai added this pull request to the merge queue Aug 21, 2026
Merged via the queue into main with commit a5228db Aug 21, 2026
10 checks passed
@openai-sdks openai-sdks Bot mentioned this pull request Aug 21, 2026
apcha-oai added a commit that referenced this pull request Aug 21, 2026
## Summary

Catch accidental growth in the SDK's remaining generated-file
customization before it becomes a large patch to maintain. This ports
the same layout and tooling approved in [Python
#3714](openai/openai-python#3714) and [Python
#3715](openai/openai-python#3715), including
Python's trusted report computation.

The existing workflow pair measures additions **plus** deletions against
verified generated output, using the checker and budget from main. A PR
cannot increase its own allowance; budget changes must be isolated and
explicitly justified, and increases require a human approving review.
Agents cannot approve or bypass increases.

Technical details live in `scripts/castiron/CUSTOM_CODE.md`, with
references from AGENTS and CONTRIBUTING. No extra workflow files, SDK
API changes, checkpoint edits, exclusion changes, or CODEOWNERS changes.
**Ruleset enforcement is intentionally deferred.**

**Do not merge until the compatible WebSocket event regeneration reaches
public main.** The 2,000-line budget is sized for the fixed generated
baseline, not today’s large event customization. A local merge preview
of the fixed generation plus this tooling measures **+1,524 / −208 =
1,732 lines**, leaving **268 lines** below the ceiling. The budget-only
foundation can merge independently. Verify this tooling against the
released fix before merging.

## Stack

The [budget-only
foundation](#924) has merged.
This tooling commit is now restacked onto `main` at `a5228db57265`; the
tooling patch is unchanged and the PR contains no budget-file change. CI
is rerunning against main. The trusted statuses become active after the
tooling lands, but will not be required until a separately authorized
ruleset rollout.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

custom-code-burndown Behavior-preserving cleanup of custom code in generated SDK files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants