Skip to content

chore: strengthen generated file verification - #1192

Merged
yoni-oai merged 1 commit into
mainfrom
castiron/promotions/pr-276
Oct 16, 2026
Merged

yoni-oai merged 1 commit into
mainfrom
castiron/promotions/pr-276

Conversation

@yoni-oai

@yoni-oai yoni-oai commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Update the shared SDK maintenance tooling to verify generated file contents, modes, workflow ownership, and retired paths when a repository opts into strict ownership. The repository keeps its existing schema-v1 policy and unchanged budget; this PR does not activate strict mode.

Evaluate main and next against trusted main policy; publish required statuses only for main, leaving next advisory.

The API snapshot, runtime source, public types, dependency manifests, and repository policies are unchanged.

Validation: all 95 local checker and publisher tests passed, including the compiler hash contract and same-SHA and next queue regressions; the workflow reporter checksum matches the integrated file. Scope and whitespace checks passed. Hosted CI and SDK CODEOWNER review remain required.

@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Castiron custom code

Evaluated main: af7ce3bde09eb5b256d9b4fc4e6a4406e2da4dde.

✅ No new custom-code files detected.

102 mixed files remain; 0 existing customizations changed; 3 customizations removed; 3 generated baselines changed.

Compared af7ce3bde09e → 55d3fa834b8d. Generated baselines verified.

File Result Current custom patch
scripts/castiron/custom_code_budget.py Generated baseline changed None
scripts/castiron/custom_code_report.py Generated baseline changed None
scripts/castiron/test_custom_code_budget.py Generated baseline changed None
102 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/agents/environments/EnvironmentCreateParams.kt
  • openai-java-core/src/main/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialAuth.kt
  • openai-java-core/src/main/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialAuthCreateParam.kt
  • openai-java-core/src/main/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialAuthRotateParam.kt
  • openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponse.kt
  • openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseError.kt
  • openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseInjectEvent.kt
  • openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseInjectFailedEvent.kt
  • openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseStreamEvent.kt
  • openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseToolSearchOutputItemParam.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/conversations/ConversationCreateParams.kt
  • openai-java-core/src/main/kotlin/com/openai/models/conversations/items/ItemCreateParams.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/live/ResponseItemCreateEvent.kt
  • openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeResponseStatus.kt
  • openai-java-core/src/main/kotlin/com/openai/models/responses/Response.kt
  • openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseCreateParams.kt
  • openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseError.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/ResponseStreamEvent.kt
  • openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseTextConfig.kt
  • openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseToolSearchOutputItemParam.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/models/videos/VideoCreateError.kt
  • openai-java-core/src/main/kotlin/com/openai/models/webhooks/UnwrapWebhookEvent.kt
  • openai-java-core/src/main/kotlin/com/openai/models/webhooks/WebhookEndpointWithSecret.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/ImageServiceAsyncImpl.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

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

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

git fetch --no-tags origin af7ce3bde09eb5b256d9b4fc4e6a4406e2da4dde 55d3fa834b8d1db9530a0bac18827dd991551f3f
python3 scripts/castiron/custom_code_report.py report \
  --base af7ce3bde09eb5b256d9b4fc4e6a4406e2da4dde \
  --head 55d3fa834b8d1db9530a0bac18827dd991551f3f --fetch --require-head-hash --public \
  --out /tmp/castiron-custom-code-55d3fa834b8d
cat /tmp/castiron-custom-code-55d3fa834b8d/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

@yoni-oai
yoni-oai marked this pull request as ready for review October 16, 2026 02:16
@yoni-oai
yoni-oai requested a review from a team as a code owner October 16, 2026 02:16
@openai-sdks

openai-sdks Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

OkTest Summary

✅ 236/236 SDK tests passed in 11.485s for Java SDK PR #1192.

Test results — 42 files
Test Result Time
tests/chat-completions-complex-body.test.ts ✅ Passed 180ms
tests/chat-completions-create.test.ts ✅ Passed 466ms
tests/chat-completions-stream.test.ts ✅ Passed 367ms
tests/files-content-binary.test.ts ✅ Passed 187ms
tests/files-create-multipart.test.ts ✅ Passed 222ms
tests/files-list-pagination.test.ts ✅ Passed 206ms
tests/initialize-config.test.ts ✅ Passed 190ms
tests/instance-isolation.test.ts ✅ Passed 170ms
tests/models-list.test.ts ✅ Passed 209ms
tests/responses-background-lifecycle.test.ts ✅ Passed 172ms
tests/responses-body-method-errors.test.ts ✅ Passed 547ms
tests/responses-cancel-timeout.test.ts ✅ Passed 198ms
tests/responses-cancel.test.ts ✅ Passed 223ms
tests/responses-compact-retries.test.ts ✅ Passed 337ms
tests/responses-compact.test.ts ✅ Passed 212ms
tests/responses-create-advanced-stream.test.ts ✅ Passed 155ms
tests/responses-create-advanced.test.ts ✅ Passed 1.121s
tests/responses-create-disconnect.test.ts ✅ Passed 988ms
tests/responses-create-errors.test.ts ✅ Passed 309ms
tests/responses-create-malformed-api-responses.test.ts ✅ Passed 188ms
tests/responses-create-retries.test.ts ✅ Passed 195ms
tests/responses-create-stream-failures.test.ts ✅ Passed 146ms
tests/responses-create-stream-timeout.test.ts ✅ Passed 181ms
tests/responses-create-stream-wire.test.ts ✅ Passed 3.531s
tests/responses-create-stream.test.ts ✅ Passed 372ms
tests/responses-create-terminal-states.test.ts ✅ Passed 324ms
tests/responses-create-timeout.test.ts ✅ Passed 214ms
tests/responses-create.test.ts ✅ Passed 764ms
tests/responses-delete.test.ts ✅ Passed 218ms
tests/responses-input-items-errors.test.ts ✅ Passed 237ms
tests/responses-input-items-list.test.ts ✅ Passed 224ms
tests/responses-input-items-options.test.ts ✅ Passed 113ms
tests/responses-input-tokens-count-timeout.test.ts ✅ Passed 237ms
tests/responses-input-tokens-count.test.ts ✅ Passed 204ms
tests/responses-malformed-inputs.test.ts ✅ Passed 2.768s
tests/responses-not-found-errors.test.ts ✅ Passed 378ms
tests/responses-parse.test.ts ✅ Passed 328ms
tests/responses-retrieve-retries.test.ts ✅ Passed 194ms
tests/responses-retrieve.test.ts ✅ Passed 240ms
tests/responses-stored-method-errors.test.ts ✅ Passed 916ms
tests/retry-behavior.test.ts ✅ Passed 3.324s
tests/sdk-error-shape.test.ts ✅ Passed 352ms

View OkTest run #38845588067

SDK merge (4a617e693f48) · head (55d3fa834b8d) · base (af7ce3bde09e) · OkTest (0bab422a5181)

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 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-10-16T03:31:48.419523Z 55d3fa8 New commits
🔒 Security Review ✅ Completed 2026-10-16T03:34:35.030359Z 55d3fa8 New commits
ℹ️ 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.

@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 all 12 changed files at aef9cd32f251608f17f88a4c3511980b9a4c51be. Requesting changes for two target/freshness correctness issues in the newly added next status support: main and next results share SHA-scoped contexts, and a next queue result can outlive the main policy it evaluated. Keeping next advisory would avoid both problems until authoritative next checks are coupled correctly.

The generated-file verifier, provenance handling, and existing schema-v1 migration policy otherwise look consistent. I checked all 3,776 manifest entries; the 110 byte differences correspond to existing mixed-file customizations, not newly introduced drift. Runtime/API sources, dependencies, and the budget policy are unchanged.

Static review only; no candidate code or tests run locally. Current exact-head hosted CI has 15 successful checks/statuses and 2 skipped checks, with no failures or pending checks.

const {data: pr} = await github.rest.pulls.get({...context.repo, pull_number: pull.number});
if (pr.state === 'open' && pr.head.sha === head &&
pr.base.ref === 'main' && pr.base.repo.full_name === `${context.repo.owner}/${context.repo.repo}`) current.push(pr);
['main', 'next'].includes(pr.base.ref) && pr.base.repo.full_name === `${context.repo.owner}/${context.repo.repo}`) current.push(pr);

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.

[P2] Keep target-specific results out of the same status context

This now accepts both main and next, but the publisher below still keys both results by the same head SHA and the same two context names. The results can legitimately differ: if next already contains a policy-only commit B and H adds code on top of B, isolation passes against next but fails against main, which sees the mixed policy/code diff. Retargeting H to next lets its later success replace the main failure; retargeting it back leaves the wrong target's result displayed until a new evaluation finishes. The ordering marker also ignores target identity. Please keep next advisory for now or use target-specific status contexts/ordering, with a same-head retargeting regression case. This is status correctness feedback, not a claim that the separate main merge-queue check can be bypassed.

Comment on lines +220 to +224
const {data: target} = await github.rest.git.getRef({...context.repo, ref: `heads/${branch}`});
const {data: main} = branch === 'main' ? {data: target}
: await github.rest.git.getRef({...context.repo, ref: 'heads/main'});
fresh = fresh && base === target.object.sha && policy === main.object.sha;
fresh = fresh && member;

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.

[P2] Invalidate next queue results when the main policy changes

This checks main only immediately before writing the status. Once a next queue head has passed under policy P1, it may still be waiting for another required check when main changes to P2. That does not change the next base or queue SHA, and neither workflow is triggered to invalidate/recompute this result, so the queue can retain a passing budget result for the old policy. This matters when the new CUSTOM_CODE.md activation steps make these statuses required on next. Please keep next non-authoritative until main-policy changes invalidate/re-evaluate its queue results, or implement that coupling before recommending activation. Add a case where main changes after status publication while next is still waiting.

@markstuart-oai markstuart-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 all 12 changed files at aef9cd32f251608f17f88a4c3511980b9a4c51be. I agree with the existing policy-invalidation finding and am leaving this review without approval.

The pre-publication comparison only proves that main policy is current when a next-queue status is written. If main later tightens that policy while the same next-queue head waits for another check, neither workflow invalidates or recomputes the saved success. The new activation guidance would make that stale result authoritative. Keep next explicitly advisory, with separate status labels and narrowed activation guidance, until policy changes can invalidate or re-evaluate pending next-queue results. A regression should cover success, a subsequent main-policy change, and delayed queue completion. I have no evidence that authoritative next checks are currently enabled.

The shared-context finding also describes a real retargeting display problem; the fresh main-queue check prevents a demonstrated main merge bypass. I am referencing both existing threads rather than posting duplicate inline comments.

The generated-file verifier, public checkpoint identity, unchanged schema-v1 budget and ownership policy otherwise look consistent. Exact-head CI has 15 successful and two skipped checks. Source and hosted-CI review only; no candidate code or local tests ran.

Castiron-Internal-PR: openai/openai-java-internal#276
Castiron-Source-SHA: a22be628beb6353aec408e6490c8e1dbeef8da2a
Castiron-Public-Base-SHA: af7ce3b
@yoni-oai
yoni-oai force-pushed the castiron/promotions/pr-276 branch from aef9cd3 to 55d3fa8 Compare October 16, 2026 03:27

@markstuart-oai markstuart-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.

Re-reviewed all 12 changed files at 55d3fa834b8d1db9530a0bac18827dd991551f3f. Both earlier findings are fixed. The publisher returns for next before reading or writing the main status contexts, and the guidance now keeps next advisory until separate authorization and policy invalidation exist. The added tests cover same-SHA main/next results and later main-policy changes.

The new inventory reader parses literal data from the verified checkpoint without executing it. It preserves generated-file ownership across compiler versions, rejects claims on SDK-owned CI, and requires identities for generated workflows omitted from public snapshots. The new ownership, retirement, and branch-rule pagination cases look consistent. I found no additional actionable issues.

The 3,776 manifest paths are unchanged; the seven updated identities match the tooling and documentation changes. The public checkpoint identity and unchanged SDK core subtree are verified. The schema-v1 budget and CODEOWNERS remain unchanged; this approval does not activate strict mode or next-branch enforcement.

At the final CI read, 13 checks/statuses passed, two were skipped, and CI / tests was still running. The changed-tooling baseline checks, budget statuses, API compatibility, and Java 8/25 runtime checks passed. Source and hosted-CI review only; no candidate code or local tests ran.

@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.

Re-reviewed all 12 changed files at 55d3fa834b8d1db9530a0bac18827dd991551f3f. Both of my earlier findings are fixed: next returns before reading or writing the main status contexts, and the activation guidance keeps next advisory until separate contexts and policy invalidation exist. The same-SHA and stale-policy regression cases cover the corrected boundary. This approval supersedes my previous request for changes.

No additional actionable findings. I also reviewed the checkpoint-owned inventory parser, generated-file ownership/retirement checks, report identity binding, and pagination changes. All 3,776 manifest entries were checked as data; the seven updated identities match the changes, and the 102 candidate/generated byte differences are preexisting customizations. The public checkpoint hash and reporter checksum match. Runtime/API sources, dependencies, CODEOWNERS, and the schema-v1 budget policy are unchanged.

Exact-head hosted CI is complete: 15 successful checks/statuses and 2 intentionally skipped queue-signal checks; none failed or pending. Static source review and inert hashing only—no candidate code or tests executed locally.

@yoni-oai
yoni-oai added this pull request to the merge queue Oct 16, 2026
Merged via the queue into main with commit 812a4fb Oct 16, 2026
17 checks passed
@openai-sdks openai-sdks Bot mentioned this pull request Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants