Skip to content

Instantly share code, notes, and snippets.

View DFRU's full-sized avatar
💭
I may be slow to respond.

DFRU

💭
I may be slow to respond.
View GitHub Profile
@DFRU
DFRU / sentinel-governance-injection.patch
Created April 9, 2026 03:31
Sentinel Governance injection into OpenClaw runtime — 4 surgical edits (SentinelGate, GCLM, lease validation, cron audit). Preserved before archiving aurelian-runtime.
diff --git a/src/agents/pi-embedded-runner/run.ts b/src/agents/pi-embedded-runner/run.ts
index 4d13eff..481f516 100644
--- a/src/agents/pi-embedded-runner/run.ts
+++ b/src/agents/pi-embedded-runner/run.ts
@@ -425,6 +425,32 @@ export async function runEmbeddedPiAgent(
// Hoisted so the retry-limit error path can use the most recent API total.
let lastTurnTotal: number | undefined;
while (true) {
+ // ── SENTINEL LEASE: Check authority before each iteration ──
+ try {