Skip to content

test(release): gate minor API compatibility - #88

Open
ben-ranford wants to merge 29 commits into
mainfrom
feat/58-api-release-baseline
Open

ben-ranford wants to merge 29 commits into
mainfrom
feat/58-api-release-baseline

Conversation

@ben-ranford

@ben-ranford ben-ranford commented Sep 13, 2026

Copy link
Copy Markdown
Owner

Summary

  • problem: The tracked candidate API inventory only checked its own freshness, so refreshing it could hide a breaking change from a working v1 consumer.
  • change: Add a source-regenerated release-baseline command that archives an annotated v1 tag, records its commit and Go floor, compares public declarations with the candidate, and compiles consumer fixtures for removals, signatures, interface methods, exported variable types, additive functions, and keyed struct fields.
  • compatibility: Additive verification tooling. Stable minor-release validation deliberately fails while no stable v1 tag exists; the explicit v1.0.0-rc.2 comparison is development evidence only. Added fields remain accepted for keyed literals of defined structs, with unkeyed-literal and prior-struct-shape conversion caveats documented; those consumers require explicit compatibility review. Anonymous struct aliases do not receive this additive-field exception because their type identity changes.

Validation

  • go test ./scripts/rigor/cmd/rigor ./scripts/rigor/cmd/releasebaseline -count=1
  • make release-baseline-development
  • make release-baseline fails explicitly because only v1.0.0-rc.1 and v1.0.0-rc.2 exist
  • make ci

The development comparison recorded v1.0.0-rc.2 at 64b0d0d96954a64d51d3c520211f2164fdacab18 and a 1.22 Go floor for both baseline and candidate.

Archive extraction separates temporary-directory ownership from entry processing. Cleaned local paths must remain below the extraction root; links and special entries are rejected. Real tar fixtures verify valid nested files and reject traversal, absolute paths, links, devices, and FIFO entries without writing outside the root. Git resolves to an absolute executable path while preserving custom installations. Shared API-test fixture setup preserves all source fixtures and assertions.

Scope firewall

This PR is limited to issue #58’s release-baseline inventory comparator, source archive handling, compatibility fixtures, and documentation. It preserves the Go floor, selected toolchain, existing API inventory format, and stable-tag prerequisite. Replacing the CI trust model or publishing the prerequisite release is outside this implementation.

The checker is a bounded declaration and consumer-fixture gate, not a complete Go source-equivalence analyzer. The supported release matrix compares the inherited native build and all four cgo-disabled public targets. Supported non-generic sealed methods require full value/pointer interface satisfaction; generic matching remains limited.

The compatibility guide records separate backlog work for external module resolution and reachable dependency types (#75, #122), generic and alias normalization (#107, #110), cgo importing (#109), root-local and hidden-type reachability (#112, #113, #119), promoted-selector compatibility (#114), equivalent interface embedding normalization (#123), and prior-struct-shape conversion policy (#124). These follow-ups do not waive defects in the issue's supported declaration, field, archive or target-selection checks. The external dependency fixture currently fails closed at the resolver; no silent-pass reproduction is claimed for it.

Current runtime 3a05494 passed full CI and 45 compiled CLI QA cases, including the real Makefile's native/cgo-disabled target modes. The later documentation-only head passed fresh candidate requirements; its remote checks and exact-head review are evaluated separately.

Release Notes

Closes #58

@ben-ranford ben-ranford added area:core Semantic, action, state, replay, and public core contracts rigor-uplift Repository hygiene, CI, release, or governance hardening type:verification Executable compatibility, testing or release verification priority:p1 Foundational or high-impact milestone work labels Sep 13, 2026
@ben-ranford ben-ranford self-assigned this Sep 13, 2026
@ben-ranford ben-ranford added this to the v1.1.0 milestone Sep 13, 2026
@ben-ranford
ben-ranford marked this pull request as ready for review September 13, 2026 12:15
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 13, 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-09-14T16:48:44.231094Z eae4e39 Draft marked ready
ℹ️ 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4e8773b96d

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/rigor/cmd/releasebaseline/main.go Outdated
Comment thread scripts/rigor/cmd/releasebaseline/main.go Outdated

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.

🟡 Changes recommended

Unresolved critical and moderate compatibility-gate issues remain.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds a source-based API compatibility gate against annotated stable v1 tags, including archive handling, inventory comparison, fixture tests, release integration, and documentation.

Changes:

  • Adds the releasebaseline command and alternate-directory inventory support.
  • Adds release-baseline Make targets and GA integration.
  • Documents compatibility rules, baseline behavior, and caveats.
File summaries
File Summary and final findings
scripts/rigor/generated/dependency-inventory.json Registers the new command package.
scripts/rigor/cmd/rigor/main.go Supports inventory generation from an alternate directory.
scripts/rigor/cmd/releasebaseline/main.go Implements baseline selection, archive extraction, and API comparison. Critical (2 votes): empty public packages can be deleted without detection. Moderate (2 votes): build-metadata stable tags are rejected. Moderate (1 vote each): raw signatures flag parameter renames or interface reordering; inline go comments produce an unknown floor; lightweight tags can block valid baseline selection; the child process ignores the selected GO; fixture compilation is not wired into the command.
scripts/rigor/cmd/releasebaseline/main_test.go Tests compatibility, fixtures, tag selection, and archive paths.
Makefile Adds release-baseline targets and GA integration. Critical (1 vote): the common non-prerelease gate is not version-aware and can force v2 releases to use a v1 baseline.
docs/releasing.md Documents GA baseline gating.
docs/compatibility.md Documents compatibility rules and caveats.
Review details

Suppressed comments (7)

scripts/rigor/cmd/releasebaseline/main.go:254

  • The compatibility decision is based on exact inventory strings, but the renderer includes non-semantic details such as parameter names and preserves interface-member order. Renaming value to input, or merely reordering interface methods, leaves Go consumer code type-correct yet is reported as a breaking change here. Compare normalized Go signatures/interface members rather than raw declaration text.
			if declaration == current || compatibleStructFieldAddition(declaration, current) {
				continue
			}
			failures = append(failures, pkg+": changed "+declaration+" -> "+current)

scripts/rigor/cmd/releasebaseline/main.go:118

  • The development-path validation only checks the v1. prefix and presence of a hyphen, so a tag such as v1.not-semver-foo is accepted whenever an annotated tag with that name exists. That contradicts the error's v1-semver contract and allows an arbitrary non-release tag to become the development baseline; validate the complete prerelease SemVer grammar (and require a prerelease in development mode).
	if !strings.HasPrefix(tag, "v1.") || (!stableV1Tag.MatchString(tag) && !strings.Contains(tag, "-")) {
		return baseline{}, fmt.Errorf("baseline tag %q is not a v1 semver tag", tag)

scripts/rigor/cmd/releasebaseline/main.go:323

  • For an empty public struct, strings.Split("", "; ") yields one empty field. Consequently, adding the first exported field to type Empty struct { } is treated as an incompatible change, even though keyed consumers remain compatible and the documented additive-field rule says it should pass.
	body := strings.TrimSuffix(strings.SplitN(declaration, structMarker, 2)[1], " }")
	fields := map[string]bool{}
	for _, field := range strings.Split(body, "; ") {

scripts/rigor/cmd/releasebaseline/main.go:233

  • A valid go.mod directive such as go 1.22 // minimum supported Go has more than two fields, so this returns unknown; the command still reports status=compatible without recording the actual Go floor. Parse the directive after removing an inline comment (and consider failing when the floor cannot be read).
	for _, line := range strings.Split(string(data), "\n") {
		fields := strings.Fields(line)
		if len(fields) == 2 && fields[0] == "go" {
			return fields[1]

scripts/rigor/cmd/releasebaseline/main.go:105

  • latestStableV1Tag returns the first semver-matching tag before checking whether it is annotated. If a newer stable v1.x.y tag is lightweight, loadBaseline rejects it instead of skipping it and selecting the next annotated ancestor, so a valid baseline can be blocked. Filter out non-tag objects while selecting the baseline (while retaining the final validation).
		commit, err := git(ctx, gitRevParse, tag+"^{commit}")
		if err != nil {
			return "", err
		}
		if strings.TrimSpace(string(commit)) != strings.TrimSpace(string(head)) {

scripts/rigor/cmd/releasebaseline/main.go:216

  • This child process hardcodes go, even though the Makefile exposes GO and invokes the release-baseline command with $(GO). With GO=go1.22 or a custom toolchain, the outer command and the inventory generator can use different Go versions, so the comparison is not reproducible under the selected toolchain. Pass the selected executable through to the child process.
	command := exec.CommandContext(ctx, "go", "run", "./scripts/rigor/cmd/rigor", "public-api", "--dir", directory)

scripts/rigor/cmd/releasebaseline/main.go:241

  • run only invokes compareInventories; the compiler matrix in main_test.go is never called by the command. Thus make release-baseline still performs only a textual inventory comparison and does not execute the advertised source-level consumer fixtures, leaving any inventory-rendering gap undetected by the release gate. Wire fixture compilation into the gate or narrow the stated acceptance scope.
func compareInventories(baselineInventory, candidateInventory string) error {
	baseline := parseInventory(baselineInventory)
	candidate := parseInventory(candidateInventory)
  • Files reviewed: 6/7 changed files
  • Comments generated: 3
  • Review effort level: Lite

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

Comment thread Makefile Outdated
Comment thread scripts/rigor/cmd/releasebaseline/main.go
Comment thread scripts/rigor/cmd/releasebaseline/main.go Outdated
@ben-ranford
ben-ranford requested a lite review from Copilot September 13, 2026 13:34
@ben-ranford
ben-ranford marked this pull request as draft September 13, 2026 13:34
@ben-ranford
ben-ranford marked this pull request as ready for review September 13, 2026 13:34

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e5c647cc49

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/rigor/cmd/rigor/main.go
Comment thread scripts/rigor/cmd/releasebaseline/main.go Outdated
Comment thread scripts/rigor/cmd/rigor/main.go

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7cb38b8fc7

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/rigor/cmd/releasebaseline/main.go Outdated
Comment thread .github/workflows/release.yml
Comment thread scripts/rigor/cmd/rigor/main.go
@ben-ranford
ben-ranford marked this pull request as draft September 13, 2026 15:17
@ben-ranford
ben-ranford marked this pull request as ready for review September 13, 2026 15:17

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fcbc796a89

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/rigor/cmd/rigor/main.go Outdated
Comment thread scripts/rigor/cmd/releasebaseline/main.go Outdated
@ben-ranford
ben-ranford marked this pull request as draft September 13, 2026 15:42
@ben-ranford
ben-ranford marked this pull request as ready for review September 13, 2026 15:42

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a9a1b4a686

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/rigor/cmd/rigor/main.go Outdated
@ben-ranford
ben-ranford force-pushed the feat/58-api-release-baseline branch from a9a1b4a to 5598709 Compare September 13, 2026 16:07
@ben-ranford
ben-ranford marked this pull request as draft September 13, 2026 16:07
@ben-ranford
ben-ranford marked this pull request as ready for review September 13, 2026 16:07

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 25867e881d

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/release.yml
Comment thread scripts/rigor/cmd/releasebaseline/main.go Outdated
@ben-ranford
ben-ranford marked this pull request as draft September 14, 2026 15:24
@ben-ranford
ben-ranford marked this pull request as ready for review September 14, 2026 15:24
@ben-ranford

Copy link
Copy Markdown
Owner Author

Sonar API audit

Reviewed commit: 3a05494ec0a93b0ee7b7d61b2180ad86a3fbcd0a.

Live public SonarCloud API queries for PR #88 returned:

  • Open issues: 0 (api/issues/search, resolved=false, all severities; total 0).
  • Security hotspots: 0 (api/hotspots/search; total 0).
  • Current-head Sonar check: passed (check run 104036123817).

Audited via CLI at 2026-09-14T15:24:58.083101+00:00. Project visibility was verified as public. No findings were changed or suppressed.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3a05494ec0

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/rigor/cmd/rigor/main.go
Comment thread scripts/rigor/cmd/rigor/main.go
@ben-ranford
ben-ranford marked this pull request as draft September 14, 2026 15:37
@ben-ranford
ben-ranford marked this pull request as ready for review September 14, 2026 15:37
@ben-ranford

Copy link
Copy Markdown
Owner Author

Sonar API audit

Reviewed commit: 3927cbffd13a644711e9302fd28332b8ded5443c.

Live public SonarCloud API queries for PR #88 returned:

  • Open issues: 0 (api/issues/search, resolved=false, all severities; total 0).
  • Security hotspots: 0 (api/hotspots/search; total 0).
  • Current-head Sonar check: passed (check run 104041037907).

Audited via CLI at 2026-09-14T15:37:53.224919+00:00. Project visibility was verified as public. No findings were changed or suppressed.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3927cbffd1

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/rigor/cmd/releasebaseline/main.go
@ben-ranford
ben-ranford marked this pull request as draft September 14, 2026 15:45
@ben-ranford
ben-ranford marked this pull request as ready for review September 14, 2026 15:45
@ben-ranford

Copy link
Copy Markdown
Owner Author

Sonar API audit

Reviewed commit: 6c72f85e77177542a2fc5bb4576a055ba9ba4d85.

Live public SonarCloud API queries for PR #88 returned:

  • Open issues: 0 (api/issues/search, resolved=false, all severities; total 0).
  • Security hotspots: 0 (api/hotspots/search; total 0).
  • Current-head Sonar check: passed (check run 104044106963).

Audited via CLI at 2026-09-14T15:47:04.229797+00:00. Project visibility was verified as public. No findings were changed or suppressed.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6c72f85e77

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/rigor/cmd/releasebaseline/main.go Outdated
@ben-ranford
ben-ranford marked this pull request as draft September 14, 2026 16:03
@ben-ranford
ben-ranford marked this pull request as ready for review September 14, 2026 16:03
@ben-ranford

Copy link
Copy Markdown
Owner Author

Sonar API audit

Reviewed commit: 4372762e7e68457f3255eb19b43f43558f2a69ba.

Live public SonarCloud API queries for PR #88 returned:

  • Open issues: 0 (api/issues/search, resolved=false, all severities; total 0).
  • Security hotspots: 0 (api/hotspots/search; total 0).
  • Current-head Sonar check: passed (check run 104050472150).

Audited via CLI at 2026-09-14T16:04:09.513705+00:00. Project visibility was verified as public. No findings were changed or suppressed.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4372762e7e

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/rigor/cmd/releasebaseline/main.go
Comment thread scripts/rigor/cmd/rigor/main.go
@ben-ranford
ben-ranford marked this pull request as draft September 14, 2026 16:39
@ben-ranford
ben-ranford marked this pull request as ready for review September 14, 2026 16:39
@sonarqubecloud

Copy link
Copy Markdown

@ben-ranford

Copy link
Copy Markdown
Owner Author

Sonar API audit

Reviewed commit: eae4e395dd24e7243947be2c9f9b55658625b6b1.

Live public SonarCloud API queries for PR #88 returned:

  • Open issues: 0 (api/issues/search, resolved=false, all severities; total 0).
  • Security hotspots: 0 (api/hotspots/search; total 0).
  • Current-head Sonar check: passed (check run 104063173102).

Audited via CLI at 2026-09-14T16:40:15.732488+00:00. Project visibility was verified as public. No findings were changed or suppressed.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: eae4e395dd

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

receiverEnd := strings.Index(rest, ") ")
if receiverEnd >= 0 {
name := strings.SplitN(rest[receiverEnd+2:], "(", 2)[0]
return methodPrefix + rest[:receiverEnd+1] + " " + name

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Accept pointer-to-value receiver widening

When an exported method changes from func (*T) M(...) to func (T) M(...), existing calls and method expressions through *T still compile, and any interfaces previously implemented by *T remain implemented. Because this key includes the receiver's *, the candidate method receives a different key and the baseline gate reports the old method as removed, blocking this source-compatible widening; match the two receiver forms and allow only the pointer-to-value direction when the method signature is otherwise unchanged.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:core Semantic, action, state, replay, and public core contracts priority:p1 Foundational or high-impact milestone work rigor-uplift Repository hygiene, CI, release, or governance hardening type:verification Executable compatibility, testing or release verification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Check minor-release API compatibility against the last stable tag

2 participants