[PR #1116] [MERGED] fix(build): exclude the test-only generated catalog from packages #2661

Closed
opened 2026-10-17 21:08:46 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/1116
Author: @N0zoM1z0
Created: 10/8/2026
Status: ✅ Merged
Merged: 10/8/2026
Merged by: @morluto

Base: main ← Head: fix/build-exclude-generated-test-catalog


📝 Commits (1)

  • 21dcc71 fix(build): exclude the test-only generated catalog from packages

📊 Changes

3 files changed (+10 additions, -3 deletions)

View changed files

📝 scripts/generate-mcp-tool-catalog.mjs (+3 -3)
📝 scripts/verify-package-pack.mjs (+6 -0)
📝 tsconfig.build.json (+1 -0)

📄 Description

Summary

Fixes #1113. Production builds included an unused generated MCP schema-test module that could retain definitions from the previous build. Exclude that source from production compilation while continuing to generate and validate it for conformance tests.

The actual production server registers canonical contracts directly. This fixes unnecessary package contents and artifact drift; live discovery was already current.

Problem and expected behavior

Updating contracts with an existing generated catalog source allowed TypeScript compilation to emit an older catalog before regeneration. Since production does not import this module, packaging should omit it and preserve the useful source-level tests.

Change and scope

  • Exclude src/generatedMcpToolCatalog.ts from the production build.
  • Correct the generator comment to describe its test/conformance role.
  • Reject the test-only generated catalog in the actual package verifier.

Contract and boundary impact

  • Semantic owner and earliest changed stage: production compilation and tarball assembly.
  • CLI and MCP/tool-catalog contract: unchanged; all 138 current inputs/outputs and inventory verified on native Windows.
  • Provider, bridge, target-format, or platform compatibility: unchanged production modules.
  • Evidence, artifact, provenance, or reconstruction contract: unchanged.
  • Process execution, authorization, cleanup, or containment impact: no new authority or runtime behavior.
  • Generated metadata, package, or installation impact: generated test source remains available; the unused compiled module is omitted. No generated artifacts are committed.

Evidence and regression coverage

  • Tests updated: actual tarball verifier rejects either compiled or source forms of this test-only module.
  • Base reproduction: seeded older generated source, performed one cache-miss build, removed own build/generated outputs, and restored from a cache hit. Fresh test source was restored and the compiled test-only artifact stayed absent.
  • Same-source package comparison at ec6db0f0, with identical bundled Windows controls: only dist/generatedMcpToolCatalog.js was removed; every other packaged file is byte-identical.
  • Compressed REA tarball: 1,882,943 → 1,518,261 bytes (19.37% reduction).
  • Unpacked REA package contents: 12,973,435 → 6,300,110 bytes (51.44% reduction). Dependency sizes are outside this comparison.
  • Native Windows isolated offline install, actual stdio tools/list, canonical post-SDK schema comparison for every tool, session call and subsequent ping passed. Sampled family peak 619,282,432 bytes; host available memory stayed above 9.6 GB and disk reserve remained intact.
  • Remaining proof gaps: this unused module was never loaded by production; no runtime CPU/model-context improvement is claimed. Output-schema reference experiments remain separate follow-up work under #1065.

Validation performed

  • npm run build:cached: one old-source cache-miss build and a subsequent missing-output cache restoration passed.
  • npm run test:focused -- six exact schema, auxiliary-provider, contract-presentation and generated-skill files: 22 tests passed.
  • npm run check -- --concurrency=1: all six static tasks passed.
  • npm run docs:check: passed.
  • npm run verify:package: passed under two cores with a 300-second deadline; CLI/MCP, installation, update, setup backups/idempotency, generated skill and lifecycle checks passed. The earlier 90-second supervisor attempt was stopped by that local budget and is not counted as passing.
  • Native Windows isolated package install and full advertised input/output parity, session/ping checks: passed.

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: real native Windows package/transport verification performed. External Hopper/Ghidra engines were not invoked for this packaging-only change; their production files are byte-identical in the same-source package comparison. Complete real Notion/Obsidian verification for the base implementation is documented in #1112.
  • Package or release metadata impact: smaller package; no version edit.
  • Security, privacy, process, or containment review: no target execution, credential handling or authorization changes. Public evidence omits private paths. Unused worktrees and the aborted verifier workspace were removed after compact proofs were retained.

Review checklist

  • One focused outcome and conventional title.
  • Related issue linked and original consumer assumption corrected.
  • Observable build/cache/package behavior verified.
  • Generator documentation and actual package check updated.
  • Actual CLI/MCP package behavior verified.
  • Final diff checked for secrets, unrelated changes and unsupported claims.

🔄 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/1116 **Author:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Created:** 10/8/2026 **Status:** ✅ Merged **Merged:** 10/8/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/build-exclude-generated-test-catalog` --- ### 📝 Commits (1) - [`21dcc71`](https://github.com/morluto/rea/commit/21dcc71447b3be07e81dbd5bda5b177fb33c9a26) fix(build): exclude the test-only generated catalog from packages ### 📊 Changes **3 files changed** (+10 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `scripts/generate-mcp-tool-catalog.mjs` (+3 -3) 📝 `scripts/verify-package-pack.mjs` (+6 -0) 📝 `tsconfig.build.json` (+1 -0) </details> ### 📄 Description ## Summary Fixes #1113. Production builds included an unused generated MCP schema-test module that could retain definitions from the previous build. Exclude that source from production compilation while continuing to generate and validate it for conformance tests. The actual production server registers canonical contracts directly. This fixes unnecessary package contents and artifact drift; live discovery was already current. ## Problem and expected behavior Updating contracts with an existing generated catalog source allowed TypeScript compilation to emit an older catalog before regeneration. Since production does not import this module, packaging should omit it and preserve the useful source-level tests. ## Change and scope - Exclude `src/generatedMcpToolCatalog.ts` from the production build. - Correct the generator comment to describe its test/conformance role. - Reject the test-only generated catalog in the actual package verifier. ## Contract and boundary impact - Semantic owner and earliest changed stage: production compilation and tarball assembly. - CLI and MCP/tool-catalog contract: unchanged; all 138 current inputs/outputs and inventory verified on native Windows. - Provider, bridge, target-format, or platform compatibility: unchanged production modules. - Evidence, artifact, provenance, or reconstruction contract: unchanged. - Process execution, authorization, cleanup, or containment impact: no new authority or runtime behavior. - Generated metadata, package, or installation impact: generated test source remains available; the unused compiled module is omitted. No generated artifacts are committed. ## Evidence and regression coverage - Tests updated: actual tarball verifier rejects either compiled or source forms of this test-only module. - Base reproduction: seeded older generated source, performed one cache-miss build, removed own build/generated outputs, and restored from a cache hit. Fresh test source was restored and the compiled test-only artifact stayed absent. - Same-source package comparison at `ec6db0f0`, with identical bundled Windows controls: only `dist/generatedMcpToolCatalog.js` was removed; every other packaged file is byte-identical. - Compressed REA tarball: 1,882,943 → 1,518,261 bytes (19.37% reduction). - Unpacked REA package contents: 12,973,435 → 6,300,110 bytes (51.44% reduction). Dependency sizes are outside this comparison. - Native Windows isolated offline install, actual stdio `tools/list`, canonical post-SDK schema comparison for every tool, session call and subsequent ping passed. Sampled family peak 619,282,432 bytes; host available memory stayed above 9.6 GB and disk reserve remained intact. - Remaining proof gaps: this unused module was never loaded by production; no runtime CPU/model-context improvement is claimed. Output-schema reference experiments remain separate follow-up work under #1065. ## Validation performed - `npm run build:cached`: one old-source cache-miss build and a subsequent missing-output cache restoration passed. - `npm run test:focused --` six exact schema, auxiliary-provider, contract-presentation and generated-skill files: 22 tests passed. - `npm run check -- --concurrency=1`: all six static tasks passed. - `npm run docs:check`: passed. - `npm run verify:package`: passed under two cores with a 300-second deadline; CLI/MCP, installation, update, setup backups/idempotency, generated skill and lifecycle checks passed. The earlier 90-second supervisor attempt was stopped by that local budget and is not counted as passing. - Native Windows isolated package install and full advertised input/output parity, session/ping checks: passed. ## Compatibility, safety, and release - Breaking changes or migration steps: none. - Real Hopper/Ghidra, browser, or OS coverage: real native Windows package/transport verification performed. External Hopper/Ghidra engines were not invoked for this packaging-only change; their production files are byte-identical in the same-source package comparison. Complete real Notion/Obsidian verification for the base implementation is documented in #1112. - Package or release metadata impact: smaller package; no version edit. - Security, privacy, process, or containment review: no target execution, credential handling or authorization changes. Public evidence omits private paths. Unused worktrees and the aborted verifier workspace were removed after compact proofs were retained. ## Review checklist - [x] One focused outcome and conventional title. - [x] Related issue linked and original consumer assumption corrected. - [x] Observable build/cache/package behavior verified. - [x] Generator documentation and actual package check updated. - [x] Actual CLI/MCP package behavior verified. - [x] Final diff checked for secrets, unrelated changes and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-17 21:08:46 +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#2661
No description provided.