Skip to content

ci: verify portable public SDK builds - #34

Merged
AlexStocks merged 5 commits into
codex/wp0-make-contractfrom
codex/wp0-portable-sdk
Aug 29, 2026
Merged

ci: verify portable public SDK builds#34
AlexStocks merged 5 commits into
codex/wp0-make-contractfrom
codex/wp0-portable-sdk

Conversation

@AlexStocks

@AlexStocks AlexStocks commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • define the deliberate public SDK package set with ./api/..., ./artifact/..., ./client/..., ./inference/..., ./openapi/..., ./source/..., and ./trigger/...
  • cross-build it with CGO_ENABLED=0 for the existing supported Linux and macOS amd64/arm64 matrix
  • make every target iteration explicitly fail the Make recipe when its build fails
  • retain the stable portable-sdk CI job and workflow topology contract

Rationale

This is part of WP0-C in #3. A self-review found that the initial target list was incomplete and that the loop depended on shell fail-fast behavior. The exact submitted version now uses the same four-platform matrix as the repository's existing platform jobs, includes openapi and all Artifact subpackages, and exits explicitly on each failed compilation.

PR #35 provides a parallel main-based implementation for the same work item. This PR remains a corrected stacked implementation.

Behavior and compatibility

  • no public API, protocol, dependency, runtime, or generated-contract changes
  • does not claim Windows server/release support
  • rejects any CGO dependency or cross-platform build break introduced into the deliberate public package set

Validation

  • GOTOOLCHAIN=local GOFLAGS=-mod=readonly make portable-sdk
  • mutation: make portable-sdk PORTABLE_SDK_PACKAGES=./internal/sqlstore/sqlitevec fails as expected with CGO_ENABLED=0
  • go test ./...
  • make lint (0 issues)
  • make check
  • make check-generated
  • make license-check
  • go run github.com/rhysd/actionlint/cmd/actionlint@v1.7.12
  • git diff --check

Exact head validated: eac7fbdc9dcf0c62e57a3f25d49d34cf9c195005.

AI usage

Implemented with Codex assistance. The public package set and fail-fast behavior were self-reviewed and verified with the commands above.

@AlexStocks

Copy link
Copy Markdown
Collaborator Author

Found a gate-integrity issue in make portable-sdk while implementing the same WP0-C item (see #35 for a parallel implementation):

The recipe runs go build inside a for loop without checking each iteration's exit status:

@for target in $(PORTABLE_SDK_TARGETS); do \
    GOOS=$${target%/*} GOARCH=$${target#*/} CGO_ENABLED=0 $(GO) build -mod=readonly $(PORTABLE_SDK_PACKAGES); \
done

A POSIX for loop only returns the last iteration's exit status, so if linux/amd64 fails but windows/amd64 (the last target) succeeds, make portable-sdk exits 0 and CI stays green despite a broken platform. Repro:

$ sh -c 'for t in first second; do if [ "$t" = first ]; then false; else true; fi; done; echo $?'
0

Suggested fix: fail each iteration, e.g. go build ... || exit 1 (or set -e semantics per iteration).

Two smaller gaps worth considering:

  • PORTABLE_SDK_TARGETS omits linux/arm64 and darwin/arm64, which the existing platform matrix in migration-gates.yml already covers.
  • The package allowlist omits ./openapi (a deliberate public package per AGENTS.md) and needs manual updates whenever an artifact subpackage is added — ./artifact/... style wildcards avoid the drift.

@AlexStocks
AlexStocks force-pushed the codex/wp0-portable-sdk branch from 297fb67 to eac7fbd Compare August 28, 2026 10:57
AlexStocks and others added 4 commits August 29, 2026 11:35
Merge the updated Make execution contract into the portable SDK branch, preserve the Base fixes, and reuse its real runMake harness for the portable matrix and fail-fast probes.

Constraint: Preserve the current public package set, four Linux/macOS targets, CGO-disabled builds, and explicit per-iteration failure.

Rejected: Rebase or force-push the shared PR branch while the base was changing.

Confidence: Focused workflow tests, ten repeated portable target tests, go vet, and make portable-sdk pass on the resolved tree.

Scope-risk: The resulting PR delta remains limited to the five portable SDK files relative to the new base.

Tested: go test workflow and Make contract subset; go test portable tests count 10; go vet tools/release; make portable-sdk; git diff check.

Not-tested: Full tools/release on Windows retains the pre-existing executable-mode failure; exact-head Linux CI will cover the merged commit.

Co-authored-by: OmX <omx@oh-my-codex.dev>
Merge the 28-check green Make contract head, preserve its governance and test-file split, and move portable matrix verification into makefile_test.go while retaining the workflow topology assertion.

Constraint: Preserve the six-file portable SDK delta relative to base and avoid reintroducing superseded workflow_test Make helpers.

Rejected: Rebase or force-push while the stacked base was advancing.

Confidence: Focused workflow and Make tests, ten repeated portable target tests, go vet, make portable-sdk, and the package/target/CGO mutant all produced the expected results.

Scope-risk: The merge carries the stabilized base unchanged; the PR-specific delta remains README, master workflow, AGENTS, Makefile, makefile tests, and workflow topology tests.

Tested: go test focused release contracts; go test portable tests count 10; go vet tools/release; make portable-sdk; git diff check; Base exact-head CI 28 of 28.

Not-tested: Full tools/release on Windows retains the pre-existing executable-mode failure; exact-head Linux CI will verify the merged PR head.

Co-authored-by: OmX <omx@oh-my-codex.dev>
Terminate helper-mode test binaries explicitly so coverage-instrumented harness output cannot enter Make command substitution during portable SDK contract probes.

Constraint: Preserve the real Make execution matrix and the first-target failure mutant without adding a production-only test seam.

Rejected: Lowering the coverage gate, skipping the portable tests under coverage, or replacing the behavioral test with source-text assertions.

Confidence: The exact race-enabled atomic coverage probe failed before this change with multiple target patterns and passes after the helper exits explicitly.

Scope-risk: Only the test helper termination path and its learned prevention rule change.

Tested: race atomic coverage portable probe; focused release contracts; ten repeated portable tests; go vet tools/release; make portable-sdk; git diff check.

Not-tested: Full tools/release remains platform-limited on Windows by the pre-existing executable-mode assertion; Linux exact-head CI will verify the repository-wide coverage job.

Co-authored-by: OmX <omx@oh-my-codex.dev>
@AlexStocks
AlexStocks merged commit ebdffd1 into codex/wp0-make-contract Aug 29, 2026
29 checks passed
@AlexStocks
AlexStocks deleted the codex/wp0-portable-sdk branch August 29, 2026 06:47
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.

1 participant