pi-daddy 0.18.1 → 0.19.0
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 +136 -0
- package/README.md +46 -2
- package/contracts/ledger/v2/README.md +59 -0
- package/contracts/ledger/v2/fixtures/capability-decision.json +95 -0
- package/contracts/ledger/v2/fixtures/check-receipt.json +40 -0
- package/contracts/ledger/v2/fixtures/child-lifecycle.json +42 -0
- package/contracts/ledger/v2/fixtures/workspace-lease.json +41 -0
- package/contracts/ledger/v2/ledger-event.schema.json +633 -0
- package/dist/approval-prompt.d.ts +2 -1
- package/dist/approval-prompt.d.ts.map +1 -1
- package/dist/approval-prompt.js +9 -0
- package/dist/approval-prompt.js.map +1 -1
- package/dist/approval.d.ts +4 -2
- package/dist/approval.d.ts.map +1 -1
- package/dist/approval.js +4 -0
- package/dist/approval.js.map +1 -1
- package/dist/capabilities.d.ts +90 -0
- package/dist/capabilities.d.ts.map +1 -1
- package/dist/capabilities.js +114 -3
- package/dist/capabilities.js.map +1 -1
- package/dist/catalog.d.ts +15 -1
- package/dist/catalog.d.ts.map +1 -1
- package/dist/catalog.js +54 -3
- package/dist/catalog.js.map +1 -1
- package/dist/check-runner.d.ts.map +1 -1
- package/dist/check-runner.js +5 -7
- package/dist/check-runner.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +21 -1
- package/dist/cli.js.map +1 -1
- package/dist/definitions.d.ts.map +1 -1
- package/dist/definitions.js +7 -1
- package/dist/definitions.js.map +1 -1
- package/dist/delegate.d.ts.map +1 -1
- package/dist/delegate.js +31 -4
- package/dist/delegate.js.map +1 -1
- package/dist/delegation-approval.d.ts.map +1 -1
- package/dist/delegation-approval.js +37 -12
- package/dist/delegation-approval.js.map +1 -1
- package/dist/executor.d.ts +2 -1
- package/dist/executor.d.ts.map +1 -1
- package/dist/executor.js +1 -0
- package/dist/executor.js.map +1 -1
- package/dist/grant-env.d.ts +2 -0
- package/dist/grant-env.d.ts.map +1 -1
- package/dist/grant-env.js +26 -3
- package/dist/grant-env.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/init.d.ts +13 -1
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +35 -2
- package/dist/init.js.map +1 -1
- package/dist/lease-helper.d.ts +58 -0
- package/dist/lease-helper.d.ts.map +1 -0
- package/dist/lease-helper.js +94 -0
- package/dist/lease-helper.js.map +1 -0
- package/dist/lease-record.d.ts +15 -3
- package/dist/lease-record.d.ts.map +1 -1
- package/dist/lease-record.js.map +1 -1
- package/dist/ledger-events.d.ts +35 -14
- package/dist/ledger-events.d.ts.map +1 -1
- package/dist/ledger-events.js +41 -0
- package/dist/ledger-events.js.map +1 -1
- package/dist/ledger.d.ts +10 -5
- package/dist/ledger.d.ts.map +1 -1
- package/dist/ledger.js +13 -3
- package/dist/ledger.js.map +1 -1
- package/dist/propagation.d.ts +16 -0
- package/dist/propagation.d.ts.map +1 -1
- package/dist/propagation.js +20 -1
- package/dist/propagation.js.map +1 -1
- package/dist/refusals.d.ts +1 -1
- package/dist/refusals.d.ts.map +1 -1
- package/dist/refusals.js +1 -0
- package/dist/refusals.js.map +1 -1
- package/dist/resolve.d.ts +10 -0
- package/dist/resolve.d.ts.map +1 -1
- package/dist/resolve.js +27 -3
- package/dist/resolve.js.map +1 -1
- package/dist/routing-authority.d.ts +71 -0
- package/dist/routing-authority.d.ts.map +1 -0
- package/dist/routing-authority.js +100 -0
- package/dist/routing-authority.js.map +1 -0
- package/dist/skill-packages.d.ts +11 -5
- package/dist/skill-packages.d.ts.map +1 -1
- package/dist/skill-packages.js +20 -11
- package/dist/skill-packages.js.map +1 -1
- package/dist/workspace-lease.d.ts +15 -3
- package/dist/workspace-lease.d.ts.map +1 -1
- package/dist/workspace-lease.js +81 -24
- package/dist/workspace-lease.js.map +1 -1
- package/dist/workspace.d.ts +25 -0
- package/dist/workspace.d.ts.map +1 -1
- package/dist/workspace.js +142 -5
- package/dist/workspace.js.map +1 -1
- package/extensions/delegation.ts +7 -1
- package/extensions/grants-command.ts +11 -1
- package/extensions/grants.ts +6 -1
- package/extensions/init-command.ts +33 -2
- package/extensions/session-report.ts +13 -20
- package/extensions/session.ts +9 -1
- package/extensions/workspace-runtime.ts +34 -4
- package/package.json +8 -3
- package/src/approval-prompt.ts +2 -1
- package/src/approval.ts +4 -2
- package/src/capabilities.ts +120 -4
- package/src/catalog.ts +62 -4
- package/src/check-runner.ts +8 -8
- package/src/cli.ts +24 -1
- package/src/definitions.ts +7 -1
- package/src/delegate.ts +41 -4
- package/src/delegation-approval.ts +37 -12
- package/src/executor.ts +2 -1
- package/src/grant-env.ts +39 -7
- package/src/index.ts +1 -0
- package/src/init.ts +40 -2
- package/src/lease-helper.ts +97 -0
- package/src/lease-record.ts +15 -3
- package/src/ledger-events.ts +66 -22
- package/src/ledger.ts +30 -6
- package/src/propagation.ts +21 -1
- package/src/refusals.ts +1 -0
- package/src/resolve.ts +29 -3
- package/src/routing-authority.ts +121 -0
- package/src/skill-packages.ts +20 -13
- package/src/workspace-lease.ts +84 -24
- package/src/workspace.ts +179 -6
package/dist/ledger.d.ts
CHANGED
|
@@ -27,10 +27,14 @@ import type { CorrelationMetadata } from "./correlation.ts";
|
|
|
27
27
|
import type { StructuredRefusal } from "./refusals.ts";
|
|
28
28
|
import type { RuntimeLedgerEvent } from "./ledger-events.ts";
|
|
29
29
|
export declare const LEDGER_VERSION: 2;
|
|
30
|
+
export declare const LEDGER_EVENT_KINDS: readonly ["capability_decision", "workspace_lease", "child_lifecycle", "check_receipt"];
|
|
31
|
+
export type LedgerEventKind = typeof LEDGER_EVENT_KINDS[number];
|
|
32
|
+
export declare const LEDGER_GATE_OUTCOMES: readonly ["declined", "dismissed", "no-ui", "error"];
|
|
33
|
+
export type LedgerGateOutcome = typeof LEDGER_GATE_OUTCOMES[number];
|
|
30
34
|
export interface LedgerEventBase {
|
|
31
35
|
/** Optional only on the legacy-compatible `GrantRecord` public type; every v2 event builder writes it. */
|
|
32
36
|
ledgerVersion?: typeof LEDGER_VERSION;
|
|
33
|
-
event?:
|
|
37
|
+
event?: LedgerEventKind;
|
|
34
38
|
ts: string;
|
|
35
39
|
childId?: string;
|
|
36
40
|
correlation?: CorrelationMetadata;
|
|
@@ -98,7 +102,7 @@ export interface GrantRecord extends LedgerEventBase {
|
|
|
98
102
|
/** Present only when the source was a live prompt, and only when one scope covers the whole set. */
|
|
99
103
|
approvalScope?: ApprovalScope;
|
|
100
104
|
/** A human was asked and declined. Distinct from `denied`, which is an escalation attempt. */
|
|
101
|
-
humanDenied?:
|
|
105
|
+
humanDenied?: true;
|
|
102
106
|
/**
|
|
103
107
|
* WHY a gate went unsatisfied, when the answer was not a yes.
|
|
104
108
|
*
|
|
@@ -114,9 +118,10 @@ export interface GrantRecord extends LedgerEventBase {
|
|
|
114
118
|
* say *"nobody was there to ask"* and be believed, so it is recorded rather than inferred.
|
|
115
119
|
*
|
|
116
120
|
* **Privacy is unchanged**: this is a fixed five-member enum, not text — nothing model-authored, nothing
|
|
117
|
-
* a task could carry.
|
|
121
|
+
* a task could carry. The prompt has five outcomes, but `granted` is deliberately omitted from the
|
|
122
|
+
* four-member ledger enum because the approval source/scope fields already record a yes.
|
|
118
123
|
*/
|
|
119
|
-
gateOutcome?:
|
|
124
|
+
gateOutcome?: LedgerGateOutcome;
|
|
120
125
|
/**
|
|
121
126
|
* WHICH operator-authored instructions this child was given (ADR-0018).
|
|
122
127
|
*
|
|
@@ -209,5 +214,5 @@ export declare function appendLedgerEvent(options: LedgerOptions, event: Runtime
|
|
|
209
214
|
export declare function appendRecord(options: LedgerOptions, record: GrantRecord): Promise<void>;
|
|
210
215
|
/** True when this record shows an agent asking for more than it holds. */
|
|
211
216
|
export declare function isEscalationAttempt(record: GrantRecord): boolean;
|
|
212
|
-
export { buildChildLifecycleEvent, buildWorkspaceLeaseEvent, type ChildLifecycleEvent, type CheckReceiptLedgerEvent, type RuntimeLedgerEvent, type WorkspaceLeaseEvent, type WorkspaceLeaseOutcome, } from "./ledger-events.ts";
|
|
217
|
+
export { CHILD_LIFECYCLE_STATES, CHILD_PROCESS_SIGNALS, WORKSPACE_ACCESSES, WORKSPACE_LEASE_OUTCOMES, WORKSPACE_RECOVERY_VALUES, buildCheckReceiptLedgerEvent, buildChildLifecycleEvent, buildWorkspaceLeaseEvent, type CapabilityDecisionEvent, type ChildLifecycleEvent, type ChildLifecycleState, type ChildProcessSignal, type CheckReceiptLedgerEvent, type RuntimeLedgerEvent, type WorkspaceAccess, type WorkspaceLeaseEvent, type WorkspaceLeaseOutcome, type WorkspaceRecovery, } from "./ledger-events.ts";
|
|
213
218
|
//# sourceMappingURL=ledger.d.ts.map
|
package/dist/ledger.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ledger.d.ts","sourceRoot":"","sources":["../src/ledger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAKH,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEzD,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAE7D,eAAO,MAAM,cAAc,EAAG,CAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"ledger.d.ts","sourceRoot":"","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AW,CAAC,EAAE,mBAAmB,CAAC;IAClC,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B,GAAG,EAAE,IAAI,CAAC;CACX,GAAG,WAAW,CAmDd;AAID,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAIhE,OAAO,EAAE,YAAY,EAAE,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAgBrE,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,kBAAkB,GAAG,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CActH;AAED,wBAAsB,YAAY,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAE7F;AAED,0EAA0E;AAC1E,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAEhE;AAED,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,kBAAkB,EAClB,wBAAwB,EACxB,yBAAyB,EACzB,4BAA4B,EAC5B,wBAAwB,EACxB,wBAAwB,EACxB,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,GACvB,MAAM,oBAAoB,CAAC"}
|
package/dist/ledger.js
CHANGED
|
@@ -23,7 +23,17 @@ import { withFileLock } from "./file-lock.js";
|
|
|
23
23
|
import { dirname } from "node:path";
|
|
24
24
|
import { DELEGATE_SUBJECT } from "./approval.js";
|
|
25
25
|
export const LEDGER_VERSION = 2;
|
|
26
|
+
export const LEDGER_EVENT_KINDS = [
|
|
27
|
+
"capability_decision", "workspace_lease", "child_lifecycle", "check_receipt",
|
|
28
|
+
];
|
|
29
|
+
export const LEDGER_GATE_OUTCOMES = ["declined", "dismissed", "no-ui", "error"];
|
|
26
30
|
export function buildRecord(args) {
|
|
31
|
+
if (args.taskDigest !== undefined && !/^[a-f0-9]{64}$/i.test(args.taskDigest)) {
|
|
32
|
+
throw new TypeError("taskDigest must be a SHA-256 hex digest");
|
|
33
|
+
}
|
|
34
|
+
if (args.definitionDigest && !/^[a-f0-9]{64}$/i.test(args.definitionDigest.sha256)) {
|
|
35
|
+
throw new TypeError("definitionDigest.sha256 must be a SHA-256 hex digest");
|
|
36
|
+
}
|
|
27
37
|
// R-46: the scalar is a SUMMARY, emitted only when it cannot mislead. `buildRecord` derives it rather
|
|
28
38
|
// than accepting it, so a call site cannot supply one that disagrees with the map beside it.
|
|
29
39
|
const sources = args.approvalSources ?? {};
|
|
@@ -33,7 +43,7 @@ export function buildRecord(args) {
|
|
|
33
43
|
return {
|
|
34
44
|
// A trusted task digest is what distinguishes a v2 capability event from the legacy construction API.
|
|
35
45
|
// Production delegation always supplies it; old TypeScript callers remain able to append legacy lines.
|
|
36
|
-
...(args.taskDigest ? { ledgerVersion: LEDGER_VERSION, event: "capability_decision" } : {}),
|
|
46
|
+
...(args.taskDigest !== undefined ? { ledgerVersion: LEDGER_VERSION, event: "capability_decision" } : {}),
|
|
37
47
|
ts: args.now.toISOString(),
|
|
38
48
|
parentId: args.parentId,
|
|
39
49
|
childId: args.childId,
|
|
@@ -41,7 +51,7 @@ export function buildRecord(args) {
|
|
|
41
51
|
agentType: args.agentType,
|
|
42
52
|
executor: args.executor,
|
|
43
53
|
...(args.taskFrom ? { taskFrom: args.taskFrom } : {}),
|
|
44
|
-
...(args.taskDigest ? { taskDigest: args.taskDigest } : {}),
|
|
54
|
+
...(args.taskDigest !== undefined ? { taskDigest: args.taskDigest } : {}),
|
|
45
55
|
...(args.correlation ? { correlation: structuredClone(args.correlation) } : {}),
|
|
46
56
|
...(args.refusal ? { refusal: structuredClone(args.refusal) } : {}),
|
|
47
57
|
requested: args.requested,
|
|
@@ -110,5 +120,5 @@ export async function appendRecord(options, record) {
|
|
|
110
120
|
export function isEscalationAttempt(record) {
|
|
111
121
|
return record.denied.length > 0;
|
|
112
122
|
}
|
|
113
|
-
export { buildChildLifecycleEvent, buildWorkspaceLeaseEvent, } from "./ledger-events.js";
|
|
123
|
+
export { CHILD_LIFECYCLE_STATES, CHILD_PROCESS_SIGNALS, WORKSPACE_ACCESSES, WORKSPACE_LEASE_OUTCOMES, WORKSPACE_RECOVERY_VALUES, buildCheckReceiptLedgerEvent, buildChildLifecycleEvent, buildWorkspaceLeaseEvent, } from "./ledger-events.js";
|
|
114
124
|
//# sourceMappingURL=ledger.js.map
|
package/dist/ledger.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ledger.js","sourceRoot":"","sources":["../src/ledger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAQjD,MAAM,CAAC,MAAM,cAAc,GAAG,CAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"ledger.js","sourceRoot":"","sources":["../src/ledger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAQjD,MAAM,CAAC,MAAM,cAAc,GAAG,CAAU,CAAC;AACzC,MAAM,CAAC,MAAM,kBA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,CAAC;QAClF,CAAC;QACD,kGAAkG;QAClG,2FAA2F;QAC3F,OAAO,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,CAAC;IAC7B,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,OAAsB,EAAE,MAAmB;IAC5E,OAAO,iBAAiB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;AAC5C,CAAC;AAED,0EAA0E;AAC1E,MAAM,UAAU,mBAAmB,CAAC,MAAmB;IACrD,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;AAClC,CAAC;AAED,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,kBAAkB,EAClB,wBAAwB,EACxB,yBAAyB,EACzB,4BAA4B,EAC5B,wBAAwB,EACxB,wBAAwB,GAWzB,MAAM,oBAAoB,CAAC"}
|
package/dist/propagation.d.ts
CHANGED
|
@@ -168,6 +168,22 @@ export interface ChildEnvInput {
|
|
|
168
168
|
* empty grant, so they can spawn nothing. That fails closed. It is also unreachable in normal flow,
|
|
169
169
|
* because a session's first provider request always precedes its first tool call.
|
|
170
170
|
*/
|
|
171
|
+
/**
|
|
172
|
+
* The part of a grant a child may inherit: everything but the wildcards that are HELD, never handed down.
|
|
173
|
+
*
|
|
174
|
+
* `tool:*` for R-26's reason — a root that handed it down let every descendant reacquire the full catalog.
|
|
175
|
+
* `workspace:*` for the same reason one namespace over (R-131): a descendant holding it could route anywhere
|
|
176
|
+
* the registry lists, which is the attenuation failure ADR-0035 exists to close. `agent:*` is deliberately
|
|
177
|
+
* NOT stripped — ADR-0023 decided that a session authorised for any definition passes that on, because
|
|
178
|
+
* definitions are ceilings rather than roots.
|
|
179
|
+
*
|
|
180
|
+
* **Exported, and there is exactly one spelling of this rule on purpose.** It shipped as a filter inline in
|
|
181
|
+
* `childEnv` and nowhere else, so a grant travelling the OTHER path — `delegate.ts` building a child's
|
|
182
|
+
* `PI_GRANTS_GRANT` from `result.effective` — carried `workspace:*` straight down. The test written beside
|
|
183
|
+
* that fix exercised `childEnv`, which is not the path a delegated child's grant travels, so it could not
|
|
184
|
+
* catch it. R-28's shape: two routes for one rule, with the guard on the quieter one. Both call this now.
|
|
185
|
+
*/
|
|
186
|
+
export declare function inheritableGrant(grant: readonly Capability[]): Capability[];
|
|
171
187
|
export declare function childEnv(input: ChildEnvInput): Record<string, string>;
|
|
172
188
|
/**
|
|
173
189
|
* The environment for a child this process spawns itself: the parent's environment with every governance
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"propagation.d.ts","sourceRoot":"","sources":["../src/propagation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"propagation.d.ts","sourceRoot":"","sources":["../src/propagation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG/C,OAAO,EAAoB,KAAK,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAG3E,eAAO,MAAM,SAAS,oBAAoB,CAAC;AAC3C;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,qBAAqB,CAAC;AAC7C;;;;GAIG;AACH,eAAO,MAAM,aAAa,wBAAwB,CAAC;AACnD,eAAO,MAAM,SAAS,oBAAoB,CAAC;AAC3C,eAAO,MAAM,aAAa,wBAAwB,CAAC;AACnD,eAAO,MAAM,SAAS,oBAAoB,CAAC;AAC3C,eAAO,MAAM,UAAU,qBAAqB,CAAC;AAC7C,eAAO,MAAM,YAAY,uBAAuB,CAAC;AAEjD;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,gLASjB,CAAC;AAEX,eAAO,MAAM,SAAS,GAAI,KAAK,MAAM,GAAG,SAAS,KAAG,UAAU,EACW,CAAC;AAkB1E;;;;;;;;;;;;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EAAE,CAE3E;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAiBrE;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAC3B,SAAS,EAAE,MAAM,CAAC,UAAU,EAC5B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC9B,MAAM,CAAC,UAAU,CAInB;AAED,2GAA2G;AAC3G,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,EAAE,GAAG,IAAI,CAoBlE"}
|
package/dist/propagation.js
CHANGED
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
* interceptor and pi handed the child more than the parent held, the intersection clamps it back.
|
|
26
26
|
*/
|
|
27
27
|
import { WILDCARD } from "./pi-tools.js";
|
|
28
|
+
import { WORKSPACE_WILDCARD } from "./resolve.js";
|
|
28
29
|
import { inheritApprovals } from "./approval.js";
|
|
29
30
|
import { assertCapabilitiesArePropagatable } from "./capabilities.js";
|
|
30
31
|
export const ENV_GRANT = "PI_GRANTS_GRANT";
|
|
@@ -191,10 +192,28 @@ export function gatedFromEnv(raw) {
|
|
|
191
192
|
* empty grant, so they can spawn nothing. That fails closed. It is also unreachable in normal flow,
|
|
192
193
|
* because a session's first provider request always precedes its first tool call.
|
|
193
194
|
*/
|
|
195
|
+
/**
|
|
196
|
+
* The part of a grant a child may inherit: everything but the wildcards that are HELD, never handed down.
|
|
197
|
+
*
|
|
198
|
+
* `tool:*` for R-26's reason — a root that handed it down let every descendant reacquire the full catalog.
|
|
199
|
+
* `workspace:*` for the same reason one namespace over (R-131): a descendant holding it could route anywhere
|
|
200
|
+
* the registry lists, which is the attenuation failure ADR-0035 exists to close. `agent:*` is deliberately
|
|
201
|
+
* NOT stripped — ADR-0023 decided that a session authorised for any definition passes that on, because
|
|
202
|
+
* definitions are ceilings rather than roots.
|
|
203
|
+
*
|
|
204
|
+
* **Exported, and there is exactly one spelling of this rule on purpose.** It shipped as a filter inline in
|
|
205
|
+
* `childEnv` and nowhere else, so a grant travelling the OTHER path — `delegate.ts` building a child's
|
|
206
|
+
* `PI_GRANTS_GRANT` from `result.effective` — carried `workspace:*` straight down. The test written beside
|
|
207
|
+
* that fix exercised `childEnv`, which is not the path a delegated child's grant travels, so it could not
|
|
208
|
+
* catch it. R-28's shape: two routes for one rule, with the guard on the quieter one. Both call this now.
|
|
209
|
+
*/
|
|
210
|
+
export function inheritableGrant(grant) {
|
|
211
|
+
return grant.filter((c) => c !== WILDCARD && c !== WORKSPACE_WILDCARD);
|
|
212
|
+
}
|
|
194
213
|
export function childEnv(input) {
|
|
195
214
|
if (input.governed === false)
|
|
196
215
|
return {};
|
|
197
|
-
const inheritable = input.ownGrant
|
|
216
|
+
const inheritable = inheritableGrant(input.ownGrant);
|
|
198
217
|
const env = {
|
|
199
218
|
[ENV_GRANT]: (assertCapabilitiesArePropagatable(inheritable), inheritable.join(",")),
|
|
200
219
|
[ENV_DEPTH]: String(input.depth + 1),
|
package/dist/propagation.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"propagation.js","sourceRoot":"","sources":["../src/propagation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAA4B,MAAM,eAAe,CAAC;AAC3E,OAAO,EAAE,iCAAiC,EAAE,MAAM,mBAAmB,CAAC;AAEtE,MAAM,CAAC,MAAM,SAAS,GAAG,iBAAiB,CAAC;AAC3C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,kBAAkB,CAAC;AAC7C;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,qBAAqB,CAAC;AACnD,MAAM,CAAC,MAAM,SAAS,GAAG,iBAAiB,CAAC;AAC3C,MAAM,CAAC,MAAM,aAAa,GAAG,qB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;IACf,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/dist/refusals.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const REFUSAL_CODES: readonly ["CAPABILITY_ESCALATION", "GRANT_ID_MALFORMED", "DEFINITION_NOT_AUTHORIZED", "UNDECLARED_TOOLS", "UNKNOWN_TOOL", "GATED_UNAPPROVED", "APPROVAL_EXPIRED", "APPROVAL_SCOPE_MISMATCH", "APPROVAL_FLOW_FAILED", "DEPTH_EXCEEDED", "FANOUT_EXCEEDED", "EXECUTOR_UNAVAILABLE", "CHILD_TIMED_OUT", "CHILD_CANCELLED", "CHILD_EXIT_NONZERO", "TASK_MISSING", "UNKNOWN_DEFINITION", "CEILING_PATTERNS_UNRESOLVED", "NARROWING_VIOLATED", "DEFINITION_UNREADABLE", "CORRELATION_TOO_LARGE", "CORRELATION_INVALID", "LEDGER_WRITE_FAILED", "FANOUT_FAILED", "WORKSPACE_NOT_REGISTERED", "WORKSPACE_WRITE_CONFLICT", "WORKSPACE_LEASE_STALE", "CHECK_NOT_CONFIGURED", "CHECK_CONFIGURATION_INVALID", "CHECK_IDENTITY_UNAVAILABLE", "CHECK_IDENTITY_MISMATCH"];
|
|
1
|
+
export declare const REFUSAL_CODES: readonly ["CAPABILITY_ESCALATION", "GRANT_ID_MALFORMED", "DEFINITION_NOT_AUTHORIZED", "UNDECLARED_TOOLS", "UNKNOWN_TOOL", "GATED_UNAPPROVED", "APPROVAL_EXPIRED", "APPROVAL_SCOPE_MISMATCH", "APPROVAL_FLOW_FAILED", "DEPTH_EXCEEDED", "FANOUT_EXCEEDED", "EXECUTOR_UNAVAILABLE", "CHILD_TIMED_OUT", "CHILD_CANCELLED", "CHILD_EXIT_NONZERO", "TASK_MISSING", "UNKNOWN_DEFINITION", "CEILING_PATTERNS_UNRESOLVED", "NARROWING_VIOLATED", "DEFINITION_UNREADABLE", "CORRELATION_TOO_LARGE", "CORRELATION_INVALID", "LEDGER_WRITE_FAILED", "FANOUT_FAILED", "WORKSPACE_NOT_REGISTERED", "WORKSPACE_NOT_AUTHORIZED", "WORKSPACE_WRITE_CONFLICT", "WORKSPACE_LEASE_STALE", "CHECK_NOT_CONFIGURED", "CHECK_CONFIGURATION_INVALID", "CHECK_IDENTITY_UNAVAILABLE", "CHECK_IDENTITY_MISMATCH"];
|
|
2
2
|
export type RefusalCode = (typeof REFUSAL_CODES)[number];
|
|
3
3
|
export interface StructuredRefusal {
|
|
4
4
|
code: RefusalCode;
|
package/dist/refusals.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refusals.d.ts","sourceRoot":"","sources":["../src/refusals.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"refusals.d.ts","sourceRoot":"","sources":["../src/refusals.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,wvBAqChB,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,WAAW,CAAC;IAClB,8EAA8E;IAC9E,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC,CAAC;CAC5D;AAED,wBAAgB,OAAO,CACrB,IAAI,EAAE,WAAW,EACjB,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,iBAAiB,CAAC,SAAS,CAAC,GACrC,iBAAiB,CAEnB;AAED,+GAA+G;AAC/G,qBAAa,iBAAkB,SAAQ,KAAK;IAC1C,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,OAAO,CAAC,EAAE,iBAAiB,CAAC,SAAS,CAAC,CAAC;gBAEpC,KAAK,EAAE,iBAAiB;CAMrC"}
|
package/dist/refusals.js
CHANGED
package/dist/refusals.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refusals.js","sourceRoot":"","sources":["../src/refusals.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,uBAAuB;IACvB,oBAAoB;IACpB,2BAA2B;IAC3B,kBAAkB;IAClB,cAAc;IACd,kBAAkB;IAClB,kBAAkB;IAClB,yBAAyB;IACzB,sBAAsB;IACtB,gBAAgB;IAChB,iBAAiB;IACjB,sBAAsB;IACtB,qGAAqG;IACrG,wFAAwF;IACxF,iBAAiB;IACjB,iBAAiB;IACjB,oBAAoB;IACpB,kGAAkG;IAClG,sEAAsE;IACtE,cAAc;IACd,oBAAoB;IACpB,6BAA6B;IAC7B,oBAAoB;IACpB,uBAAuB;IACvB,uBAAuB;IACvB,qBAAqB;IACrB,qBAAqB;IACrB,eAAe;IACf,0BAA0B;IAC1B,0BAA0B;IAC1B,uBAAuB;IACvB,sBAAsB;IACtB,6BAA6B;IAC7B,4BAA4B;IAC5B,yBAAyB;CACjB,CAAC;AAWX,MAAM,UAAU,OAAO,CACrB,IAAiB,EACjB,OAAe,EACf,OAAsC;IAEtC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,GAAG,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;AAC/G,CAAC;AAED,+GAA+G;AAC/G,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IACjC,IAAI,CAAc;IAClB,OAAO,CAAgC;IAEhD,YAAY,KAAwB;QAClC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC;QAChC,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC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AmB,CAAC;QAChC,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;IAC/B,CAAC;CACF"}
|
package/dist/resolve.d.ts
CHANGED
|
@@ -49,6 +49,16 @@ export declare function expandSubsumed(grant: Capability[]): Capability[];
|
|
|
49
49
|
* `tool:*` — authority to grant every tool — which made the safe configuration the laborious one.
|
|
50
50
|
*/
|
|
51
51
|
export declare const AGENT_WILDCARD: Capability;
|
|
52
|
+
/**
|
|
53
|
+
* `workspace:*` covers any `workspace:<id>` — ADR-0035, and the second namespace wildcard.
|
|
54
|
+
*
|
|
55
|
+
* Added as a deliberate edit, which is what the comment in `resolve()` below asks for: there is no
|
|
56
|
+
* generalised `<ns>:*` rule, so a namespace does not acquire a wildcard by existing. Unlike `agent:*` this
|
|
57
|
+
* one is **not inheritable** (`childEnv` strips it) — R-26's rule, because a root that handed
|
|
58
|
+
* `workspace:*` down would make routing attenuation meaningless below the root, which is the exact defect
|
|
59
|
+
* R-131 records.
|
|
60
|
+
*/
|
|
61
|
+
export declare const WORKSPACE_WILDCARD: Capability;
|
|
52
62
|
export interface ResolveInput {
|
|
53
63
|
/** What the delegating agent asked to give the child. */
|
|
54
64
|
requested: Capability[];
|
package/dist/resolve.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../src/resolve.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,yFAAyF;AACzF,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC;AAEhC;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,EAAE,SAAS,UAAU,EAGvD,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,UAAU,EAAE,SAAS,UAAU,EAAE,CAAC,CAU3E,CAAC;AAEF,4DAA4D;AA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AAO,EAAE,UAAU,EAAE,CAAC;IACtB,oDAAoD;IACpD,YAAY,EAAE,UAAU,EAAE,CAAC;IAC3B,+EAA+E;IAC/E,SAAS,EAAE,UAAU,EAAE,CAAC;IACxB;;;OAGG;IACH,UAAU,EAAE,UAAU,EAAE,CAAC;CAC1B;AAID;;;GAGG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,GAAG,aAAa,CAkG1D;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,aAAa,EAAE,cAAc,UAAQ,GAAG,IAAI,CAQnF;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,UAAU,EAAE,GAAG,MAAM,EAAE,GAAG,IAAI,CAQ3E"}
|
package/dist/resolve.js
CHANGED
|
@@ -69,6 +69,16 @@ import { isWellFormedCapability } from "./capabilities.js";
|
|
|
69
69
|
* `tool:*` — authority to grant every tool — which made the safe configuration the laborious one.
|
|
70
70
|
*/
|
|
71
71
|
export const AGENT_WILDCARD = "agent:*";
|
|
72
|
+
/**
|
|
73
|
+
* `workspace:*` covers any `workspace:<id>` — ADR-0035, and the second namespace wildcard.
|
|
74
|
+
*
|
|
75
|
+
* Added as a deliberate edit, which is what the comment in `resolve()` below asks for: there is no
|
|
76
|
+
* generalised `<ns>:*` rule, so a namespace does not acquire a wildcard by existing. Unlike `agent:*` this
|
|
77
|
+
* one is **not inheritable** (`childEnv` strips it) — R-26's rule, because a root that handed
|
|
78
|
+
* `workspace:*` down would make routing attenuation meaningless below the root, which is the exact defect
|
|
79
|
+
* R-131 records.
|
|
80
|
+
*/
|
|
81
|
+
export const WORKSPACE_WILDCARD = "workspace:*";
|
|
72
82
|
const unique = (xs) => [...new Set(xs)].sort();
|
|
73
83
|
/**
|
|
74
84
|
* Resolve a child's grant. Total and side-effect free; every rejected capability is reported rather
|
|
@@ -79,7 +89,10 @@ export function resolve(input) {
|
|
|
79
89
|
const held = new Set(input.parentGrant);
|
|
80
90
|
const parent = input.subsumption === false ? held : new Set(expandSubsumed(input.parentGrant));
|
|
81
91
|
/**
|
|
82
|
-
* `agent:*` covers any `agent:<name>` — ADR-0023
|
|
92
|
+
* `agent:*` covers any `agent:<name>` — ADR-0023. It was the only wildcard rule in this function when
|
|
93
|
+
* that was written; ADR-0035 added a third, so `covered()` now has `tool:*`, `agent:*` and `workspace:*`.
|
|
94
|
+
* There is still no GENERALISED `<ns>:*` rule: each is a deliberate edit, which is the property worth
|
|
95
|
+
* keeping. Corrected because the sentence sat eighty lines above "all THREE wildcards are excluded".
|
|
83
96
|
*
|
|
84
97
|
* `resolve` is otherwise exact-match plus subsumption, deliberately: `tool:*` works not because anything
|
|
85
98
|
* here understands it, but because `deriveOwnGrant` *enumerates* a session's observed tool names beside
|
|
@@ -104,12 +117,15 @@ export function resolve(input) {
|
|
|
104
117
|
* spellings of one rule, and the enforcing one was wrong.
|
|
105
118
|
*/
|
|
106
119
|
const anyCapability = held.has(WILDCARD);
|
|
120
|
+
const anyWorkspace = held.has(WORKSPACE_WILDCARD);
|
|
107
121
|
// A malformed id is never covered — not by an exact hold, and above all not by a wildcard's PREFIX rule,
|
|
108
122
|
// which is how `agent:x,tool:bash` got admitted and then split into two capabilities in the child.
|
|
109
123
|
// Landing in `denied` is the right outcome rather than a throw: it fails closed AND records an
|
|
110
124
|
// escalation attempt, so the ledger shows the attempt instead of a clean line.
|
|
111
125
|
const covered = (c) => isWellFormedCapability(c)
|
|
112
|
-
&& (parent.has(c) || anyCapability
|
|
126
|
+
&& (parent.has(c) || anyCapability
|
|
127
|
+
|| (anyDefinition && c.startsWith("agent:"))
|
|
128
|
+
|| (anyWorkspace && c.startsWith("workspace:")));
|
|
113
129
|
const ceiling = input.ceiling === undefined ? null : new Set(input.ceiling);
|
|
114
130
|
const gated = new Set(input.gated ?? []);
|
|
115
131
|
const approved = new Set(input.approved ?? []);
|
|
@@ -148,7 +164,15 @@ export function resolve(input) {
|
|
|
148
164
|
// F9: capabilities covered by a WILDCARD are not "subsumed" — this field means "the grant is broader
|
|
149
165
|
// than its list suggests", which is the `bash`-covers-`grep` warning. A wildcard holder already knows
|
|
150
166
|
// its grant is broad; listing every id under it would bury the signal the field exists to carry.
|
|
151
|
-
|
|
167
|
+
//
|
|
168
|
+
// All THREE wildcards are excluded. `anyWorkspace` was missing, so a caller holding `workspace:*` saw
|
|
169
|
+
// its own `workspace:prod` reported as subsumed while the `agent:*` holder correctly saw nothing — the
|
|
170
|
+
// field contradicting its own rule, and a false "broader than it looks" flag in the ledger and in
|
|
171
|
+
// `/grants`. Every wildcard added to `covered()` above needs a line here; that is now three for three.
|
|
172
|
+
subsumedBy: effective.filter((c) => !held.has(c)
|
|
173
|
+
&& !anyCapability
|
|
174
|
+
&& !(anyDefinition && c.startsWith("agent:"))
|
|
175
|
+
&& !(anyWorkspace && c.startsWith("workspace:"))),
|
|
152
176
|
};
|
|
153
177
|
}
|
|
154
178
|
/**
|
package/dist/resolve.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve.js","sourceRoot":"","sources":["../src/resolve.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAKH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAA0B;IAC3D,2BAA2B;IAC3B,kBAAkB;CACnB,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,WAAW,GAAwD;IAC9E,WAAW,EAAE;QACX,WAAW;QACX,WAAW;QACX,SAAS;QACT,WAAW;QACX,YAAY;QACZ,WAAW;QACX,gBAAgB;KACjB;CACF,CAAC;AAEF,4DAA4D;AAC5D,MAAM,UAAU,cAAc,CAAC,KAAmB;IAChD,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC;IAChC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,KAAK,MAAM,OAAO,IAAI,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE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AG,SAAS;SACpB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QAC7D,6FAA6F;SAC5F,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;SAClF,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC/B,MAAM,OAAO,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAC3C,OAAO,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC;AAC7C,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ADR-0035's three routing guards, and why each one is shaped the way it is.
|
|
3
|
+
*
|
|
4
|
+
* Lifted out of `delegate.ts` when it crossed the 400-line ceiling `test/file-size.test.ts` enforces — the
|
|
5
|
+
* same move `grants.ts` made at 398 and `delegate.ts` itself made at 413. It is a real seam rather than a
|
|
6
|
+
* line-count dodge: all three answer one question, *may this caller route this child to this workspace, and
|
|
7
|
+
* is the id even usable as a capability?*, and none of them looks at anything else in a delegation. The
|
|
8
|
+
* alternative was trimming the rationale below to fit, which is how a codebase loses the reasons for its
|
|
9
|
+
* guards.
|
|
10
|
+
*
|
|
11
|
+
* Each returns a refusal DESCRIPTOR rather than a `Delegation`, so the planner keeps sole ownership of
|
|
12
|
+
* assembling records. `denied` is present exactly when the attempt should count as an escalation.
|
|
13
|
+
*/
|
|
14
|
+
import { type Capability } from "./resolve.ts";
|
|
15
|
+
import type { RefusalCode } from "./refusals.ts";
|
|
16
|
+
export interface RoutingRefusal {
|
|
17
|
+
code: RefusalCode;
|
|
18
|
+
reason: string;
|
|
19
|
+
/**
|
|
20
|
+
* The capability to record in `denied`, when this refusal IS an escalation attempt.
|
|
21
|
+
*
|
|
22
|
+
* Absent for a malformed id, which is a bad request rather than a bid for authority — and seeding `denied`
|
|
23
|
+
* with an id that re-splits into several capabilities would make the one signal `isEscalationAttempt` reads
|
|
24
|
+
* unparseable. Present for an unauthorised route, which is exactly a bid for authority.
|
|
25
|
+
*/
|
|
26
|
+
denied?: Capability[];
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* May this caller route a child to `boundWorkspaceId`, and is that id usable as a capability id at all?
|
|
30
|
+
*
|
|
31
|
+
* Checked before anything is said about the target, for the reason `maySpawnDefinition` is: it is a
|
|
32
|
+
* governance question about the SESSION. Before ADR-0035 nothing checked it — the registry inherited into
|
|
33
|
+
* every governed child and a child routed to `staging` could route its grandchild to `prod` (R-131, measured
|
|
34
|
+
* in `docs/probes/g36-workspace-attenuation`).
|
|
35
|
+
*
|
|
36
|
+
* **Well-formedness first, because `workspace_id` is a model-facing tool parameter** and the next step turns
|
|
37
|
+
* it into a capability id. `workspace_id: "prod,tool:bash"` produced a `WORKSPACE_NOT_AUTHORIZED` whose
|
|
38
|
+
* `denied` array held `workspace:prod,tool:bash`: no authority minted, since the refusal is terminal, but
|
|
39
|
+
* `denied` is the channel `isEscalationAttempt` and `/grants ledger` count and an id that re-splits makes it
|
|
40
|
+
* unreadable. 0.18.1 is what happens when a comma goes unremarked.
|
|
41
|
+
*
|
|
42
|
+
* **`!== undefined`, not truthiness.** `workspace_id: ""` is falsy, so it skipped BOTH checks and failed
|
|
43
|
+
* closed much later at `resolveWorkspace` with `denied: []` — an unauthorised routing attempt invisible to
|
|
44
|
+
* every audit query. An empty id is a malformed id, not an absent one.
|
|
45
|
+
*/
|
|
46
|
+
export declare function checkRoutingAuthority(boundWorkspaceId: string | undefined, ownGrant: readonly Capability[]): RoutingRefusal | null;
|
|
47
|
+
/**
|
|
48
|
+
* May `workspace:*` be handed to a child? No — and only its HOLDER gets told so in those words.
|
|
49
|
+
*
|
|
50
|
+
* `workspace:*` is held and never inherited, so a child that "was granted" it would receive an env without
|
|
51
|
+
* it, and the ledger would record an authority the child does not have — the mirror image of R-131 and just
|
|
52
|
+
* as unreadable. `childEnv` strips it from a session's OWN grant because a root legitimately holds it; asking
|
|
53
|
+
* to hand it to a child is a different act and the honest answer is no. `NARROWING_VIOLATED` is the existing
|
|
54
|
+
* code for "this grant would not actually narrow", which is precisely what routing authority over every
|
|
55
|
+
* registered root does.
|
|
56
|
+
*
|
|
57
|
+
* **`tool:*` does NOT reach the same outcome, and an earlier comment claimed it did.** It said
|
|
58
|
+
* `assertNarrowing` produces the equivalent refusal; it does not. `UNIVERSAL_CAPABILITIES` is
|
|
59
|
+
* `["ext:pi-fabric/fabric_exec", "tool:fabric_exec"]`, so `result.universal` is empty for `tool:*` and
|
|
60
|
+
* nothing throws: requesting it for a child is allowed, recorded as granted, and silently stripped from the
|
|
61
|
+
* child env by `inheritableGrant` (R-135). The asymmetry is deliberate — an ungoverned session's own grant IS
|
|
62
|
+
* `tool:*`, so refusing to spawn from one would break governance-is-opt-in, while `workspace:*` only ever
|
|
63
|
+
* appears in `requested` because somebody asked — but it is an asymmetry, not one rule twice.
|
|
64
|
+
*
|
|
65
|
+
* **Only for a holder.** A caller without it is attempting an escalation, and this refusal would tell it the
|
|
66
|
+
* wildcard "is held, never inherited" — false about a session holding nothing of the sort — while leaving
|
|
67
|
+
* `denied` empty, so nothing counted a model probing `tools: ["workspace:*"]`. Returning `null` lets
|
|
68
|
+
* `resolve()` deny it as uncovered, which is what `agent:*` and `tool:*` already do.
|
|
69
|
+
*/
|
|
70
|
+
export declare function checkWorkspaceWildcardRequest(requested: readonly Capability[], ownGrant: readonly Capability[]): RoutingRefusal | null;
|
|
71
|
+
//# sourceMappingURL=routing-authority.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routing-authority.d.ts","sourceRoot":"","sources":["../src/routing-authority.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,EAAsB,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAEnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,WAAW,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,UAAU,EAAE,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,qBAAqB,CACnC,gBAAgB,EAAE,MAAM,GAAG,SAAS,EACpC,QAAQ,EAAE,SAAS,UAAU,EAAE,GAC9B,cAAc,GAAG,IAAI,CA6BvB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,6BAA6B,CAC3C,SAAS,EAAE,SAAS,UAAU,EAAE,EAChC,QAAQ,EAAE,SAAS,UAAU,EAAE,GAC9B,cAAc,GAAG,IAAI,CAUvB"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ADR-0035's three routing guards, and why each one is shaped the way it is.
|
|
3
|
+
*
|
|
4
|
+
* Lifted out of `delegate.ts` when it crossed the 400-line ceiling `test/file-size.test.ts` enforces — the
|
|
5
|
+
* same move `grants.ts` made at 398 and `delegate.ts` itself made at 413. It is a real seam rather than a
|
|
6
|
+
* line-count dodge: all three answer one question, *may this caller route this child to this workspace, and
|
|
7
|
+
* is the id even usable as a capability?*, and none of them looks at anything else in a delegation. The
|
|
8
|
+
* alternative was trimming the rationale below to fit, which is how a codebase loses the reasons for its
|
|
9
|
+
* guards.
|
|
10
|
+
*
|
|
11
|
+
* Each returns a refusal DESCRIPTOR rather than a `Delegation`, so the planner keeps sole ownership of
|
|
12
|
+
* assembling records. `denied` is present exactly when the attempt should count as an escalation.
|
|
13
|
+
*/
|
|
14
|
+
import { mayRouteToWorkspace, isSafeWorkspaceId, workspaceCapability } from "./capabilities.js";
|
|
15
|
+
import { WORKSPACE_WILDCARD } from "./resolve.js";
|
|
16
|
+
import { WILDCARD } from "./pi-tools.js";
|
|
17
|
+
/**
|
|
18
|
+
* May this caller route a child to `boundWorkspaceId`, and is that id usable as a capability id at all?
|
|
19
|
+
*
|
|
20
|
+
* Checked before anything is said about the target, for the reason `maySpawnDefinition` is: it is a
|
|
21
|
+
* governance question about the SESSION. Before ADR-0035 nothing checked it — the registry inherited into
|
|
22
|
+
* every governed child and a child routed to `staging` could route its grandchild to `prod` (R-131, measured
|
|
23
|
+
* in `docs/probes/g36-workspace-attenuation`).
|
|
24
|
+
*
|
|
25
|
+
* **Well-formedness first, because `workspace_id` is a model-facing tool parameter** and the next step turns
|
|
26
|
+
* it into a capability id. `workspace_id: "prod,tool:bash"` produced a `WORKSPACE_NOT_AUTHORIZED` whose
|
|
27
|
+
* `denied` array held `workspace:prod,tool:bash`: no authority minted, since the refusal is terminal, but
|
|
28
|
+
* `denied` is the channel `isEscalationAttempt` and `/grants ledger` count and an id that re-splits makes it
|
|
29
|
+
* unreadable. 0.18.1 is what happens when a comma goes unremarked.
|
|
30
|
+
*
|
|
31
|
+
* **`!== undefined`, not truthiness.** `workspace_id: ""` is falsy, so it skipped BOTH checks and failed
|
|
32
|
+
* closed much later at `resolveWorkspace` with `denied: []` — an unauthorised routing attempt invisible to
|
|
33
|
+
* every audit query. An empty id is a malformed id, not an absent one.
|
|
34
|
+
*/
|
|
35
|
+
export function checkRoutingAuthority(boundWorkspaceId, ownGrant) {
|
|
36
|
+
if (boundWorkspaceId === undefined)
|
|
37
|
+
return null;
|
|
38
|
+
const authorising = workspaceCapability(boundWorkspaceId);
|
|
39
|
+
if (!isSafeWorkspaceId(boundWorkspaceId)) {
|
|
40
|
+
return {
|
|
41
|
+
code: "GRANT_ID_MALFORMED",
|
|
42
|
+
reason: `workspace id ${JSON.stringify(boundWorkspaceId)} is not usable as a capability id — it would ` +
|
|
43
|
+
`become ${JSON.stringify(authorising)}, and an id must match [A-Za-z0-9][A-Za-z0-9._/-]*. Slashes ` +
|
|
44
|
+
`and dots are fine; spaces, quotes, commas, wildcards, shell metacharacters and non-ASCII are not.`,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
if (mayRouteToWorkspace(ownGrant, boundWorkspaceId))
|
|
48
|
+
return null;
|
|
49
|
+
// Filtered by the grammar too: an id that cannot pass `isSafeWorkspaceId` is refused on every
|
|
50
|
+
// attempt, so listing it here points the model at a destination it can never reach.
|
|
51
|
+
const held = ownGrant
|
|
52
|
+
.filter((c) => c.startsWith("workspace:") && isSafeWorkspaceId(c.slice("workspace:".length)))
|
|
53
|
+
.sort();
|
|
54
|
+
return {
|
|
55
|
+
code: "WORKSPACE_NOT_AUTHORIZED",
|
|
56
|
+
// Recorded as a denial rather than a bare refusal, exactly as DEFINITION_NOT_AUTHORIZED is: asking to
|
|
57
|
+
// route somewhere this session was not granted IS an attempt to exceed the grant.
|
|
58
|
+
denied: [authorising],
|
|
59
|
+
reason: `cannot route a child to workspace "${boundWorkspaceId}" — this session does not hold ${authorising}. ` +
|
|
60
|
+
(held.length > 0
|
|
61
|
+
? `It may route to: ${held.join(", ")}.`
|
|
62
|
+
: `It may route to no workspace at all; add ${authorising} to its grant to allow this one.`),
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* May `workspace:*` be handed to a child? No — and only its HOLDER gets told so in those words.
|
|
67
|
+
*
|
|
68
|
+
* `workspace:*` is held and never inherited, so a child that "was granted" it would receive an env without
|
|
69
|
+
* it, and the ledger would record an authority the child does not have — the mirror image of R-131 and just
|
|
70
|
+
* as unreadable. `childEnv` strips it from a session's OWN grant because a root legitimately holds it; asking
|
|
71
|
+
* to hand it to a child is a different act and the honest answer is no. `NARROWING_VIOLATED` is the existing
|
|
72
|
+
* code for "this grant would not actually narrow", which is precisely what routing authority over every
|
|
73
|
+
* registered root does.
|
|
74
|
+
*
|
|
75
|
+
* **`tool:*` does NOT reach the same outcome, and an earlier comment claimed it did.** It said
|
|
76
|
+
* `assertNarrowing` produces the equivalent refusal; it does not. `UNIVERSAL_CAPABILITIES` is
|
|
77
|
+
* `["ext:pi-fabric/fabric_exec", "tool:fabric_exec"]`, so `result.universal` is empty for `tool:*` and
|
|
78
|
+
* nothing throws: requesting it for a child is allowed, recorded as granted, and silently stripped from the
|
|
79
|
+
* child env by `inheritableGrant` (R-135). The asymmetry is deliberate — an ungoverned session's own grant IS
|
|
80
|
+
* `tool:*`, so refusing to spawn from one would break governance-is-opt-in, while `workspace:*` only ever
|
|
81
|
+
* appears in `requested` because somebody asked — but it is an asymmetry, not one rule twice.
|
|
82
|
+
*
|
|
83
|
+
* **Only for a holder.** A caller without it is attempting an escalation, and this refusal would tell it the
|
|
84
|
+
* wildcard "is held, never inherited" — false about a session holding nothing of the sort — while leaving
|
|
85
|
+
* `denied` empty, so nothing counted a model probing `tools: ["workspace:*"]`. Returning `null` lets
|
|
86
|
+
* `resolve()` deny it as uncovered, which is what `agent:*` and `tool:*` already do.
|
|
87
|
+
*/
|
|
88
|
+
export function checkWorkspaceWildcardRequest(requested, ownGrant) {
|
|
89
|
+
if (!requested.includes(WORKSPACE_WILDCARD))
|
|
90
|
+
return null;
|
|
91
|
+
if (!ownGrant.includes(WORKSPACE_WILDCARD) && !ownGrant.includes(WILDCARD))
|
|
92
|
+
return null;
|
|
93
|
+
return {
|
|
94
|
+
code: "NARROWING_VIOLATED",
|
|
95
|
+
reason: `cannot grant ${WORKSPACE_WILDCARD} to a child — it is held, never inherited, because a descendant ` +
|
|
96
|
+
`holding it could route anywhere the registry lists and routing would stop attenuating below here. ` +
|
|
97
|
+
`Name the workspaces this child may route to instead (workspace:<id>, one per id).`,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=routing-authority.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routing-authority.js","sourceRoot":"","sources":["../src/routing-authority.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAChG,OAAO,EAAE,kBAAkB,EAAmB,MAAM,cAAc,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAgBzC;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,qBAAqB,CACnC,gBAAoC,EACpC,QAA+B;IAE/B,IAAI,gBAAgB,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IAChD,MAAM,WAAW,GAAG,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;IAC1D,IAAI,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,EAAE,CAAC;QACzC,OAAO;YACL,IAAI,EAAE,oBAAoB;YAC1B,MAAM,EACJ,gBAAgB,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,+CAA+C;gBAC/F,UAAU,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,8DAA8D;gBACnG,mGAAmG;SACtG,CAAC;IACJ,CAAC;IACD,IAAI,mBAAmB,CAAC,QAAQ,EAAE,gBAAgB,CAAC;QAAE,OAAO,IAAI,CAAC;IACjE,8FAA8F;IAC9F,oFAAoF;IACpF,MAAM,IAAI,GAAG,QAAQ;SAClB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,iBAAiB,CAAC,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC;SAC5F,IAAI,EAAE,CAAC;IACV,OAAO;QACL,IAAI,EAAE,0BAA0B;QAChC,sGAAsG;QACtG,kFAAkF;QAClF,MAAM,EAAE,CAAC,WAAW,CAAC;QACrB,MAAM,EACJ,sCAAsC,gBAAgB,kCAAkC,WAAW,IAAI;YACvG,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC;gBACd,CAAC,CAAC,oBAAoB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG;gBACxC,CAAC,CAAC,4CAA4C,WAAW,kCAAkC,CAAC;KACjG,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,6BAA6B,CAC3C,SAAgC,EAChC,QAA+B;IAE/B,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,kBAAkB,CAAC;QAAE,OAAO,IAAI,CAAC;IACzD,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC;QAAE,OAAO,IAAI,CAAC;IACxF,OAAO;QACL,IAAI,EAAE,oBAAoB;QAC1B,MAAM,EACJ,gBAAgB,kBAAkB,kEAAkE;YACpG,oGAAoG;YACpG,mFAAmF;KACtF,CAAC;AACJ,CAAC"}
|
package/dist/skill-packages.d.ts
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
* `source`s; the only strings that may reach it are ones that survived a whitelist here.
|
|
26
26
|
*/
|
|
27
27
|
import { type SkillDefinition } from "./definitions.ts";
|
|
28
|
-
import {
|
|
28
|
+
import { isSafeCapability } from "./capabilities.ts";
|
|
29
29
|
export interface DiscoveredSkill {
|
|
30
30
|
definition: SkillDefinition;
|
|
31
31
|
/** The file verbatim. `init` copies it rather than regenerating it, so nothing is lost in a round trip. */
|
|
@@ -94,11 +94,17 @@ export declare function isSafeName(name: string): boolean;
|
|
|
94
94
|
* grants), which is right for the enforcement path — the catalog refuses what it does not know — and is
|
|
95
95
|
* exactly why the check has to be here, at the boundary that *generates* rather than the one that enforces.
|
|
96
96
|
*
|
|
97
|
-
* The grammar is the one `docs/SPEC.md` documents: `tool:<name>`, `skill:<name>`, `agent:<name>`,
|
|
98
|
-
* `ext:<pkg>/<tool>` where `<pkg>` may be npm-scoped. No wildcards — those are refused
|
|
99
|
-
* loudly, because "you tried to grant yourself everything" is a different fact from "that is
|
|
97
|
+
* The grammar is the one `docs/SPEC.md` documents: `tool:<name>`, `skill:<name>`, `agent:<name>`,
|
|
98
|
+
* `workspace:<id>`, and `ext:<pkg>/<tool>` where `<pkg>` may be npm-scoped. No wildcards — those are refused
|
|
99
|
+
* separately and loudly, because "you tried to grant yourself everything" is a different fact from "that is
|
|
100
|
+
* not a name".
|
|
101
|
+
*
|
|
102
|
+
* `workspace:` was absent until 2026-08-21, so the boundary that GENERATES grants could not emit the one
|
|
103
|
+
* capability ADR-0035's breaking change made mandatory: a package needing to route was reported as declaring
|
|
104
|
+
* something that "is not a name". A namespace has to be added here as well as to the enforcing path, and
|
|
105
|
+
* that is the whole lesson of the review this came out of.
|
|
100
106
|
*/
|
|
101
|
-
export
|
|
107
|
+
export { isSafeCapability };
|
|
102
108
|
/** Read one installed package, if it declares skills. `null` means "not a skill package", not an error. */
|
|
103
109
|
export declare function readSkillPackage(packageDir: string): Promise<SkillPackage | null>;
|
|
104
110
|
/**
|