Repository navigation
fix(ci): keep the catalog publish PR when main changes nothing it generates - #5372
Conversation
…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.
terencecho
left a comment
There was a problem hiding this comment.
Reviewed d4038f6315487898dd924af9c920c65c0a4eecd1 against the actual merge-base 5ec2dd2e121f25b45f3cc642504757970ed41027.
Strengths
scripts/publish-catalog.mjs:255–293preserves 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–25shares 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
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.mjsdecided 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
*-vectors.binstill counts as equal when every row agrees within the drift check's cosine threshold.scripts/catalog-vectors.mjs, so the drift check and the publisher share one definition.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}.htmlandregistry/components/shutter-slam/{shutter-slam,demo}.html. Only comment lines change.Verification
catalog-publication.test.mjs: the fixture now has a realoriginholding the published branch. New tests:21/21, three runs in a row.
catalog-drift.test.ts4/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.