[PR #4337] [CLOSED] fix(domain): fail closed on conflicting reconstruction proofs and evaluate required claim surfaces #6181

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

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/4337
Author: @1aifanatic
Created: 10/16/2026
Status: ❌ Closed

Base: main ← Head: fix/4210-mixed-reference-endpoint-comparison


📝 Commits (2)

  • e3e3558 fix(domain): fail closed when a passing package proof conflicts with a failing one
  • c7cc8c6 fix(domain): evaluate authority routing, contradictions, and package proofs on required claim surfaces

📊 Changes

2 files changed (+275 additions, -13 deletions)

View changed files

📝 src/domain/reconstructionCoverage.test.ts (+243 -0)
📝 src/domain/reconstructionCoverageEvaluation.ts (+32 -13)

📄 Description

Summary

  • Problem:
    1. evaluateReconstructionPackageProofs (src/domain/reconstructionCoverageEvaluation.ts) checked proofs.find(status === "pass") before proofs.find(status === "fail"), allowing a passing proof on a required package proof kind to mask a conflicting failed proof for the same artifact and report status: "ready".
    2. evaluateReconstructionSurfaces, evaluateReconstructionCoverageRisks, and evaluateReconstructionPackageProofs (src/domain/reconstructionCoverageEvaluation.ts) evaluated surface ownership/authority routing (authority-routing-detected), active contradictions (active-contradiction), and required artifact digests only across boundary.required_surface_ids, ignoring surfaces covered by boundary.required_claim_ids.
  • Outcome:
    1. Required package proof kinds with any applicable failing proof emit package-proof-failed and evaluate to "failed" while retaining evidence_ids from both passing and failing proofs.
    2. Surface ownership/authority routing, active contradiction checks, and required artifact digests are evaluated across boundarySurfaceIds(context) (the union of boundary.required_surface_ids and surfaces covered by boundary.required_claim_ids).
  • Approach:
    • Filter applicable passing and failing proofs in evaluateReconstructionPackageProofs and prioritize failing.length > 0 before passing.length > 0, retaining evidence IDs from both sets.
    • Introduce boundarySurfaceIds(context) in src/domain/reconstructionCoverageEvaluation.ts as the single owner for a boundary's required surfaces across evaluateReconstructionSurfaces, evaluateReconstructionCoverageRisks, and evaluateReconstructionPackageProofs.
    • (Note: The previous reference-comparison commit for #4210 was dropped during rebase because #4210 was superseded on main by 92dadf933. Also note: PR #3802 touches reconstructionCoverageEvaluation.ts for transitive dependency inventory in #3354.)
  • Scope and authority impact: None; internal domain reconstruction-coverage evaluation fixes with no new capabilities or schema changes.
  • Linked issues: Closes #3889, Closes #3890, Closes #3937

Validation

  • Executed:
    • npm run test:local -- src/domain/reconstructionCoverage.test.ts
    • npm run check:fast
    • npm run format:check
  • Not run / unavailable:
    • Full npm run check:pr gate was not run locally.

Performance and Evidence impact

  • Not performance-sensitive: Linear-time set/array traversal over in-memory boundary surfaces and package proofs; Evidence schemas and token footprint are unchanged.

Author readiness

Leave these unchecked until a human owner has reviewed the diff and validation evidence and is ready to request initial maintainer review.

  • A human contributor reviewed the final diff and owns this pull request.
  • Validation entries above report only checks that actually ran, and unavailable coverage is explicit.
  • Scope, authority, and user-visible changes are accurately described.

Human owner:


🔄 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/4337 **Author:** [@1aifanatic](https://github.com/1aifanatic) **Created:** 10/16/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/4210-mixed-reference-endpoint-comparison` --- ### 📝 Commits (2) - [`e3e3558`](https://github.com/morluto/rea/commit/e3e3558aecefc2e4012700c46a0eb3212440b7b8) fix(domain): fail closed when a passing package proof conflicts with a failing one - [`c7cc8c6`](https://github.com/morluto/rea/commit/c7cc8c6e6a4dd30119a4b63f35bff13809632c97) fix(domain): evaluate authority routing, contradictions, and package proofs on required claim surfaces ### 📊 Changes **2 files changed** (+275 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `src/domain/reconstructionCoverage.test.ts` (+243 -0) 📝 `src/domain/reconstructionCoverageEvaluation.ts` (+32 -13) </details> ### 📄 Description ## Summary - Problem: 1. `evaluateReconstructionPackageProofs` (`src/domain/reconstructionCoverageEvaluation.ts`) checked `proofs.find(status === "pass")` before `proofs.find(status === "fail")`, allowing a passing proof on a required package proof kind to mask a conflicting failed proof for the same artifact and report `status: "ready"`. 2. `evaluateReconstructionSurfaces`, `evaluateReconstructionCoverageRisks`, and `evaluateReconstructionPackageProofs` (`src/domain/reconstructionCoverageEvaluation.ts`) evaluated surface ownership/authority routing (`authority-routing-detected`), active contradictions (`active-contradiction`), and required artifact digests only across `boundary.required_surface_ids`, ignoring surfaces covered by `boundary.required_claim_ids`. - Outcome: 1. Required package proof kinds with any applicable failing proof emit `package-proof-failed` and evaluate to `"failed"` while retaining `evidence_ids` from both passing and failing proofs. 2. Surface ownership/authority routing, active contradiction checks, and required artifact digests are evaluated across `boundarySurfaceIds(context)` (the union of `boundary.required_surface_ids` and surfaces covered by `boundary.required_claim_ids`). - Approach: - Filter applicable passing and failing proofs in `evaluateReconstructionPackageProofs` and prioritize `failing.length > 0` before `passing.length > 0`, retaining evidence IDs from both sets. - Introduce `boundarySurfaceIds(context)` in `src/domain/reconstructionCoverageEvaluation.ts` as the single owner for a boundary's required surfaces across `evaluateReconstructionSurfaces`, `evaluateReconstructionCoverageRisks`, and `evaluateReconstructionPackageProofs`. - *(Note: The previous reference-comparison commit for #4210 was dropped during rebase because #4210 was superseded on `main` by `92dadf933`. Also note: PR #3802 touches `reconstructionCoverageEvaluation.ts` for transitive dependency inventory in #3354.)* - Scope and authority impact: None; internal domain reconstruction-coverage evaluation fixes with no new capabilities or schema changes. - Linked issues: Closes #3889, Closes #3890, Closes #3937 ## Validation - Executed: - `npm run test:local -- src/domain/reconstructionCoverage.test.ts` - `npm run check:fast` - `npm run format:check` - Not run / unavailable: - Full `npm run check:pr` gate was not run locally. ## Performance and Evidence impact - Not performance-sensitive: Linear-time set/array traversal over in-memory boundary surfaces and package proofs; Evidence schemas and token footprint are unchanged. ## Author readiness Leave these unchecked until a human owner has reviewed the diff and validation evidence and is ready to request initial maintainer review. - [ ] A human contributor reviewed the final diff and owns this pull request. - [ ] Validation entries above report only checks that actually ran, and unavailable coverage is explicit. - [ ] Scope, authority, and user-visible changes are accurately described. Human owner: <!-- @GitHub-handle --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:12:30 +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#6181
No description provided.