Skip to content

Enforce the stable release publication contract - #202

Merged
Pepps233 merged 2 commits into
feat/verified-release-publicationfrom
feat/release-contract
Sep 13, 2026
Merged

Pepps233 merged 2 commits into
feat/verified-release-publicationfrom
feat/release-contract

Conversation

@Pepps233

@Pepps233 Pepps233 commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Make release publication enforce the stored-record contract and add matching fixtures for the future Diffex latest-version consumer.

Companion cloud PR: https://github.com/diffexai/diffex-cloud/pull/144.

Reasoning

The real publisher command previously accepted --source-commit not-a-commit and wrote release records in the controlled reproduction.

It now rejects malformed release identities before writing and validates existing records before trusting their versions or reusing immutable records.

The public contract means verified npm availability, without claiming that GitHub binary assets are already public.

Changes

  • Add strict stored-record and public-response validators, covering canonical stable versions, exact CLI identity, unique lockstep packages, commit, timestamp, HTTPS URLs, and SRI metadata.
  • Apply record validation to publisher writes and storage reads while preserving conditional latest updates and immutable-record recovery.
  • Add matching cloud/CLI contract documentation, fixtures, publisher command regressions, and consumer conformance tests.
  • Use structurally valid synthetic integrity metadata in the existing publication harness.

This deliberately tightens acceptance of malformed stored records; it adds no dependency or schema migration.
The production checker still uses its existing endpoint and parsing until the separately planned consumer migration connects the new validator.
Existing update-note behavior is preserved.

Testing

  • Before implementation: node --test --test-name-pattern='noncanonical source commit' scripts/publish-release-announcement.test.mjs failed because the publisher exited successfully.
  • node --test scripts/release-contract.test.mjs scripts/publish-release-announcement.test.mjs: 130 tests passed, including actual publisher output and rejection of every invalid stored-record fixture.
  • From packages/coding-agent, node ../../node_modules/vitest/dist/cli.js --run test/release-contract.test.ts: 23 tests passed.
  • npm run check and ./test.sh: passed.
  • Both cloud quality gates and the cross-repository document/fixture comparison: passed.

The controlled publisher uses mocked npm and intercepted storage, with temporary-fixture cleanup.
There is no deployed R2-to-HTTP-to-CLI E2E path in this contract change, and no real release or remote storage write was performed.

- Validate announced and stored records against the Worker contract before trusting release identity
- Share publisher and consumer fixtures for stable versions and canonical package responses
@Pepps233 Pepps233 added enhancement New feature or request coding-agent labels Sep 10, 2026
@Pepps233 Pepps233 self-assigned this Sep 10, 2026
@Pepps233
Pepps233 added this pull request to stack #200 September 10, 2026 18:17

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

large diff due to this test file.

@Pepps233
Pepps233 merged commit 1d78b5a into main Sep 13, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

coding-agent enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant