[PR #206] [MERGED] fix: resolve validation and artifact edge cases #1857

Closed
opened 2026-10-16 21:11:51 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: agent/fix-domain-edge-cases


📝 Commits (1)

  • ef7f2f9 fix: resolve validation and artifact edge cases

📊 Changes

9 files changed (+138 additions, -67 deletions)

View changed files

📝 src/application/ArtifactGraphConstruction.ts (+1 -1)
📝 src/application/BoundedJsonFiles.ts (+4 -31)
📝 src/application/InvestigationWorkspaceStore.ts (+2 -29)
➕ src/domain/jsonLimits.ts (+35 -0)
📝 src/domain/permissionPolicy.ts (+1 -4)
📝 tests/artifactProvider.test.ts (+2 -2)
📝 tests/investigationWorkspace.test.ts (+21 -0)
➕ tests/jsonLimits.test.ts (+36 -0)
📝 tests/permissionPolicy.test.ts (+36 -0)

📄 Description

Summary

  • report grant_required when same-capability revoked grants do not cover the requested scope
  • share one pure bounded-JSON traversal across evidence and investigation workspace readers
  • infer source-map parent edges case-insensitively for mixed-case .map suffixes
  • add regression coverage for permission reasons, nested JSON limits, both read paths, and mixed-case source maps

Root cause and impact

Permission denial classification used the existence of any same-capability grant, even when its scope did not cover the request. Evidence and workspace readers maintained duplicate JSON limit walkers that could drift. Artifact edge construction classified source maps case-insensitively but used a case-sensitive suffix check when resolving their mapped source.

These changes keep remediation actionable, make JSON policy enforcement consistent, and preserve correct source-map parentage across extension casing.

Verification

  • npm run check — 87 files, 589 tests
  • npm run knip
  • npm run jscpd — 0.92% duplicated lines
  • npm run scan:todos
  • targeted permission, JSON-limit, evidence, workspace, and artifact tests

Real Hopper verification was not performed; the changes are pure policy/validation and artifact graph behavior covered by unit and adapter tests.

Closes #188
Closes #193
Closes #195


🔄 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/206 **Author:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Created:** 7/14/2026 **Status:** ✅ Merged **Merged:** 7/14/2026 **Merged by:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Base:** `main` ← **Head:** `agent/fix-domain-edge-cases` --- ### 📝 Commits (1) - [`ef7f2f9`](https://github.com/morluto/rea/commit/ef7f2f93747f0a4d9f70c9fc2e252456d20843f3) fix: resolve validation and artifact edge cases ### 📊 Changes **9 files changed** (+138 additions, -67 deletions) <details> <summary>View changed files</summary> 📝 `src/application/ArtifactGraphConstruction.ts` (+1 -1) 📝 `src/application/BoundedJsonFiles.ts` (+4 -31) 📝 `src/application/InvestigationWorkspaceStore.ts` (+2 -29) ➕ `src/domain/jsonLimits.ts` (+35 -0) 📝 `src/domain/permissionPolicy.ts` (+1 -4) 📝 `tests/artifactProvider.test.ts` (+2 -2) 📝 `tests/investigationWorkspace.test.ts` (+21 -0) ➕ `tests/jsonLimits.test.ts` (+36 -0) 📝 `tests/permissionPolicy.test.ts` (+36 -0) </details> ### 📄 Description ## Summary - report `grant_required` when same-capability revoked grants do not cover the requested scope - share one pure bounded-JSON traversal across evidence and investigation workspace readers - infer source-map parent edges case-insensitively for mixed-case `.map` suffixes - add regression coverage for permission reasons, nested JSON limits, both read paths, and mixed-case source maps ## Root cause and impact Permission denial classification used the existence of any same-capability grant, even when its scope did not cover the request. Evidence and workspace readers maintained duplicate JSON limit walkers that could drift. Artifact edge construction classified source maps case-insensitively but used a case-sensitive suffix check when resolving their mapped source. These changes keep remediation actionable, make JSON policy enforcement consistent, and preserve correct source-map parentage across extension casing. ## Verification - `npm run check` — 87 files, 589 tests - `npm run knip` - `npm run jscpd` — 0.92% duplicated lines - `npm run scan:todos` - targeted permission, JSON-limit, evidence, workspace, and artifact tests Real Hopper verification was not performed; the changes are pure policy/validation and artifact graph behavior covered by unit and adapter tests. Closes #188 Closes #193 Closes #195 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-16 21:11:51 +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#1857
No description provided.