Skip to content

fix: fail closed when bootstrapping Go dependencies - #94

Merged
jbeckwith-oai merged 2 commits into
mainfrom
codex/fail-closed-dependency-bootstrap
Aug 19, 2026
Merged

jbeckwith-oai merged 2 commits into
mainfrom
codex/fail-closed-dependency-bootstrap

Conversation

@jbeckwith-oai

Copy link
Copy Markdown
Contributor

Summary

  • Replace the fail-open dependency bootstrap with a non-mutating go mod tidy -diff preflight followed by fail-closed go mod download and go mod verify.
  • Remove the three redundant CI bootstrap steps while preserving the shared setup action and the hourly SDK updater's intentional dependency updates.
  • Add focused regression coverage for manifest drift, dependency-resolution errors, checksum-verification errors, and unchanged go.mod/go.sum.

Why

The previous go mod tidy -e || true rewrote committed dependency metadata during ordinary bootstrap and suppressed dependency-resolution failures. Checking the tidy diff before downloading is necessary because go mod download can update go.sum even when GOFLAGS=-mod=readonly is set.

Verification

  • go test -race ./scripts
  • go test ./internal/... ./scripts with the minimum supported Go 1.25.0
  • go build ./...
  • Offline bootstrap with GOPROXY=off GOSUMDB=off on Go 1.25.0 and Go 1.25.13
  • Full ./scripts/test -skip '^TestFilesCreateCLICancelClosesStalledFIFO$' against an isolated mock server, including Windows cross-compilation
  • The excluded FIFO test also fails unchanged on a pristine archive of the base commit; the integration run otherwise passed 524 structurally valid requests.
  • git diff --exit-code -- go.mod go.sum

Copilot AI lite review requested due to automatic review settings August 18, 2026 21:55
@jbeckwith-oai
jbeckwith-oai requested a review from a team as a code owner August 18, 2026 21:55

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

This PR tightens Go dependency bootstrapping by switching from a fail-open go mod tidy -e || true approach to a fail-closed sequence that detects go.mod/go.sum drift before downloading, then verifies module integrity. It also deduplicates CI by relying on the shared setup-go composite action to run bootstrap, and adds regression tests around the new bootstrap behavior.

Changes:

  • Update scripts/bootstrap to run go mod tidy -diff, then go mod download, then go mod verify under set -euo pipefail.
  • Remove redundant ./scripts/bootstrap steps from CI jobs since .github/actions/setup-go already runs it.
  • Add tests covering fail-closed behavior and ensuring manifest drift is rejected without mutating go.mod/go.sum.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
scripts/bootstrap_test.go Adds regression tests for fail-closed bootstrap and non-mutating manifest drift detection.
scripts/bootstrap Replaces fail-open tidy with tidy-diff preflight + download + verify under stricter shell settings.
.github/workflows/ci.yml Removes redundant bootstrap steps now covered by the shared setup-go action.

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

Comment thread scripts/bootstrap_test.go
Copilot AI review requested due to automatic review settings August 18, 2026 22:03

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

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings August 18, 2026 23:20
@jbeckwith-oai
jbeckwith-oai force-pushed the codex/fail-closed-dependency-bootstrap branch from eeb329d to a8c1680 Compare August 18, 2026 23:20

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

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

Suppressed comments (1)

scripts/bootstrap_test.go:20

  • PR description says regression coverage was added for the "unchanged go.mod/go.sum" case, but the current tests don’t actually assert that a successful ./scripts/bootstrap run leaves go.mod/go.sum unchanged. TestBootstrapFailsClosed stubs go (so it can’t detect mutation), and TestBootstrapRejectsManifestDriftWithoutMutation only checks non-mutation on the failure path.

Consider adding a success-path fixture that writes a minimal tidy module (and sum), runs scripts/bootstrap with real go, and then asserts go.mod and go.sum are byte-for-byte identical after the run (plus GOPROXY=off/GOSUMDB=off to keep it hermetic).

func TestBootstrapFailsClosed(t *testing.T) {
	tests := []struct {
		name        string
		failure     string
		wantCalls   []string
		wantSuccess bool
	}{

@HAYDEN-OAI HAYDEN-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 exact head a8c1680. Fresh and offline dependency bootstraps fail closed and preserve go.mod/go.sum; adversarial module-cache checks, verified GoReleaser provenance, privileged-release ordering, and Windows cross-platform builds passed.

@jbeckwith-oai
jbeckwith-oai added this pull request to the merge queue Aug 19, 2026
Merged via the queue into main with commit 4ebe610 Aug 19, 2026
9 checks passed
@jbeckwith-oai
jbeckwith-oai deleted the codex/fail-closed-dependency-bootstrap branch August 19, 2026 00:58
@openai-sdks openai-sdks Bot mentioned this pull request Aug 18, 2026
markstuart-oai pushed a commit to fallintoplace/openai-cli that referenced this pull request Sep 6, 2026
Automated Release PR
---


## [1.9.0](openai/openai-cli@v1.8.0...v1.9.0)
(2026-08-26)


### Features

* **api:** Add residency flag and deprecate geography
([openai#136](openai#136))
([e460582](openai@e460582))


### Bug Fixes

* Add provenance-aware untrusted stdin mode
([openai#137](openai#137))
([a133707](openai@a133707))
* build CLI releases with patched Go toolchains
([openai#93](openai#93))
([a58f1cc](openai@a58f1cc))
* discard fish completion diagnostics
([openai#109](openai#109))
([4f35fc0](openai@4f35fc0))
* escape raw output controls on interactive terminals
([openai#112](openai#112))
([7601afb](openai@7601afb))
* fail closed when bootstrapping Go dependencies
([openai#94](openai#94))
([4ebe610](openai@4ebe610))
* lock and verify Steady mock tooling
([openai#95](openai#95))
([681d595](openai@681d595))
* prepare release artifacts before publishing
([openai#111](openai#111))
([4193619](openai@4193619))
* redact sensitive response headers in debug logs
([openai#106](openai#106))
([4931572](openai@4931572))
* reject invalid multipart MIME header controls
([openai#105](openai#105))
([fad98b4](openai@fad98b4))
* restrict downloaded file permissions
([openai#107](openai#107))
([7a3a7d1](openai@7a3a7d1))
* safely construct bash file completions
([openai#110](openai#110))
([b3e0946](openai@b3e0946))
* stream binary download responses
([openai#108](openai#108))
([1f3ba6c](openai@1f3ba6c))
* stream multipart uploads without buffering
([openai#65](openai#65))
([bcf0ecd](openai@bcf0ecd))
* verify GoReleaser before privileged release execution
([openai#96](openai#96))
([b3729ea](openai@b3729ea))


### Chores

* **api:** clarify image background and audio delta docs
([openai#124](openai#124))
([056f306](openai@056f306))
* **api:** No customer-visible SDK or public API changes
([openai#128](openai#128))
([12e0d28](openai@12e0d28))
* **api:** refresh image model API reference
([openai#115](openai#115))
([a771913](openai@a771913))
* **api:** Refresh the bundled OpenAPI reference
([openai#66](openai#66))
([d14387a](openai@d14387a))
* **api:** Report no customer-visible SDK or public API changes
([openai#113](openai#113))
([8da2d53](openai@8da2d53))
* **api:** update generation metadata only
([openai#138](openai#138))
([4244a62](openai@4244a62))
* configure Dependabot for Go and GitHub Actions
([openai#69](openai#69))
([f495366](openai@f495366))
* **deps:** bump actions/attest-build-provenance from 4.1.0 to 4.2.2
([openai#102](openai#102))
([6594c73](openai@6594c73))
* **deps:** bump actions/checkout from 6.0.2 to 7.0.1
([openai#103](openai#103))
([ce6a6d0](openai@ce6a6d0))
* **deps:** bump actions/checkout from 6.0.2 to 7.0.1
([openai#134](openai#134))
([f40d5f2](openai@f40d5f2))
* **deps:** bump actions/download-artifact from 4.3.0 to 8.0.1
([openai#133](openai#133))
([98ed029](openai@98ed029))
* **deps:** bump actions/github-script from 7.1.0 to 9.0.0
([openai#132](openai#132))
([978ce47](openai@978ce47))
* **deps:** bump actions/setup-go in /
([openai#101](openai#101))
([5564982](openai@5564982))
* **deps:** bump actions/upload-artifact from 4.6.2 to 7.0.1
([openai#104](openai#104))
([b3ac15a](openai@b3ac15a))
* **deps:** bump github.com/charmbracelet/bubbles from 0.21.0 to 1.0.0
([openai#99](openai#99))
([7ac7035](openai@7ac7035))
* **deps:** bump github.com/urfave/cli/v3 from 3.4.1 to 3.10.1 in the
go-minor-and-patch group across 1 directory
([openai#130](openai#130))
([ddc612e](openai@ddc612e))
* **deps:** bump the charmbracelet group across 1 directory with 2
updates ([openai#97](openai#97))
([2137b80](openai@2137b80))
* **deps:** bump the codeql group across 1 directory with 2 updates
([openai#100](openai#100))
([c95ac0a](openai@c95ac0a))
* **deps:** bump the codeql group across 1 directory with 2 updates
([openai#131](openai#131))
([58e3bdd](openai@58e3bdd))
* **deps:** bump the go-minor-and-patch group across 1 directory with 5
updates ([openai#98](openai#98))
([74822be](openai@74822be))
* **deps:** update openai-go to v3.51.0
([openai#63](openai#63))
([68e3e70](openai@68e3e70))
* **deps:** update openai-go to v3.52.0
([openai#67](openai#67))
([7d87ee2](openai@7d87ee2))
* set a 1,000-line custom-code budget
([openai#126](openai#126))
([016bfb2](openai@016bfb2))


### Documentation

* add secure CLI agent and contributor guidance
([openai#72](openai#72))
([09ec087](openai@09ec087))
* standardize CLI vulnerability disclosure policy
([openai#71](openai#71))
([d082a01](openai@d082a01))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: openai-sdks[bot] <284451331+openai-sdks[bot]@users.noreply.github.com>
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