Skip to content

[Infra] Default bootstrap to active enforcement and fail closed on ruleset downgrades - #65

Merged
DongyuZhao merged 2 commits into
mainfrom
bootstrap-fail-closed-protections
Jul 28, 2026
Merged

[Infra] Default bootstrap to active enforcement and fail closed on ruleset downgrades#65
DongyuZhao merged 2 commits into
mainfrom
bootstrap-fail-closed-protections

Conversation

@DongyuZhao

Copy link
Copy Markdown
Contributor

Summary

Verification

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

🤖 Generated with Claude Code

@DongyuZhao
DongyuZhao requested a review from a team July 28, 2026 05:45

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b8fae9f367

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/repository-setup-template.md Outdated
Comment thread docs/repository-setup-template.md Outdated
@github-actions

github-actions Bot commented Jul 28, 2026

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 unavailable for exact PR base 938bba6aa55a; current values are shown without a diff.

Performance

Runtime Workload Median Perf diff Memory Memory diff
c representative_large 6.133 ms n/a 8,560 KiB n/a
es deep_nesting 0.320 ms n/a 146,800 KiB n/a
es large_document 38.189 ms n/a 146,800 KiB n/a
kotlin deep_nesting 0.293 ms n/a 93,600 KiB n/a
kotlin large_document 29.944 ms n/a 90,972 KiB n/a
swift deep_nesting 0.076 ms n/a 26,064 KiB n/a
swift large_document 12.641 ms n/a 25,936 KiB n/a

Binary size

Artifact Bytes KiB Size diff
c-shared-library 501,952 490.2 n/a
es-wasm 288,818 282.0 n/a
kotlin-jvm-jar 318,255 310.8 n/a

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 and others added 2 commits July 28, 2026 09:35
…leset downgrades

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Review: comparing bypass_actors by length let a re-run swap one actor
for another without ALLOW_PROTECTION_DOWNGRADE, and the enforcement
guard missed evaluate -> disabled. Compare requested actors as a subset
of currently granted ones and order enforcement levels instead.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@DongyuZhao
DongyuZhao force-pushed the bootstrap-fail-closed-protections branch from 8859468 to 20ea398 Compare July 28, 2026 13:35
@DongyuZhao
DongyuZhao merged commit c4249db into main Jul 28, 2026
87 checks passed
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