Skip to content

fix(release): port three release-gate fixes to main so cuts stop re-inheriting them - #19945

Merged
brennanb2025 merged 5 commits into
mainfrom
brennanb2025/port-release-gate-fixes-to-main
Sep 11, 2026
Merged

brennanb2025 merged 5 commits into
mainfrom
brennanb2025/port-release-gate-fixes-to-main

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​86 $\color{#cf222e}{\Huge{\mathbf{−}}}$​6 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​80
Prod 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​33 $\color{#cf222e}{\Huge{\mathbf{−}}}$​16 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​17

Problem

Three release-gate fixes have been written on release branches and never merged back to main, so
every new cut re-inherits all three failures. This is the third recurrence:

When Commit Reached main?
v1.4.197 branch, Sep 3 35f1b0ebb9 "validate minified telemetry and prune target natives first" No
v1.4.199 branch, Sep 8 a883e17116 + d0bbe4475d (also duplicated as 6400598212) No
1.4.200 (today) re-picked again onto release/adhoc-1.4.200-daily-202609091829-cherrypicks —

The automated Daily Release Readiness Scan files it fresh every cut:
STA-7114 (v1.4.199) and
STA-7186 (09-10 daily) are the same bug, filed twice.

Release lineage is a side branch that never merges back, so a fix landed only there is lost by
construction. This PR lands all three on main once.

What's here

Three cherry-picks, -x so provenance is preserved. All authored by Neil; I only ported them.

  1. prune optional natives before the linux arch floor check (config/electron-builder.config.cjs)
    verifyLinuxGlibcFloor ran at line 288, but prunePackagedRuntimeNodeModules — which deletes the
    wrong-arch optional natives — runs at line 328. A cross-build still carries
    @parcel/watcher-linux-x64-glibc/watcher.node in the arm64 slice at check time, so the check throws
    on a file that was about to be deleted and was never going to ship. Linux arm64 packaging fails.
    Pure code motion: the check moves after the prune, with a comment recording the ordering constraint.

  2. restore the minified telemetry constant fallback (config/scripts/verify-telemetry-constants.mjs,
    telemetry-bundle-constant-patterns.mjs)
    Both regexes key off the literal BUILD_IDENTITY / WRITE_KEY identifiers, which oxc renames —
    minify: 'oxc' is pinned at electron.vite.config.ts:200,312. The identifier does not occur in the
    shipped bundle, so the verifier reports it missing with no fallback. Fails macOS, Windows and both
    Linux builds.
    Note this class is invisible to PR CI, which packages Linux and Windows only and
    never runs the asar verifier.

  3. stop asserting readdir order in the skill root walk test (src/main/skills/skill-root-file-walk.test.ts)
    The test asserted an exact array order. findSkillFiles emits in readdir order, and NTFS
    enumerates its filename index on the uppercased name, where LINK00 sorts before SKILL.MD. Windows
    returns the same two paths reversed. Asserts the contract instead of the order.

Verification

  • All three cherry-pick cleanly onto current main.
  • Each is already proven in production — this exact content shipped in v1.4.199.
  • Diff is 4 files, +44 / −20. No lockfile change, no dependency change.
  • Not run locally: the scratch worktree had no node_modules and I did not want a package-script
    run installing into a shared tree. CI covers skill-root-file-walk.test.ts; the other two files are
    packaging scripts exercised only by a real cut.

Why it matters

Until this lands, every future cut starts broken in the same three ways and someone re-discovers them
under release pressure. Landing it is what closes STA-7114 / STA-7186 for good rather than for one release.

The linux-arm64 release build failed packaging, and retried three times:

    [verify-linux-glibc-floor] 1 bundled native binary is built for the
    wrong architecture (target arm64):
      resources/node_modules/@parcel/watcher-linux-x64-glibc/watcher.node
      is x64, expected arm64 (from its own path)

`afterPack` ran `verifyLinuxGlibcFloor` at its top, before
`prunePackagedRuntimeNodeModules`. A cross-build intentionally installs
every optional native variant, so at that point the arm64 slice still
carries the x64 `@parcel/watcher` package that the prune exists to drop.
The check was reading a file that was never going to ship.

Move the floor check below the prune so it inspects the binaries actually
packed. Same ordering as 35f1b0e on the v1.4.197 release branch, which
shipped green and was never merged back to main.

(cherry picked from commit 6400598)
(cherry picked from commit a883e17)
The macOS, Windows, and both Linux release builds all failed on "Verify
telemetry constants present in app.asar", blocking publish-release:

    ::error::BUILD_IDENTITY constant missing or unexpected value in
    dist/mac-arm64/Orca.app/Contents/Resources/app.asar

The verifier printed no context sample, because the string
`BUILD_IDENTITY` does not occur anywhere in the shipped bundle at all.
#17527 added `minify: 'oxc'` to the main bundle, so oxc renames the
module-local `const BUILD_IDENTITY` to a short identifier.
`BUILD_IDENTITY_RE` keys off the literal name and therefore cannot match a
production bundle. `MINIFIED_TELEMETRY_RE` matches the adjacent injected
identity/key pair instead, which survives renaming.

#11019 created these patterns without that fallback, and its own comment
predicted this exact failure if minification were ever enabled on the main
bundle. The fallback was written on the v1.4.197 release branch in
35f1b0e and never merged back to main, so main has never been able to
verify a minified bundle.

Verified against a real local bundle built with the release env vars
(ORCA_BUILD_IDENTITY=stable, ORCA_POSTHOG_WRITE_KEY=phc_...): the bundle
does not contain "BUILD_IDENTITY"; both the narrowed and the widened
BUILD_IDENTITY_RE fail; MINIFIED_TELEMETRY_RE matches and recovers
identity=stable plus the write key.

(cherry picked from commit 39c3e44)
(cherry picked from commit d0bbe44)
The Windows skill-sharing release gate — which blocks publish-release —
failed on this test, wedging the 1.4.198 cut. The implementation is
correct; the assertion was not.

`findSkillFiles` pushes results in `readdir` order and dedupes visited
directories by realpath, so of the 32 junctions pointing at one target
exactly one survives. The assertion hardcoded both the array order and
which link won. `readdir` order is filesystem-dependent: APFS and ext4
return SKILL.md first, while NTFS enumerates its filename index
alphabetically on the uppercased name, where "LINK00" sorts before
"SKILL.MD" (L=0x4C < S=0x53). Windows therefore returned the same two
paths in the opposite order.

Assert the contract instead: the real file is present, exactly one
link-routed path survives dedup, and nothing else does.

(cherry picked from commit 9a832e9)
(cherry picked from commit 505b85c)
@coderabbitai

coderabbitai Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

Warning

Review limit reached

Next included review available in 4 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: b2005823-f7ac-4d60-8ba6-30217b0d1ceb

📥 Commits

Reviewing files that changed from the base of the PR and between 9d372d8 and b6f3af5.

📒 Files selected for processing (3)
  • config/scripts/electron-builder-runtime-resources.test.mjs
  • config/scripts/telemetry-bundle-constant-patterns.test.mjs
  • src/main/skills/skill-root-file-walk.test.ts

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 383b6704-a033-4cbe-93d9-448da2738f51

📥 Commits

Reviewing files that changed from the base of the PR and between 027acb4 and 9d372d8.

📒 Files selected for processing (4)
  • config/electron-builder.config.cjs
  • config/scripts/telemetry-bundle-constant-patterns.mjs
  • config/scripts/verify-telemetry-constants.mjs
  • src/main/skills/skill-root-file-walk.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 2 remain after this review.


📝 Walkthrough

Walkthrough

The Linux packaging hook now checks the pruned target-architecture binaries. Telemetry constant matching supports backtick literals and minified declarations. Telemetry verification uses fallback matches for renamed production constants. The skill-file walk test no longer depends on filesystem directory order.

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to 9d372

The packaging validation, telemetry verification fallback, and filesystem-independent test assertions have no remaining actionable merge risk.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description clearly explains the problem, three changes, affected platforms, linked issues, verification status, and testing limitations. It does not follow the template fully because it omits exp… Add the missing template sections. State N/A with a reason for Visual Proof because this is not a UI change. Complete the Agent skill upstream boundary and Checklist items, and include Review and Notes information. Preserve the existing pro…
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: porting three release-gate fixes to main to prevent repeated release failures.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 4 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description clearly explains the problem, three changes, affected platforms, linked issues, verification status, and testing limitations. It does not follow the template fully because it omits explicit ELI5, Visual Proof with N/A, Review, Agent skill upstream boundary, Notes, and Checklist sections.

Resolution

Add the missing template sections. State N/A with a reason for Visual Proof because this is not a UI change. Complete the Agent skill upstream boundary and Checklist items, and include Review and Notes information. Preserve the existing problem, change, issue, and verification details.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pullfrog pullfrog Bot 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.

ℹ️ One minor suggestion inline — the three fixes look correct and mergeable.

Reviewed changes

Three release-gate fixes cherry-picked from release branches onto main so future cuts stop re-inheriting them.

  • electron-builder.config.cjs — glibc floor check reordered after the prune. verifyLinuxGlibcFloor now runs after prunePackagedRuntimeNodeModules, so it no longer trips on wrong-arch @parcel/watcher natives that were about to be deleted. Verified the correct-arch node-pty pty.node still survives the prune, so the original #9902 glibc-floor protection is preserved.
  • telemetry-bundle-constant-patterns.mjs + verify-telemetry-constants.mjs — minified-constant fallback. Adds MINIFIED_TELEMETRY_RE and a ?? fallback because oxc renames BUILD_IDENTITY/WRITE_KEY in shipped bundles. Since TELEMETRY_ENABLED is true, this gate now enforces on macOS/Windows/Linux cuts.
  • skill-root-file-walk.test.ts — stop asserting readdir order. Asserts the dedup contract (real SKILL.md + exactly one collapsed link, total 2) instead of a fixed array, which is genuinely order-independent and can still fail if dedup regresses.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

export const BUILD_IDENTITY_RE = /\b(?:const|let|var)\s+BUILD_IDENTITY\s*=\s*["`](rc|stable)["`]/
export const WRITE_KEY_RE = /\b(?:const|let|var)\s+WRITE_KEY\s*=\s*["`](phc_[A-Za-z0-9_-]+)["`]/
export const MINIFIED_TELEMETRY_RE =
/\b(?:const|let|var)\s+[$\w]+\s*=\s*["'`](rc|stable)["'`][\s\S]{0,200}?[,$]\s*[$\w]+\s*=\s*["'`](phc_[A-Za-z0-9_-]+)["'`]/

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.

The $ inside [,$] is a literal dollar sign, not an end-of-line/string anchor, so it matches nothing for the comma-separated minified declaration the comment above describes (const n="rc",t="phc_..."). If it was meant to also cover a ;-separated statement form, it isn't doing that — consider dropping it or documenting why it's there, otherwise it reads as a delimiter that can never match.

@pullfrog pullfrog Bot 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.

ℹ️ No new issues in this delta — the two added tests correctly pin the ported fixes.

Reviewed changes

Since the prior pullfrog review (9d372d8), two test commits landed that pin the three release-gate fixes:

  • Pinned the prune-before-glibc-gate ordering with a test. Added prunes non-target native packages before the Linux glibc gate to config/scripts/electron-builder-runtime-resources.test.mjs, building a cross-built fixture whose non-target @parcel/watcher ELF carries a path-declared-arch vs e_machine mismatch so verifyLinuxGlibcFloor throws if it ever runs before the prune. The arch mapping is symmetric (x64↔arm64) and the assertion genuinely fails on revert.
  • Pinned the minified-telemetry fallback with a test. Added accepts minified adjacent declarations to config/scripts/telemetry-bundle-constant-patterns.test.mjs, asserting MINIFIED_TELEMETRY_RE matches the minifier's comma-separated const form.
  • Reformatted the skill-root walk assertion. Collapsed the dedup .toHaveLength(1) filter onto one line in src/main/skills/skill-root-file-walk.test.ts.

The single prior minor suggestion remains open and unaddressed (the dead $ in MINIFIED_TELEMETRY_RE's [,$] class), so this is a non-approving comment review rather than an approval; I'm not re-raising it here.

Pullfrog  | Fix it ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Review status: clean, and the PR changed as a result

Ran a multi-model review loop over this branch. It found a real defect in the PR — fixed below — and
added executable enforcement that was missing.

What changed during review

47b84eeae7 — restored a test the port had dropped. The original v1.4.197 fix 35f1b0ebb9 touched
four files, including the MINIFIED_TELEMETRY_RE unit case in
config/scripts/telemetry-bundle-constant-patterns.test.mjs. The v1.4.199 split commit this PR ported
(d0bbe4475d) carries only two — the test was lost in that lineage, and the first version of this PR
faithfully reproduced the loss. The restored file is byte-identical to the original.

47b84eeae7 — added an afterPack ordering regression test. The ordering constraint was previously
held by a code comment only, for a bug that has now been rediscovered three times. The new case in
config/scripts/electron-builder-runtime-resources.test.mjs places a wrong-architecture ELF under a
non-target @parcel/watcher-* directory with a stubbed objdump, and asserts afterPack succeeds only
because
the prune runs before the glibc gate.

This test ablates — verified twice, independently: with the check/prune order reverted it fails
(synthetic watcher.node reported as x64 instead of arm64), and passes once restored. A pin that passes
either way would be worse than none, since it implies protection that isn't there.

b6f3af52b2 — oxfmt formatting only, no logic change.

Verification

  • True diff (merge-base, not two-dot): 6 files, +119 / −22
  • 32 focused tests pass; oxlint and oxfmt clean; pnpm-lock.yaml untouched
  • Telemetry fallback validated against a real oxc-minified bundle, not by reading
  • All three ported commits confirmed patch-id-identical to their release-branch originals and ancestors
    of the shipped v1.4.199 tag
  • The arm64-only nature of the break was reproduced: declaredArchFromPath takes the first arch
    token in the absolute path, so dist/linux-arm64-unpacked/ shadows the package's own x64 token
  • Readiness checklist run at both ends of the session: 0 P0, 0 P1 both times

On precedent

"Prune, then verify" is the standard ordering for Electron packaging pipelines — validation belongs after
every step that mutates the packaged tree, because the shipping set is only known once pruning is done.
This change removes the scope mismatch rather than guarding it with an allowlist or exemption, and brings
the glibc gate in line with verifyPackagedMainRuntimeDeps, verifyPackagedNodePtyJobOwnership and
verifySkillsCliRuntime, which already ran post-prune. Regex-scanning a minified bundle after capturing
the renamed binding is an ordinary technique for this problem, not a workaround.

Known limitations, deliberately not addressed here

These are P2 follow-ups, out of scope for a port PR:

  1. The new ordering test passes through the verifier's zero-binaries success path, so it pins the
    order but would not catch the gate being removed entirely.
  2. verifyLinuxGlibcFloor logs OK on zero inspected binaries — more load-bearing now the check runs on a
    smaller post-prune set. Changing a verifier's failure semantics belongs in its own PR.
  3. MINIFIED_TELEMETRY_RE pins the minifier's declaration shape rather than the literal values
    (phc_…, stable), which a minifier never renames. It fails closed in all 14 drift shapes probed, so
    this is robustness, not correctness.
  4. The asar telemetry verifier still runs only in a release cut, not on the PR/build path. This is the
    underlying recurrence mechanism
    and this PR does not close it.

Why this matters beyond one release

Release lineage is a side branch that never merges back, so a fix landed only there is lost by
construction. The same three fixes were written on the v1.4.197 branch, again on the v1.4.199 branch, and
re-picked again for 1.4.200. Landing them on main with an executable pin is what makes cut #4 start clean.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Manual Electron validation — regression smoke only

Validated a dev build launched from this PR head (b6f3af52b2b356dad58c62ce66905952a94dd88c) in an isolated, off-screen Electron instance driven over CDP.

Read this first: these screenshots do not show the packaging fix working. This PR has zero renderer/UI changes, so the app's UI here is byte-identical to its base. The point of this pass is narrower: confirm the branch still builds and runs a healthy app, and that the skills surfaces touched by skill-root-file-walk are intact.

Instance identity (proof I drove my own instance)

{"name":"PR19945 QA","isDev":true,"devLabel":"pr19945qa",
 "devBranch":"brennanb2025/pr19945-electron-validation",
 "devWorktreeName":"pr19945-electron-validation",
 "devRepoRoot":"/Users/brennanbenson/orca/workspaces/orca/pr19945-electron-validation"}

Dedicated worktree, private user-data dir, private CDP port (9337) and renderer port (5177). The dev server returned 200 for a file in this worktree and 403 for a peer worktree, confirming the renderer served this checkout.

1. App boots and paints, no error dialog / whitescreen

01-app-boot.png

Fresh profile, so "No workspaces found" is expected.

2. Skills page enumerates correctly — 127 skills across 12 present sources

Opened through the real sidebar Skills button (not a direct route call).

02-skills-page.png

Facet counts are self-consistent: Home 34 + Workspace 45 + Bundled 6 + Plugin 42 = 127.

Main-process log, repeated across four separate scans:

[skills] scan roots=24 present=12 walked=24 skills=127 ms=626

walked=24 with present=12 means every configured root was visited and the 12 absent ones were cleanly recorded as skippedReason: "missing" rather than erroring.

3. Skill detail resolves a real SKILL.md path from the walk

03-skill-detail.png

The Path row is the resolved output of findSkillFiles.

4. Workspace-root walking works (repo-scoped roots)

04-skills-workspace-facet.png

45 results, all from repo roots inside the worktree. Cross-root de-duplication is also correct — skills present in .agents, .claude and .grok merge into one row carrying all three rootPaths.

Console / main-process errors

Renderer: 0 errors. Three warnings, all pre-existing dev-mode noise unrelated to this diff:

  • React DevTools install suggestion (info)
  • Tooltip is changing from uncontrolled to controlled. — from a vendored dep
  • [React Grab] v0.1.34 is outdated (latest: v0.2.0).

Main process: no errors. Two non-fatal notes:

  • MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 closed listeners added to [BrowserWindow]. MaxListeners is 10. — a warning, not an error. This PR touches no window or listener code, so it is not plausibly caused by this diff, but I did not run a base-build comparison to confirm it is pre-existing.
  • A Vite outside of Vite serving allow list line — self-inflicted by my own ownership probe, not a defect.

In-scope tests

npx vitest run --config config/vitest.config.ts \
  config/scripts/electron-builder-runtime-resources.test.mjs \
  config/scripts/telemetry-bundle-constant-patterns.test.mjs \
  src/main/skills/skill-root-file-walk.test.ts

Test Files  3 passed (3)
     Tests  32 passed (32)

All three files resolved and ran (non-zero count matching the filters). Worth noting: prunes non-target native packages before the Linux glibc gate passes, and its stdout shows [verify-linux-glibc-floor] OK running after the prune — that is the ordering this PR fixes, but it is unit-level evidence against a synthetic tree, not a real package.


What this does NOT prove

  • It does not prove the Linux glibc-floor ordering fix. That needs a real Linux arm64 electron-builder package run. Not done here, and a macOS dev build cannot show it. Dev-mode CDP is structurally blind to packaged-build behavior.
  • It does not prove the telemetry minified-bundle fallback. verify-telemetry-constants.mjs runs at package time in a release cut. I exercised it only through its unit tests, never against a real oxc-minified release bundle.
  • No packaging, signing, or release-cut path was executed at all.
  • No macOS/Windows packaged builds, no cross-platform run.
  • The MaxListenersExceededWarning is unattributed — I did not build the base ref to compare.
  • Skills coverage was discovery/enumeration/detail/filter only. I did not exercise install, share, delete, or update-run flows.

@brennanb2025
brennanb2025 merged commit 254a07b into main Sep 11, 2026
33 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.

2 participants