[PR #983] [MERGED] perf(reconstruction): index coverage evaluation #2553

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

📋 Pull Request Information

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

Base: main ← Head: codex/reconstruction-coverage-pr


📝 Commits (1)

  • d2acab3 perf(reconstruction): index verifier coverage checks

📊 Changes

2 files changed (+259 additions, -40 deletions)

View changed files

📝 src/domain/reconstructionCoverage.test.ts (+163 -0)
📝 src/domain/reconstructionCoverageEvaluation.ts (+96 -40)

📄 Description

Large reconstruction closures currently rescan verifier contracts and results for every claim, repeatedly sort candidate results, and rebuild identity indexes per claim. This makes valid large coverage evaluations grow quadratically. The evaluator now indexes contracts by claim, selects each verifier's most recent result once while preserving stable tie behavior, and builds shared artifact/owner identity indexes once per evaluation. It preserves multiple-claim contracts, duplicate verifier ambiguity, failure reasons, missing results, and equal-timestamp ordering.

The paired profile exercises the shared ReconstructionCoverageService workflow used by CLI and MCP. It constructs and validates inputs outside the timed region, performs one warmup, then runs seven interleaved baseline/candidate pairs per workload. The baseline evaluator is from b5afa5f91eed9ae31d670aeab9bbf5112d790ec2; full canonical outputs and their SHA-256 hashes match for all cases. At 10,000 claims, medians were:

Case Baseline Candidate
Ready 820.2 ms 93.9 ms
Incomplete 783.4 ms 89.9 ms
Failed 828.7 ms 95.2 ms
Foreign evidence 950.0 ms 108.9 ms

The valid inputs, full result hashes, and per-round timings are retained in .cache/luna-application-wave3/reconstruction-coverage-paired.json locally. Workload dimensions cover 100, 1,000, 5,000, and 10,000 claims across all four cases.

Verification:

  • npm run test:local -- src/domain/reconstructionCoverage.test.ts
  • npm run test:focused -- tests/boundary/mcp/reconstructionCoverageMcp.test.ts
  • npm run check:fast -- --force
  • npm run check:ci -- --force

The checks passed. No provider-dependent claims are involved.


🔄 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/983 **Author:** [@morluto](https://github.com/morluto) **Created:** 10/7/2026 **Status:** ✅ Merged **Merged:** 10/7/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `codex/reconstruction-coverage-pr` --- ### 📝 Commits (1) - [`d2acab3`](https://github.com/morluto/rea/commit/d2acab3e90a0267be410472fb1b97a867f101c3e) perf(reconstruction): index verifier coverage checks ### 📊 Changes **2 files changed** (+259 additions, -40 deletions) <details> <summary>View changed files</summary> 📝 `src/domain/reconstructionCoverage.test.ts` (+163 -0) 📝 `src/domain/reconstructionCoverageEvaluation.ts` (+96 -40) </details> ### 📄 Description Large reconstruction closures currently rescan verifier contracts and results for every claim, repeatedly sort candidate results, and rebuild identity indexes per claim. This makes valid large coverage evaluations grow quadratically. The evaluator now indexes contracts by claim, selects each verifier's most recent result once while preserving stable tie behavior, and builds shared artifact/owner identity indexes once per evaluation. It preserves multiple-claim contracts, duplicate verifier ambiguity, failure reasons, missing results, and equal-timestamp ordering. The paired profile exercises the shared `ReconstructionCoverageService` workflow used by CLI and MCP. It constructs and validates inputs outside the timed region, performs one warmup, then runs seven interleaved baseline/candidate pairs per workload. The baseline evaluator is from `b5afa5f91eed9ae31d670aeab9bbf5112d790ec2`; full canonical outputs and their SHA-256 hashes match for all cases. At 10,000 claims, medians were: | Case | Baseline | Candidate | | --- | ---: | ---: | | Ready | 820.2 ms | 93.9 ms | | Incomplete | 783.4 ms | 89.9 ms | | Failed | 828.7 ms | 95.2 ms | | Foreign evidence | 950.0 ms | 108.9 ms | The valid inputs, full result hashes, and per-round timings are retained in `.cache/luna-application-wave3/reconstruction-coverage-paired.json` locally. Workload dimensions cover 100, 1,000, 5,000, and 10,000 claims across all four cases. Verification: - `npm run test:local -- src/domain/reconstructionCoverage.test.ts` - `npm run test:focused -- tests/boundary/mcp/reconstructionCoverageMcp.test.ts` - `npm run check:fast -- --force` - `npm run check:ci -- --force` The checks passed. No provider-dependent claims are involved. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-17 21:07:29 +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#2553
No description provided.