8000 Add fork release-candidate policy, tooling, and gate (#19) by Tigon32 · Pull Request #180 · Tigon32/miniquad · GitHub
[go: up one dir, main page]

Skip to content

Add fork release-candidate policy, tooling, and gate (#19) - #180

Merged
github-actions[bot] merged 18 commits into
masterfrom
feat/release-policy-integration
Nov 25, 2026
Merged

github-actions[bot] merged 18 commits into
masterfrom
feat/release-policy-integration

Conversation

@Tigon32
@Tigon32 Tigon32 commented Nov 25, 2026
Copy link
Copy Markdown
Owner

Related issue: #19.

Adds the fork release-candidate contract, the candidate tooling, drill, and gate, and the CI evidence collection and identity checks. It supersedes the local branch feat/release-candidate, which holds an earlier copy of the same commits.

Source: feat/release-policy-integration at fcbc464. Clean merge into current origin/master (checked with git merge-tree). The branch is 8 commits behind master.

Tests: not run locally for this PR. Hosted PR checks decide. Do not merge if a required check fails.
Writing review state: STE-aligned draft.

🤖 Generated with Claude Code

Tigon32 and others added 18 commits November 11, 2026 09:05
Add proposed MADR 0010 and an executable candidate contract.
Define fork-scoped labels and tags, immutable packages, a rollout
and rollback exercise, a reference-profile regression guard, and a
fail-closed candidate gate. No release approval. STE-aligned draft.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Separate automated candidate review from human owner release approval.
Restrict leak scan to full private paths and standard patterns.
Use upper confidence bound and measured clock resolution in the guard.
Give the bootstrap baseline no candidate label.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Link proposed MADR 0010 and distinguish candidate qualification, bootstrap rollback, measured CI regression guards, and human publication approval. Keep unavailable evidence explicitly blocked.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Implements the five implementer-scope files from
docs/release-candidate-contract.md (MADR 0010), covering sections 2-13:

- scripts/release-candidate.mjs: label grammar/precedence, compatibility-
  core derivation, candidate package prepare/verify/compare, collect-ci,
  and gate evaluation (section 9), with the canonical manifest and
  leak-scan rules.
- scripts/release-browser.mjs: ephemeral 127.0.0.1 release server, the
  rollout/rollback drill (section 6), and the paired regression measure
  command (section 7), with Playwright/pngjs loaded lazily so importing
  this file for its pure functions never requires either dependency.
- tests/release-candidate.test.mjs: 65 hermetic node:test cases covering
  section 13's required cases; no network or browser access, and no
  top-level Playwright/pngjs import, so it runs before npm ci in CI.
- .github/workflows/release-candidate.yml: manual-only (workflow_dispatch)
  reference-profile job per section 8; never runs on pull_request or push.
- CHANGELOG.md: first candidate section for 0.5.0-tigon32.1.rc.1 per
  section 10, recording the bridge protocol break (gl.js version 2 to 3)
  and the known limits (no merged/tagged candidate SHA yet, no owner
  approval).

Local verification performed on this host (PATH including
~/.cargo/bin for the rustup toolchain with wasm32-unknown-unknown):

- node --check on all three .mjs scripts: pass.
- node --test tests/release-candidate.test.mjs: 65/65 pass, no network
  or browser required.
- node scripts/check-actions.mjs: pass (all actions pinned to full SHAs).
- node scripts/check-docs.mjs: fails today because docs/adr/README.md
  does not yet list 0010-browser-release-candidates.md. That edit is
  parent-owned (docs/release-candidate-contract.md section 3), not in
  this implementer's file scope, so it is left unchanged here.
- Two independent prepare --role baseline --reference bootstrap-reference
  builds of commit f837a98 (the merged
  bootstrap reference commit) produced byte-identical app.wasm, sha256
  1ffb41f147ffc5c1abde1148740eb28d37063ade673605ebc14edcedf9ca73ab;
  compare returned ok: true and verify passed on both packages. No
  local-path strings were found in the built app.wasm.
- A prepare --role candidate --label 0.5.0-tigon32.1.rc.1 package was
  also built from f837a98 (the design commit ae1decd
  203eb98ea53029975 is not yet merged into origin/master, so it fails
  the required merge-base --is-ancestor gate in section 5.1 step 3 by
  design; this is correct fail-closed behavior, not a bug). This
  candidate-labeled package was used only to exercise the drill/measure
  mechanics below, not as evidence of the real candidate's content.
- release-browser.mjs drill across chromium 141.0.7390.37, firefox
  142.0.1, and desktop webkit 26.0: PASS in all three engines, all four
  phases (baseline, candidate, rollback-fresh, rollback-reload), full
  hash/pixel/ABI checks; screenshots and drill.json retained outside Git
  under a local evidence directory.
- release-browser.mjs measure (profile local-macos-shared-rehearsal, 20
  pairs) ran across all three engines as a rehearsal only: firefox PASS,
  chromium and webkit INCONCLUSIVE. This is a shared-host rehearsal per
  MADR 0010 and contract section 7.1 and section 12 step 6; it is not
  the formal gha-ubuntu-24.04-x64-pw1.56.1 reference-profile run and
  does not enter any regression.json gate record.

Remaining before a QUALIFIED-CANDIDATE gate record: merge this PR,
dispatch the three required CI workflows and this new manual workflow
on master at the merge commit, run collect-ci, and have the candidate
reviewer record the gate decision; all parent/owner responsibility per
docs/release-candidate-contract.md section 12.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Parent review of bebcdb4 (integration of 9401e0c) found that evaluateGate
in scripts/release-candidate.mjs could be made to report QUALIFIED-CANDIDATE
from a malformed or falsified gate record. Reproduced each route against the
pre-fix code (see rc19-evidence/pre-fix-repro/prefix-results.txt, kept
outside Git) before changing any logic:

1. REQUIRED_GATE_FIELDS only checked undefined/null/"". Setting
   record.ci = {} passed that check, and the CI-job loop ran only inside
   `if (Array.isArray(record.ci))` with no else, so a non-array ci silently
   skipped every required CI job check. -> QUALIFIED-CANDIDATE.
2. drill.local was only checked for an explicit "FAIL"; drill.local = {}
   (no result at all) was accepted. -> QUALIFIED-CANDIDATE.
3. compare was never in REQUIRED_GATE_FIELDS and was only checked via
   `record.compare === false`; an absent compare field passed.
   -> QUALIFIED-CANDIDATE.
4. candidateSha/toolSha/baseline.sha were never validated as real commit
   SHAs, and CI evidence was never cross-checked against candidateSha
   (collectCi did not even record which SHA a result was collected for).
   -> QUALIFIED-CANDIDATE for garbage SHAs or for CI evidence collected for
   a different commit.
5. regression.result was trusted at face value with no cross-check against
   the newest entry in regression.runs, allowing an earlier PASS to be
   reported while the newest retained run was INCONCLUSIVE (cherry-picking).
   -> QUALIFIED-CANDIDATE.

Fix (scripts/release-candidate.mjs):
- collectCi now records the sha each result was collected for, on every
  code path (gh api failure, no matching run, jobs api failure, and both
  matched branches).
- evaluateGate:
  - ci must be a real non-empty array; every required job must be present,
    have conclusion "success" (or BLOCKED/FAILED otherwise), and carry a
    sha that is a 40-hex commit SHA equal to candidateSha.
  - drill.local.result is now required to equal "PASS", mirroring the
    existing drill.reference requirement.
  - compare must be the literal boolean true; false still gives FAILED,
    anything else (including absent) gives BLOCKED.
  - candidateSha, toolSha, and baseline.sha must each match
    /^[0-9a-f]{40}$/; baseline.sha must not equal candidateSha.
  - regression.runs must be a non-empty array of at most 3 runs, each with
    a string runId, a recognized result, and a profile equal to
    regression.profileId; the newest (last) run's result must equal the
    asserted regression.result (no cherry-picking a non-newest run).
  - audited sizes.brotliTotalDelta, which silently treated a
    missing/non-numeric value as "no increase"; it must now be a finite
    number or the gate is BLOCKED.
  - tag is now cross-checked against formatTag(label) in the existing
    compatibility try/catch (same block that already parses the label).

This is the same evaluateGate data shape already defined by the contract
(docs/release-candidate-contract.md section 9); no new field, API, or
dependency was introduced, and review.ownerApproval !== false -> BLOCKED is
unchanged. No cryptographic attestation was added.

Tests (tests/release-candidate.test.mjs):
- Updated buildValidGateRecord() to add the now-required ci[].sha and
  regression.runs[].profile fields so the existing happy-path and
  "remove any required field" tests still exercise a genuinely valid
  record.
- Added 13 new regression tests, one per bug above plus adjacent fail-closed
  checks (missing CI job, baseline.sha === candidateSha, wrong regression
  profile, more than 3 retained runs, missing sizes.brotliTotalDelta), each
  asserting the record is no longer QUALIFIED-CANDIDATE.
- Added two CLI-level tests for the gate command (gate() already set
  process.exitCode = 1 for a non-QUALIFIED-CANDIDATE result before this
  change; added coverage confirming it still does, and that it reports a
  successful exit code only for QUALIFIED-CANDIDATE).

Verification:
- node --check scripts/release-candidate.mjs and tests/release-candidate.test.mjs: ok.
- node --test tests/release-candidate.test.mjs: 78 passed, 0 failed (up
  from 65 before this change).
- Re-ran the same 6 adversarial scenarios used for pre-fix reproduction
  against the fixed code: all now report BLOCKED with a specific reason
  instead of QUALIFIED-CANDIDATE with no reasons (see
  rc19-evidence/post-fix-repro/postfix-results.txt, kept outside Git).

Scope: scripts/release-candidate.mjs and tests/release-candidate.test.mjs
only, per the explicit ownership handoff. No push, PR, merge, or tag from
this change.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Reproduce and close false candidate qualification from partial CI, missing platform and security evidence, inconsistent metrics, invalid metadata, and discarded samples. Use the largest per-run clock resolution. All 102 focused tests pass; no actual release qualification is claimed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

# Conflicts:
#	docs/adr/README.md
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Bound numeric identifiers to exact JSON integers and reject invalid compatibility cores or overflowing increments. Record the tool limit in the proposed contract and decision.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Reproduce false QUALIFIED-CANDIDATE results with missing CI identifiers and unrelated security evidence. Require canonical repository run URLs, valid job IDs, unique regression runs, and binding to the collected security and reference runs. All 107 focused release tests pass. Formal candidate qualification remains incomplete.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Fix two release-gate correctness gaps for issue #19:

collectCi (section 9.1): paginate both the runs list and the per-run
jobs list with gh api --paginate --slurp, and merge pages instead of
reading only the first page. A failed job returned only on a later
page is no longer silently omitted. Validate that every job run_id
matches the selected run before accepting it as evidence; a
misattributed, missing, or malformed job record fails closed with an
explicit reason instead of being treated as absent evidence. A
transport error, invalid JSON, a missing jobs/workflow_runs array, or
a merged item count that disagrees with total_count also fails closed.

evaluateGate size evidence (section 7.6/9.2): replace the lone
sizes.brotliTotalDelta check with validated baseline/candidate
per-compression totals (raw/gzip/brotli, non-negative safe integers)
and signed deltas that must equal candidate minus baseline. A missing,
NaN, negative, non-integer, or inconsistent value now blocks. An
accepted Brotli size increase now also requires a non-empty, documented
review.sizeIncreaseReason; an acceptance flag alone no longer qualifies.

Updated docs/release-candidate-contract.md sections 7.6 and 9.1/9.2 to
match. Added focused regression tests that fail against the prior
implementation and pass after the fix (116 of 116 total tests pass).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
gate package-binding gaps (issue #19 artifact-acceptance review)

Four bounded correctness fixes from a read-only artifact review of the
release tooling (findings F1-F4), each with a failing-before regression
test:

* release-browser.mjs phaseCheck/runDrillEngine/drill (F1): the phase
  `pass` boolean ignored the browser's own observed response hashes, so
  a browser that never actually executed the active package (stale
  cache, or a 304 in every phase) still gave PASS. Require status 200
  and a matching hash for every PHASE_CHECK_FILES entry in every phase,
  including rollback-reload; retain responseHashes, responseChecksPass,
  and userAgent per phase; bind drill.json to the two concrete packages
  it exercised with a new top-level `packages` field.

* release-candidate.mjs verify() (F2): verify() compiled app.wasm but
  never checked its exports, and never checked the canonical manifest's
  own identity fields, so an export-less WASM file and an
  unlabeled/misattributed manifest both passed. Check
  WebAssembly.Module.exports against REQUIRED_WASM_EXPORTS, validate
  schema/role/label/reference/source.repository/source.sha/abiVersion,
  and, when provenance.json is present, cross-check its
  canonicalManifestSha256 and assetSource.sha against the real package.

* release-candidate.mjs canonicalizeManifest rule 6 (F3): a null or
  unrecognized sourcePath silently skipped the source-bytes check
  instead of failing, so an asset with no real source binding could
  still pass. Use a fixed path map for the five copied assets and throw
  on a mismatched/missing sourcePath or missing/mismatched source bytes.

* release-candidate.mjs evaluateGate (F4): a gate record's drill
  evidence only carried an opaque sha256, so nothing bound a retained
  drill.json to the two packages the gate record claims. Require each
  retained drill's own recorded package identity
  (packages.baseline/candidate.canonicalManifestSha256) to match the
  record's own packages.baselineManifestSha256/candidateManifestSha256,
  plus a defense-in-depth baseline != candidate hash check.

Updated docs/release-candidate-contract.md sections 5.3, 5.6, 6.2, 9.2,
9.3, and 15 to match (Proposed contract, not an Accepted MADR).

Tests: node --test tests/release-candidate.test.mjs (138 incl. 19 new)
and tests/release-browser.test.mjs (new file, 3 tests) all pass; full
node --test tests/*.cjs tests/*.mjs: 357/357 pass (up from 335). Each
new regression was confirmed to fail against the pre-fix script via
`git stash` before the fix was restored. node --check on both scripts,
node scripts/check-docs.mjs, node scripts/check-actions.mjs, and
actionlint all pass.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…g-binding question (issue #19)

- evaluateGate now requires each retained drill's own
  packages.{baseline,candidate}.{role,label,sourceSha} to independently
  match the gate record's candidate/baseline identity (not only the
  canonicalManifestSha256 at the right key), rejecting a role swap or a
  contradicted label/sourceSha even when both hashes are individually
  correct (G1, Opus follow-up on 0c59538).
- Documents the already-landed verifyTagBinding/gate() tag-binding proof
  (F4(c)) and resolves release-candidate-contract.md section 15, open
  question 5, recording the chosen binding mechanism in section 14.

Verification (all run locally, no Docker, no push):
- node --test tests/release-candidate.test.mjs: 150 pass, 0 fail
  (was 145 pass / 5 fail with G1 temporarily reverted for reproduction)
- node --test tests/*.test.cjs: 65 pass, 0 fail
- node --check scripts/release-candidate.mjs, node --check js/gl.js
- cargo test --lib (rustup 1.99.1 toolchain): 10 pass
- cargo check --target wasm32-unknown-unknown --lib: ok
- Real starter build (not a synthetic fixture): ran the actual
  prepare --role baseline --reference bootstrap-reference against
  origin/master at 1364b6d, compiled a
  real consumer app.wasm via the real generator/build pipeline, and
  confirmed (independently of verify()) that all 7 required exports
  (memory, main, frame, crate_version, allocate_transfer_vec_u8,
  discard_transfer_vec_u8, mq_params_version) are present; verify
  passed on the resulting package. Scratch build directory removed
  after evidence capture.
- node scripts/check-docs.mjs: passed
- npm ci --ignore-scripts --no-audit --no-fund; npm run lint:js: clean
- actionlint: clean; all workflow uses: references are commit-SHA
  pinned (none on a branch or floating tag)

Not run (per explicit scope): npm run ci:local (Docker; third in the
Docker queue, no release-stage Docker run performed), any tag/publish
action. This commit is candidate work only; stable publication needs a
separate explicit approval. Per the latest priority change (WebGPU
replacement / whole-toolchain audit), no further release-candidate
qualification, packaging, Docker, PR, or push work follows this commit.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ned PipelineId rename (issue #19)

Verification: node scripts/check-docs.mjs passed;
node --test tests/release-candidate.test.mjs: 150 pass, 0 fail.
No tag, push, drill, or reference-profile run.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Merge origin/master 4009d20.
docs/glossary.md conflict: both sides added independent table rows;
kept all rows from both sides. docs/release.md: link the manual
compatibility matrix to the proposed platform support policy.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
github-actions Bot enabled auto-merge (squash) November 25, 2026 14:45
@github-actions
github-actions Bot merged commit 0ca1665 into master Nov 25, 2026
3 checks passed
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

0