[PR #124] [MERGED] feat(core): add typed policy and integrity contracts #1846

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

📋 Pull Request Information

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

Base: feat/mcp-identity-metadata ← Head: feat/integrity-permission-contracts


📝 Commits (4)

  • 6540d64 feat(core): add typed policy and integrity contracts
  • 009fa33 fix(workspace): migrate legacy integrity identities
  • d4e49c5 fix(ci): keep generated error docs with their owner
  • 97f5694 docs: generate typed error schema

📊 Changes

53 files changed (+4421 additions, -186 deletions)

View changed files

➕ docs/error-contract.schema.json (+831 -0)
➕ docs/mcp-contracts.md (+116 -0)
➕ scripts/generate-error-schema.mjs (+13 -0)
📝 src/application/AnalysisProvider.ts (+3 -1)
📝 src/application/ArtifactGraphConstruction.ts (+2 -1)
📝 src/application/ArtifactInventory.ts (+156 -23)
📝 src/application/AuthorizedArtifactInventory.ts (+9 -1)
📝 src/application/BinarySession.ts (+113 -0)
📝 src/application/BinarySessionPort.ts (+10 -0)
📝 src/application/CrossVersionInventory.ts (+20 -9)
📝 src/application/CrossVersionInvestigation.ts (+76 -2)
📝 src/application/DirectAnalysis.ts (+140 -10)
➕ src/application/PermissionAuthority.ts (+278 -0)
➕ src/application/PermissionConfiguration.ts (+52 -0)
📝 src/application/ProcessCaptureError.ts (+19 -0)
📝 src/application/ProcessCaptureLifecycle.ts (+3 -1)
📝 src/application/ProcessCli.ts (+32 -1)
📝 src/application/ProcessHarness.ts (+4 -1)
➕ src/application/ProgressReporter.ts (+55 -0)
➕ src/application/ProjectPermissionStore.ts (+145 -0)

...and 33 more files

📄 Description

Description

Add the provider-neutral core for typed operational errors, explicit integrity record-and-continue, reloadable scoped permission grants, progress reporting, and legacy workspace migration.

Integrity remains fail-closed by default. Continuation requires both operator policy and per-call approval, records contradictions, prevents equivalence claims, and preserves strict request identity across workspace reuse.

This is stack 2 of 3 and depends on the identity foundation PR.

Type of Change

  • Bug fix
  • New feature
  • Tool contract change (MCP schema modification)

Testing Performed

  • Unit tests added or updated
  • TypeScript typecheck passes
  • Build passes
  • Focused error, integrity, permission, workspace, and CLI tests pass
  • Real Hopper verification performed
  • Linux real Hopper verification performed

Real Hopper verification was unavailable in this environment. No provider-specific Hopper behavior changed.

Tool Contract Impact

Adds discriminated error schemas, permission remediation details, integrity contradiction fields, cancellation details, and generated error-contract documentation. No tool names are added or removed.

Relates to #100
Relates to #111
Relates to #112
Relates to #114
Relates to #98


🔄 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/124 **Author:** [@morluto](https://github.com/morluto) **Created:** 7/14/2026 **Status:** ✅ Merged **Merged:** 7/14/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `feat/mcp-identity-metadata` ← **Head:** `feat/integrity-permission-contracts` --- ### 📝 Commits (4) - [`6540d64`](https://github.com/morluto/rea/commit/6540d648487d4431863eacd7db63c44f65ffc2fa) feat(core): add typed policy and integrity contracts - [`009fa33`](https://github.com/morluto/rea/commit/009fa3311eccfb0835e05d0fc1840615496bb70d) fix(workspace): migrate legacy integrity identities - [`d4e49c5`](https://github.com/morluto/rea/commit/d4e49c5b7c818971da2f7ceb3cc5015c213ba5db) fix(ci): keep generated error docs with their owner - [`97f5694`](https://github.com/morluto/rea/commit/97f56943852251cc8e798c416a54c52adbfe79c1) docs: generate typed error schema ### 📊 Changes **53 files changed** (+4421 additions, -186 deletions) <details> <summary>View changed files</summary> ➕ `docs/error-contract.schema.json` (+831 -0) ➕ `docs/mcp-contracts.md` (+116 -0) ➕ `scripts/generate-error-schema.mjs` (+13 -0) 📝 `src/application/AnalysisProvider.ts` (+3 -1) 📝 `src/application/ArtifactGraphConstruction.ts` (+2 -1) 📝 `src/application/ArtifactInventory.ts` (+156 -23) 📝 `src/application/AuthorizedArtifactInventory.ts` (+9 -1) 📝 `src/application/BinarySession.ts` (+113 -0) 📝 `src/application/BinarySessionPort.ts` (+10 -0) 📝 `src/application/CrossVersionInventory.ts` (+20 -9) 📝 `src/application/CrossVersionInvestigation.ts` (+76 -2) 📝 `src/application/DirectAnalysis.ts` (+140 -10) ➕ `src/application/PermissionAuthority.ts` (+278 -0) ➕ `src/application/PermissionConfiguration.ts` (+52 -0) 📝 `src/application/ProcessCaptureError.ts` (+19 -0) 📝 `src/application/ProcessCaptureLifecycle.ts` (+3 -1) 📝 `src/application/ProcessCli.ts` (+32 -1) 📝 `src/application/ProcessHarness.ts` (+4 -1) ➕ `src/application/ProgressReporter.ts` (+55 -0) ➕ `src/application/ProjectPermissionStore.ts` (+145 -0) _...and 33 more files_ </details> ### 📄 Description ## Description Add the provider-neutral core for typed operational errors, explicit integrity record-and-continue, reloadable scoped permission grants, progress reporting, and legacy workspace migration. Integrity remains fail-closed by default. Continuation requires both operator policy and per-call approval, records contradictions, prevents equivalence claims, and preserves strict request identity across workspace reuse. This is stack 2 of 3 and depends on the identity foundation PR. ## Type of Change - [x] Bug fix - [x] New feature - [x] Tool contract change (MCP schema modification) ## Testing Performed - [x] Unit tests added or updated - [x] TypeScript typecheck passes - [x] Build passes - [x] Focused error, integrity, permission, workspace, and CLI tests pass - [ ] Real Hopper verification performed - [ ] Linux real Hopper verification performed Real Hopper verification was unavailable in this environment. No provider-specific Hopper behavior changed. ## Tool Contract Impact Adds discriminated error schemas, permission remediation details, integrity contradiction fields, cancellation details, and generated error-contract documentation. No tool names are added or removed. ## Related Issues Relates to #100 Relates to #111 Relates to #112 Relates to #114 Relates to #98 --- <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:44 +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#1846
No description provided.