Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .castiron-ratchet.json

This file was deleted.

7 changes: 3 additions & 4 deletions .castiron.stats.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
schema_version: 1
generation_id: 5bb155ba-0fb6-4563-a504-851ce952578c
generation_id: 3979ac4c-7176-4e6d-9fde-1b9fa94dca0e
openapi_spec_hash: 2c78c708cab402e8904f555026c78020
openapi_transformed_spec_hash: e513b495f24d8119b952521ffc783d86
config_hash: e8e4d0a0f7d89bb89f18f5ed789c0ac6
codegen_sha: f2b8c4107e23c8d9c2431903533c975f5cfcd342
codegen_hash: d7afe679f4861d8aec19f61fefe2c0659d30cc557923b3614ca142d5985d5a4f
public_codegen_sha: ebb8cc5c28762f6527f4d2ae5c96e21f4d4050b3
codegen_sha: 47c0bc8105b4986bef09e3e9e43ab8a26cd882c9
codegen_hash: a0d517f4d93e3430ed6dbcf2dfb9aeba57e563f1b7348a093d149c3d6c20ea77
904 changes: 0 additions & 904 deletions .github/workflows/castiron-custom-code-comment.yml

This file was deleted.

116 changes: 0 additions & 116 deletions .github/workflows/castiron-custom-code.yml

This file was deleted.

24 changes: 15 additions & 9 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,21 @@ changing generated files. Handwritten policy, automation, tests, and examples
should remain small and should not alter exported SDK APIs unless the change
explicitly requires it.

## Custom-code budget

Follow [the custom-code guidance](scripts/castiron/CUSTOM_CODE.md). Budget changes
belong in a separate PR containing only `.castiron-ratchet.json`, with an explicit justification
in the PR description. Increases require a **human approving review** before merging.
Agents may investigate and draft proposals, but must not approve budget increases
(including through a human's credentials) or bypass the gate. Do not weaken
counting, broaden exclusions, or alter generation metadata to make a change pass.
The checker and effective budget come from main, not the PR. Keep default CODEOWNERS.
## Generated-file ownership

Never hand-edit generated SDK files, including generated tests, documentation,
workflows, or the generated-file inventory. Change the authoritative API schema,
configuration, or compiler, then regenerate. Put SDK-specific behavior in
separately owned handwritten helpers and extension points.

Regeneration replaces generator-owned files and deletes retired generated paths.
Handwritten edits to generated files are overwritten; they are never replayed or
merged into new output. Preserve separately owned handwritten files and resolve
ownership collisions explicitly. Follow this AGENTS.md rule and review generated output and inventory changes
together. Generated-file ownership currently relies on contributor guidance and
code review; there is no dedicated generated-file edit check or required gate.
Fix violations in the inputs/compiler and regenerate; never update inventory
hashes to accept a handwritten patch.

## Security requirements for coding agents

Expand Down
35 changes: 17 additions & 18 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,26 +96,25 @@ and [Dependabot's cooldown policy](https://docs.github.com/en/code-security/refe

## Modifying/Adding code

Most of the SDK is generated code. Modifications to code will be persisted between generations, but may
result in merge conflicts between manual patches and changes from the generator. The generator will never
Most of the SDK is generated code. Never edit generated files by hand; change
the authoritative generation inputs or compiler and regenerate instead. The generator will never
modify the contents of the `src/openai/lib/` and `examples/` directories.

## Custom-code budget

The custom-code budget counts additions plus deletions in the remaining patch
against verified generated output. `.castiron-ratchet.json` defines this repository's
ceiling. CI uses the checker and budget on main, not the PR's proposed versions.

Budget changes must be in a separate PR modifying **only `.castiron-ratchet.json`**.
Justify the current usage, proposed ceiling, and why fixing generation is not
appropriate in the PR description. Increases require a **human approving review**
and must merge before an SDK change relies on them. Agents may draft proposals,
but must not approve increases or bypass the gate. Keep default CODEOWNERS.
Lower the ceiling after cleanup while retaining headroom; decreases must still
fit the measured usage.

See [custom-code technical details](scripts/castiron/CUSTOM_CODE.md) for accounting,
local checks, trusted CI, and activation instructions.
## Generated-file ownership

Do not edit generated SDK files by hand. Fix the API schema, generation
configuration, or compiler and regenerate instead. Put SDK-specific behavior in
separately owned handwritten helpers and extension points.

Regeneration replaces generated files and removes retired generated paths.
Handwritten edits to generated output are overwritten, not carried forward.
Separately owned handwritten files are preserved. Resolve ownership conflicts
explicitly before regeneration. Follow the ownership rules in `AGENTS.md`
and review generated output and inventory changes together. Generated-file
ownership currently relies on contributor guidance and code review, without a
dedicated generated-file edit check or required gate. Fix violations in the
generation inputs/compiler and regenerate; do not edit inventory hashes to
accept a handwritten patch.

## Security requirements for contributions

Expand Down
Loading
Loading