[PR #3649] [MERGED] Prevent capability package downgrades #6031

Closed
opened 2026-10-23 04:06:25 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/3649
Author: @thetopham
Created: 7/15/2026
Status: ✅ Merged
Merged: 7/15/2026
Merged by: @SpicyMarinara

Base: staging ← Head: agent/capability-version-direction-3648


📝 Commits (1)

  • a85c584 Prevent capability package downgrades

📊 Changes

4 files changed (+71 additions, -17 deletions)

View changed files

📝 packages/client/src/components/agents/AgentCatalogView.tsx (+15 -3)
📝 packages/server/src/services/capability-packages/package-manager.service.ts (+15 -14)
📝 packages/shared/src/schemas/capability-package.schema.ts (+32 -0)
📝 scripts/regressions/capability-package-lifecycle.regression.ts (+9 -0)

📄 Description

Linked issue

Closes #3648

Why this change

The Agent Catalog treated every installed/catalog version mismatch as an available update. A locally installed Hierarchical Maps 1.0.1 therefore appeared as Agent v1.0.0 with an Update button while the published catalog was still older. With privileged access, that action could select the 1.0.0 artifact and downgrade the working package.

What changed

  • Added shared capability-package version ordering, including prerelease precedence.
  • Made the installed version the primary detail label for installed packages.
  • Labeled a differing catalog version as available or older based on direction.
  • Showed Update only when the catalog version is newer than the installed version.
  • Rejected downgrade attempts in the server package manager before download and again before registry replacement.
  • Added focused version-ordering regression coverage.

Validation

Automated evidence:

  • pnpm regression:issues passed, including capability lifecycle and version-ordering cases.

  • pnpm check passed, including Impeccable context, TypeScript, ESLint, server build, client build, and PWA generation.

  • Live post-build restart kept Hierarchical Maps 1.0.1 active and ready with overall capability health ok.

  • The rebuilt Agent Catalog chunk containing the installed/catalog labels returned HTTP 200.

  • The production server build contains the downgrade refusal path.

  • pnpm check passes locally

  • Container (Docker / Podman) built and ran without issue

  • Ran the app, clicked through the changes manually

  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)

  • Above manual verification completed (describe below)

  • Read and followed CONTRIBUTING.md

Manual verification notes

  • Refresh the browser and verify Hierarchical Maps reads Installed v1.0.1 and Catalog v1.0.0 (older) with no Update button.
  • Verify an actually newer catalog package still shows Update.
  • Verify equal installed/catalog versions show one installed version label and no Update button.
  • Verify remote privileged package management still behaves normally for genuine upgrades.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

Small state-copy correction only. No layout, theme, or responsive structure changes.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/3649 **Author:** [@thetopham](https://github.com/thetopham) **Created:** 7/15/2026 **Status:** ✅ Merged **Merged:** 7/15/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `agent/capability-version-direction-3648` --- ### 📝 Commits (1) - [`a85c584`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a85c5843cfa41c2c78dcdc3a2372b80d155ae883) Prevent capability package downgrades ### 📊 Changes **4 files changed** (+71 additions, -17 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/agents/AgentCatalogView.tsx` (+15 -3) 📝 `packages/server/src/services/capability-packages/package-manager.service.ts` (+15 -14) 📝 `packages/shared/src/schemas/capability-package.schema.ts` (+32 -0) 📝 `scripts/regressions/capability-package-lifecycle.regression.ts` (+9 -0) </details> ### 📄 Description ## Linked issue Closes #3648 ## Why this change The Agent Catalog treated every installed/catalog version mismatch as an available update. A locally installed Hierarchical Maps 1.0.1 therefore appeared as `Agent v1.0.0` with an Update button while the published catalog was still older. With privileged access, that action could select the 1.0.0 artifact and downgrade the working package. ## What changed - Added shared capability-package version ordering, including prerelease precedence. - Made the installed version the primary detail label for installed packages. - Labeled a differing catalog version as available or older based on direction. - Showed Update only when the catalog version is newer than the installed version. - Rejected downgrade attempts in the server package manager before download and again before registry replacement. - Added focused version-ordering regression coverage. ## Validation Automated evidence: - `pnpm regression:issues` passed, including capability lifecycle and version-ordering cases. - `pnpm check` passed, including Impeccable context, TypeScript, ESLint, server build, client build, and PWA generation. - Live post-build restart kept Hierarchical Maps 1.0.1 active and ready with overall capability health `ok`. - The rebuilt Agent Catalog chunk containing the installed/catalog labels returned HTTP 200. - The production server build contains the downgrade refusal path. - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes - Refresh the browser and verify Hierarchical Maps reads `Installed v1.0.1` and `Catalog v1.0.0 (older)` with no Update button. - Verify an actually newer catalog package still shows Update. - Verify equal installed/catalog versions show one installed version label and no Update button. - Verify remote privileged package management still behaves normally for genuine upgrades. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) Small state-copy correction only. No layout, theme, or responsive structure changes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:06:25 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#6031
No description provided.