Skip to content

[Release] Refresh Maven checksum sidecars after the publication merge - #36

Merged
DongyuZhao merged 1 commit into
mainfrom
fix-merge-maven-checksum-sidecars
Jul 21, 2026
Merged

[Release] Refresh Maven checksum sidecars after the publication merge#36
DongyuZhao merged 1 commit into
mainfrom
fix-merge-maven-checksum-sidecars

Conversation

@DongyuZhao

Copy link
Copy Markdown
Contributor

merge-maven-publications.mjs mutates two files in the staged repository — jar --update rewrites the JVM JAR and the Gradle module metadata gets re-hashed — but the Maven checksum sidecars (.md5/.sha1/.sha256/.sha512) next to both files still described the pre-merge bytes. A checksum-verifying consumer, or a Central upload that validates repository checksums, would reject the merged Kotlin publication.

The merge now recomputes the four sidecars in place for both mutated files. Verified with a synthetic staged repository (jar + module + sidecars + the macOS payload jar): post-merge, every sidecar matches the mutated bytes, and the existing native-payload assertions still pass.

Found while porting this script to tex-core (nouprax/tex-core#9, where the same fix landed); flagged there by review.

🤖 Generated with Claude Code

jar --update changes the JVM JAR bytes and the module metadata rewrite
changes the .module file, but the staged repository's checksum sidecars
still described the pre-merge contents, so a checksum-verifying consumer
or a Central upload would reject the merged publication. Recompute the
four sidecars for both mutated files; verified with a synthetic staged
repository. Found while porting this script to tex-core.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@DongyuZhao
DongyuZhao requested a review from a team July 21, 2026 19:00
@github-actions

Copy link
Copy Markdown

PR performance and binary-size diff

Benchmark execution is required; hosted-runner timing, memory, and size deltas are informational only.

Baseline: exact PR base 3f8bf973fb11 (successful main CI).

Performance

Runtime Workload Median Perf diff Memory Memory diff
c representative_large 6.631 ms ⚠️ +9.0% 8,624 KiB ✅ +0.0%
es deep_nesting 0.298 ms ⚠️ +0.1% 139,252 KiB ✅ -2.1%
es large_document 37.404 ms ⚠️ +20.7% 139,252 KiB ✅ -2.1%
kotlin deep_nesting 0.258 ms ✅ -6.4% 94,692 KiB ✅ -9.1%
kotlin large_document 33.213 ms ✅ -2.4% 92,804 KiB ✅ -8.7%
swift deep_nesting 0.097 ms ⚠️ +41.6% 26,208 KiB ✅ +0.2%
swift large_document 13.288 ms ⚠️ +43.1% 26,112 KiB ✅ +0.2%

Binary size

Artifact Bytes KiB Size diff
c-shared-library 501,888 490.1 ✅ 0 B (0.0%)
es-wasm 288,573 281.8 ✅ 0 B (0.0%)
kotlin-jvm-jar 312,972 305.6 ✅ 0 B (0.0%)

Head CI run

Size deltas are deterministic for identical build inputs. Performance deltas compare separate hosted runners and should be treated as directional evidence, not a pass/fail threshold.

@DongyuZhao
DongyuZhao merged commit b78fd1e into main Jul 21, 2026
87 checks passed
DongyuZhao added a commit that referenced this pull request Jul 27, 2026
## Summary

- The template's embedded `bootstrap-repository.sh` now pins the merge
policy: squash-only (`allow_merge_commit=false`,
`allow_rebase_merge=false`) with `squash_merge_commit_title=PR_TITLE` +
`squash_merge_commit_message=PR_BODY`, so both direct merges and
merge-queue commits land as `title (#N)` + PR description. The `PATCH`
sits between the default-branch validation and the ruleset upserts,
matching the tex-core placement, and the re-run stays idempotent.
- Ported from tex-core (nouprax/tex-core#20), the same direction as
#36/#37. tex-core changed both its checked-in
`scripts/bootstrap-repository.sh` and its template's embedded copy;
markdown-core carries the script only as the embedded copy in
`docs/repository-setup-template.md`, so this PR touches that one spot.
- No CHANGELOG entry: markdown-core's changelog records release changes
only (no Unreleased section), matching #36/#37.

## Verification

`shellcheck` clean on the extracted embedded script; `audit:repository`
and `audit:ci` green.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
DongyuZhao added a commit that referenced this pull request Jul 28, 2026
…leset downgrades (#65)

## Summary

- The template's embedded `bootstrap-repository.sh` now defaults to the
mature-repository shape: `RULESET_ENFORCEMENT=active` and
`MAIN_ADMIN_BYPASS=false`, so a maintenance re-run with only the
required inputs converges on full protection instead of silently
re-weakening it. Initial bootstrap of a fresh repository can still opt
into `RULESET_ENFORCEMENT=evaluate` explicitly while CI stabilizes,
exactly as the migration runbook already does.
- `upsert_ruleset` now fails closed when updating an existing ruleset:
downgrading enforcement from `active` to `evaluate`/`disabled`, or
adding bypass actors beyond the current set, aborts with an explanation
unless `ALLOW_PROTECTION_DOWNGRADE=true` is passed deliberately.
- A short note after the migration examples documents the new defaults
and the override variable.
- Ported from tex-core (nouprax/tex-core#70), the same direction as
#36/#37/#39. markdown-core carries the bootstrap script only as the
embedded copy in `docs/repository-setup-template.md`, so this PR touches
that one spot (same as #39).
- No CHANGELOG entry: markdown-core's changelog records release changes
only, matching #36/#37/#39.

## Verification

`shellcheck` clean and `bash -n` on the extracted embedded script;
`audit:repository` and `audit:ci` green.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
DongyuZhao added a commit that referenced this pull request Jul 28, 2026
## Summary

- Every `uses:` reference across the five workflows (`ci`, `codeql`,
`release`, `release-dry-run`, `pr-metrics-comment`) is now pinned to a
full commit SHA with the release version recorded in a trailing comment.
A movable major tag lets a tag replacement change the code that CI and
release jobs execute without a reviewed diff; the SHA makes the executed
bytes part of the reviewed history.
- `audit-ci-policy.sh` (run as `audit:ci` in the repository health
check) now rejects any workflow action reference that is not a 40-hex
commit SHA, so a future workflow edit cannot quietly reintroduce a
movable ref. Local `uses: ./…` references stay exempt.
- Every SHA↔version pair was verified against the GitHub API
(`repos/<action>/commits/<tag>`) before landing; the pins match the ones
tex-core reviewed.
- Ported from tex-core (nouprax/tex-core#70), the same direction as
#36/#37/#39/#65.
- No CHANGELOG entry: markdown-core's changelog records release changes
only, matching the previous mirrors.

## Verification

`audit:ci` green on the pinned tree; negative test confirmed the new
check fails with a pointed message when a single ref is reverted to
`@v7`.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
DongyuZhao added a commit that referenced this pull request Jul 28, 2026
## Summary

- The repo-managed Python tool venvs now install from hash-locked
requirements files (`pip --require-hashes`):
`scripts/requirements/clang-format.txt` for the clang-format venv in
`init-environment.sh`, and `scripts/requirements/cmakelang.txt`
(cmakelang + PyYAML + the transitive six) for the cmake-format venv in
`format-cmake.sh`, which is where markdown-core builds that venv. Every
distribution PyPI publishes for the pinned versions is enumerated, so an
index-side replacement cannot change the bytes the tools run.
- `install_emscripten` now pins the emsdk manager itself to
`EMSCRIPTEN_COMMIT` — the immutable commit of the `4.0.23` release tag,
kept in lockstep with `EMSCRIPTEN_VERSION` — and verifies the checkout,
so a moved tag or new default-branch commit can never change the
installer bytes it executes.
- `audit-ci-policy.sh` (`audit:ci`) now enforces all of this: it fails
if `init-environment.sh` loses the emsdk commit pin or
`--require-hashes`, or if `format-cmake.sh` loses `--require-hashes`.
- Ported from tex-core (nouprax/tex-core#70), the same direction as
#36/#37/#39/#65/#66. Adapted where the repos differ: markdown-core
installs cmakelang via `format-cmake.sh` rather than inline in
`init-environment.sh`, so the requirements file is wired (and audited)
there. The emsdk commit was verified against the GitHub API to be the
`4.0.23` tag commit.
- No CHANGELOG entry: markdown-core's changelog records release changes
only, matching the previous mirrors.

## Verification

`audit:ci` green with the new checks active; both requirements files
installed for real with `--require-hashes` into fresh venvs on macOS
arm64 (`cmake-format 0.6.13`, `clang-format 22.1.8`); the modified
`format-cmake.sh --check` ran end-to-end against the repo with a fresh
tool dir; `shellcheck` reports nothing new on either script.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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.

1 participant