[PR #1389] [MERGED] fix(rulesets): hold ruleset sizes to the Engine's Capability API 1.340 limits #1434

Closed
opened 2026-10-21 05:11:25 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Agents/pull/1389
Author: @kolacheee
Created: 10/14/2026
Status: ✅ Merged
Merged: 10/14/2026
Merged by: @kolacheee

Base: staging ← Head: fix/ruleset-size-limits-1340


📝 Commits (1)

  • 33320aa fix(rulesets): hold ruleset sizes to the Engine's Capability API 1.340 limits

📊 Changes

2 files changed (+106 additions, -10 deletions)

View changed files

📝 scripts/ruleset-package-checks.mjs (+39 -7)
📝 scripts/tests/ruleset-package.regression.mjs (+67 -3)

📄 Description

Pull request

Linked issue

Closes #1388

Why this change

  • Before: the catalog check refused any ruleset catalog over 1 MiB, even for a package that declares Capability API 1.340, where the Engine allows 2 MiB. Nothing checked the size of ruleset.json at all.
  • After: the checker uses the same limits the Engine applies at install. Packages declaring 1.340 or newer may ship a 512 KiB ruleset and 2 MiB catalogs; older ones keep 256 KiB and 1 MiB. When a file is over an older limit, the error says which Capability API raises it.

What changed

  • scripts/ruleset-package-checks.mjs:
    • Adds RULESET_MAX_BYTES / RULESET_EARLIER_MAX_BYTES and RULESET_CATALOG_MAX_BYTES / RULESET_CATALOG_EARLIER_MAX_BYTES, plus rulesetSizeLimits(manifest).
    • The package contract checks the size declared in manifest.files for ruleset.json and each catalogs/<id>.json, as the Engine does before reading. The catalog payload check uses the same limit.
  • scripts/tests/ruleset-package.regression.mjs covers:
    • the four limits pinned as literal sizes;
    • declared-size cases at both limits, below and from 1.340;
    • a 1 MiB+ catalog accepted once the package declares 1.340;
    • a catalog over 2 MiB still refused.
  • No package, catalog lane or artifact changes. ruleset-5e-2014 declares 1.46 and its largest catalog is about 780 KB, so it is unaffected.

Package and security impact

  • Affected package IDs: none (checker only)
  • Engine compatibility impact: mirrors Marinara-Engine Capability API 1.340 (Pasta-Devs/Marinara-Engine#7629)
  • New or changed permissions/entrypoints: none
  • Restart, storage, update, or uninstall impact: none

Validation

  • node scripts/validate-catalog.mjs passes locally
  • git diff --check passes locally
  • Rebuilt every affected manifest, payload, artifact, and catalog entry (none affected)
  • Installed or updated the affected package through Marinara Engine (no package changed)
  • Checked supported modes, restart behavior, and uninstall cleanup (not applicable)
  • Read and followed CONTRIBUTING.md

Manual verification notes

  • node scripts/tests/ruleset-package.regression.mjs passes. Before the fix, the existing 1 MiB padding case fails under the new expectations.
  • npm run check shows no errors and no new warnings in the changed files.

Documentation impact

  • No documentation changes needed

Generated by Claude Code

Summary by CodeRabbit

  • Package Validation
    • Packages declaring Capability API 1.340 or newer can include ruleset files up to 512 KiB and catalog files up to 2 MiB. Earlier API declarations retain limits of 256 KiB and 1 MiB.
    • Validation now checks the declared sizes of listed ruleset and catalog files, as well as catalog payload sizes, and reports the applicable limit when a file exceeds it.

🔄 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-Agents/pull/1389 **Author:** [@kolacheee](https://github.com/kolacheee) **Created:** 10/14/2026 **Status:** ✅ Merged **Merged:** 10/14/2026 **Merged by:** [@kolacheee](https://github.com/kolacheee) **Base:** `staging` ← **Head:** `fix/ruleset-size-limits-1340` --- ### 📝 Commits (1) - [`33320aa`](https://github.com/Pasta-Devs/Marinara-Agents/commit/33320aa924848cb134beecc4a29e9c1eefe64562) fix(rulesets): hold ruleset sizes to the Engine's Capability API 1.340 limits ### 📊 Changes **2 files changed** (+106 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `scripts/ruleset-package-checks.mjs` (+39 -7) 📝 `scripts/tests/ruleset-package.regression.mjs` (+67 -3) </details> ### 📄 Description # Pull request ## Linked issue Closes #1388 ## Why this change - Before: the catalog check refused any ruleset catalog over 1 MiB, even for a package that declares Capability API 1.340, where the Engine allows 2 MiB. Nothing checked the size of ruleset.json at all. - After: the checker uses the same limits the Engine applies at install. Packages declaring 1.340 or newer may ship a 512 KiB ruleset and 2 MiB catalogs; older ones keep 256 KiB and 1 MiB. When a file is over an older limit, the error says which Capability API raises it. ## What changed - `scripts/ruleset-package-checks.mjs`: - Adds `RULESET_MAX_BYTES` / `RULESET_EARLIER_MAX_BYTES` and `RULESET_CATALOG_MAX_BYTES` / `RULESET_CATALOG_EARLIER_MAX_BYTES`, plus `rulesetSizeLimits(manifest)`. - The package contract checks the size declared in `manifest.files` for ruleset.json and each `catalogs/<id>.json`, as the Engine does before reading. The catalog payload check uses the same limit. - `scripts/tests/ruleset-package.regression.mjs` covers: - the four limits pinned as literal sizes; - declared-size cases at both limits, below and from 1.340; - a 1 MiB+ catalog accepted once the package declares 1.340; - a catalog over 2 MiB still refused. - No package, catalog lane or artifact changes. `ruleset-5e-2014` declares 1.46 and its largest catalog is about 780 KB, so it is unaffected. ## Package and security impact - Affected package IDs: none (checker only) - Engine compatibility impact: mirrors Marinara-Engine Capability API 1.340 (Pasta-Devs/Marinara-Engine#7629) - New or changed permissions/entrypoints: none - Restart, storage, update, or uninstall impact: none ## Validation - [x] `node scripts/validate-catalog.mjs` passes locally - [x] `git diff --check` passes locally - [ ] Rebuilt every affected manifest, payload, artifact, and catalog entry (none affected) - [ ] Installed or updated the affected package through Marinara Engine (no package changed) - [ ] Checked supported modes, restart behavior, and uninstall cleanup (not applicable) - [x] Read and followed `CONTRIBUTING.md` ### Manual verification notes - `node scripts/tests/ruleset-package.regression.mjs` passes. Before the fix, the existing 1 MiB padding case fails under the new expectations. - `npm run check` shows no errors and no new warnings in the changed files. ## Documentation impact - [x] No documentation changes needed --- _Generated by [Claude Code](https://claude.ai/code/session_01RfaPewYEVNZXyuB3Lc73Aj)_ <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Package Validation** * Packages declaring Capability API 1.340 or newer can include ruleset files up to 512 KiB and catalog files up to 2 MiB. Earlier API declarations retain limits of 256 KiB and 1 MiB. * Validation now checks the declared sizes of listed ruleset and catalog files, as well as catalog payload sizes, and reports the applicable limit when a file exceeds it. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-21 05:11: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-Agents#1434
No description provided.