[PR #7005] test(domain): kill surviving mutants in redactExplicitText #7567

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

📋 Pull Request Information

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

Base: main ← Head: test/redact-explicit-mutation-coverage


📝 Commits (1)

  • b99eccc test(domain): kill surviving mutants in redactExplicitText

📊 Changes

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

View changed files

📝 src/domain/explicitSensitiveValues.test.ts (+22 -0)

📄 Description

Summary

Adds focused unit tests for redactExplicitText so two behavior-changing mutants no longer survive: reversing the longest-literal-first order, and removing the fail-closed guard. 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 suite stays green when replacement order is reversed (shorter literals first) and when the final fail-closed check is removed. Expected: tests pin [REDACTED] replacement with surrounding text preserved, the fallback replacement (…, then empty) when a candidate contains a declared literal, longest-literal-first ordering, and fail-closed empty output when replacement re-forms a declared literal.

Change and scope

src/domain/explicitSensitiveValues.test.ts only (+22 lines, 5 cases). Each case maps to an existing branch of redactExplicitText. No source change, no new capability, no speculative edge cases.

Contract and boundary impact

  • Semantic owner and earliest changed stage: not applicable; redactExplicitText 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: 5 cases in src/domain/explicitSensitiveValues.test.ts
  • Base reproduction or other evidence: with the unchanged source and the original test file from main, two source mutants kept 6/6 green: reversed sort order, and removal of the fail-closed guard (return result). The original test does catch a return "" mutant (1 failed), so that is not a gap. With the new tests: reversed sort -> 1 fails; removed guard -> 1 fails; return "" -> 5 fail.
  • 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.

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/explicitSensitiveValues.test.ts --no-coverage — 11 passed (11)
  • 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/7005 **Author:** [@coskunulug](https://github.com/coskunulug) **Created:** 10/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `test/redact-explicit-mutation-coverage` --- ### 📝 Commits (1) - [`b99eccc`](https://github.com/morluto/rea/commit/b99ecccfa97ba2337fb9c8039845ec6278beb52b) test(domain): kill surviving mutants in redactExplicitText ### 📊 Changes **1 file changed** (+22 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/domain/explicitSensitiveValues.test.ts` (+22 -0) </details> ### 📄 Description ## Summary Adds focused unit tests for `redactExplicitText` so two behavior-changing mutants no longer survive: reversing the longest-literal-first order, and removing the fail-closed guard. 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 suite stays green when replacement order is reversed (shorter literals first) and when the final fail-closed check is removed. Expected: tests pin `[REDACTED]` replacement with surrounding text preserved, the fallback replacement (`…`, then empty) when a candidate contains a declared literal, longest-literal-first ordering, and fail-closed empty output when replacement re-forms a declared literal. ## Change and scope `src/domain/explicitSensitiveValues.test.ts` only (+22 lines, 5 cases). Each case maps to an existing branch of `redactExplicitText`. No source change, no new capability, no speculative edge cases. ## Contract and boundary impact - Semantic owner and earliest changed stage: not applicable; `redactExplicitText` 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: 5 cases in `src/domain/explicitSensitiveValues.test.ts` - Base reproduction or other evidence: with the unchanged source and the original test file from `main`, two source mutants kept 6/6 green: reversed sort order, and removal of the fail-closed guard (`return result`). The original test does catch a `return ""` mutant (1 failed), so that is not a gap. With the new tests: reversed sort -> 1 fails; removed guard -> 1 fails; `return ""` -> 5 fail. - 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`. 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/explicitSensitiveValues.test.ts --no-coverage` — 11 passed (11) - 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#7567
No description provided.