Skip to content

fix(ci): keep the catalog publish PR when main changes nothing it generates - #5372

Merged
miguel-heygen merged 4 commits into
mainfrom
fix/catalog-publish-keeps-approval
Oct 9, 2026
Merged

miguel-heygen merged 4 commits into
mainfrom
fix/catalog-publish-keeps-approval

Conversation

@miguel-heygen

@miguel-heygen miguel-heygen commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

What

The standing catalog publish PR keeps its approval when main moves without changing anything the catalog generates. Today it can only merge if a reviewer approves it and the merge queue takes it before the next push to main lands.

Also here: a seven-line comment copied across five motion-blur sources is cut to three lines. The publish PR carries it into the generated pages, and it is held there on comment length.

Why

publish-catalog.mjs decided whether the branch already held the right snapshot by comparing the branch's whole tree with "main plus generated catalog". Any push to main changes that tree, even one that touches no catalog source, so the bot force-pushed a new commit on every main push. With "approval of the most recent push" required, each rewrite dismissed the approval.

Two consecutive bot commits from this afternoon differ, among generated files, only in registry/catalog-artifact/local-vectors.bin. The embedding model's floats vary slightly between runs, which is why the drift check already compares vectors by direction rather than bytes.

How

  • The bot fetches the published branch and finds where it left main. It keeps the branch as is (no new commit, no force-push) only when all of these hold:
    • main has not changed any generated file since that point;
    • the branch carries nothing but generated files;
    • its generated files equal what this run generated. A modified *-vectors.bin still counts as equal when every row agrees within the drift check's cosine threshold.
  • Anything else republishes exactly as before.
  • The cosine rule moves to scripts/catalog-vectors.mjs, so the drift check and the publisher share one definition.
  • A kept PR's body names the main commit its snapshot was built on.

A kept branch sits on an older main. The merge queue does not require it to be up to date, and the first rule above means main changed nothing it would merge into.

Comment trim, the same three lines in each file: registry/blocks/gooey-split/gooey-split.html, registry/components/motion-blur/{motion-blur,demo}.html and registry/components/shutter-slam/{shutter-slam,demo}.html. Only comment lines change.

Verification

  • catalog-publication.test.mjs: the fixture now has a real origin holding the published branch. New tests:
    • an unrelated main push leaves the publication alone;
    • regenerated vectors nudged slightly keep it, and vectors that point elsewhere replace it;
    • vectors the publication lacks replace it;
    • a main commit to a generated file replaces it;
    • a publication carrying a non-generated file is replaced.
      21/21, three runs in a row.
  • Non-vacuous: removing each of the three keep conditions fails exactly the test for it, and the publisher from main fails the new tests.
  • catalog-drift.test.ts 4/4 after the move. Lint, format, typecheck and the fallow audit pass in pre-commit.

Not exercised: the workflow itself on GitHub. The fetch relies on the repository being public, since the checkout does not persist credentials.

…erates

The bot compared the whole branch tree with main, so every main push rewrote
the standing PR and dismissed its approval. It now compares only generated
catalog files, with search vectors judged by the drift check's cosine rule.
@miguel-heygen
miguel-heygen marked this pull request as ready for review October 9, 2026 21:32

@terencecho terencecho 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.

Reviewed d4038f6315487898dd924af9c920c65c0a4eecd1 against the actual merge-base 5ec2dd2e121f25b45f3cc642504757970ed41027.

Strengths

  • scripts/publish-catalog.mjs:255–293 preserves the standing branch only when main has no generated-path delta, the publication has no non-generated delta, and fresh generated contents agree. Metadata and non-vector artifacts remain byte-exact; added/deleted artifacts force replacement.
  • scripts/catalog-vectors.mjs:6–25 shares the existing row-direction tolerance with drift detection instead of adding a second equality policy. The five HTML changes are comment-only; removing full-line comments yields identical complete files.

Verification: checked-in publication/drift tests 25/25; independent real-Git publication scenarios 24/24 and drift cases 6/6; four consumed guard/equality mutants killed. Covered unrelated main changes, generated changes on main, extra source edits on the publication branch, payload/metadata changes, missing/deleted artifacts, vector direction/count/truncation/nonfinite cases, and fetch/main-advancement failures. Git history, fetches and tree comparisons were real local repositories; GitHub API responses were modeled, not live signed-commit writes. No full model regeneration or workspace build claimed.

Nonblocking hardening: scripts/catalog-vectors.mjs:14–25 ignores row magnitude. A deliberately rescaled standing vector with identical metadata can therefore survive the new preservation path, although search uses a raw dot product. A norm guard and regression pin would close that recovery gap. The supported producer normalizes rows, the current 388-row matrix is finite/unit-normalized, and no legitimate writer/reuse path producing the corruption was established; this is not a demonstrated normal-generation blocker.

CI: ten required contexts succeeded, including Windows Tests. Studio: edit accuracy gate was intentionally skipped: the exact-head change-detection job reports edit_accuracy=false with no matching files. Skipped is not an exercised test pass.

Verdict: APPROVE
Reasoning: The preservation guards retain equivalent generated output without bypassing source/artifact boundaries; independent negative cases and mutations support the contract. No merge-blocking regression was established on the supported generation path.

— tai

@miguel-heygen
miguel-heygen added this pull request to the merge queue Oct 9, 2026
Merged via the queue into main with commit 7b85b28 Oct 9, 2026
62 checks passed
@miguel-heygen
miguel-heygen deleted the fix/catalog-publish-keeps-approval branch October 9, 2026 22:32
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.

2 participants