[PR #229] [MERGED] fix(runtime): apply permission reloads atomically #1880

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

📋 Pull Request Information

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

Base: main ← Head: agent/reload-atomic


📝 Commits (2)

  • 3ae7109 fix(runtime): apply permission reloads atomically
  • 7e53dd6 fix(runtime): serialize permission reloads

📊 Changes

4 files changed (+428 additions, -66 deletions)

View changed files

📝 src/application/PermissionAuthority.ts (+40 -0)
📝 src/main.ts (+56 -66)
➕ tests/mainReload.test.ts (+253 -0)
📝 tests/permissionAuthority.test.ts (+79 -0)

📄 Description

Summary

  • read the proposed project permission store before mutating live authority
  • canonicalize every proposed ceiling and administrator/project grant into one candidate policy
  • validate all grants against the candidate ceilings
  • swap the live permission policy only after the complete candidate succeeds
  • update the remaining runtime configuration only after the permission transaction commits

The root cause was sequential live mutation during SIGHUP reload: a late project-grant failure could leave new ceilings and administrator grants active while every other runtime policy stayed old.

Verification

  • 7 focused permission-authority tests
  • npm run typecheck
  • npm run lint (pre-existing warnings only)
  • npm run format:check
  • npm run knip
  • diff check

This patch fixes partial commits within one reload. Ordering of separately overlapping SIGHUP callbacks remains a follow-up concern.


🔄 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/229 **Author:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Created:** 7/14/2026 **Status:** ✅ Merged **Merged:** 7/14/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `agent/reload-atomic` --- ### 📝 Commits (2) - [`3ae7109`](https://github.com/morluto/rea/commit/3ae7109faa29175e84ef695b296ad4db14097a37) fix(runtime): apply permission reloads atomically - [`7e53dd6`](https://github.com/morluto/rea/commit/7e53dd6ad321f9b75dbe458f9e116da7637d740c) fix(runtime): serialize permission reloads ### 📊 Changes **4 files changed** (+428 additions, -66 deletions) <details> <summary>View changed files</summary> 📝 `src/application/PermissionAuthority.ts` (+40 -0) 📝 `src/main.ts` (+56 -66) ➕ `tests/mainReload.test.ts` (+253 -0) 📝 `tests/permissionAuthority.test.ts` (+79 -0) </details> ### 📄 Description ## Summary - read the proposed project permission store before mutating live authority - canonicalize every proposed ceiling and administrator/project grant into one candidate policy - validate all grants against the candidate ceilings - swap the live permission policy only after the complete candidate succeeds - update the remaining runtime configuration only after the permission transaction commits The root cause was sequential live mutation during SIGHUP reload: a late project-grant failure could leave new ceilings and administrator grants active while every other runtime policy stayed old. ## Verification - 7 focused permission-authority tests - `npm run typecheck` - `npm run lint` (pre-existing warnings only) - `npm run format:check` - `npm run knip` - diff check This patch fixes partial commits within one reload. Ordering of separately overlapping SIGHUP callbacks remains a follow-up concern. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-16 21:12:07 +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#1880
No description provided.