@xemahq/kernel-contracts 0.22.3 → 0.23.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/dist/agent-workspace/awp-spec.json +0 -1
- package/dist/agent-workspace/lib/workspace-layout.d.ts.map +1 -1
- package/dist/agent-workspace/lib/workspace-layout.js.map +1 -1
- package/dist/biome/lib/biome-manifest.d.ts +0 -8
- package/dist/biome/lib/biome-manifest.d.ts.map +1 -1
- package/dist/biome/lib/biome-manifest.js +4 -50
- package/dist/biome/lib/biome-manifest.js.map +1 -1
- package/dist/capability/lib/errors.d.ts.map +1 -1
- package/dist/capability/lib/errors.js.map +1 -1
- package/dist/capability/lib/meta-tool.d.ts.map +1 -1
- package/dist/capability/lib/meta-tool.js.map +1 -1
- package/dist/connector/lib/connector-descriptor.d.ts.map +1 -1
- package/dist/connector/lib/credential-kind.d.ts.map +1 -1
- package/dist/connector/lib/credential-kind.js.map +1 -1
- package/dist/connector/lib/filter-expr.js +6 -0
- package/dist/connector/lib/filter-expr.js.map +1 -1
- package/dist/contribution/lib/contribution-kind.d.ts.map +1 -1
- package/dist/contribution/lib/contribution-kind.js.map +1 -1
- package/dist/contribution/lib/contribution-source.d.ts.map +1 -1
- package/dist/contribution/lib/contribution-source.js.map +1 -1
- package/dist/contribution/lib/contribution.d.ts.map +1 -1
- package/dist/contribution/lib/contribution.js.map +1 -1
- package/dist/document-render/lib/render-enums.d.ts.map +1 -1
- package/dist/document-render/lib/render-enums.js.map +1 -1
- package/dist/execution-context/lib/execution-context.d.ts.map +1 -1
- package/dist/execution-context/lib/execution-context.js.map +1 -1
- package/dist/execution-environment/lib/built-in-environments.d.ts.map +1 -1
- package/dist/execution-environment/lib/built-in-environments.js.map +1 -1
- package/dist/execution-environment/lib/execution-environment.d.ts.map +1 -1
- package/dist/execution-environment/lib/execution-environment.js +1 -1
- package/dist/execution-environment/lib/execution-environment.js.map +1 -1
- package/dist/inquiry/index.d.ts.map +1 -1
- package/dist/inquiry/index.js.map +1 -1
- package/dist/object/lib/object-lifecycle.d.ts.map +1 -1
- package/dist/object/lib/object-lifecycle.js.map +1 -1
- package/dist/policy/lib/obligations.d.ts.map +1 -1
- package/dist/policy/lib/obligations.js.map +1 -1
- package/dist/runner/lib/runner-registration.d.ts.map +1 -1
- package/dist/runner/lib/runner-registration.js.map +1 -1
- package/dist/service-registry/lib/service-names.generated.d.ts.map +1 -1
- package/dist/service-registry/lib/service-names.generated.js.map +1 -1
- package/dist/space/lib/space.d.ts.map +1 -1
- package/dist/space/lib/space.js.map +1 -1
- package/dist/workflow/index.d.ts.map +1 -1
- package/dist/workflow/index.js.map +1 -1
- package/dist/workflow/lib/activity-outputs.d.ts.map +1 -1
- package/package.json +28 -19
- package/src/agent-composition/lib/agent-workspace-config.ts +3 -3
- package/src/agent-composition/lib/capability-layer.ts +2 -2
- package/src/agent-composition/lib/intrinsic-floor.ts +1 -1
- package/src/agent-session/lib/participant.ts +1 -1
- package/src/agent-workspace/lib/context-json.ts +1 -1
- package/src/agent-workspace/lib/mount-apply.ts +2 -2
- package/src/agent-workspace/lib/workspace-layout.ts +2 -4
- package/src/app-runtime/lib/app-client.ts +1 -1
- package/src/app-runtime/lib/app-lockfile.ts +2 -2
- package/src/app-runtime/lib/app.ts +4 -4
- package/src/app-runtime/lib/audience-policy.ts +2 -2
- package/src/app-runtime/lib/biome-install.ts +3 -3
- package/src/app-runtime/lib/branding-config.ts +1 -1
- package/src/app-runtime/lib/delegated-session.ts +1 -1
- package/src/app-runtime/lib/external-subject.ts +1 -1
- package/src/biome/lib/biome-capability-refs.ts +3 -3
- package/src/biome/lib/biome-engines.ts +2 -2
- package/src/biome/lib/biome-lifecycle-hooks.ts +1 -1
- package/src/biome/lib/biome-lifecycle.ts +3 -3
- package/src/biome/lib/biome-manifest.ts +68 -122
- package/src/biome/lib/biome-permissions.ts +2 -2
- package/src/biome/lib/biome-scope.ts +2 -2
- package/src/biome/lib/biome-trust-tier.ts +1 -1
- package/src/biome/lib/trust-tier-policies.ts +2 -2
- package/src/biome-availability/lib/biome-availability.ts +1 -1
- package/src/capability/lib/capability-contribution.ts +3 -3
- package/src/capability/lib/capability-grant.ts +5 -5
- package/src/capability/lib/capability-policy.ts +2 -2
- package/src/capability/lib/capability-ref.ts +4 -4
- package/src/capability/lib/errors.ts +4 -10
- package/src/capability/lib/meta-tool.ts +2 -5
- package/src/capability/lib/permission-profile.ts +7 -7
- package/src/capability/lib/shell-command-descriptor.ts +3 -3
- package/src/connector/lib/adapter-kind.ts +1 -1
- package/src/connector/lib/capability-refs.ts +1 -1
- package/src/connector/lib/connector-descriptor.ts +4 -3
- package/src/connector/lib/credential-kind.ts +3 -4
- package/src/connector/lib/envelope-schema.ts +2 -2
- package/src/connector/lib/filter-expr-validate.ts +1 -1
- package/src/connector/lib/filter-expr.ts +8 -0
- package/src/contribution/lib/contribution-kind.ts +11 -12
- package/src/contribution/lib/contribution-source.ts +1 -2
- package/src/contribution/lib/contribution.ts +3 -6
- package/src/document-render/lib/render-enums.ts +1 -2
- package/src/execution-context/lib/caller.ts +2 -2
- package/src/execution-context/lib/execution-context.ts +12 -18
- package/src/execution-environment/lib/approval-rule.ts +2 -2
- package/src/execution-environment/lib/built-in-environments.ts +9 -11
- package/src/execution-environment/lib/execution-environment.ts +25 -26
- package/src/inquiry/index.ts +1 -2
- package/src/invocation/lib/invocation-mode.ts +1 -1
- package/src/invocation/lib/invocation-record.ts +1 -1
- package/src/invocation/lib/isolation-level.ts +1 -1
- package/src/kernel-state/lib/adapter-kind.ts +3 -3
- package/src/kernel-state/lib/kernel-state.ts +1 -1
- package/src/kernel-state/lib/key-grammar.ts +1 -1
- package/src/mcp-tool/lib/tool-selection.ts +1 -1
- package/src/object/lib/object-lifecycle.ts +1 -2
- package/src/object/lib/xema-object-kind.ts +1 -1
- package/src/object/lib/xema-object-ref.ts +2 -2
- package/src/org-database/lib/db-result-event.ts +3 -3
- package/src/policy/lib/obligations.ts +5 -6
- package/src/policy/lib/policy.ts +7 -7
- package/src/policy/lib/route-hints.ts +1 -1
- package/src/provisioning/index.ts +1 -1
- package/src/provisioning/lib/provisioning.ts +4 -4
- package/src/resource/lib/resource-ownership-contribution.ts +2 -2
- package/src/runner/lib/dispatch.ts +5 -5
- package/src/runner/lib/job-token.ts +2 -2
- package/src/runner/lib/runner-attestation.ts +2 -2
- package/src/runner/lib/runner-job.ts +2 -2
- package/src/runner/lib/runner-mode.ts +1 -1
- package/src/runner/lib/runner-plane.ts +2 -2
- package/src/runner/lib/runner-registration.ts +9 -10
- package/src/runner/lib/runner.ts +7 -7
- package/src/runner-input-hash/lib/input-hash.ts +2 -2
- package/src/service-registry/lib/service-descriptor.ts +1 -1
- package/src/service-registry/lib/service-names.generated.ts +1 -3
- package/src/space/lib/space-ref-parser.ts +1 -1
- package/src/space/lib/space.ts +4 -5
- package/src/widget/lib/chat-widget-envelope.ts +1 -1
- package/src/worker-runtime/lib/capabilities.ts +1 -1
- package/src/workflow/index.ts +2 -3
- package/src/workflow/lib/activity-outputs.ts +3 -4
- package/src/workflow/lib/agent-role.ts +5 -5
- package/src/workflow/lib/artifact-ref.ts +1 -1
- package/src/workflow/lib/compiled-run.ts +2 -2
- package/src/workflow/lib/compiled-workspace-manifest.ts +2 -2
- package/src/workflow/lib/enums.ts +4 -4
- package/src/workflow/lib/errors.ts +1 -1
- package/src/workflow/lib/model-ref.ts +1 -1
- package/src/workflow/lib/mount-plan.ts +1 -1
- package/src/workflow/lib/platform-task-queue.ts +3 -3
- package/src/workflow/lib/role-capability.ts +1 -1
- package/src/workflow/lib/run-progress.ts +2 -2
- package/src/workflow/lib/trigger-payload.ts +2 -2
- package/src/workflow/lib/variable-requirement.ts +1 -1
- package/src/workflow/lib/workspace-manifest-enums.ts +1 -1
- package/src/workspace-storage/lib/types.ts +1 -1
- package/LICENSE +0 -176
|
@@ -66,7 +66,7 @@ export enum XemaObjectKind {
|
|
|
66
66
|
// Contribution registry (self-referential)
|
|
67
67
|
ContributionEntry = 'contribution-entry',
|
|
68
68
|
|
|
69
|
-
// Concept registry — self-describing OS documentation objects
|
|
69
|
+
// Concept registry — self-describing OS documentation objects
|
|
70
70
|
Concept = 'concept',
|
|
71
71
|
}
|
|
72
72
|
|
|
@@ -3,8 +3,8 @@ import { SpaceRef, SpaceKind, spaceRefToPath } from '../../space';
|
|
|
3
3
|
import { XemaObjectKind, XemaObjectKindSchema } from './xema-object-kind';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* Stable wire shape for every XemaObject address (XSI plane 1
|
|
7
|
-
*
|
|
6
|
+
* Stable wire shape for every XemaObject address (XSI plane 1). The
|
|
7
|
+
* grammar is:
|
|
8
8
|
*
|
|
9
9
|
* `xema://<scope-path>/<kind>/<slug>[@<version>]`
|
|
10
10
|
*
|
|
@@ -30,12 +30,12 @@ export interface DbColumnMeta {
|
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
32
|
* Surface event payload emitted when the database explorer executes a SQL
|
|
33
|
-
* statement on behalf of an agent tool call.
|
|
33
|
+
* statement on behalf of an agent tool call.
|
|
34
34
|
*
|
|
35
35
|
* `rows` carries the actual row data — it MUST go to the frontend only and
|
|
36
36
|
* MUST never be passed back into LLM context. Producers route it through
|
|
37
|
-
* the agent-session SSE channel
|
|
38
|
-
* caller
|
|
37
|
+
* the agent-session SSE channel where available, or return it inline to the
|
|
38
|
+
* caller when no SSE bridge exists yet.
|
|
39
39
|
*
|
|
40
40
|
* `statement` is the SQL string the agent supplied. It is shown in the UI
|
|
41
41
|
* as a reference for the user; it is NOT a secret. Audit logs hash the
|
|
@@ -2,7 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import { DataClassificationSchema } from '../../space';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* Closed obligation taxonomy
|
|
5
|
+
* Closed obligation taxonomy.
|
|
6
6
|
*
|
|
7
7
|
* Every `PolicyObligation` carries one of these `kind` discriminants;
|
|
8
8
|
* the wire payload is a discriminated union (see `PolicyObligation`).
|
|
@@ -33,8 +33,7 @@ export const PolicyObligationKindSchema = z.nativeEnum(PolicyObligationKind);
|
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
35
|
* Closed runner-kind set referenced by `PolicyObligation`
|
|
36
|
-
* (`require-runner-kind`) and by `RouteHint.preferredRunnerKind
|
|
37
|
-
* v4.3 §2 / §A.4).
|
|
36
|
+
* (`require-runner-kind`) and by `RouteHint.preferredRunnerKind`.
|
|
38
37
|
*
|
|
39
38
|
* This is the canonical `RunnerKind` — the policy decision layer is its
|
|
40
39
|
* primary author (policy selects on it to route an invocation), so it lives
|
|
@@ -50,7 +49,7 @@ export enum RunnerKind {
|
|
|
50
49
|
Sandbox = 'sandbox',
|
|
51
50
|
CI = 'ci',
|
|
52
51
|
/**
|
|
53
|
-
*
|
|
52
|
+
* External MCP server bridged through `mcp-gateway-api`'s
|
|
54
53
|
* external-bridge. The router resolves capability refs of the form
|
|
55
54
|
* `<provider-slug>:<tool-name>@1` to this runner kind, then forwards
|
|
56
55
|
* the invoke envelope to the bridge which translates back to an MCP
|
|
@@ -63,7 +62,7 @@ export const RunnerKindSchema = z.nativeEnum(RunnerKind);
|
|
|
63
62
|
|
|
64
63
|
/**
|
|
65
64
|
* Closed data-residency tag set referenced by `PolicyObligation`
|
|
66
|
-
* (`data-residency`)
|
|
65
|
+
* (`data-residency`).
|
|
67
66
|
*
|
|
68
67
|
* `customer-private` is the customer-edge tenancy class used when the
|
|
69
68
|
* org runs its own runner in a private network. Add new regions by
|
|
@@ -195,7 +194,7 @@ export type EgressAllowlistObligation = z.infer<
|
|
|
195
194
|
>;
|
|
196
195
|
|
|
197
196
|
/**
|
|
198
|
-
* `PolicyObligation` — closed discriminated union
|
|
197
|
+
* `PolicyObligation` — closed discriminated union.
|
|
199
198
|
*
|
|
200
199
|
* Producers MUST construct one of the typed variants above; consumers
|
|
201
200
|
* MUST switch on `kind` and handle every variant explicitly. The kernel
|
package/src/policy/lib/policy.ts
CHANGED
|
@@ -10,11 +10,11 @@ import {
|
|
|
10
10
|
import { RouteHintSchema, type RouteHint } from './route-hints';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
* Closed decision set
|
|
13
|
+
* Closed decision set.
|
|
14
14
|
*
|
|
15
15
|
* `needs_approval` is its own outcome — never collapsed into `allow`
|
|
16
16
|
* with an obligation; the router suspends the invocation when it sees
|
|
17
|
-
* this kind and emits `approval.requested.v1
|
|
17
|
+
* this kind and emits `approval.requested.v1`.
|
|
18
18
|
*/
|
|
19
19
|
export enum PolicyDecisionKind {
|
|
20
20
|
Allow = 'allow',
|
|
@@ -26,7 +26,7 @@ export const PolicyDecisionKindSchema = z.nativeEnum(PolicyDecisionKind);
|
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
28
|
* Which precedence tier supplied the `credentialBindingId` on an `allow`
|
|
29
|
-
* decision
|
|
29
|
+
* decision. Closed set — the PDP applies a fixed
|
|
30
30
|
* priority ladder and records the winning tier so the Studio debugger (and
|
|
31
31
|
* audit) can explain WHY a given binding was selected, without re-deriving it.
|
|
32
32
|
*
|
|
@@ -47,7 +47,7 @@ export enum CredentialPrecedenceSource {
|
|
|
47
47
|
* A deployment-wide platform default provision (broadest tier, below org).
|
|
48
48
|
* An org-scoped default always overrides it. Used by `authorization-api`'s
|
|
49
49
|
* credential-precedence resolver once this kernel change is published +
|
|
50
|
-
* consumed
|
|
50
|
+
* consumed.
|
|
51
51
|
*/
|
|
52
52
|
PlatformDefault = 'platform_default',
|
|
53
53
|
}
|
|
@@ -58,7 +58,7 @@ export const CredentialPrecedenceSourceSchema = z.nativeEnum(
|
|
|
58
58
|
|
|
59
59
|
/**
|
|
60
60
|
* `PolicyRequest` — the input shape `authorization-api.policyCheck`
|
|
61
|
-
* accepts
|
|
61
|
+
* accepts.
|
|
62
62
|
*
|
|
63
63
|
* Currently a type alias for `ExecutionContext` because every field
|
|
64
64
|
* policy needs is already on the envelope. Kept as a separate name so a
|
|
@@ -72,7 +72,7 @@ export const PolicyRequestSchema: z.ZodType<PolicyRequest> =
|
|
|
72
72
|
|
|
73
73
|
/**
|
|
74
74
|
* `PolicyDecision` — the output shape `authorization-api.policyCheck`
|
|
75
|
-
* returns
|
|
75
|
+
* returns.
|
|
76
76
|
*
|
|
77
77
|
* `kind` is the verdict; `obligations` is a CLOSED discriminated union
|
|
78
78
|
* (see `PolicyObligation`); `routeHints` carries runner-selection
|
|
@@ -86,7 +86,7 @@ export interface PolicyDecision {
|
|
|
86
86
|
routeHints?: RouteHint;
|
|
87
87
|
/**
|
|
88
88
|
* The credential binding the executing gateway MUST use to resolve the
|
|
89
|
-
* external credential for this invocation
|
|
89
|
+
* external credential for this invocation. Present
|
|
90
90
|
* ONLY on an `allow` decision for a capability that declares an
|
|
91
91
|
* `externalServiceRef`. The PDP is the single authority that selects it via
|
|
92
92
|
* the deterministic precedence ladder; the router passes ONLY this opaque id
|
|
@@ -3,7 +3,7 @@ import { RunnerKind, RunnerKindSchema } from './obligations';
|
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* `RouteHint` — runner-selection guidance emitted alongside a
|
|
6
|
-
* `PolicyDecision
|
|
6
|
+
* `PolicyDecision`.
|
|
7
7
|
*
|
|
8
8
|
* The capability router consults this AFTER policy returns `allow`, to
|
|
9
9
|
* pick a runner that satisfies all hints. Hints are PREFERENCES unless
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// ═══════════════════════════════════════════════════════════════════════════
|
|
2
2
|
// @xemahq/provisioning-contracts — Workspace Provisioning wire contracts.
|
|
3
3
|
//
|
|
4
|
-
// Pure types + Zod schemas for the `provision` lifecycle phase
|
|
4
|
+
// Pure types + Zod schemas for the `provision` lifecycle phase: the
|
|
5
5
|
// deterministic, guard-gated `SCAFFOLD` / `EQUIP` steps that prepare a
|
|
6
6
|
// session's repo content. agent-session-api's `provisioning-plan-resolver`
|
|
7
7
|
// RESOLVES a plan from biome manifests; workspace-proxy's
|
|
@@ -140,7 +140,7 @@ export type ProvisioningAgentInstruction = z.infer<
|
|
|
140
140
|
>;
|
|
141
141
|
|
|
142
142
|
/**
|
|
143
|
-
* Presigned-URL pair for the content-addressed scaffold cache
|
|
143
|
+
* Presigned-URL pair for the content-addressed scaffold cache.
|
|
144
144
|
* agent-session-api mints these from a step's `cacheKey`; workspace-proxy
|
|
145
145
|
* GETs `getUrl` to probe for a hit, and on a miss PUTs the built tar to
|
|
146
146
|
* `putUrl` (write-through). `getHeaders` / `putHeaders` are the headers the
|
|
@@ -194,7 +194,7 @@ export const ResolvedProvisioningStepSchema = z
|
|
|
194
194
|
targetDir: z.string().min(1),
|
|
195
195
|
cacheKey: z.string().min(1).nullable(),
|
|
196
196
|
/**
|
|
197
|
-
* Presigned scaffold-cache URLs derived from `cacheKey
|
|
197
|
+
* Presigned scaffold-cache URLs derived from `cacheKey`.
|
|
198
198
|
* Present only on a cacheable step whose URLs were minted at resolve
|
|
199
199
|
* time; absent ⇒ the executor builds locally with no cache.
|
|
200
200
|
*/
|
|
@@ -231,7 +231,7 @@ export type ResolvedProvisioningPlan = z.infer<
|
|
|
231
231
|
* A `built` step that had a `cache` ref and is eligible for an out-of-band
|
|
232
232
|
* cache write. The executor no longer writes the cache inline; instead it
|
|
233
233
|
* surfaces the pending write here, and the caller (agent-session-api)
|
|
234
|
-
* dispatches `writeScaffoldCacheWorkflow` per entry
|
|
234
|
+
* dispatches `writeScaffoldCacheWorkflow` per entry.
|
|
235
235
|
*
|
|
236
236
|
* `cacheRef` is the SAME ref the plan carried in — re-passed to keep the
|
|
237
237
|
* activity stateless (workspace-proxy doesn't have to retain a presigned
|
|
@@ -257,7 +257,7 @@ export const ProvisioningStepResultSchema = z
|
|
|
257
257
|
/**
|
|
258
258
|
* Non-empty only on a `built` step whose plan carried a `cache` ref.
|
|
259
259
|
* The caller dispatches `writeScaffoldCacheWorkflow` per entry — the
|
|
260
|
-
* executor never writes the cache itself
|
|
260
|
+
* executor never writes the cache itself.
|
|
261
261
|
*/
|
|
262
262
|
pendingCacheWrite: ProvisioningPendingCacheWriteSchema.optional(),
|
|
263
263
|
})
|
|
@@ -19,7 +19,7 @@ const RESOURCE_PRINCIPALS_MAX = 100;
|
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* `ResourceVisibilityPattern` — the closed set of ownership/visibility shapes a
|
|
22
|
-
* biome may declare for a resource instance it contributes
|
|
22
|
+
* biome may declare for a resource instance it contributes.
|
|
23
23
|
*
|
|
24
24
|
* Precedence is NOT encoded here — this enum only names HOW a resource is
|
|
25
25
|
* shared; the PDP in `authorization-api` derives the effective verdict from the
|
|
@@ -78,7 +78,7 @@ export const ExplicitShareRefSchema: z.ZodType<ExplicitShareRef> = z.object({
|
|
|
78
78
|
|
|
79
79
|
/**
|
|
80
80
|
* Manifest shape carried by every `ContributionKind.ResourceOwnership`
|
|
81
|
-
* envelope
|
|
81
|
+
* envelope. One contribution = one resource instance's
|
|
82
82
|
* ownership/visibility declaration.
|
|
83
83
|
*
|
|
84
84
|
* Mirrors `CapabilityContributionManifest` precisely: a value-identical subset
|
|
@@ -5,8 +5,8 @@ import {
|
|
|
5
5
|
} from '../../execution-context';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* CloudEvent type emitted on the dispatch fan-out channel (
|
|
9
|
-
*
|
|
8
|
+
* CloudEvent type emitted on the dispatch fan-out channel (Push
|
|
9
|
+
* transport). Pull-mode runners receive the same envelope as the
|
|
10
10
|
* body of `POST /runners/<id>/pull-work`.
|
|
11
11
|
*
|
|
12
12
|
* Constant, not enum — there is exactly one dispatch type today.
|
|
@@ -16,13 +16,13 @@ import {
|
|
|
16
16
|
export const RUNNER_DISPATCH_CLOUDEVENT_TYPE = 'xema.runner.dispatch.v1' as const;
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
|
-
* `RunnerDispatch`
|
|
19
|
+
* `RunnerDispatch` — superset of the legacy
|
|
20
20
|
* `RunnerJobDispatch` shape. This v1 envelope carries the full
|
|
21
21
|
* `ExecutionContext` so the runner can re-validate the policy decision
|
|
22
22
|
* locally before invoking the capability.
|
|
23
23
|
*
|
|
24
24
|
* `tokenJwt` is the compact-JWS form of the RS256 `JobToken` minted by
|
|
25
|
-
* the kernel-server
|
|
25
|
+
* the kernel-server, aligned with `RunnerJobDispatch.tokenJwt`.
|
|
26
26
|
* The runner MUST verify the signature + claims against the kernel-server
|
|
27
27
|
* JWKS before touching the dispatch.
|
|
28
28
|
*/
|
|
@@ -33,7 +33,7 @@ export interface RunnerDispatch {
|
|
|
33
33
|
executionContext: ExecutionContext;
|
|
34
34
|
/**
|
|
35
35
|
* The capability invocation input, carried by value so the runner has the
|
|
36
|
-
* actual arguments to execute with
|
|
36
|
+
* actual arguments to execute with. The `ExecutionContext`
|
|
37
37
|
* carries only an `inputHash` fingerprint — not the payload — so without
|
|
38
38
|
* this field the runner could verify identity but had nothing to run.
|
|
39
39
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { RunnerId } from './runner';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Signed job token
|
|
4
|
+
* Signed job token.
|
|
5
5
|
*
|
|
6
6
|
* Kernel-server mints an RS256 token with a hard ceiling of 60 seconds
|
|
7
7
|
* per invocation. The runner MUST verify signature + scope before
|
|
@@ -37,7 +37,7 @@ export interface JobToken {
|
|
|
37
37
|
subjectId: string;
|
|
38
38
|
/**
|
|
39
39
|
* `canonicalCapabilityInputHash` of the dispatched invocation input
|
|
40
|
-
*
|
|
40
|
+
* Binds the unsigned `RunnerDispatch.input` to this signed
|
|
41
41
|
* token so the runner can detect input tampering before executing.
|
|
42
42
|
*/
|
|
43
43
|
inputHash: string;
|
|
@@ -12,14 +12,14 @@ export const RUNNER_ATTESTATION_REJECTED_CLOUDEVENT_TYPE =
|
|
|
12
12
|
'xema.runner.attestation.rejected.v1' as const;
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
-
* Runner attestation
|
|
15
|
+
* Runner attestation.
|
|
16
16
|
*
|
|
17
17
|
* Carried by a runner on every `register` against the kernel-server.
|
|
18
18
|
* The kernel-server validates:
|
|
19
19
|
* - `identityJwt` is signed by the trusted Keycloak realm and the
|
|
20
20
|
* subject is a service-account claim of kind `runner`.
|
|
21
21
|
* - `allowedEnvironments` is countersigned by an org-admin role
|
|
22
|
-
* (validated via OpenFGA / OPA
|
|
22
|
+
* (validated via OpenFGA / OPA).
|
|
23
23
|
* - `signedAt` is within the configured attestation freshness window.
|
|
24
24
|
*
|
|
25
25
|
* Any validation failure is fail-fast — the runner is rejected and the
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* `RunnerJob` lifecycle state machine
|
|
4
|
+
* `RunnerJob` lifecycle state machine.
|
|
5
5
|
*
|
|
6
6
|
* Pending → Dispatched → Accepted → Running → Succeeded (terminal)
|
|
7
7
|
* ↘ Failed (terminal)
|
|
@@ -64,7 +64,7 @@ export const RUNNER_JOB_COMPLETED_CLOUDEVENT_TYPE =
|
|
|
64
64
|
|
|
65
65
|
/**
|
|
66
66
|
* Report-back envelope a runner emits on accept / progress / completion
|
|
67
|
-
*
|
|
67
|
+
* `workload-runtime` keys idempotent state transitions on
|
|
68
68
|
* `(jobId, state)`; `output` is present only on a `Succeeded` report and
|
|
69
69
|
* `error` only on a `Failed` report.
|
|
70
70
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Runner-plane registry conventions
|
|
2
|
+
* Runner-plane registry conventions.
|
|
3
3
|
*
|
|
4
4
|
* Runners do not have a bespoke registry; they publish ordinary
|
|
5
5
|
* `ServiceDescriptor`s to the Service Registry under ONE well-known
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* the `ServiceDescriptor` type is in scope).
|
|
12
12
|
*
|
|
13
13
|
* Keeping the name + label keys here — in the kernel leaf both the
|
|
14
|
-
* runner producers
|
|
14
|
+
* runner producers and the router selector consume —
|
|
15
15
|
* guarantees producer/consumer agreement without a second contracts
|
|
16
16
|
* package. Adding/renaming a key is a coordinated kernel change.
|
|
17
17
|
*/
|
|
@@ -5,8 +5,7 @@ import { RunnerTransportMode } from './runner-mode';
|
|
|
5
5
|
import { RunnerTrustTier } from './runner';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* High-level execution mode a runner declares at registration time
|
|
9
|
-
* (plan §6 Phase F, north-star §3 "three biome execution modes").
|
|
8
|
+
* High-level execution mode a runner declares at registration time.
|
|
10
9
|
*
|
|
11
10
|
* This is the *biome execution mode* (where the biome physically runs)
|
|
12
11
|
* — DISTINCT from `RunnerTransportMode` (push vs pull, how the runner
|
|
@@ -17,19 +16,19 @@ import { RunnerTrustTier } from './runner';
|
|
|
17
16
|
*/
|
|
18
17
|
export enum RunnerMode {
|
|
19
18
|
/**
|
|
20
|
-
* Runs inside `xema-kernel-server` itself
|
|
19
|
+
* Runs inside `xema-kernel-server` itself. The kernel
|
|
21
20
|
* registers a synthetic runner descriptor under this mode so the
|
|
22
21
|
* dispatcher sees embedded biomes as ordinary registry entries.
|
|
23
22
|
*/
|
|
24
23
|
Embedded = 'embedded',
|
|
25
24
|
/**
|
|
26
25
|
* Sidecar process supervised by `biome-host-api`'s local-module
|
|
27
|
-
* supervisor
|
|
26
|
+
* supervisor. The default for dev + first-party.
|
|
28
27
|
*/
|
|
29
28
|
LocalModule = 'local-module',
|
|
30
29
|
/**
|
|
31
30
|
* Out-of-cluster runner reachable via event-hub Push or long-poll
|
|
32
|
-
* Pull
|
|
31
|
+
* Pull.
|
|
33
32
|
*/
|
|
34
33
|
Remote = 'remote',
|
|
35
34
|
}
|
|
@@ -54,7 +53,7 @@ export enum DataLocality {
|
|
|
54
53
|
export const DataLocalitySchema = z.nativeEnum(DataLocality);
|
|
55
54
|
|
|
56
55
|
/**
|
|
57
|
-
* Embedded biome registration
|
|
56
|
+
* Embedded biome registration.
|
|
58
57
|
*
|
|
59
58
|
* Lives on a `RunnerRegistration` whose `mode === RunnerMode.Embedded`.
|
|
60
59
|
* The `xema-kernel-server` enumerates its built-in biomes (concept
|
|
@@ -152,9 +151,9 @@ export const RunnerHealthcheckSchema = z.object({
|
|
|
152
151
|
|
|
153
152
|
/**
|
|
154
153
|
* Top-level registration a runner publishes to the Service Registry at
|
|
155
|
-
* boot
|
|
154
|
+
* boot. One row per runner instance; biomes hang underneath.
|
|
156
155
|
*
|
|
157
|
-
* Carry-forwards (
|
|
156
|
+
* Carry-forwards (planned):
|
|
158
157
|
* - Keycloak service-account JWT validation
|
|
159
158
|
* - Org-admin-countersigned `allowedEnvironments`
|
|
160
159
|
* - RS256 signed job tokens with ≤60s TTL
|
|
@@ -167,7 +166,7 @@ export interface RunnerRegistration {
|
|
|
167
166
|
region?: string;
|
|
168
167
|
/**
|
|
169
168
|
* IDs of `ExecutionEnvironment`s this runner is permitted to serve.
|
|
170
|
-
*
|
|
169
|
+
* A future step will countersign this list via the Keycloak service
|
|
171
170
|
* account; until then the runner is trusted to declare its own set.
|
|
172
171
|
*/
|
|
173
172
|
allowedEnvironments?: string[];
|
|
@@ -177,7 +176,7 @@ export interface RunnerRegistration {
|
|
|
177
176
|
*/
|
|
178
177
|
dataLocality?: DataLocality;
|
|
179
178
|
/**
|
|
180
|
-
* Trust tier assigned at attestation time
|
|
179
|
+
* Trust tier assigned at attestation time. Absent until
|
|
181
180
|
* the kernel-server attests the runner; the policy bundle MAY gate
|
|
182
181
|
* sensitive capabilities to `Trusted`/`System` tiers only.
|
|
183
182
|
*/
|
package/src/runner/lib/runner.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RunnerKind } from '../../policy';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Runner-plane contracts
|
|
4
|
+
* Runner-plane contracts.
|
|
5
5
|
*
|
|
6
6
|
* A runner is the executor that picks up a `RunnerJobDispatch` and
|
|
7
7
|
* actually invokes the capability.
|
|
@@ -14,7 +14,7 @@ import { RunnerKind } from '../../policy';
|
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
* Trust tier assigned to a runner at attestation time
|
|
17
|
+
* Trust tier assigned to a runner at attestation time. The
|
|
18
18
|
* authorization-api's policy bundle MAY gate sensitive capabilities to
|
|
19
19
|
* `Trusted` or `System` tiers only.
|
|
20
20
|
*
|
|
@@ -32,8 +32,8 @@ export enum RunnerTrustTier {
|
|
|
32
32
|
/**
|
|
33
33
|
* Canonical ordinal rank for each {@link RunnerTrustTier}. Higher = more
|
|
34
34
|
* authority. This is the SINGLE source of trust ordering — the router's
|
|
35
|
-
* dispatch min-trust gate
|
|
36
|
-
* min-trust gate
|
|
35
|
+
* dispatch min-trust gate and the runner's per-capability
|
|
36
|
+
* min-trust gate MUST both rank through this map so a runner
|
|
37
37
|
* the router accepts is ranked identically by the executor. Do not inline a
|
|
38
38
|
* second ordering.
|
|
39
39
|
*/
|
|
@@ -75,9 +75,9 @@ export type RunnerId = string & { readonly __brand: 'RunnerId' };
|
|
|
75
75
|
/**
|
|
76
76
|
* Self-description a runner publishes at registration time. Mirrors
|
|
77
77
|
* `ServiceDescriptor` in spirit but carries runner-specific labels
|
|
78
|
-
* (data locality, region) consumed by `Policy.routeHints
|
|
78
|
+
* (data locality, region) consumed by `Policy.routeHints`.
|
|
79
79
|
*
|
|
80
|
-
* For the richer
|
|
80
|
+
* For the richer registration shape (mode + biome
|
|
81
81
|
* provisioning + transport) see `RunnerRegistration`.
|
|
82
82
|
*/
|
|
83
83
|
export interface RunnerDescriptor {
|
|
@@ -87,7 +87,7 @@ export interface RunnerDescriptor {
|
|
|
87
87
|
version: string;
|
|
88
88
|
/**
|
|
89
89
|
* IDs of `ExecutionEnvironment`s this runner is allowed to serve.
|
|
90
|
-
* The list is signed by the org admin via
|
|
90
|
+
* The list is signed by the org admin via attestation; a
|
|
91
91
|
* runner MUST refuse a dispatch whose `executionContext.environmentId`
|
|
92
92
|
* is not in this list.
|
|
93
93
|
*/
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createHash } from 'node:crypto';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Deterministic canonical hash of a capability invocation input
|
|
5
|
-
*
|
|
4
|
+
* Deterministic canonical hash of a capability invocation input
|
|
5
|
+
* (input-integrity binding).
|
|
6
6
|
*
|
|
7
7
|
* The runner plane separates execution authority: the kernel-server mints
|
|
8
8
|
* the RS256 `JobToken` and the router dispatches the `RunnerDispatch`. Under
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
//
|
|
2
|
-
// names verbatim (e.g. 'opencode-worker'); those names ARE the data, not a
|
|
3
|
-
// tech-stack leak, so the stack-confidentiality scan is opted out here.
|
|
1
|
+
// Canonical first-party service names for the platform.
|
|
4
2
|
// AUTO-GENERATED by tooling/codegen/generate-service-names.mjs — DO NOT EDIT.
|
|
5
3
|
// Source of truth: each biome's xema-biome.json ships.apis[].name + every
|
|
6
4
|
// ServiceRegistryModule descriptor name. Regenerate: `node tooling/codegen/generate-service-names.mjs`.
|
package/src/space/lib/space.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Closed kind set — Spaces have exactly these 7 layers
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* ownership plane introduced in Phase A.2.
|
|
4
|
+
* Closed kind set — Spaces have exactly these 7 layers. Replaces the
|
|
5
|
+
* legacy 5-tier `ScopeTier` (System / Biome / Org / Project / User) by
|
|
6
|
+
* adding `App` and `Session` for the runtime ownership plane.
|
|
8
7
|
*
|
|
9
8
|
* Precedence is **most specific wins**:
|
|
10
9
|
* User > Session > Biome > App > Project > Org > System
|
|
@@ -38,7 +37,7 @@ export enum DataClassification {
|
|
|
38
37
|
* `orgId` and `projectId`). Optional `path` carries the fully-formatted
|
|
39
38
|
* `xema://...` URI when materialised.
|
|
40
39
|
*
|
|
41
|
-
*
|
|
40
|
+
* Value-identical rename from `ScopeRef`. Field
|
|
42
41
|
* names (`tier`, `orgId`, `projectId`, `biomeId`, `userId`) are
|
|
43
42
|
* unchanged so the rename is a single identifier swap at every consumer.
|
|
44
43
|
*/
|
|
@@ -3,7 +3,7 @@ import { z } from 'zod';
|
|
|
3
3
|
/**
|
|
4
4
|
* `ChatWidgetEnvelope` — a single widget instance recorded on an assistant
|
|
5
5
|
* message's `metadata.widgets[]` and rendered by the host-web ChatWidget
|
|
6
|
-
* registry
|
|
6
|
+
* registry.
|
|
7
7
|
*
|
|
8
8
|
* `kind` is a first-party {@link ChatWidgetKind} value OR a namespaced biome
|
|
9
9
|
* string (`<biomeId>:<kind>`). `version` is the monotonic schema version for
|
|
@@ -38,7 +38,7 @@ export interface WorkerRuntimeCapabilityBits {
|
|
|
38
38
|
* Scheduler-side capability bits. The runtime declares which scheduler
|
|
39
39
|
* features it depends on; the scheduler advertises which it provides. The
|
|
40
40
|
* composer matches the two — a required capability missing on the
|
|
41
|
-
* scheduler is a fail-fast error (
|
|
41
|
+
* scheduler is a fail-fast error (no silent degradation).
|
|
42
42
|
*/
|
|
43
43
|
export interface SchedulerCapabilityBits {
|
|
44
44
|
readonly autoRestart: boolean;
|
package/src/workflow/index.ts
CHANGED
|
@@ -35,9 +35,8 @@ export * from './lib/briefcase';
|
|
|
35
35
|
export * from './lib/catalog-taxonomies';
|
|
36
36
|
export * from './lib/domain-tag';
|
|
37
37
|
// Generic ordered-stage contract. The software-delivery-specific stage list,
|
|
38
|
-
// hierarchy, and gate-reviewer map were relocated to the software-dev biome
|
|
39
|
-
//
|
|
40
|
-
// kernel carries no domain phase enum.
|
|
38
|
+
// hierarchy, and gate-reviewer map were relocated to the software-dev biome's
|
|
39
|
+
// workflow config — the kernel carries no domain phase enum.
|
|
41
40
|
export * from './lib/phase-report';
|
|
42
41
|
export * from './lib/work-item-payloads';
|
|
43
42
|
export * from './lib/canonical-concepts';
|
|
@@ -17,10 +17,9 @@
|
|
|
17
17
|
// output was conditionally absent).
|
|
18
18
|
//
|
|
19
19
|
// Activity authors do NOT construct ArtifactRefs themselves. They pass
|
|
20
|
-
// content + type to the `finalizeOutputs` helper
|
|
21
|
-
// `
|
|
22
|
-
//
|
|
23
|
-
// replaces the values with refs.
|
|
20
|
+
// content + type to the `finalizeOutputs` helper, which promotes content
|
|
21
|
+
// to artifacts via `workflow-artifact-emitter` and replaces the values
|
|
22
|
+
// with refs.
|
|
24
23
|
//
|
|
25
24
|
// Orchestration metadata (worker IDs, allocation status, page IDs, repo
|
|
26
25
|
// SHAs, etc.) stays on the envelope alongside `outputs`. The discipline
|
|
@@ -60,7 +60,7 @@ export const AGENT_RUN_ROLES = [
|
|
|
60
60
|
/**
|
|
61
61
|
* Studio chat-author. Read-only authoring co-pilot bound to the
|
|
62
62
|
* `studio-{workflow|manifest|spec}-author` workspace manifests
|
|
63
|
-
* shipped by `
|
|
63
|
+
* shipped by the `studio-author` biome. The agent emits typed
|
|
64
64
|
* proposals only — apply goes through the standard write APIs on
|
|
65
65
|
* user confirmation. Interactive surface; never runs in a pipeline.
|
|
66
66
|
*/
|
|
@@ -70,8 +70,8 @@ export const AGENT_RUN_ROLES = [
|
|
|
70
70
|
* project's attached repo. Planner-only `webapp-coordinator` agent
|
|
71
71
|
* orchestrates scaffolder + page-builder + data-builder sub-agents.
|
|
72
72
|
* Interactive surface; never runs in a pipeline. Bound to the
|
|
73
|
-
* `webapp-studio-default` workspace manifest shipped by
|
|
74
|
-
* `
|
|
73
|
+
* `webapp-studio-default` workspace manifest shipped by the
|
|
74
|
+
* `webapp-studio` biome.
|
|
75
75
|
*/
|
|
76
76
|
'webapp-studio',
|
|
77
77
|
/**
|
|
@@ -81,8 +81,8 @@ export const AGENT_RUN_ROLES = [
|
|
|
81
81
|
* workspace-proxy's document-sync component derives the reviewable
|
|
82
82
|
* diff and persists it to knowledge-base-api. Interactive surface;
|
|
83
83
|
* never runs in a pipeline. Bound to the `document-md-default` /
|
|
84
|
-
* `document-rich-default` workspace manifests shipped by
|
|
85
|
-
* `
|
|
84
|
+
* `document-rich-default` workspace manifests shipped by the
|
|
85
|
+
* `document-buddy` biome.
|
|
86
86
|
*/
|
|
87
87
|
'document',
|
|
88
88
|
] as const;
|
|
@@ -74,7 +74,7 @@ export function isArtifactRef(value: unknown): value is ArtifactRef {
|
|
|
74
74
|
* Closed set of `ArtifactRef` member names — i.e. the fields a DSL
|
|
75
75
|
* expression `outputs.<name>.<field>` can read directly off the
|
|
76
76
|
* envelope without fetching artifact bytes. Anything else is treated
|
|
77
|
-
* as a payload-reach-in by the DSL compiler
|
|
77
|
+
* as a payload-reach-in by the DSL compiler.
|
|
78
78
|
*
|
|
79
79
|
* Kept here so the DSL compiler, the worker evaluator, and any future
|
|
80
80
|
* static-analysis tools share one source of truth.
|
|
@@ -297,7 +297,7 @@ export interface CompiledJob extends BiomeAvailabilityScoped {
|
|
|
297
297
|
* The compiler emits at most one pin per `(consumerJob, upstreamJob)`
|
|
298
298
|
* pair because the deliverable-spec binding on an upstream activity is
|
|
299
299
|
* job-level today (`with.deliverableSpecRef`). When per-output spec
|
|
300
|
-
* bindings land
|
|
300
|
+
* bindings land, this shape extends with `outputName` and the
|
|
301
301
|
* cardinality changes to `(consumerJob, upstreamJob, outputName)`.
|
|
302
302
|
*/
|
|
303
303
|
export interface PayloadReachInPin {
|
|
@@ -342,7 +342,7 @@ export interface CompiledStaticMatrixStrategy {
|
|
|
342
342
|
* Matrix expanded at runtime. `fromExpression` is the expression the root
|
|
343
343
|
* workflow evaluates once upstream outputs are available; it must resolve
|
|
344
344
|
* to an array of bindings. `maxParallel` caps concurrent child spawns.
|
|
345
|
-
* The compile-time cardinality cap
|
|
345
|
+
* The compile-time cardinality cap is enforced at runtime by
|
|
346
346
|
* rejecting arrays > maxEntries.
|
|
347
347
|
*/
|
|
348
348
|
export interface CompiledDynamicMatrixStrategy {
|
|
@@ -77,7 +77,7 @@ export interface CompiledManifestAgent {
|
|
|
77
77
|
readonly defaultModel?: ModelRef;
|
|
78
78
|
/**
|
|
79
79
|
* Optional node-level instructions carried through from the authored
|
|
80
|
-
* manifest's `spec.agent.instructions` (
|
|
80
|
+
* manifest's `spec.agent.instructions` (authoring a migrated
|
|
81
81
|
* agent as `base agent slug + instructions`). A prompt fragment the
|
|
82
82
|
* runtime layers ONTO the referenced base agent's intrinsic system
|
|
83
83
|
* prompt — semantically the same as `AgentNode.instructions`.
|
|
@@ -94,7 +94,7 @@ export interface CompiledManifestAgent {
|
|
|
94
94
|
readonly promptMode?: PromptMergeMode;
|
|
95
95
|
/**
|
|
96
96
|
* Optional node-level permission override carried through from the
|
|
97
|
-
* authored manifest's `spec.agent.permission` (
|
|
97
|
+
* authored manifest's `spec.agent.permission` (kernel extension).
|
|
98
98
|
* Deep-merged (per top-level key) over the referenced base agent's
|
|
99
99
|
* authored permission before the system tiers run — lets a generic base
|
|
100
100
|
* agent (e.g. `coder`/`planner`) be specialized into a bounded role
|