[PR #7006] test(domain): pin artifactExpansionBudget constants and floor boundary #7570

Open
opened 2026-11-03 13:38:47 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/7006
Author: @coskunulug
Created: 10/24/2026
Status: 🔄 Open

Base: main ← Head: test/artifact-expansion-budget-boundaries


📝 Commits (1)

  • ee8a668 test(domain): pin artifactExpansionBudget constants and floor boundary

📊 Changes

1 file changed (+21 additions, -0 deletions)

View changed files

📝 src/domain/artifactExpansionBudget.test.ts (+21 -0)

📄 Description

Summary

Adds focused unit tests for artifactExpansionBudgetBytes so three source mutants no longer survive: a changed ARTIFACT_EXPANSION_RATIO, a changed 256 MiB floor, and removal of the Math.floor truncation. Test-only; source unchanged. AI-assisted (Claude Code); kept in draft until the human owner completes the readiness declarations.

Problem and expected behavior

The existing tests derive their expectations from the exported constants, so changing a constant's value changes the expectation with it. The floor-to-scaled crossover and fractional-size truncation are also unexercised. Expected: tests pin the documented ZIP policy values (ratio 500, 256 MiB floor), the crossover on both sides, and truncation of fractional archive sizes.

Change and scope

src/domain/artifactExpansionBudget.test.ts only (+21 lines, 3 cases added to the existing 2). Each case maps to an existing branch of the function. No source change, no new capability, no speculative edge cases.

Contract and boundary impact

  • Semantic owner and earliest changed stage: not applicable; artifactExpansionBudgetBytes is unchanged
  • Contribution scope fit and linked maintainer decision: ordinary test coverage within existing boundaries; maintainer scope decision not applicable
  • CLI and MCP/tool-catalog contract: none
  • Provider, bridge, target-format, or platform compatibility: not applicable
  • Evidence, artifact, provenance, or reconstruction contract: not applicable
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): not applicable
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact: none

Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible. This PR only adds unit tests for a pure function; it has no target interaction.

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

Executed locally (not on the CI-pinned toolchain).

  • Tests added or updated: 3 cases added in src/domain/artifactExpansionBudget.test.ts (5 total)
  • Base reproduction or other evidence: with the unchanged source and the original test file from main (2 tests), these mutants stayed green: ratio 500 -> 499, floor 256 -> 255 MiB, removal of Math.floor. With the new tests: ratio -> 499 fails 1; floor -> 255 MiB fails 1; Math.floor removal fails 1; Math.max -> Math.min fails 4.
  • User-visible CLI/MCP output (if applicable): not applicable
  • Remaining proof gaps: only this single test file was run; no full suite, typecheck, or lint. Local Node is v24.20.0 (below .nvmrc / engines ^24.22.1); dependencies were installed with --engine-strict=false --ignore-scripts. The tests pin the current policy values by design, so an intentional policy change will require updating them.

For evidence-bearing changes:

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

  • node_modules/.bin/vitest run src/domain/artifactExpansionBudget.test.ts --no-coverage — 5 passed (5)
  • The same command against the original test file with each mutant above — results as listed under Evidence
  • Not run: npm run check:fast, npm run check:pr, the full test suite

Compatibility, safety, and release

  • Breaking changes or migration steps: none
  • Real Hopper/Ghidra, browser, or OS coverage: not applicable (pure-function unit tests); run on Windows 11
  • Package or release metadata impact: none
  • Security, privacy, process, or containment review: tests only, no runtime change

Author readiness

Human owner:

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, 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/7006 **Author:** [@coskunulug](https://github.com/coskunulug) **Created:** 10/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `test/artifact-expansion-budget-boundaries` --- ### 📝 Commits (1) - [`ee8a668`](https://github.com/morluto/rea/commit/ee8a668bcca989fd354f51a9648db4d28f9146e2) test(domain): pin artifactExpansionBudget constants and floor boundary ### 📊 Changes **1 file changed** (+21 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/domain/artifactExpansionBudget.test.ts` (+21 -0) </details> ### 📄 Description ## Summary Adds focused unit tests for `artifactExpansionBudgetBytes` so three source mutants no longer survive: a changed `ARTIFACT_EXPANSION_RATIO`, a changed 256 MiB floor, and removal of the `Math.floor` truncation. Test-only; source unchanged. AI-assisted (Claude Code); kept in draft until the human owner completes the readiness declarations. ## Problem and expected behavior The existing tests derive their expectations from the exported constants, so changing a constant's value changes the expectation with it. The floor-to-scaled crossover and fractional-size truncation are also unexercised. Expected: tests pin the documented ZIP policy values (ratio 500, 256 MiB floor), the crossover on both sides, and truncation of fractional archive sizes. ## Change and scope `src/domain/artifactExpansionBudget.test.ts` only (+21 lines, 3 cases added to the existing 2). Each case maps to an existing branch of the function. No source change, no new capability, no speculative edge cases. ## Contract and boundary impact - Semantic owner and earliest changed stage: not applicable; `artifactExpansionBudgetBytes` is unchanged - Contribution scope fit and linked maintainer decision: ordinary test coverage within existing boundaries; maintainer scope decision not applicable - CLI and MCP/tool-catalog contract: none - Provider, bridge, target-format, or platform compatibility: not applicable - Evidence, artifact, provenance, or reconstruction contract: not applicable - Target selection, authority, upstream behavior, and cleanup details (if applicable): not applicable - Generated metadata (`docs/public/product-catalog.json`), package, or installation impact: none Expected effects (check known effects; use documentation-only on its own). Unchecked items do not establish absence; leave uncertainties visible. This PR only adds unit tests for a pure function; it has no target interaction. - [ ] Read existing files or captured data. - [ ] Launch or attach to a process. - [ ] Inject instrumentation or run scripts/code. - [ ] Change process memory, registers, files, or configuration. - [ ] Contact network services. - [ ] Recover protected code or work around protections. - [ ] Documentation or usability only; no target interaction. - [ ] Not sure yet; investigation or maintainer guidance needed. ## Evidence and regression coverage Executed locally (not on the CI-pinned toolchain). - Tests added or updated: 3 cases added in `src/domain/artifactExpansionBudget.test.ts` (5 total) - Base reproduction or other evidence: with the unchanged source and the original test file from `main` (2 tests), these mutants stayed green: ratio 500 -> 499, floor 256 -> 255 MiB, removal of `Math.floor`. With the new tests: ratio -> 499 fails 1; floor -> 255 MiB fails 1; `Math.floor` removal fails 1; `Math.max` -> `Math.min` fails 4. - User-visible CLI/MCP output (if applicable): not applicable - Remaining proof gaps: only this single test file was run; no full suite, typecheck, or lint. Local Node is v24.20.0 (below `.nvmrc` / engines `^24.22.1`); dependencies were installed with `--engine-strict=false --ignore-scripts`. The tests pin the current policy values by design, so an intentional policy change will require updating them. For evidence-bearing changes: - [ ] Observed, derived, and inferred claims remain distinguishable. - [ ] Artifact identity, source provenance, and failed attempts remain preserved. - [ ] Unsupported, incomplete, unavailable, or uncertain outcomes remain visible. ## Validation performed - `node_modules/.bin/vitest run src/domain/artifactExpansionBudget.test.ts --no-coverage` — 5 passed (5) - The same command against the original test file with each mutant above — results as listed under Evidence - Not run: `npm run check:fast`, `npm run check:pr`, the full test suite ## Compatibility, safety, and release - Breaking changes or migration steps: none - Real Hopper/Ghidra, browser, or OS coverage: not applicable (pure-function unit tests); run on Windows 11 - Package or release metadata impact: none - Security, privacy, process, or containment review: tests only, no runtime change ## Author readiness Human owner: <!-- @GitHub-handle --> - [ ] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [ ] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [ ] I declare this PR ready for initial maintainer review. ## Before merge - [ ] This PR addresses a concrete problem or an agreed enhancement. - [ ] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [ ] The PR has one focused outcome and the title follows `type(scope): outcome`. - [ ] Related issue is linked, or the reason for not linking one is stated above. - [ ] Tests cover changed observable behavior and meaningful failure paths. - [ ] Owning docs, contracts, and generated metadata are updated where needed. - [ ] User-visible CLI/MCP changes include representative output. - [ ] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#7570
No description provided.