mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #5493] [MERGED] Read the staging catalog preview overlay behind a strict channel gate #6785
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#6785
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?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/5493
Author: @kolacheee
Created: 8/24/2026
Status: ✅ Merged
Merged: 8/24/2026
Merged by: @kolacheee
Base:
staging← Head:fix/5492-preview-catalog-overlay📝 Commits (2)
5cd8b7dfeat(agents): read the staging catalog preview overlay behind a strict channel gatefba2586fix(agents): keep preview provenance out of the downloaded catalog contract📊 Changes
5 files changed (+436 additions, -28 deletions)
View changed files
📝
CHANGELOG.md(+1 -0)📝
packages/server/src/services/capability-packages/package-manager.service.ts(+170 -27)📝
packages/shared/src/schemas/capability-package.schema.ts(+14 -0)📝
scripts/regressions/capability-package-lifecycle.regression.ts(+5 -1)➕
scripts/regressions/capability-preview-overlay.regression.ts(+246 -0)📄 Description
Linked issue
Closes #5492
Why this change
The Agents repository ships two tiers for holding a package back (Pasta-Devs/Marinara-Agents#410 / Pasta-Devs/Marinara-Agents#411).
INCOMPLETE_PACKAGE_IDSworks — those entries are dropped from every catalog at generation time.STAGING_ONLY_PACKAGE_IDSwas meant to mean "testers can install it, stable users cannot": those entries are cut from the published lanes and written to an overlay undercatalog/preview/instead.Nothing in the Engine had ever heard of that path, so a staging-only package was hidden from staging users too. The tier was inert, and a package author who wanted testers but not stable had no working option — they could expose a package to everyone or to nobody.
This cannot be fixed on the catalog side. Promotion is a wholesale
staging→mainbyte-copy merge, socatalog/preview/exists onmainand serves 200 there, with matching artifacts undermain/artifacts/. The containment guarantee has to live in the Engine: it must decline to construct that URL.What changed
A strict channel gate.
isPreviewCatalogChannel()is an exact match on thestagingbranch. It deliberately does not reuseresolveOfficialAgentBranch(), which is deny-list shaped — anything that is notmain,hotfix/*, or a release tag resolves to"staging", so a checkout on a branch namedmaster(whichstart.batitself treats as a mainline name) would have qualified. Being wrong there only hands someone a slightly newer package list; being wrong here shows unreleased packages to a stable user.A URL that does not exist off-channel.
resolvePreviewCatalogUrl()returnsnullunless the gate passes, so a stable Engine never holds an overlay URL that any later code path could fetch — rather than building one and filtering it downstream. It mirrors the published lane derivation exactly, including the fallback to the legacy alias for a non-release version string. An explicitMARINARA_AGENT_CATALOG_URLoverride also returnsnull: that override is the whole catalog, and synthesising a preview sibling for someone's fork would fetch a URL they never pointed us at.Merge semantics. Overlay entries are stamped
preview: trueand merged intocatalog(). The published lanes win on an id collision (the overlay copy is dropped with a warning rather than failing the catalog), and the combined list is re-sorted with a fixedencollator because the two documents are each sorted only within themselves and the client renders catalog order as-is.The migrations no longer see the overlay. This is the part that matters most.
migrateLegacyAvailabilityloops the entire catalog and callsinstallCatalogPackage(entry, true)on every entry — unattended, at startup, with activation on. Merging staging-only packages into it would have silently installed and activated every unfinished package on a tester's machine the first time they upgraded. It andmigrateExtractedNoodleAvailabilitynow passnullexplicitly, so they never even request the overlay.install(),pendingUpdates(), anddeclineUpdate()keep the default and do see preview entries, which is what lets a tester install one and then receive its updates.Failure is silent and non-fatal. A missing overlay is the normal steady state (
STAGING_ONLY_PACKAGE_IDScurrently ships empty), and raw.githubusercontent.com answers it with a404carryingContent-Type: text/plain. That, a non-404 error, a malformed document, and a thrown request all degrade to the published catalog.catalog()has no cache and no stale fallback, so anything propagating from here would blank the Agents browser and the update prompter for every package at once.Deliberately not included
isOfficialCatalogUrlaccepts a.../main/catalog/preview/...path (issue item 8). Nothing constructs that URL, and tightening it would change behaviour on theMARINARA_AGENT_CATALOG_URLoverride path for no live benefit, so it is left alone here. The real containment is that the URL is never built.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Automated results from this branch, for whoever picks up the checklist:
pnpm lintpasses (TypeScript--noEmiton shared and server, ESLint on client).pnpm buildpasses.pnpm impeccable:checkandpnpm localization:checkpass.node ./scripts/run-regressions.mjs --filter capability-preview-overlaypasses (new).node ./scripts/run-regressions.mjs --filter capability-package-lifecyclepasses.git diff --checkis clean.pnpm format:checkdoes NOT pass, and did not before this branch either. This Windows checkout hascore.autocrlf=truewhile Prettier defaults toendOfLine: "lf", so it reports all 1303packages/**/*.{ts,tsx}files, including files this branch never touches. Checked with--end-of-line auto, both files this PR edits underpackages/are clean. Please confirm on a LF checkout.Still needs a human at a real Engine:
catalog/preview/is made (server logs or a proxy).debug).migrateLegacyAvailability) does not auto-install a staging-only package on a staging Engine.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)A CHANGELOG entry is included under
[Unreleased] → Added. No user-facing doc underdocs/describes catalog channels today, so nothing there needed a matching edit and nodocs-i18nmirror is implied. No version-bearing file is touched.Summary by CodeRabbit
New Features
Bug Fixes
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.