pi-daddy 0.44.2 → 0.44.4

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.md CHANGED
@@ -12,6 +12,15 @@ the record of how the package got here and are worth keeping; they are not worth
12
12
  > the record of how the package arrived at what it does, and because the reasoning behind each one is
13
13
  > usually the clearest statement of why the current behaviour is what it is.
14
14
 
15
+ ## 0.44.4 — model-visible execution evidence (2026-10-07)
16
+
17
+ - Add a versioned runtime evidence block to the model-visible result of `delegate`, `delegate_all` and `delegate_chain`. Pi provider conversion sends tool content, not UI-only details; coordinators can now inspect the actual terminal identity, final hash, captured-process cleanup receipt, observation state and terminal flags without reading private sessions. Authored final text and structured result details remain unchanged.
18
+ - Keep missing or unknown evidence explicit, and preserve each returned child/step separately. Process settlement does not establish task acceptance or disposable workspace cleanup. Chain tasks still receive only the previous authored final; the evidence block is returned to the coordinator. No prompts, private reasoning, raw diagnostics or retained-session contents are added to the projection.
19
+
20
+ ## 0.44.3 — exported ledger capability grammar (2026-10-07)
21
+
22
+ - Derive the published ledger schema capability namespaces from the runtime source, so actual `context:files` and `context:summary` grants validate. Regenerate the production-builder fixtures and hash chain. Consumers pinned to an older schema must explicitly update their pin; runtime authority and record bytes are unchanged.
23
+
15
24
  ## 0.44.2 — installed extension-loader proof (2026-10-07)
16
25
 
17
26
  - Exercise the packed `grants.ts` extension through Pi 1.0.4's real resource loader in an isolated managed-package layout. The release smoke now proves that host peers produce no diagnostics and that the initial activity tool and `/grants` command register, and moving a host package back into `dependencies` triggers Pi's warning.
@@ -33,6 +33,13 @@ The governance schema is closed. Adding or removing a field, event, or enum memb
33
33
  meaning requires an explicit compatibility decision and regenerated fixtures. Run `npm run contracts:generate` from
34
34
  the repository root and commit the generated contract with the runtime change.
35
35
 
36
+ ## Capability namespace correction (2026-10-07)
37
+
38
+ The published schema now derives its capability namespaces from the runtime list, including `context:`.
39
+ Earlier schema snapshots omitted `context:` even though the runtime emitted and accepted it. This corrects
40
+ validation of existing records; it changes no grant or execution authority. Consumers pinned to older schemas
41
+ must explicitly adopt the corrected contract. The closed field and identifier-tail rules remain unchanged.
42
+
36
43
  ## Execution identity
37
44
 
38
45
  Every v3 execution event carries:
@@ -58,7 +58,9 @@
58
58
  "parentGrant": [
59
59
  "agent:build",
60
60
  "tool:bash",
61
- "tool:read"
61
+ "tool:read",
62
+ "context:files",
63
+ "context:summary"
62
64
  ],
63
65
  "effective": [
64
66
  "tool:bash",
@@ -1,6 +1,6 @@
1
- {"v":1,"seq":1,"prev":null,"at":"2026-09-21T00:00:00.000Z","kind":"capability","id":"fixture-capability-decision","body":{"ledgerVersion":3,"event":"capability_decision","executionId":"exec:00000000-0000-4000-8000-000000000001","parentExecutionId":null,"ts":"2026-08-20T12:00:01.000Z","episodeId":"episode:00000000-0000-4000-8000-000000000099","parentId":"d0","childId":"d0.1","depth":1,"agentType":"build","executor":"process","taskFrom":"d0.0","taskFromExecutionId":"exec:00000000-0000-4000-8000-000000000000","taskDigest":"9999999999999999999999999999999999999999999999999999999999999999","correlation":{"schema_version":"1.0","run_id":"run-contract-001","task_id":"task-contract-001","workspace_id":"workspace-contract","context_id":"context-contract","phase":"verify","assurance":"critical","assurance_effective":"critical","policy_label":"policy-contract","assurance_source":"policy","assurance_scope":{"type":"selectors","selectors":["src/**"]},"activated_at":"2026-08-20T12:00:00.000Z","plan_digest":"1111111111111111111111111111111111111111111111111111111111111111","definition_digest":"2222222222222222222222222222222222222222222222222222222222222222","task_digest":"3333333333333333333333333333333333333333333333333333333333333333","base_sha":"4444444444444444444444444444444444444444","head_sha":"5555555555555555555555555555555555555555","tree_sha":"6666666666666666666666666666666666666666","event_seq":21,"last_change_seq":18,"last_authority_seq":20,"check_receipt_id":"7777777777777777777777777777777777777777777777777777777777777777"},"refusal":{"code":"WORKSPACE_WRITE_CONFLICT","message":"workspace-contract already has a governed writer","details":{"workspace_id":"workspace-contract","retryable":true,"holder_depth":1}},"requested":["tool:bash","tool:read"],"parentGrant":["agent:build","tool:bash","tool:read"],"effective":["tool:bash","tool:read"],"denied":[],"clipped":[],"gatedBlocked":[],"blocked":true,"reason":"workspace-contract already has a governed writer","approved":["tool:bash","tool:read"],"approvalSources":{"tool:bash":"persisted","tool:read":"prompt"},"approvalScopes":{"tool:bash":"always","tool:read":"once"},"approvalExpiresAt":{"tool:bash":"2026-09-19T12:00:00.000Z"},"approvalUses":{"tool:read":{"max":1,"remaining":0}},"definitionDigest":{"name":"build","source":"/operator/skills/build/SKILL.md","sha256":"8888888888888888888888888888888888888888888888888888888888888888"},"definitionHash":"7777777777777777777777777777777777777777777777777777777777777777","definitionPackageVersion":"2.3.1"},"digest":"4a36018bd75320d5f278ac3f31ebd676a0a24e40a779821ac1fcd67b520f8d9c"}
2
- {"v":1,"seq":2,"prev":"02bdcfc121a09e09df55d592196009d85c4857cdafc6d10ffae52df9ef790cf9","at":"2026-09-21T00:00:00.000Z","kind":"lease","id":"fixture-workspace-lease","body":{"ledgerVersion":3,"event":"workspace_lease","ts":"2026-08-20T12:00:02.000Z","episodeId":"episode:00000000-0000-4000-8000-000000000099","executionId":"exec:00000000-0000-4000-8000-000000000001","parentExecutionId":null,"childId":"d0.1","workspaceId":"workspace-contract","root":"/worktrees/contract","access":"write","outcome":"acquired","recovered":"unknown","correlation":{"schema_version":"1.0","run_id":"run-contract-001","task_id":"task-contract-001","workspace_id":"workspace-contract","context_id":"context-contract","phase":"verify","assurance":"critical","assurance_effective":"critical","policy_label":"policy-contract","assurance_source":"policy","assurance_scope":{"type":"selectors","selectors":["src/**"]},"activated_at":"2026-08-20T12:00:00.000Z","plan_digest":"1111111111111111111111111111111111111111111111111111111111111111","definition_digest":"2222222222222222222222222222222222222222222222222222222222222222","task_digest":"3333333333333333333333333333333333333333333333333333333333333333","base_sha":"4444444444444444444444444444444444444444","head_sha":"5555555555555555555555555555555555555555","tree_sha":"6666666666666666666666666666666666666666","event_seq":21,"last_change_seq":18,"last_authority_seq":20,"check_receipt_id":"7777777777777777777777777777777777777777777777777777777777777777"}},"digest":"846254fb313861742c04f576f6afca484f1e9954461bd55a28d2e46c10c3143a"}
3
- {"v":1,"seq":3,"prev":"5171a9ea3de47b21d07d72606d69f1529d9b26ded8d0a9e66f249ba0782a6bf4","at":"2026-09-21T00:00:00.000Z","kind":"fact","id":"fixture-episode-cost-gate","body":{"ledgerVersion":3,"event":"cost_gate","ts":"2026-08-20T12:00:02.500Z","episodeId":"episode:00000000-0000-4000-8000-000000000099","executionId":"exec:00000000-0000-4000-8000-000000000001","parentExecutionId":null,"childId":"d0.1","gate":"episode_cost","cost":5.2,"ceiling":5,"outcome":"continued","newCeiling":10},"digest":"144512eeb39ca539e5f27a7113afa5139b1ce507028d81c9fbae45b092149e13"}
4
- {"v":1,"seq":4,"prev":"b2968d627c54e65c0e98a297c521ad6229367c75df4c68db2a18586eb4729a24","at":"2026-09-21T00:00:00.000Z","kind":"fact","id":"fixture-session-config","body":{"ledgerVersion":3,"event":"session_config","ts":"2026-08-20T12:00:02.750Z","episodeId":"episode:00000000-0000-4000-8000-000000000099","outcome":"changed","trigger":"first-delegation","overrides":{"review":{"model":"anthropic/claude-opus-4-6","thinking":"high"}}},"digest":"a363414f30242ae9a74db705691f5f8768070169e2676d1d7a3143adc6e46800"}
5
- {"v":1,"seq":5,"prev":"0e3fd664c2dca1fc47d2009379607904458aa3a93dfe6e13a3ea485489398a4d","at":"2026-09-21T00:00:00.000Z","kind":"fact","id":"fixture-episode-outcome","body":{"ledgerVersion":3,"event":"episode_outcome","ts":"2026-08-20T12:00:02.750Z","episodeId":"episode:00000000-0000-4000-8000-000000000099","commit":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","survived":true,"ci":"green","amended":false,"corrected":false,"label":"positive"},"digest":"7617dfb4e545c6a0d54c2daf0d7598a2e191e333d67bb79189c618ea30752772"}
6
- {"v":1,"seq":6,"prev":"e537315b2ab8675356be15e9b77ce51caceac65e7abc965d2ff3253e1e90bf0e","at":"2026-09-21T00:00:00.000Z","kind":"lifecycle","id":"fixture-child-lifecycle","body":{"ledgerVersion":3,"event":"child_lifecycle","ts":"2026-08-20T12:00:03.000Z","episodeId":"episode:00000000-0000-4000-8000-000000000099","executionId":"exec:00000000-0000-4000-8000-000000000001","parentExecutionId":null,"childId":"d0.1","state":"failed","executor":"process","deadlineAt":"2026-08-20T12:10:00.000Z","idleTimeoutMs":900000,"exitCode":null,"signal":null,"aborted":true,"reason":"child did not start","resolvedModel":{"provider":"openai-codex","modelId":"gpt-5.3-codex"},"modelSource":"definition","thinkingLevel":{"level":"high","source":"advisor"},"thinkingSource":"advisor","tokenDetail":{"inputTokens":120,"outputTokens":30,"cacheReadTokens":20,"cacheWriteTokens":10,"reasoningTokens":5},"usage":{"input":120,"output":30,"cacheRead":20,"cacheWrite":10,"reasoning":5,"totalTokens":185,"cost":{"input":0.12,"output":0.06,"cacheRead":0.01,"cacheWrite":0.01,"total":0.2}},"compactionCount":1,"exportedEnvironment":["PI_DADDY_EPISODE","PI_DADDY_DEFINITION","PI_DADDY_EXECUTION"],"definitionHash":"7777777777777777777777777777777777777777777777777777777777777777","definitionPackageVersion":"2.3.1","correlation":{"schema_version":"1.0","run_id":"run-contract-001","task_id":"task-contract-001","workspace_id":"workspace-contract","context_id":"context-contract","phase":"verify","assurance":"critical","assurance_effective":"critical","policy_label":"policy-contract","assurance_source":"policy","assurance_scope":{"type":"selectors","selectors":["src/**"]},"activated_at":"2026-08-20T12:00:00.000Z","plan_digest":"1111111111111111111111111111111111111111111111111111111111111111","definition_digest":"2222222222222222222222222222222222222222222222222222222222222222","task_digest":"3333333333333333333333333333333333333333333333333333333333333333","base_sha":"4444444444444444444444444444444444444444","head_sha":"5555555555555555555555555555555555555555","tree_sha":"6666666666666666666666666666666666666666","event_seq":21,"last_change_seq":18,"last_authority_seq":20,"check_receipt_id":"7777777777777777777777777777777777777777777777777777777777777777"}},"digest":"c13fc25e8a93c853be54ecebcaf4e9a2d6137bd1c37cc5655d33c71da3877cad"}
1
+ {"v":1,"seq":1,"prev":null,"at":"2026-09-21T00:00:00.000Z","kind":"capability","id":"fixture-capability-decision","body":{"ledgerVersion":3,"event":"capability_decision","executionId":"exec:00000000-0000-4000-8000-000000000001","parentExecutionId":null,"ts":"2026-08-20T12:00:01.000Z","episodeId":"episode:00000000-0000-4000-8000-000000000099","parentId":"d0","childId":"d0.1","depth":1,"agentType":"build","executor":"process","taskFrom":"d0.0","taskFromExecutionId":"exec:00000000-0000-4000-8000-000000000000","taskDigest":"9999999999999999999999999999999999999999999999999999999999999999","correlation":{"schema_version":"1.0","run_id":"run-contract-001","task_id":"task-contract-001","workspace_id":"workspace-contract","context_id":"context-contract","phase":"verify","assurance":"critical","assurance_effective":"critical","policy_label":"policy-contract","assurance_source":"policy","assurance_scope":{"type":"selectors","selectors":["src/**"]},"activated_at":"2026-08-20T12:00:00.000Z","plan_digest":"1111111111111111111111111111111111111111111111111111111111111111","definition_digest":"2222222222222222222222222222222222222222222222222222222222222222","task_digest":"3333333333333333333333333333333333333333333333333333333333333333","base_sha":"4444444444444444444444444444444444444444","head_sha":"5555555555555555555555555555555555555555","tree_sha":"6666666666666666666666666666666666666666","event_seq":21,"last_change_seq":18,"last_authority_seq":20,"check_receipt_id":"7777777777777777777777777777777777777777777777777777777777777777"},"refusal":{"code":"WORKSPACE_WRITE_CONFLICT","message":"workspace-contract already has a governed writer","details":{"workspace_id":"workspace-contract","retryable":true,"holder_depth":1}},"requested":["tool:bash","tool:read"],"parentGrant":["agent:build","tool:bash","tool:read","context:files","context:summary"],"effective":["tool:bash","tool:read"],"denied":[],"clipped":[],"gatedBlocked":[],"blocked":true,"reason":"workspace-contract already has a governed writer","approved":["tool:bash","tool:read"],"approvalSources":{"tool:bash":"persisted","tool:read":"prompt"},"approvalScopes":{"tool:bash":"always","tool:read":"once"},"approvalExpiresAt":{"tool:bash":"2026-09-19T12:00:00.000Z"},"approvalUses":{"tool:read":{"max":1,"remaining":0}},"definitionDigest":{"name":"build","source":"/operator/skills/build/SKILL.md","sha256":"8888888888888888888888888888888888888888888888888888888888888888"},"definitionHash":"7777777777777777777777777777777777777777777777777777777777777777","definitionPackageVersion":"2.3.1"},"digest":"7539ab3b51f6b12548e48cd6b25ff8f4106108cd416cb9ec500450a16423939c"}
2
+ {"v":1,"seq":2,"prev":"3e210dc319211177845d1d1b527e5f3735d50254dbcdaf279a29c68e95acc78d","at":"2026-09-21T00:00:00.000Z","kind":"lease","id":"fixture-workspace-lease","body":{"ledgerVersion":3,"event":"workspace_lease","ts":"2026-08-20T12:00:02.000Z","episodeId":"episode:00000000-0000-4000-8000-000000000099","executionId":"exec:00000000-0000-4000-8000-000000000001","parentExecutionId":null,"childId":"d0.1","workspaceId":"workspace-contract","root":"/worktrees/contract","access":"write","outcome":"acquired","recovered":"unknown","correlation":{"schema_version":"1.0","run_id":"run-contract-001","task_id":"task-contract-001","workspace_id":"workspace-contract","context_id":"context-contract","phase":"verify","assurance":"critical","assurance_effective":"critical","policy_label":"policy-contract","assurance_source":"policy","assurance_scope":{"type":"selectors","selectors":["src/**"]},"activated_at":"2026-08-20T12:00:00.000Z","plan_digest":"1111111111111111111111111111111111111111111111111111111111111111","definition_digest":"2222222222222222222222222222222222222222222222222222222222222222","task_digest":"3333333333333333333333333333333333333333333333333333333333333333","base_sha":"4444444444444444444444444444444444444444","head_sha":"5555555555555555555555555555555555555555","tree_sha":"6666666666666666666666666666666666666666","event_seq":21,"last_change_seq":18,"last_authority_seq":20,"check_receipt_id":"7777777777777777777777777777777777777777777777777777777777777777"}},"digest":"a2ed374f48f227bb4a680ea13ee06732697fbc2d985cf60ac3e4d7c7069d847f"}
3
+ {"v":1,"seq":3,"prev":"14b3f8cb70678facd2ffecfe213ee0f2b33878d77cf8d717b2f726bbfa05c006","at":"2026-09-21T00:00:00.000Z","kind":"fact","id":"fixture-episode-cost-gate","body":{"ledgerVersion":3,"event":"cost_gate","ts":"2026-08-20T12:00:02.500Z","episodeId":"episode:00000000-0000-4000-8000-000000000099","executionId":"exec:00000000-0000-4000-8000-000000000001","parentExecutionId":null,"childId":"d0.1","gate":"episode_cost","cost":5.2,"ceiling":5,"outcome":"continued","newCeiling":10},"digest":"d636bf4a001569590f7fcaaebcd127c95540dfd636613a93889107ab646e92fb"}
4
+ {"v":1,"seq":4,"prev":"fe6123f561d3e26b435e6bd0679ed0b96c716dba31aa93c79abf4509c2573477","at":"2026-09-21T00:00:00.000Z","kind":"fact","id":"fixture-session-config","body":{"ledgerVersion":3,"event":"session_config","ts":"2026-08-20T12:00:02.750Z","episodeId":"episode:00000000-0000-4000-8000-000000000099","outcome":"changed","trigger":"first-delegation","overrides":{"review":{"model":"anthropic/claude-opus-4-6","thinking":"high"}}},"digest":"afaec06afd330417ba77b0def28052b4c68ea703224d1b058e562bf96a4afe07"}
5
+ {"v":1,"seq":5,"prev":"ccdd1a0ee255dea80beba25cb6cc59d0fd7e6710493be49524aab68591391671","at":"2026-09-21T00:00:00.000Z","kind":"fact","id":"fixture-episode-outcome","body":{"ledgerVersion":3,"event":"episode_outcome","ts":"2026-08-20T12:00:02.750Z","episodeId":"episode:00000000-0000-4000-8000-000000000099","commit":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","survived":true,"ci":"green","amended":false,"corrected":false,"label":"positive"},"digest":"4ec05abbb13f71568a22b3e2fc31162bc31e2fad36f310ee456bcd126b89a8f5"}
6
+ {"v":1,"seq":6,"prev":"fb6a280e8efe540850adc4a7ee19b83fda001e050459c19d620f99a3d0bcb71c","at":"2026-09-21T00:00:00.000Z","kind":"lifecycle","id":"fixture-child-lifecycle","body":{"ledgerVersion":3,"event":"child_lifecycle","ts":"2026-08-20T12:00:03.000Z","episodeId":"episode:00000000-0000-4000-8000-000000000099","executionId":"exec:00000000-0000-4000-8000-000000000001","parentExecutionId":null,"childId":"d0.1","state":"failed","executor":"process","deadlineAt":"2026-08-20T12:10:00.000Z","idleTimeoutMs":900000,"exitCode":null,"signal":null,"aborted":true,"reason":"child did not start","resolvedModel":{"provider":"openai-codex","modelId":"gpt-5.3-codex"},"modelSource":"definition","thinkingLevel":{"level":"high","source":"advisor"},"thinkingSource":"advisor","tokenDetail":{"inputTokens":120,"outputTokens":30,"cacheReadTokens":20,"cacheWriteTokens":10,"reasoningTokens":5},"usage":{"input":120,"output":30,"cacheRead":20,"cacheWrite":10,"reasoning":5,"totalTokens":185,"cost":{"input":0.12,"output":0.06,"cacheRead":0.01,"cacheWrite":0.01,"total":0.2}},"compactionCount":1,"exportedEnvironment":["PI_DADDY_EPISODE","PI_DADDY_DEFINITION","PI_DADDY_EXECUTION"],"definitionHash":"7777777777777777777777777777777777777777777777777777777777777777","definitionPackageVersion":"2.3.1","correlation":{"schema_version":"1.0","run_id":"run-contract-001","task_id":"task-contract-001","workspace_id":"workspace-contract","context_id":"context-contract","phase":"verify","assurance":"critical","assurance_effective":"critical","policy_label":"policy-contract","assurance_source":"policy","assurance_scope":{"type":"selectors","selectors":["src/**"]},"activated_at":"2026-08-20T12:00:00.000Z","plan_digest":"1111111111111111111111111111111111111111111111111111111111111111","definition_digest":"2222222222222222222222222222222222222222222222222222222222222222","task_digest":"3333333333333333333333333333333333333333333333333333333333333333","base_sha":"4444444444444444444444444444444444444444","head_sha":"5555555555555555555555555555555555555555","tree_sha":"6666666666666666666666666666666666666666","event_seq":21,"last_change_seq":18,"last_authority_seq":20,"check_receipt_id":"7777777777777777777777777777777777777777777777777777777777777777"}},"digest":"0ebd5c47ad544fa2e52d7c8a73630ed9beae4bb3038fda57693a5bf56796f2be"}
@@ -163,7 +163,7 @@
163
163
  },
164
164
  "ledgerCapabilityIdentifier": {
165
165
  "type": "string",
166
- "pattern": "^(tool|skill|agent|workspace|ext):[A-Za-z0-9@*][A-Za-z0-9@*._/-]{0,255}$"
166
+ "pattern": "^(?:tool:|ext:|skill:|agent:|workspace:|context:)[A-Za-z0-9@*][A-Za-z0-9@*._/-]{0,255}$"
167
167
  },
168
168
  "refusalCode": {
169
169
  "type": "string",
@@ -1,3 +1,4 @@
1
+ import { executionEvidenceContent } from "./execution-evidence.ts";
1
2
  import { assertDefinitionIdentity } from "./definition-describe.ts";
2
3
  /**
3
4
  * `delegate_chain` — a governed sequential pipeline, planned and gated as one unit (ADR-0033).
@@ -408,7 +409,10 @@ export function registerChainTool(pi: ExtensionAPI, session: GrantsSession): voi
408
409
  }
409
410
  return {
410
411
  isError: aborted || outcomes.some((o) => o.control === "failed"),
411
- content: [{ type: "text", text: `${report}${tail}` }],
412
+ content: [
413
+ { type: "text", text: `${report}${tail}` },
414
+ executionEvidenceContent("delegate_chain", outcomes, steps.length),
415
+ ],
412
416
  details: {
413
417
  outcomes,
414
418
  steps: steps.length,
@@ -1,3 +1,4 @@
1
+ import { executionEvidenceContent } from "./execution-evidence.ts";
1
2
  import { reconcileDelegationCapacity, reserveDelegationCapacity } from "./session-capacity.ts";
2
3
  import { registerDefinitionDescribe } from "./definition-describe.ts";
3
4
  /**
@@ -292,6 +293,7 @@ export function registerDelegationTools(pi: ExtensionAPI, session: GrantsSession
292
293
  ? `delegation failed: ${outcome.reason ?? "required control failed"}${outcome.text ? `\n\n${outcome.text}` : ""}`
293
294
  : outcome.text || "(no output)",
294
295
  },
296
+ executionEvidenceContent("delegate", [outcome], 1),
295
297
  ],
296
298
  details: outcome,
297
299
  };
@@ -385,7 +387,7 @@ export function registerDelegationTools(pi: ExtensionAPI, session: GrantsSession
385
387
 
386
388
  return {
387
389
  isError: outcomes.some((o) => !o.ok || o.control === "failed"),
388
- content: [{ type: "text", text: report }],
390
+ content: [{ type: "text", text: report }, executionEvidenceContent("delegate_all", outcomes, children.length)],
389
391
  details: {
390
392
  outcomes,
391
393
  children: outcomes.length,
@@ -0,0 +1,94 @@
1
+ /** Model-visible projection of runtime facts. UI-only details never reach provider tool output.
2
+ * Keep authored final text and raw result objects unchanged. This is process settlement evidence,
3
+ * not task acceptance or a claim that a disposable workspace was removed.
4
+ */
5
+ import type { DelegationOutcome } from "./execute-child.ts";
6
+ import type { CapturedWorkerIdentity } from "../src/kernel/captured-worker-contract.ts";
7
+
8
+ function identity(value: CapturedWorkerIdentity) {
9
+ return {
10
+ revision: value.revision,
11
+ executionId: value.executionId,
12
+ nonce: value.nonce,
13
+ root: value.root,
14
+ rootDevice: value.rootDevice,
15
+ rootInode: value.rootInode,
16
+ bootId: value.bootId,
17
+ pidNamespace: value.pidNamespace,
18
+ helperPid: value.helperPid,
19
+ helperStartTicks: value.helperStartTicks,
20
+ helperSha256: value.helperSha256,
21
+ workerPid: value.workerPid,
22
+ ownershipPath: value.ownershipPath,
23
+ receiptPath: value.receiptPath,
24
+ };
25
+ }
26
+ function cleanup(value: DelegationOutcome["cleanup"]) {
27
+ if (!value) return null;
28
+ if (value.state === "not-started") return { state: value.state, reason: value.reason };
29
+ if (value.state === "unknown")
30
+ return {
31
+ state: value.state,
32
+ ...(value.identity ? { identity: identity(value.identity) } : {}),
33
+ reason: value.reason,
34
+ };
35
+ return {
36
+ state: value.state,
37
+ identity: identity(value.identity),
38
+ receipt: {
39
+ state: value.receipt.state,
40
+ identity: identity(value.receipt.identity),
41
+ workerCode: value.receipt.workerCode,
42
+ workerSignal: value.receipt.workerSignal,
43
+ reason: value.receipt.reason,
44
+ reapedAll: value.receipt.reapedAll,
45
+ },
46
+ };
47
+ }
48
+ function outcomeEvidence(outcome: DelegationOutcome, index: number) {
49
+ const final = outcome.final;
50
+ return {
51
+ ordinal: index + 1,
52
+ ok: outcome.ok,
53
+ work: outcome.work ?? null,
54
+ control: outcome.control ?? null,
55
+ reason: outcome.reason ?? null,
56
+ exitCode: outcome.exitCode,
57
+ timedOut: outcome.timedOut ?? null,
58
+ aborted: outcome.aborted ?? null,
59
+ truncated: outcome.truncated ?? null,
60
+ spawnFailed: outcome.spawnFailed ?? null,
61
+ final: !final
62
+ ? null
63
+ : final.state === "unavailable"
64
+ ? { state: final.state, reason: final.reason }
65
+ : {
66
+ state: final.state,
67
+ sessionId: final.sessionId,
68
+ messageId: final.messageId,
69
+ leafId: final.leafId,
70
+ sha256: final.sha256,
71
+ },
72
+ cleanup: cleanup(outcome.cleanup),
73
+ observation: outcome.observation
74
+ ? { state: outcome.observation.state, reasons: [...outcome.observation.reasons] }
75
+ : null,
76
+ retention: outcome.retention ? { status: outcome.retention.status } : null,
77
+ };
78
+ }
79
+
80
+ /** Absent dimensions remain null, never inferred as success. Only actual returned outcomes appear. */
81
+ export function executionEvidenceContent(
82
+ tool: "delegate" | "delegate_all" | "delegate_chain",
83
+ outcomes: readonly DelegationOutcome[],
84
+ requested: number,
85
+ ) {
86
+ const evidence = { version: 1, tool, requested, outcomes: outcomes.map(outcomeEvidence) };
87
+ return {
88
+ type: "text" as const,
89
+ text:
90
+ "Runtime execution evidence (process settlement; not workspace cleanup or task acceptance):\n```json\n" +
91
+ JSON.stringify(evidence) +
92
+ "\n```",
93
+ };
94
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-daddy",
3
- "version": "0.44.2",
3
+ "version": "0.44.4",
4
4
  "description": "Capability governance for pi sub-agents: spawn Agent Skills (SKILL.md) definitions whose allowed-tools becomes a grant that can only narrow going down a delegation tree, enforced by pi's own --tools allowlist, with an append-only ledger.",
5
5
  "keywords": [
6
6
  "pi-package",