Skip to content

Track license categories source and publication provenance - #183

Open
elrayle wants to merge 4 commits into
elr/license-categories-release-eventsfrom
elr/license-categories-source-provenance
Open

elrayle wants to merge 4 commits into
elr/license-categories-release-eventsfrom
elr/license-categories-source-provenance

Conversation

@elrayle

@elrayle elrayle commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator

Purpose

Fourth and final focused replacement for #176, based on #182. Preserves the implementation at immutable source commit 6c84574c70c4eb9a85f760633bc3eed9ebf2874d without bringing forward the separate all-provenance/data-only or scheduled-update layers.

Changes

  • Record the generator source checkout's full SHA plus (local) while retaining genuine versioned-module installs and explicit source/trimpath errors.
  • Use non-writing CLI -verify, ignoring only the leading go-spdx provenance value while validating all generated header labels and other contents.
  • Stamp the actual release tag plus (release) or checked-out HEAD plus (dispatch) after verification and before build/tests, preparation, and publication.
  • Publish the exact compared tarball with npm provenance enabled; retain whole-package comparison, including stamp-only changes, at this intermediate layer.
  • Keep workflow contracts in their purpose-owning test files and document local and publication provenance.

Source fidelity

Production generator, Makefile, publication helper, stamp helper, publication workflow, package API/data/dependencies, and Go regressions match #176 exactly. Remaining cumulative tree differences are relocated workflow tests (with stronger inherited assertions), operations-document organization/retained preparation detail and untouched inherited migration prose, the generated local provenance SHA (800eb5569623608304d722de5fce026619adddf9, the checkout base used for regeneration), and a display-only validation step name inherited from the earlier validation layer. No license data changed.

The six unresolved review proposals remain deferred; this extraction adds none of their production logic. Publication enablement and existing native stack metadata are unchanged.

Validation

  • go test -race ./...
  • golangci-lint run ./cmd/license-categories/... (0 issues)
  • npm test --prefix packages/license-categories (22 tests, including tarball/API, publication, and provenance contracts)
  • make license-categories followed by make verify-license-categories, including verification after committing
  • Actual compiled CLI verification from an unrelated directory leaves the generated file unchanged; a local -trimpath build fails explicitly
  • Parsed all workflow YAML and checked focused diffs

Copilot AI adaptive review requested due to automatic review settings November 11, 2026 18:39
@elrayle
elrayle added this pull request to stack #184 November 11, 2026 18:45

Copilot AI 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.

🟡 Changes recommended

Critical unresolved flaws can misattribute npm provenance, turn release-tag text into executable TypeScript, and allow non-comment source changes to bypass verification.

5 open issues
What changed in this PR

Extends license-categories generation and npm publishing with source and publication provenance, without changing license data.

Changes:

  • Add local checkout SHA provenance and non-writing verification that ignores only the leading go-spdx value.
  • Stamp release or dispatch provenance before building and testing, and enable npm provenance for the exact compared tarball.
  • Add regression coverage and operational documentation while retaining whole-package comparison.
File Description
packages/​license-categories/​test/​stamp-provenance.test.mjs Tests stamping, compiled headers, and provenance-only package changes.
packages/​license-categories/​test/​publication-workflow.test.mjs Checks stamping order and npm provenance flags.
packages/​license-categories/​src/​generated.ts Records the local source SHA; license data is unchanged.
packages/​license-categories/​script/​stamp-provenance.mjs Adds release-tag and dispatch-commit stamping.
packages/​license-categories/​docs/​operations.md Documents local generation and publication provenance.
Makefile Switches verification to the generator’s -verify mode.
cmd/​license-categories/​main.go Adds checkout provenance resolution and non-writing verification.
cmd/​license-categories/​main_test.go Covers provenance resolution, header validation, and conflicting flags.
.github/​workflows/​publish-license-categories.yaml Stamps before tests and enables provenance when publishing the compared tarball.

Review effort: Max (auto)

Comment thread cmd/license-categories/main.go Resolved
Comment on lines +261 to +263
if version := buildInfo.Main.Version; version != "" && version != "(devel)" {
return version, nil
}
Comment on lines +56 to +59
execFileSync(process.execPath, [
new URL('../node_modules/typescript/bin/tsc', import.meta.url).pathname,
join(directory, 'generated.ts'), '--target', 'ES2022', '--module', 'ES2022',
])
@elrayle
elrayle force-pushed the elr/license-categories-release-events branch from 7f53918 to a9f95e7 Compare November 11, 2026 20:53
@elrayle
elrayle force-pushed the elr/license-categories-source-provenance branch from 5977708 to 51fc71f Compare November 11, 2026 21:00
@elrayle
elrayle force-pushed the elr/license-categories-release-events branch from a9f95e7 to 6a7d3ea Compare November 11, 2026 22:19
elrayle and others added 4 commits November 11, 2026 17:24
Verify generated data without ignoring non-go-spdx content, record local checkout provenance, and stamp release or dispatch provenance before building the compared npm artifact.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Support initial stable releases and prerelease promotions through the released action without accepting duplicate published events.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Prevent source verification from ignoring code after CR or Unicode line separators, and reject unsafe release tags and stamped provenance values. Cover all four TypeScript line terminators with regressions.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Validate GITHUB_SHA and require checked-out HEAD to match before stamping release or dispatch provenance. Exercise the CLI against missing, malformed, and stale event SHAs without modifying generated source on failure.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@elrayle
elrayle force-pushed the elr/license-categories-source-provenance branch from 168fc68 to fbd47e2 Compare November 11, 2026 22:25
@elrayle
elrayle removed this pull request from stack #184 November 12, 2026 11:28
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.

2 participants