Skip to content

chore: set a 3,000-line custom-code budget - #2446

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

chore: set a 3,000-line custom-code budget#2446
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 3,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 verified current patch is +1,589 / −181 = 1,770 lines, leaving 1,230 lines of headroom. This is a generous bound on accidental growth, not a target or permission to add custom code.

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: #2447

@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 reductions 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:16:11.397312Z dec6a84 PR opened
🔒 Security Review Completed 2026-08-21T16:16:18.561618Z dec6a84 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.

32 mixed files remain; 0 existing customizations changed.

Compared 283e12be45fbdec6a84940e6. Generated baselines verified.

32 existing customizations unchanged
  • api.md
  • scripts/castiron/README.md
  • scripts/castiron/custom_code_report.py
  • scripts/castiron/test_custom_code_report.py
  • src/client.ts
  • src/resources/audio/transcriptions.ts
  • src/resources/audio/translations.ts
  • src/resources/beta/assistants.ts
  • src/resources/beta/beta.ts
  • src/resources/beta/index.ts
  • src/resources/beta/responses/internal-base.ts
  • src/resources/beta/responses/responses.ts
  • src/resources/beta/threads/index.ts
  • src/resources/beta/threads/runs/index.ts
  • src/resources/beta/threads/runs/runs.ts
  • src/resources/beta/threads/threads.ts
  • src/resources/chat/completions/completions.ts
  • src/resources/chat/completions/index.ts
  • src/resources/conversations/index.ts
  • src/resources/embeddings.ts
  • src/resources/files.ts
  • src/resources/fine-tuning/checkpoints/permissions.ts
  • src/resources/images.ts
  • src/resources/responses/internal-base.ts
  • src/resources/responses/responses.ts
  • src/resources/skills/skills.ts
  • src/resources/skills/versions/versions.ts
  • src/resources/vector-stores/file-batches.ts
  • src/resources/vector-stores/files.ts
  • src/resources/webhooks/index.ts
  • src/resources/webhooks/webhooks.ts
  • tests/lib/data-residency.test.ts

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 32501926530 --repo openai/openai-node \
  --name castiron-custom-code-32501926530-1 --dir /tmp/castiron-custom-code-32501926530-1
git apply --stat /tmp/castiron-custom-code-32501926530-1/custom-code.patch
cat /tmp/castiron-custom-code-32501926530-1/custom-code.patch

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

git fetch --no-tags origin 283e12be45fbcd3a230b5c3e4651b87073d7116f dec6a84940e67986dc0792fe03789528ca0203c6
python3 scripts/castiron/custom_code_report.py report \
  --base 283e12be45fbcd3a230b5c3e4651b87073d7116f \
  --head dec6a84940e67986dc0792fe03789528ca0203c6 --fetch --require-head-hash --public \
  --out /tmp/castiron-custom-code-dec6a84940e6
cat /tmp/castiron-custom-code-dec6a84940e6/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 9.196s for Node SDK PR #2446.

Test results — 42 files
Test Result Time
tests/chat-completions-complex-body.test.ts ✅ Passed 197ms
tests/chat-completions-create.test.ts ✅ Passed 221ms
tests/chat-completions-stream.test.ts ✅ Passed 165ms
tests/files-content-binary.test.ts ✅ Passed 122ms
tests/files-create-multipart.test.ts ✅ Passed 111ms
tests/files-list-pagination.test.ts ✅ Passed 136ms
tests/initialize-config.test.ts ✅ Passed 214ms
tests/instance-isolation.test.ts ✅ Passed 78ms
tests/models-list.test.ts ✅ Passed 105ms
tests/responses-background-lifecycle.test.ts ✅ Passed 194ms
tests/responses-body-method-errors.test.ts ✅ Passed 311ms
tests/responses-cancel-timeout.test.ts ✅ Passed 200ms
tests/responses-cancel.test.ts ✅ Passed 207ms
tests/responses-compact-retries.test.ts ✅ Passed 224ms
tests/responses-compact.test.ts ✅ Passed 266ms
tests/responses-create-advanced-stream.test.ts ✅ Passed 134ms
tests/responses-create-advanced.test.ts ✅ Passed 186ms
tests/responses-create-disconnect.test.ts ✅ Passed 947ms
tests/responses-create-errors.test.ts ✅ Passed 190ms
tests/responses-create-malformed-api-responses.test.ts ✅ Passed 103ms
tests/responses-create-retries.test.ts ✅ Passed 243ms
tests/responses-create-stream-failures.test.ts ✅ Passed 161ms
tests/responses-create-stream-timeout.test.ts ✅ Passed 2.126s
tests/responses-create-stream-wire.test.ts ✅ Passed 2.041s
tests/responses-create-stream.test.ts ✅ Passed 101ms
tests/responses-create-terminal-states.test.ts ✅ Passed 254ms
tests/responses-create-timeout.test.ts ✅ Passed 229ms
tests/responses-create.test.ts ✅ Passed 123ms
tests/responses-delete.test.ts ✅ Passed 141ms
tests/responses-input-items-errors.test.ts ✅ Passed 182ms
tests/responses-input-items-list.test.ts ✅ Passed 141ms
tests/responses-input-items-options.test.ts ✅ Passed 96ms
tests/responses-input-tokens-count-timeout.test.ts ✅ Passed 244ms
tests/responses-input-tokens-count.test.ts ✅ Passed 197ms
tests/responses-malformed-inputs.test.ts ✅ Passed 1.608s
tests/responses-not-found-errors.test.ts ✅ Passed 262ms
tests/responses-parse.test.ts ✅ Passed 240ms
tests/responses-retrieve-retries.test.ts ✅ Passed 233ms
tests/responses-retrieve.test.ts ✅ Passed 200ms
tests/responses-stored-method-errors.test.ts ✅ Passed 479ms
tests/retry-behavior.test.ts ✅ Passed 2.868s
tests/sdk-error-shape.test.ts ✅ Passed 255ms

View OkTest run #32501928322

SDK merge (d078f0737bff) · head (dec6a84940e6) · base (283e12be45fb) · 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.

Reviewed the customization allowance against actual SDK-owned patch metrics: current usage is 1,770 lines (+1,589/-181), and the proposed 3,000-line ceiling leaves 1,230 lines (69.5%) of reasonable generation headroom while bounding material growth. The schema-version-1 policy seed changes no runtime, API, workflow, security, or ownership behavior; enforcement is intentionally staged separately.

@apcha-oai
apcha-oai added this pull request to the merge queue Aug 21, 2026
Merged via the queue into main with commit 2035847 Aug 21, 2026
38 checks passed
@apcha-oai
apcha-oai deleted the apcha/custom-code-budget branch August 21, 2026 17:00
@openai-sdks openai-sdks Bot mentioned this pull request Aug 21, 2026
euntaek-hong pushed a commit to wrongbutworks/openai-node 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.**

The integrated tooling measures **+1,955 / −208 = 2,163 custom lines**,
below the **3,000-line** ceiling. This includes the reporter changes
themselves.

## Stack

The [budget-only
foundation](openai#2446) has merged.
This tooling commit is now restacked onto `main` at `d1410d190d04`; 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 reductions of custom code in generated SDK files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants