@ouro.bot/cli 0.1.0-alpha.1020 → 0.1.0-alpha.1023

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/changelog.json CHANGED
@@ -1,6 +1,12 @@
1
1
  {
2
2
  "_note": "This changelog is maintained as part of the PR/version-bump workflow. Agent-curated, not auto-generated. Agents read this file directly via read_file to understand what changed between versions.",
3
3
  "versions": [
4
+ {
5
+ "version": "0.1.0-alpha.1023",
6
+ "changes": [
7
+ "Habits run again. The private runtime policy allows a habit wake that carries verified daemon provenance (habit, matching habit-trigger and habit-occurrence refs, and the habit scheduler, habit.poke or habit.probe as source), where before every habit fire was denied as default policy deny. A denied private-turn decision no longer reserves its idempotency key, so a habit whose first attempt was denied, and then retried after a provider credential revision change, runs on its next fire instead of failing forever with idempotency-key fingerprint mismatch."
8
+ ]
9
+ },
4
10
  {
5
11
  "version": "0.1.0-alpha.1020",
6
12
  "changes": [
@@ -1,5 +1,5 @@
1
1
  {
2
- "runtimeVersion": "0.1.0-alpha.1020",
2
+ "runtimeVersion": "0.1.0-alpha.1023",
3
3
  "bundleSchemaVersion": 3,
4
4
  "lastUpdated": "2026-09-03T00:00:00.000Z"
5
5
  }
@@ -1,7 +1,7 @@
1
1
  <?xml version="1.0"?>
2
2
  <Container version="2">
3
3
  <Name>ouro-butler</Name>
4
- <Repository>ghcr.io/ourostack/ouroboros-butler:0.1.0-alpha.1020</Repository>
4
+ <Repository>ghcr.io/ourostack/ouroboros-butler:0.1.0-alpha.1023</Repository>
5
5
  <Registry>https://github.com/ourostack/ouroboros/pkgs/container/ouroboros-butler</Registry>
6
6
  <Network>host</Network>
7
7
  <Shell>sh</Shell>
@@ -180,34 +180,25 @@ function recordPrivateTurnDecision(decision, deps = {}) {
180
180
  };
181
181
  try {
182
182
  const matchingRows = readRows(ledgerPath).filter((row) => row.idempotencyKey === candidate.idempotencyKey);
183
- const anchor = matchingRows[0];
184
- if (anchor) {
185
- if (anchor.requestFingerprint !== candidate.requestFingerprint) {
186
- const mismatch = mismatchDecision(candidate, anchor);
187
- const writtenMismatch = writeRow(ledgerPath, mismatch);
188
- emitDecisionRecorded(deps, { level: "warn", decision: writtenMismatch });
189
- return writtenMismatch;
190
- }
191
- const priorExecutable = matchingRows.find((row) => row.requestFingerprint === candidate.requestFingerprint && row.executable);
192
- if (priorExecutable && candidate.executable) {
193
- return duplicateDecision(priorExecutable);
194
- }
195
- const latestSameFingerprint = [...matchingRows].reverse().find((row) => row.requestFingerprint === candidate.requestFingerprint);
196
- if (latestSameFingerprint
197
- && latestSameFingerprint.result === candidate.result
198
- && latestSameFingerprint.executable === candidate.executable
199
- && latestSameFingerprint.deniedReason === candidate.deniedReason
200
- && latestSameFingerprint.denialCode === candidate.denialCode) {
201
- return latestSameFingerprint;
202
- }
203
- if (priorExecutable && !candidate.executable) {
204
- const written = writeRow(ledgerPath, candidate);
205
- emitDecisionRecorded(deps, { level: "warn", decision: written });
206
- return written;
207
- }
208
- const written = writeRow(ledgerPath, candidate);
209
- emitDecisionRecorded(deps, { level: written.result === "allow" ? "info" : "warn", decision: written });
210
- return written;
183
+ // Only an executable allow reserves a key. A deny spent nothing, so a later request under the
184
+ // same key (for example after a provider credential revision change) is evaluated afresh.
185
+ const anchor = matchingRows.find((row) => row.executable);
186
+ if (anchor && anchor.requestFingerprint !== candidate.requestFingerprint) {
187
+ const mismatch = mismatchDecision(candidate, anchor);
188
+ const writtenMismatch = writeRow(ledgerPath, mismatch);
189
+ emitDecisionRecorded(deps, { level: "warn", decision: writtenMismatch });
190
+ return writtenMismatch;
191
+ }
192
+ if (anchor && candidate.executable) {
193
+ return duplicateDecision(anchor);
194
+ }
195
+ const latestSameFingerprint = [...matchingRows].reverse().find((row) => row.requestFingerprint === candidate.requestFingerprint);
196
+ if (latestSameFingerprint
197
+ && latestSameFingerprint.result === candidate.result
198
+ && latestSameFingerprint.executable === candidate.executable
199
+ && latestSameFingerprint.deniedReason === candidate.deniedReason
200
+ && latestSameFingerprint.denialCode === candidate.denialCode) {
201
+ return latestSameFingerprint;
211
202
  }
212
203
  const written = writeRow(ledgerPath, candidate);
213
204
  emitDecisionRecorded(deps, { level: written.result === "allow" ? "info" : "warn", decision: written });
@@ -184,6 +184,19 @@ async function evaluatePolicy(request, context, deps) {
184
184
  reason: "verified daemon await check",
185
185
  };
186
186
  }
187
+ const habitTrigger = request.triggerSource.startsWith("habit-") ? request.triggerSource.slice("habit-".length) : "";
188
+ if (habitTrigger.length > 0
189
+ && hasNonEmptyOriginRef(originRefs, "habit")
190
+ && hasOriginRef(originRefs, "habit-trigger", habitTrigger)
191
+ && hasNonEmptyOriginRef(originRefs, "habit-occurrence")
192
+ && (hasOriginRef(originRefs, "daemon-entry", "habit-scheduler")
193
+ || hasOriginRef(originRefs, "daemon-command", "habit.poke")
194
+ || hasOriginRef(originRefs, "daemon-command", "habit.probe"))) {
195
+ return {
196
+ result: "allow",
197
+ reason: "verified daemon habit",
198
+ };
199
+ }
187
200
  return {
188
201
  result: "deny",
189
202
  reason: "private runtime policy denies by default",
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.1020",
3
+ "version": "0.1.0-alpha.1023",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@ouro.bot/cli",
9
- "version": "0.1.0-alpha.1020",
9
+ "version": "0.1.0-alpha.1023",
10
10
  "dependencies": {
11
11
  "@anthropic-ai/sdk": "^0.78.0",
12
12
  "@ouro.bot/friends": "0.1.0-alpha.17",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.1020",
3
+ "version": "0.1.0-alpha.1023",
4
4
  "engines": {
5
5
  "node": ">=22"
6
6
  },