mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #5492] Staging Engines should read the catalog preview overlay so staging-only packages reach testers #3052
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#3052
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @kolacheee on GitHub (Aug 24, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5492
Originally assigned to: @kolacheee on GitHub.
The catalog repo shipped a two-tier system for holding packages back (Marinara-Agents #410 / PR #411). The Engine half was always meant to be a separate PR here, and it has not been written yet — so one of the two tiers currently does nothing useful.
What works today and what doesn't
INCOMPLETE_PACKAGE_IDSworks fine: those packages are dropped from every catalog at generation time, so no Engine on any channel ever sees them. That is how Pixelforge is hidden right now, and I verified it is genuinely absent from all four published lanes on both branches.STAGING_ONLY_PACKAGE_IDSis meant to be "testers can install it, stable users can't." Those packages are cut from the published lanes and written to a preview overlay atcatalog/preview/v{major}/catalog.json(plus a legacy alias atcatalog/preview/catalog.json, mirroring the published layout). But nothing in the Engine has ever heard of that path —git grep -i preview packages/server/src/services/capability-packagesreturns nothing. So a staging-only package is hidden from staging users too, making the tier equivalent to the incomplete tier.Net effect: a package author who wants to ship to testers but not to stable has no working option. They either expose it to everyone or to nobody.
What needs to happen
A staging-channel Engine should fetch the overlay and merge it over the published catalog. A stable Engine must never request it.
Worth being explicit about why this cannot be solved on the catalog side: promotion is a wholesale
staging→mainbyte-copy merge, socatalog/preview/will exist onmain, and the matching artifacts will exist undermain/artifacts/. Both will return 200. Nothing server-side hides them. The entire containment guarantee is the Engine declining to construct that URL.Things that will bite whoever implements this
These came out of tracing the current code, and each one is a real hazard rather than a style preference.
1. The legacy auto-install migration will mass-install everything in the merged catalog. This is the big one.
migrateLegacyAvailability(packages/server/src/services/capability-packages/package-manager.service.ts:919-924) loops the entire catalog and callsinstallCatalogPackage(entry, true)on every entry, unattended, at startup, with activation on:If the overlay is merged into
catalog()without thought, every upgrading staging profile silently installs and activates every unfinished package. Preview entries need to be excluded from this path (and frommigrateExtractedNoodleAvailabilityjust below it) — or the merge has to happen somewhere narrower thancatalog().2. The channel classifier is deny-list shaped and will misfire.
resolveOfficialAgentBranch(:86-96) returnsmainonly for a falsy branch, literally"main",hotfix/*, or a canonicalvX.Y.Ztag — everything else returnsstaging. A checkout on a branch namedmasterresolves to staging, and the launchers explicitly treatmasteras a mainline name (start.batsetsALLOW_DETACHED_FALLBACKfor it). Reusing this function as the preview gate hands the overlay to anyone on an unusual branch name.For the existing use this is harmless — a stable-ish user getting the staging catalog just sees a slightly newer package list. For the preview gate it is a leak. The preview gate should be stricter: an exact match on
staging, ideally with the detached-HEAD ancestry probe thatgetUpdateChannelForCheckout(packages/server/src/routes/updates.routes.ts:186-191) already uses for the update channel. Note that one is async and module-private whileCATALOG_URLis a module-load constant, so this needs a small restructure rather than a drop-in call.3. Derive the overlay URL, do not string-patch it. The overlay URL should be produced by a function that returns
nullwhen the channel is not staging, so on a stable Engine there is no URL in existence to accidentally fetch. Please do not implement it by inserting/previewintoCATALOG_URL— that turns a channel bug into a leak. It also needs to mirror the published derivation exactly, including the non-release-version fallback to the legacy alias.4. A 404 is the normal steady state and must stay silent. With
STAGING_ONLY_PACKAGE_IDSempty (its current state), the overlay does not exist. I confirmed live that raw.githubusercontent.com answers those paths with404andContent-Type: text/plain; charset=utf-8. SincesafeFetchrejects a disallowed content type before the caller sees the status (packages/server/src/lib/security.ts:680-686), an overlay fetch that narrowsallowedContentTypestoapplication/jsonwill throw on every startup. The overlay fetch must catch, log at debug, and degrade to published-only — never propagate. Todaycatalog()is a single uncached fetch with no stale fallback, and any throw there 500s the Agents browser entirely.5. Carry the tier by file path, not by a new field. The shared catalog schema is
.strict()per entry, so adding a marker field to the published lane would break parsing on older installs.parseCapabilityCatalogWithCompat(added in #5091, present in 2.4.3) makes this per-entry tolerant on current releases, but installs at 2.4.2 and earlier still parse the whole array strictly. The Engine should mark an entry as preview-sourced based on which URL it came from.6. Artifact validation already works — do not "fix" it.
getOfficialAgentBranchFromCatalogUrl(:406-411) is a prefix test, so.../staging/catalog/preview/v2/catalog.jsoncorrectly resolves to branchstagingand the artifact assertion accepts.../staging/artifacts/{id}-{version}.zip. No change needed. The corollary for the catalog repo: staging-only artifacts must stay at the flatartifacts/root, since the URL rewrite would discard anartifacts/preview/...path.7. Merge semantics worth pinning down. Published-wins on an id collision (drop the overlay copy and warn, rather than rejecting the whole catalog); re-sort the merged list, since the client does not sort; keep the published
generatedAt.8.
isOfficialCatalogUrlaccepts a preview URL on main. The regex at:112matches/^\/Pasta-Devs\/Marinara-Agents\/(?:main|staging)\/catalog(?:\/|$)/u, which happily accepts.../main/catalog/preview/.... Not currently reachable, since nothing constructs that URL — but it means this function is not the thing protecting stable users, and it would stop being harmless if combined with aMARINARA_AGENT_CATALOG_URLoverride. Tightening it is cheap defense in depth.Try it yourself
Current behavior, no build needed:
404, because no package is marked staging-only yet. To see the gap, add any package id to
STAGING_ONLY_PACKAGE_IDSin the catalog repo'sscripts/catalog-incomplete.mjs, rebuild that package, and confirm it vanishes from Agents → Download Agents on a staging Engine as well as a stable one. That second disappearance is the bug.Suggested regression
The Engine has a
scripts/regressions/lane. A regression here should assert that a main-channel Engine never produces a preview URL (including formaster,release/*, and detached tag checkouts), that a staging Engine does, and that a 404 overlay degrades to the published catalog without throwing.Not urgent, but blocking a real request
Nothing is broken today — the tier is inert, and inertness is the safe direction. But contributors are already asking how to list a package for testers only, and right now the honest answer is that they cannot.
@kolacheee commented on GitHub (Aug 24, 2026):
Picked this up — draft PR #5493 (
fix/5492-preview-catalog-overlay→staging) is open so the board shows it in progress. Owner: @kolacheee.It implements the gate as an allow-list (exact
staging) rather than reusingresolveOfficialAgentBranch, excludes the two unattended startup migrations from the overlay, and degrades silently on a missing or broken overlay. Item 8 (isOfficialCatalogUrlaccepting a preview path) is deliberately left alone — reasoning in the PR description.Still needs manual verification on a real staging and a real stable Engine before it leaves draft.