Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved critical issues let executable code in provenance headers evade source verification and cause validation and publication to fail on shallow CI checkouts.
4 open issues
What changed in this PR
Makes automatic license-category publication depend on literal generated data rather than provenance or unrelated package files, while allowing manual publication of non-data fixes.
Changes:
- Ignore all three leading provenance values during source verification while preserving other comparisons.
- Parse and compare packaged license data without executing downloaded JavaScript.
- Allow verified manual dispatch to publish unchanged data, preserving version safeguards and expanding tests and documentation.
| File | Description |
|---|---|
packages/license-categories/test/stamp-provenance.test.mjs |
Tests built-data equivalence across provenance stamps. |
packages/license-categories/test/prepare-publication.test.mjs |
Covers data-only comparison, forced dispatch, and malformed data. |
packages/license-categories/script/prepare-publication.mjs |
Adds literal-data parsing, comparison, and dispatch override. |
packages/license-categories/docs/operations.md |
Documents comparison rules and manual publication policy. |
cmd/license-categories/main.go |
Normalizes all three provenance values during verification. |
cmd/license-categories/main_test.go |
Updates provenance acceptance and rejection coverage. |
Review effort: Max (auto)
| len(bytes.TrimSpace(lines[i+1][len(prefix):])) == 0 { | ||
| return nil, fmt.Errorf("generated data must have a nonempty %q provenance header on line %d", prefix, i+2) | ||
| } | ||
| lines[i+1] = []byte(prefix + "<provenance>") |
Comment on lines
+56
to
+58
| const script = new URL('../script/prepare-publication.mjs', import.meta.url).pathname | ||
| const run = (event, ref) => { | ||
| assert.throws(() => execFileSync(process.execPath, [script, join(directory, 'candidate.tgz')], { |
Comment on lines
+76
to
+77
| if (!ts.isPropertyAssignment(property) || property.questionToken || property.exclamationToken | ||
| || !(ts.isStringLiteral(property.name) || ts.isIdentifier(property.name))) unsupported() |
| } else if (name === 'licensesById') { | ||
| data.set(name, objectValue(declaration.initializer, node => { | ||
| const record = objectValue(node, stringValue) | ||
| if (Object.keys(record).sort().join(',') !== 'category,name') unsupported() |
This was referenced Nov 11, 2026
elrayle
force-pushed
the
elr/license-categories-data-only
branch
from
November 11, 2026 18:43
d3b0f4d to
2238d31
Compare
elrayle
changed the base branch from
elr/license-categories-release-policy
to
elr/license-categories-source-provenance
November 11, 2026 18:45
elrayle
force-pushed
the
elr/license-categories-source-provenance
branch
from
November 11, 2026 21:00
5977708 to
51fc71f
Compare
elrayle
force-pushed
the
elr/license-categories-data-only
branch
from
November 11, 2026 21:03
2238d31 to
a991934
Compare
elrayle
force-pushed
the
elr/license-categories-source-provenance
branch
from
November 11, 2026 22:25
168fc68 to
fbd47e2
Compare
Ignore all three leading provenance values during generated-source verification while retaining strict header and remaining-byte checks. Compare packed literal license data for automatic releases; allow validated dispatches to publish non-data fixes without weakening version or registry safeguards. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Build mismatching refs in a temporary Git repository and run the Actions entry point there, so depth-one checkouts exercise the intended commit-mismatch guard without relying on HEAD~1. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Keep the data-only provenance cross-product test aligned with the inherited released-event contract after synchronizing the stack. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Run the isolated publication fixture from its own packaged helper, supply event SHAs to provenance equivalence checks, and exercise comment terminator rejection for every normalized header. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
elrayle
force-pushed
the
elr/license-categories-data-only
branch
from
November 11, 2026 22:28
a991934 to
a0b1264
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Stack position
Layer 3 of the fresh four-PR stack, based on #176 (
elr/license-categories-release-policyat6c84574c70c4eb9a85f760633bc3eed9ebf2874d). This PR targets that parent branch. The existing #174 and its branches remain intact. Fetch/npm-generation integration and scheduled updates belong to layer 4 and are not included here.Changes
categoryDescriptionsandlicensesByIdfrom the packeddist/generated.jsagainst the most recently published npm artifact. Ignore the entire header, all comments, literal formatting/key order, and other package files for automatic publication decisions.workflow_dispatchto publish unchanged data for non-data fixes. Preserve consistent, unused, semantically newer version requirements, archive/integrity and registry checks, first-publication handling, exact refs, the enablement gate, and the GitHub prerelease guard. No automatic version bumps or older-track bypass.Validation
go test -race ./cmd/license-categories/...passed.golangci-lint run ./cmd/license-categories/...passed with zero issues.make verify-license-categoriespassed before and after the commit; existing missing-ScanCode metadata warnings were unchanged.npm test --prefix packages/license-categoriespassed all 26 checks, including independent tarball import, offline registry fixtures, forced-dispatch version reuse rejection, malformed-data failures, and stamped built-data equivalence.actionlintwas not installed. Local checks used Node.js 26.4.0; the unchanged workflows use Node.js 24.git diff --checkpassed.No npm publication, workflow dispatch, remote-setting changes, or merges were performed.