8000 fix(stdlib): type the patch ledger by kind, and check revision against it by minimal-backporter[bot] · Pull Request #3786 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

fix(stdlib): type the patch ledger by kind, and check revision against it - #3786

Open
minimal-backporter[bot] wants to merge 2 commits into
release/0.7.xfrom
backport/1277-to-release/0.7.x
Open

minimal-backporter[bot] wants to merge 2 commits into
release/0.7.xfrom
backport/1277-to-release/0.7.x

Conversation

@minimal-backporter
Copy link
Copy Markdown

Backport of #1277 to release/0.7.x.

Squash-merge this PR and keep the PR title as the subject. The cherry-picked commit keeps the source subject.

…st it (#1277)

* feat(stdlib): revision counter and typed patch ledger in Attrs

Two attrs for the security-patch convention in gominimal/inbox#511: a
`revision` counting the patch-sets applied on top of upstream_version,
and a typed `patches[]` ledger naming what each one fixed. Entries are
contract-enforced, so a blank cve or origin refuses to parse rather than
producing an SBOM row that asserts nothing.

`upstream_version` gains a contract: it never carries an `-rN` suffix,
because it is the advisory-matching key that feeds and `pkgmgr check`
compare against. None of the registry's recipes violate it.

Attrs is a closed schema, so recipes may set these only once every
consumer carries this stdlib. The publish-boundary `qualified_version()`
in pkgmgr renders `-rN` into SBOM, OpenVEX and secdb output.

Refs: gominimal/inbox#511, gominimal/pkgmgr-rs#750

* feat(stdlib): type the patch ledger by kind, and check revision against it

A ledger entry carries a kind of security, build or vendor; only a
security fix must name its CVE and upstream commit, and the records are
closed so a build or vendor entry cannot carry one. The ledger is checked
entry by entry when the attribute is, because a consumer that reads attrs
as values sees an array's elements without their contracts. Across
attributes, a non-empty ledger needs revision >= 1, and neither revision
nor patches is accepted without an upstream_version to qualify. An attr
that fails now says why. decode gains the tests the spec names for
REV-001, REV-003 and REV-011.

stdlib 0.0.22.

Refs: gominimal/inbox#511

* fix(stdlib): restart revision at 1 when a patch survives a bump; CVE sequence syntax

Review (mitodrummer, 10-10): resetting revision to 0 on an upstream bump
while a build patch survives produced a bump PR the ledger rule refuses
to load. The counter restarts at 0 only when no patch survives, else 1
(spec REV-002, gominimal/pkgmgr-rs#962); a test pins both states.

CveId now follows CVE syntax: a four-digit sequence may be zero-padded,
five or more digits may not start with zero (CodeRabbit). The eager-fold
comment gives its real reason after #2047.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit aa13deb)
@coderabbitai
coderabbitai Bot commented Nov 25, 2026 •
Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

Ask an organization administrator to verify that this bot has an active assigned CodeRabbit review seat. See the seat-assignment guide. After the seat is confirmed, request a review again.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fc9463e7-314e-479e-adff-b1dff857eccf

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@minimal-foundry
minimal-foundry Bot commented Nov 25, 2026 •
Copy link
Copy Markdown
8000
Contributor

Approved: no findings at 2bf5cf325cae.

Nothing to do.

Clobber: none: the PR is the cherry-pick of #1277 plus a fix that removes a duplicate test helper.

@minimal-foundry minimal-foundry Bot 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.

minimal-review — approved

Verdict APPROVE — No findings.

Panel: 3 of 3 personas ran (correctness, security, supply-chain).

@minimal-foundry minimal-foundry Bot added the review:approved minimal-review approved the current head label Nov 25, 2026
…ackport

release/0.7.x already defines the same helper (identical body) at the top of
the test module, so the cherry-picked copy failed with E0428.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@minimal-foundry minimal-foundry Bot 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.

minimal-review — approved

Verdict APPROVE — No findings.

Panel: 3 of 3 personas ran (correctness, security, supply-chain).

This branch has not been deployed

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

Labels

review:approved minimal-review approved the current head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0