[PR #2936] [MERGED] fix(package-verifier): reject overview responses without a procedure count #5502

Closed
opened 2026-10-31 01:07:09 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/2936
Author: @CodeAlex52
Created: 10/13/2026
Status: ✅ Merged
Merged: 10/13/2026
Merged by: @morluto

Base: main ← Head: fix/package-platform-overview-count


📝 Commits (2)

  • c7f55df fix(package-verifier): reject overview responses without a procedure count
  • 23f2500 test(package-verifier): cover malformed overview receipts

📊 Changes

3 files changed (+96 additions, -16 deletions)

View changed files

📝 scripts/verify-package-platform.d.mts (+6 -0)
📝 scripts/verify-package-platform.mjs (+29 -15)
📝 tests/evaluation/package/packagePlatformDiagnostics.test.ts (+61 -1)

📄 Description

Summary

Fixes #2518.

The packaged platform smoke check now rejects an analyze or inspect response whose binary_overview result is missing or null, instead of reporting a false success.

Problem and expected behavior

scripts/verify-package-platform.mjs:17-18,27-28 compared normalized_result?.procedure_count < 1. An absent or null normalized_result makes that comparison false in JavaScript, so a malformed overview passed the check.

Expected (per the issue's restoration check): a response with the expected operation and a positive procedure count passes; a response without the result, with normalized_result: null, with a zero count, or with a wrong operation is rejected.

Change and scope

scripts/verify-package-platform.mjs: both overview checks now require Number.isInteger(normalized_result?.procedure_count) before the existing positive-count comparison. The positive-count, wrong-operation and other lane assertions are unchanged.

Verification

I ran a fixture-driven harness against the modified script (the issue's fixture CLI, with the assertion executed from the exported production verifier):

positive control: accepted ✓
analyze/missing: rejected ✓      analyze/null: rejected ✓
analyze: zero-count and wrong-operation rejected ✓
inspect/missing: rejected ✓      inspect/null: rejected ✓
inspect: zero-count and wrong-operation rejected ✓
ALL EXPECTATIONS MET

As a control, the same harness against the unmodified script fails at analyze/missing with AssertionError: Missing expected rejection, which is the reported false acceptance. The harness stubs scripts/lib/verify-package-core.mjs's run/runWithStatus/json helpers with equivalent implementations (the original module additionally validates schemas with Ajv); the code under test is the unmodified verifier. I did not run the packaged platform lane or the repository's static checks here.


🔄 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/morluto/rea/pull/2936 **Author:** [@CodeAlex52](https://github.com/CodeAlex52) **Created:** 10/13/2026 **Status:** ✅ Merged **Merged:** 10/13/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/package-platform-overview-count` --- ### 📝 Commits (2) - [`c7f55df`](https://github.com/morluto/rea/commit/c7f55df340b4eb7e1550d952f594fe49ada45c1b) fix(package-verifier): reject overview responses without a procedure count - [`23f2500`](https://github.com/morluto/rea/commit/23f25001be12e54f370fad70ef69c11e0b4b063f) test(package-verifier): cover malformed overview receipts ### 📊 Changes **3 files changed** (+96 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `scripts/verify-package-platform.d.mts` (+6 -0) 📝 `scripts/verify-package-platform.mjs` (+29 -15) 📝 `tests/evaluation/package/packagePlatformDiagnostics.test.ts` (+61 -1) </details> ### 📄 Description ## Summary Fixes #2518. The packaged platform smoke check now rejects an `analyze` or `inspect` response whose `binary_overview` result is missing or null, instead of reporting a false success. ## Problem and expected behavior `scripts/verify-package-platform.mjs:17-18,27-28` compared `normalized_result?.procedure_count < 1`. An absent or null `normalized_result` makes that comparison `false` in JavaScript, so a malformed overview passed the check. Expected (per the issue's restoration check): a response with the expected operation and a positive procedure count passes; a response without the result, with `normalized_result: null`, with a zero count, or with a wrong operation is rejected. ## Change and scope `scripts/verify-package-platform.mjs`: both overview checks now require `Number.isInteger(normalized_result?.procedure_count)` before the existing positive-count comparison. The positive-count, wrong-operation and other lane assertions are unchanged. ## Verification I ran a fixture-driven harness against the modified script (the issue's fixture CLI, with the assertion executed from the exported production verifier): ```text positive control: accepted ✓ analyze/missing: rejected ✓ analyze/null: rejected ✓ analyze: zero-count and wrong-operation rejected ✓ inspect/missing: rejected ✓ inspect/null: rejected ✓ inspect: zero-count and wrong-operation rejected ✓ ALL EXPECTATIONS MET ``` As a control, the same harness against the unmodified script fails at `analyze/missing` with `AssertionError: Missing expected rejection`, which is the reported false acceptance. The harness stubs `scripts/lib/verify-package-core.mjs`'s `run`/`runWithStatus`/`json` helpers with equivalent implementations (the original module additionally validates schemas with Ajv); the code under test is the unmodified verifier. I did not run the packaged platform lane or the repository's static checks here. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:07:09 +00: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
morluto/rea#5502
No description provided.