Skip to content

chore: set a 1,000-line custom-code budget - #126

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

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 1,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 +61 / −41 = 102 lines, leaving 898 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: #127

Copilot AI lite review requested due to automatic review settings August 21, 2026 16:14
@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
@github-actions

Copy link
Copy Markdown

Castiron custom code

✅ No new custom-code files detected.

5 mixed files remain; 0 existing customizations changed.

Compared 056f30641987 → 3b0f397e182c. Generated baselines verified.

5 existing customizations unchanged
  • pkg/cmd/adminorganizationcertificate.go
  • pkg/cmd/cmd.go
  • scripts/castiron/README.md
  • scripts/castiron/custom_code_report.py
  • scripts/castiron/test_custom_code_report.py

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

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

git fetch --no-tags origin 056f306419877c8b97b4e5a2340a90f6bfda717f 3b0f397e182c13feb562efaa139f331094360ff3
python3 scripts/castiron/custom_code_report.py report \
  --base 056f306419877c8b97b4e5a2340a90f6bfda717f \
  --head 3b0f397e182c13feb562efaa139f331094360ff3 --fetch --require-head-hash --public \
  --out /tmp/castiron-custom-code-3b0f397e182c
cat /tmp/castiron-custom-code-3b0f397e182c/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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Introduces a Castiron “ratchet” configuration file to cap the allowed size of the remaining custom patch against verified generated output, aligning with the stated 1,000-line additions+deletions budget.

Changes:

  • Add .castiron-ratchet.json with schema_version: 1 and max_custom_patch_lines: 1000.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@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 proposed allowance against the small CLI customization baseline: current usage is 102 lines (+61/-41), and the 1,000-line ceiling leaves 898 lines of practical generation headroom while remaining the smallest absolute SDK cap. The valid 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 016bfb2 Aug 21, 2026
11 checks passed
@apcha-oai
apcha-oai deleted the apcha/custom-code-budget branch August 21, 2026 17:04
@openai-sdks openai-sdks Bot mentioned this pull request Aug 21, 2026
Hughhhhcoder pushed a commit to Hughhhhcoder/openai-cli that referenced this pull request Aug 24, 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 **+427 / −68 = 495 custom lines**, below
the **1,000-line** ceiling. This includes the reporter changes
themselves.

## Stack

The [budget-only
foundation](openai#126) has merged.
This tooling commit is now restacked onto `main` at `016bfb28b10f`; 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.

3 participants