@capybara-hq/kernel 0.1.0-rc.145 → 0.1.0-rc.147

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.
Files changed (185) hide show
  1. package/dist/admin/extensions.controller.d.ts +0 -11
  2. package/dist/admin/extensions.controller.js +0 -28
  3. package/dist/admin/health.service.d.ts +25 -1
  4. package/dist/admin/health.service.js +50 -18
  5. package/dist/audit/full-access.d.ts +78 -0
  6. package/dist/audit/full-access.js +283 -0
  7. package/dist/automations/automations.service.d.ts +1 -0
  8. package/dist/automations/automations.service.js +3 -1
  9. package/dist/automations/calendar.js +3 -1
  10. package/dist/automations/grant-rules.d.ts +2 -1
  11. package/dist/automations/grant-rules.js +8 -1
  12. package/dist/automations/unattended.d.ts +13 -1
  13. package/dist/automations/unattended.js +13 -1
  14. package/dist/catalog/admin-catalog.controller.d.ts +8 -0
  15. package/dist/catalog/admin-catalog.controller.js +8 -2
  16. package/dist/catalog/admin-catalog.schemas.d.ts +10 -0
  17. package/dist/catalog/admin-catalog.schemas.js +8 -1
  18. package/dist/catalog/catalog-content.d.ts +6 -0
  19. package/dist/catalog/catalog-scope.service.d.ts +22 -2
  20. package/dist/catalog/catalog-scope.service.js +27 -3
  21. package/dist/catalog/catalog.service.js +19 -2
  22. package/dist/catalog/marketplaces.service.d.ts +1 -1
  23. package/dist/catalog/org-catalog.service.d.ts +8 -1
  24. package/dist/catalog/org-catalog.service.js +36 -3
  25. package/dist/catalog/platform-components.js +3 -2
  26. package/dist/catalog/platform-import-update.d.ts +2 -0
  27. package/dist/catalog/platform-import-update.js +8 -1
  28. package/dist/catalog/plugin-connectors.d.ts +11 -0
  29. package/dist/catalog/plugin-connectors.js +33 -0
  30. package/dist/catalog/plugin-import.d.ts +35 -15
  31. package/dist/catalog/plugin-import.js +110 -35
  32. package/dist/catalog/plugin-install.js +6 -0
  33. package/dist/catalog/provenance.d.ts +71 -0
  34. package/dist/catalog/provenance.js +112 -0
  35. package/dist/config/auto-approve.d.ts +16 -0
  36. package/dist/config/auto-approve.js +24 -0
  37. package/dist/config/capacity-presets.d.ts +243 -0
  38. package/dist/config/capacity-presets.js +195 -0
  39. package/dist/config/env.d.ts +2 -1
  40. package/dist/config/env.js +6 -1
  41. package/dist/config/load.js +15 -0
  42. package/dist/config/schema.d.ts +46 -9
  43. package/dist/config/schema.js +154 -30
  44. package/dist/ctx/create-ctx.d.ts +16 -0
  45. package/dist/ctx/create-ctx.js +269 -34
  46. package/dist/ctx/net.d.ts +5 -1
  47. package/dist/ctx/net.js +62 -12
  48. package/dist/db/kernel-schema.d.ts +31 -0
  49. package/dist/db/migrator.js +0 -36
  50. package/dist/dial-in/routes.js +1 -1
  51. package/dist/erasure/org-batches.js +1 -6
  52. package/dist/erasure/org-catalog.js +6 -2
  53. package/dist/erasure/org-rules.js +1 -0
  54. package/dist/erasure/org-worker.js +0 -13
  55. package/dist/errors.d.ts +6 -0
  56. package/dist/errors.js +6 -0
  57. package/dist/extensions/admin-ops.d.ts +14 -1
  58. package/dist/extensions/admin-ops.js +30 -3
  59. package/dist/extensions/admin-view.d.ts +21 -1
  60. package/dist/extensions/admin-view.js +43 -0
  61. package/dist/extensions/bootstrap-packages.d.ts +5 -0
  62. package/dist/extensions/bootstrap-packages.js +1 -1
  63. package/dist/extensions/bootstrap-review.d.ts +251 -0
  64. package/dist/extensions/bootstrap-review.js +676 -0
  65. package/dist/extensions/bootstrap.d.ts +21 -1
  66. package/dist/extensions/bootstrap.js +72 -2
  67. package/dist/extensions/cli.d.ts +6 -0
  68. package/dist/extensions/cli.js +4 -0
  69. package/dist/extensions/enabled.d.ts +3 -0
  70. package/dist/extensions/execution-realm.d.ts +96 -0
  71. package/dist/extensions/execution-realm.js +141 -0
  72. package/dist/extensions/extensions.module.js +12 -0
  73. package/dist/extensions/full-access-disclosure.d.ts +15 -0
  74. package/dist/extensions/full-access-disclosure.js +57 -0
  75. package/dist/extensions/grant-epoch.d.ts +9 -2
  76. package/dist/extensions/grant-epoch.js +13 -2
  77. package/dist/extensions/host.d.ts +96 -4
  78. package/dist/extensions/host.js +411 -33
  79. package/dist/extensions/installs.d.ts +18 -0
  80. package/dist/extensions/installs.js +28 -0
  81. package/dist/extensions/instance.d.ts +2 -0
  82. package/dist/extensions/instance.js +1 -0
  83. package/dist/extensions/isolated/admission.d.ts +23 -2
  84. package/dist/extensions/isolated/admission.js +32 -7
  85. package/dist/extensions/isolated/authorization.d.ts +8 -2
  86. package/dist/extensions/isolated/authorization.js +11 -3
  87. package/dist/extensions/isolated/broker.d.ts +3 -0
  88. package/dist/extensions/isolated/broker.js +50 -14
  89. package/dist/extensions/isolated/configured-package.d.ts +5 -0
  90. package/dist/extensions/isolated/configured-package.js +2 -0
  91. package/dist/extensions/isolated/lanes.d.ts +44 -3
  92. package/dist/extensions/isolated/lanes.js +263 -80
  93. package/dist/extensions/isolated/metrics.d.ts +146 -0
  94. package/dist/extensions/isolated/metrics.js +304 -0
  95. package/dist/extensions/isolated/revision.d.ts +7 -1
  96. package/dist/extensions/isolated/revision.js +26 -5
  97. package/dist/extensions/isolated/rpc.d.ts +5 -0
  98. package/dist/extensions/isolated/rpc.js +7 -2
  99. package/dist/extensions/isolated/sandbox.d.ts +23 -0
  100. package/dist/extensions/isolated/sandbox.js +50 -0
  101. package/dist/extensions/isolated/status.d.ts +79 -0
  102. package/dist/extensions/isolated/status.js +216 -0
  103. package/dist/extensions/isolated/tier.d.ts +127 -2
  104. package/dist/extensions/isolated/tier.js +266 -7
  105. package/dist/extensions/isolated/usage.d.ts +134 -0
  106. package/dist/extensions/isolated/usage.js +322 -0
  107. package/dist/extensions/ledger.d.ts +5 -0
  108. package/dist/extensions/ledger.js +16 -0
  109. package/dist/extensions/lifecycle.d.ts +42 -2
  110. package/dist/extensions/lifecycle.js +100 -4
  111. package/dist/extensions/org-config.js +11 -0
  112. package/dist/extensions/package.d.ts +14 -0
  113. package/dist/extensions/package.js +23 -0
  114. package/dist/extensions/permission-view.d.ts +2 -2
  115. package/dist/extensions/permissions.controller.d.ts +35 -0
  116. package/dist/extensions/permissions.controller.js +98 -0
  117. package/dist/extensions/permissions.schemas.d.ts +288 -0
  118. package/dist/extensions/permissions.schemas.js +96 -0
  119. package/dist/extensions/permissions.service.d.ts +116 -0
  120. package/dist/extensions/permissions.service.js +428 -0
  121. package/dist/extensions/realm-retirement.d.ts +65 -0
  122. package/dist/extensions/realm-retirement.js +150 -0
  123. package/dist/extensions/registry.d.ts +6 -0
  124. package/dist/extensions/registry.js +8 -0
  125. package/dist/extensions/review-hash.d.ts +114 -0
  126. package/dist/extensions/review-hash.js +145 -0
  127. package/dist/extensions/revision-approvals.d.ts +58 -3
  128. package/dist/extensions/revision-approvals.js +135 -14
  129. package/dist/extensions/revision-grants.d.ts +10 -0
  130. package/dist/extensions/revision-review.d.ts +144 -0
  131. package/dist/extensions/revision-review.js +297 -0
  132. package/dist/extensions/revocation-leases.d.ts +273 -0
  133. package/dist/extensions/revocation-leases.js +533 -0
  134. package/dist/extensions/revocation.d.ts +78 -0
  135. package/dist/extensions/revocation.js +205 -0
  136. package/dist/extensions/state.module.js +12 -0
  137. package/dist/git/run-end.d.ts +35 -7
  138. package/dist/git/run-end.js +87 -38
  139. package/dist/http/api.module.js +2 -0
  140. package/dist/identity/audit.d.ts +2 -1
  141. package/dist/identity/audit.js +4 -17
  142. package/dist/index.d.ts +10 -2
  143. package/dist/index.js +10 -2
  144. package/dist/infra/config/kernel-config.service.d.ts +6 -0
  145. package/dist/infra/config/kernel-config.service.js +21 -0
  146. package/dist/infra/outbox/registry.d.ts +13 -0
  147. package/dist/infra/outbox/registry.js +8 -0
  148. package/dist/lifecycle/kernel-lifecycle.d.ts +27 -1
  149. package/dist/lifecycle/kernel-lifecycle.js +83 -22
  150. package/dist/net/private-endpoint-preflight.d.ts +159 -0
  151. package/dist/net/private-endpoint-preflight.js +417 -0
  152. package/dist/net/private-endpoints.d.ts +68 -0
  153. package/dist/net/private-endpoints.js +164 -0
  154. package/dist/net/public-address.d.ts +14 -0
  155. package/dist/net/public-address.js +15 -1
  156. package/dist/net/safe-fetch.d.ts +2 -1
  157. package/dist/net/safe-fetch.js +10 -3
  158. package/dist/overrides.d.ts +9 -1
  159. package/dist/overrides.js +4 -0
  160. package/dist/packages/official-publisher.d.ts +65 -1
  161. package/dist/packages/official-publisher.js +171 -46
  162. package/dist/packages/provenance.d.ts +11 -0
  163. package/dist/packages/provenance.js +24 -0
  164. package/dist/platform/exclusions.js +4 -4
  165. package/dist/platform/ops/automations.ops.js +1 -1
  166. package/dist/platform/ops/catalog-admin.ops.js +25 -4
  167. package/dist/platform/ops/extension-permissions.ops.d.ts +11 -0
  168. package/dist/platform/ops/extension-permissions.ops.js +159 -0
  169. package/dist/platform/platform-ops.module.d.ts +2 -1
  170. package/dist/platform/platform-ops.module.js +2 -0
  171. package/dist/platform/route-schemas.js +2 -0
  172. package/dist/retention/purge-batch.js +10 -14
  173. package/dist/runtime/maintenance.d.ts +4 -2
  174. package/dist/runtime/maintenance.js +16 -3
  175. package/dist/runtime/run-finish.d.ts +3 -3
  176. package/dist/runtime/run-finish.js +7 -3
  177. package/dist/sandbox/permission-availability.d.ts +17 -2
  178. package/dist/sandbox/permission-availability.js +22 -1
  179. package/dist/sandbox/permission-facts.js +7 -1
  180. package/dist/tools/builtins/sandbox/common.js +2 -0
  181. package/dist/tools/pipeline.d.ts +2 -1
  182. package/dist/tools/pipeline.js +7 -2
  183. package/package.json +4 -3
  184. package/src/migrations/0238_extension_usage.sql +40 -0
  185. package/src/migrations/0239_extension_replica_isolation.sql +28 -0
@@ -0,0 +1,205 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
8
+ return function (target, key) { decorator(target, key, paramIndex); }
9
+ };
10
+ import { Inject, Injectable } from "@nestjs/common";
11
+ import { audit } from "../identity/audit.js";
12
+ import { afterCommit } from "../infra/database/after-commit.js";
13
+ import { KernelDb } from "../infra/database/kernel-db.js";
14
+ import { TransactionHost } from "../infra/database/transaction-host.js";
15
+ import { Transactional } from "../infra/database/transactional.decorator.js";
16
+ import { KERNEL_BUS, KERNEL_LOGGER } from "../infra/tokens.js";
17
+ import { ExtensionHost } from "./host.js";
18
+ import { ExtensionRevisionGrants, RevisionGrantError, } from "./revision-grants.js";
19
+ import { revocationView, unrevocableKeys } from "./revocation-leases.js";
20
+ export { classifyKey, PermissionLease, RevisionLeases, realmAfterRevocation, revocationView, } from "./revocation-leases.js";
21
+ /**
22
+ * Revoking revision grants (extension permission model spec 2026-12-04, "Revocation, audit and
23
+ * people"; plan task 1.3e).
24
+ *
25
+ * The grant state and its audit change in one transaction; the store's write advances the grant
26
+ * epoch in the same transaction (the grant tables' triggers of migration 0235). After the commit
27
+ * this replica fences
28
+ * its leases of the plugin at once (the local fence) and publishes {@link GRANT_REVOKED_TOPIC} to
29
+ * the others. The hint is only the fast path: a replica that misses it sees the epoch change and
30
+ * revalidates its leases within the 5 s bound (`grant-epoch.ts`).
31
+ *
32
+ * Shadow mode until plan task 1.5a (`REVOCATION_ENFORCED`): the write, audit, epoch bump, fence and
33
+ * hint are real, and the leases compute and report the decision (logs, the Partially revoked view),
34
+ * but nothing below is enforced yet. Once enforcing, on each replica the leases:
35
+ * - withdraw the registrations of revoked registration keys (routes, tools, providers, hooks,
36
+ * views, setup checks); a revoked policy hook stays registered and denies, so a required
37
+ * policy mount fails closed until the admin disables the extension;
38
+ * - refuse `ctx` operations of revoked capability keys with `ExtensionPermissionError` and abort
39
+ * the handles that relied on them; unaffected keys keep serving;
40
+ * - for revoked server full access, refuse the in-process generation's `ctx` and converge: the
41
+ * generation is unloaded, and an isolated one starts when the remaining grant fits the sandbox
42
+ * (otherwise it waits for a new review).
43
+ *
44
+ * Plugin data stays; durable effects keep their delivery-time authority checks.
45
+ */
46
+ /** The fan-out hint after a committed revocation: `{ plugin }`. Losing it is harmless. */
47
+ export const GRANT_REVOKED_TOPIC = "kernel.extensions.grant-revoked";
48
+ let ExtensionRevocations = class ExtensionRevocations {
49
+ kdb;
50
+ txHost;
51
+ grants;
52
+ host;
53
+ bus;
54
+ log;
55
+ unsubscribe;
56
+ constructor(kdb, txHost, grants, host, bus, log) {
57
+ this.kdb = kdb;
58
+ this.txHost = txHost;
59
+ this.grants = grants;
60
+ this.host = host;
61
+ this.bus = bus;
62
+ this.log = log;
63
+ }
64
+ /**
65
+ * Every replica takes the hints of the others (and its own, a no-op after the local fence).
66
+ * Called by the kernel's start sequence (never in the CLI, which loads no extension).
67
+ */
68
+ async start() {
69
+ if (this.unsubscribe)
70
+ return;
71
+ try {
72
+ this.unsubscribe = await this.bus.subscribe(GRANT_REVOKED_TOPIC, (payload) => {
73
+ const plugin = payload?.plugin;
74
+ if (typeof plugin !== "string")
75
+ return;
76
+ this.fence(plugin);
77
+ });
78
+ }
79
+ catch (err) {
80
+ // the grant epoch still fences every lease within the bound
81
+ this.log.warn("cannot subscribe to grant revocation hints", { err });
82
+ }
83
+ }
84
+ async stop() {
85
+ const unsubscribe = this.unsubscribe;
86
+ this.unsubscribe = undefined;
87
+ await unsubscribe?.().catch(() => { });
88
+ }
89
+ /**
90
+ * Revokes keys of a revision's live grant (**Partially revoked** while others still serve). A
91
+ * key no running surface can withdraw on its own (network, config, tables, embeds, dependencies,
92
+ * client code, raw egress, migration warnings) is refused (`unknown_keys`): the Partially revoked
93
+ * view never shows a still-serving key as withdrawn. Revoke the whole grant to take those away.
94
+ */
95
+ async revokeKeys(revision, keys, by) {
96
+ const unhonoured = unrevocableKeys(keys);
97
+ if (unhonoured.length > 0) {
98
+ throw new RevisionGrantError("unknown_keys", `These keys cannot be revoked on their own; revoke the whole grant instead: ${unhonoured.join(", ")}`);
99
+ }
100
+ const before = await this.lockLive(revision);
101
+ const after = await this.grants.revokeKeys(revision, keys, by.accountId);
102
+ return this.record(before, after, by);
103
+ }
104
+ /** Revokes a revision's live grant entirely: the revision is unloaded and waits for a new review. */
105
+ async revoke(revision, by) {
106
+ const before = await this.lockLive(revision);
107
+ const after = await this.grants.revoke(revision, by.accountId);
108
+ return this.record(before, after, by);
109
+ }
110
+ /** The newest grant of a revision with its withdrawn keys and serving surface. */
111
+ async view(revision) {
112
+ const grant = await this.grants.get(revision);
113
+ return grant ? revocationView(grant) : undefined;
114
+ }
115
+ /** The live grant, locked for this transaction so the audit diff matches the write. */
116
+ async lockLive(revision) {
117
+ await this.kdb.db
118
+ .selectFrom("extension_revision_grants")
119
+ .select("generation")
120
+ .where("plugin", "=", revision.plugin)
121
+ .where("version", "=", revision.version)
122
+ .where("sha512", "=", revision.sha512)
123
+ .where("state", "in", ["approved", "partially_revoked"])
124
+ .forNoKeyUpdate()
125
+ .execute();
126
+ const live = await this.grants.live(revision);
127
+ if (live)
128
+ return live;
129
+ const newest = await this.grants.get(revision);
130
+ throw newest
131
+ ? new RevisionGrantError("terminal", `The grant of ${revision.plugin}@${revision.version} is ${newest.state}`)
132
+ : new RevisionGrantError("not_found", `${revision.plugin}@${revision.version} has no grant`);
133
+ }
134
+ async record(before, after, by) {
135
+ const was = new Set(revocationView(before).withdrawn);
136
+ const view = revocationView(after);
137
+ const withdrawn = view.withdrawn.filter((key) => !was.has(key));
138
+ const { plugin, version, sha512 } = after.revision;
139
+ await audit(this.kdb.db, {
140
+ actorAccountId: by.accountId,
141
+ ...(by.tokenId !== undefined && { actorTokenId: by.tokenId }),
142
+ action: "extension.grant_revoked",
143
+ target: plugin,
144
+ detail: {
145
+ plugin,
146
+ version,
147
+ sha512,
148
+ generation: after.generation,
149
+ previousState: before.state,
150
+ state: after.state,
151
+ keys: withdrawn,
152
+ registrations: view.registrations.filter((key) => !was.has(key)),
153
+ capabilities: view.capabilities.filter((key) => !was.has(key)),
154
+ fullAccess: view.fullAccess,
155
+ // the realms the grant reviewed: a full-access grant's revocation is surfaced in the orgs
156
+ // it affects (plan task 1.4c, `audit/full-access.ts`)
157
+ realms: after.realms,
158
+ serving: view.serving,
159
+ scope: after.approvalScope,
160
+ purposesDigest: after.purposesDigest,
161
+ reviewHash: after.reviewHash,
162
+ publisherEvidence: after.publisherEvidence,
163
+ ...(after.publisher !== null && { publisher: after.publisher }),
164
+ ...(by.reason !== undefined && { reason: by.reason }),
165
+ },
166
+ });
167
+ afterCommit(async () => {
168
+ // The local fence first: this replica revalidates its leases of the plugin at once.
169
+ await this.host
170
+ .fenceRevocation(plugin)
171
+ .catch((err) => this.log.warn("grant revocation fence failed", { plugin, err }));
172
+ try {
173
+ await this.bus.publish(GRANT_REVOKED_TOPIC, { plugin });
174
+ }
175
+ catch (err) {
176
+ this.log.warn("cannot publish a grant revocation hint; the grant epoch fences replicas", {
177
+ plugin,
178
+ err,
179
+ });
180
+ }
181
+ });
182
+ return { grant: after, withdrawn, view };
183
+ }
184
+ fence(plugin) {
185
+ void this.host
186
+ .fenceRevocation(plugin)
187
+ .catch((err) => this.log.warn("grant revocation fence failed", { plugin, err }));
188
+ }
189
+ };
190
+ __decorate([
191
+ Transactional()
192
+ ], ExtensionRevocations.prototype, "revokeKeys", null);
193
+ __decorate([
194
+ Transactional()
195
+ ], ExtensionRevocations.prototype, "revoke", null);
196
+ ExtensionRevocations = __decorate([
197
+ Injectable(),
198
+ __param(0, Inject(KernelDb)),
199
+ __param(1, Inject(TransactionHost)),
200
+ __param(2, Inject(ExtensionRevisionGrants)),
201
+ __param(3, Inject(ExtensionHost)),
202
+ __param(4, Inject(KERNEL_BUS)),
203
+ __param(5, Inject(KERNEL_LOGGER))
204
+ ], ExtensionRevocations);
205
+ export { ExtensionRevocations };
@@ -13,9 +13,12 @@ import { ExtensionApprovals } from "./approvals.js";
13
13
  import { ExtensionBlobs } from "./blobs.js";
14
14
  import { EffectiveConfigs } from "./effective-config.js";
15
15
  import { ExtensionInstalls } from "./installs.js";
16
+ import { IsolationStatusReader, ReplicaIsolationStore } from "./isolated/status.js";
17
+ import { REVIEWED_GRANTS } from "./isolated/tier.js";
16
18
  import { ExtensionRegistryModule } from "./registry.js";
17
19
  import { ExtensionRevisionApprovals } from "./revision-approvals.js";
18
20
  import { ExtensionRevisionGrants } from "./revision-grants.js";
21
+ import { RevisionReviews } from "./revision-review.js";
19
22
  /**
20
23
  * The extension state the model domain reads below the host: the install records with their
21
24
  * packages and approvals, and each extension's effective config per org. Apart from
@@ -42,6 +45,11 @@ ExtensionStateModule = __decorate([
42
45
  EffectiveConfigs,
43
46
  ExtensionRevisionGrants,
44
47
  ExtensionRevisionApprovals,
48
+ // 1.3b's tier admits a reviewed pin-only official revision through it (#1368)
49
+ { provide: REVIEWED_GRANTS, useExisting: ExtensionRevisionApprovals },
50
+ RevisionReviews,
51
+ ReplicaIsolationStore,
52
+ IsolationStatusReader,
45
53
  ],
46
54
  exports: [
47
55
  ExtensionRegistryModule,
@@ -51,6 +59,10 @@ ExtensionStateModule = __decorate([
51
59
  EffectiveConfigs,
52
60
  ExtensionRevisionGrants,
53
61
  ExtensionRevisionApprovals,
62
+ REVIEWED_GRANTS,
63
+ RevisionReviews,
64
+ ReplicaIsolationStore,
65
+ IsolationStatusReader,
54
66
  ],
55
67
  })
56
68
  ], ExtensionStateModule);
@@ -1,13 +1,27 @@
1
1
  import type { Redis } from "ioredis";
2
2
  import { KernelDb } from "../infra/database/kernel-db.js";
3
+ import { TransactionHost } from "../infra/database/transaction-host.js";
4
+ import type { OutboxService } from "../infra/outbox/outbox.service.js";
3
5
  import type { KernelLogger } from "../log.js";
4
6
  import { GitTickets } from "./tickets.js";
5
7
  /**
6
8
  * What a run's end does for the git gateway (sandbox git credentials spec §9): revokes the run's
7
- * tickets and writes the `git.fetch` summaries. `RunFinish` calls it in `afterCommit` of the
8
- * transaction that set the terminal status (set first, then revoke: `GitTickets.resolve` already
9
- * refuses a run that is not active, so revocation is cleanup and defense in depth).
9
+ * tickets and writes the `git.fetch` summaries. `RunFinish` revokes in `afterCommit` of the
10
+ * transaction that set the terminal status (a hint: `GitTickets.resolve` already refuses a run that
11
+ * is not active, so revocation is cleanup and defense in depth), and owes the summaries in that
12
+ * transaction as a {@link GIT_FETCH_AUDIT_JOB} outbox job, so a crash after the commit never loses
13
+ * the audit.
10
14
  */
15
+ /** The maintenance job that writes a finished run's `git.fetch` summaries (outbox registry). */
16
+ export declare const GIT_FETCH_AUDIT_JOB = "git-fetch-audit";
17
+ /** One job per run (no `:`): a second owe of the same run's end is a no-op. */
18
+ export declare const gitFetchAuditJobId: (runId: string) => string;
19
+ /** What a {@link GIT_FETCH_AUDIT_JOB} job carries. */
20
+ export interface GitFetchAuditJobData {
21
+ runId: string;
22
+ }
23
+ /** Owes the run's fetch summaries in the caller's transaction (throws outside one). */
24
+ export declare function oweGitFetchAudit(outbox: Pick<OutboxService, "add">, runId: string, orgId: string): Promise<boolean>;
11
25
  /** The Redis hash of a run's fetch counters: fields `<host>/<repo>|n` and `<host>/<repo>|bytes`. */
12
26
  export declare const gitFetchKey: (runId: string) => string;
13
27
  /**
@@ -22,8 +36,22 @@ export declare class GitRunEnd {
22
36
  private readonly db;
23
37
  private readonly redis;
24
38
  private readonly log;
25
- constructor(tickets: Pick<GitTickets, "revokeRun">, db: KernelDb, redis: Redis, log: Pick<KernelLogger, "warn">);
26
- /** Run end: revokes the run's tickets and writes one `git.fetch` audit row per repository. */
27
- onRunFinished(runId: string): Promise<void>;
28
- private writeFetchSummaries;
39
+ readonly txHost: TransactionHost;
40
+ constructor(tickets: Pick<GitTickets, "revokeRun">, db: KernelDb, redis: Redis, log: Pick<KernelLogger, "warn">, txHost: TransactionHost);
41
+ /**
42
+ * Whether the run counted any fetch, read in its terminal transaction: only then is a summary
43
+ * owed. A failed read owes it anyway (the job finds nothing to write).
44
+ */
45
+ hasFetches(runId: string): Promise<boolean>;
46
+ /** Run end, after the commit: revokes the run's tickets (a hint whose loss is harmless). */
47
+ revokeTickets(runId: string): Promise<void>;
48
+ /**
49
+ * The {@link GIT_FETCH_AUDIT_JOB} body, in the run's org scope: one `git.fetch` audit row per
50
+ * repository from the run's counters, then the counters dropped. The rows commit before the
51
+ * delete, and a run that already has summaries gets none again, so a redelivery after a crash
52
+ * between the two writes no duplicate.
53
+ */
54
+ writeFetchSummaries(runId: string): Promise<void>;
55
+ /** The rows, committed in their own transaction before the caller drops the counters. */
56
+ private insertSummaries;
29
57
  }
@@ -8,16 +8,36 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
8
8
  return function (target, key) { decorator(target, key, paramIndex); }
9
9
  };
10
10
  import { Inject, Injectable } from "@nestjs/common";
11
+ import { sql } from "kysely";
11
12
  import { audit } from "../identity/audit.js";
12
13
  import { KernelDb } from "../infra/database/kernel-db.js";
14
+ import { TransactionHost } from "../infra/database/transaction-host.js";
15
+ import { Transactional } from "../infra/database/transactional.decorator.js";
13
16
  import { KERNEL_LOGGER, REDIS } from "../infra/tokens.js";
17
+ import { MAINTENANCE_QUEUE_NAME } from "../runtime/maintenance-queue.js";
14
18
  import { GitTickets } from "./tickets.js";
15
19
  /**
16
20
  * What a run's end does for the git gateway (sandbox git credentials spec §9): revokes the run's
17
- * tickets and writes the `git.fetch` summaries. `RunFinish` calls it in `afterCommit` of the
18
- * transaction that set the terminal status (set first, then revoke: `GitTickets.resolve` already
19
- * refuses a run that is not active, so revocation is cleanup and defense in depth).
21
+ * tickets and writes the `git.fetch` summaries. `RunFinish` revokes in `afterCommit` of the
22
+ * transaction that set the terminal status (a hint: `GitTickets.resolve` already refuses a run that
23
+ * is not active, so revocation is cleanup and defense in depth), and owes the summaries in that
24
+ * transaction as a {@link GIT_FETCH_AUDIT_JOB} outbox job, so a crash after the commit never loses
25
+ * the audit.
20
26
  */
27
+ /** The maintenance job that writes a finished run's `git.fetch` summaries (outbox registry). */
28
+ export const GIT_FETCH_AUDIT_JOB = "git-fetch-audit";
29
+ /** One job per run (no `:`): a second owe of the same run's end is a no-op. */
30
+ export const gitFetchAuditJobId = (runId) => `git-fetch-audit-${runId}`;
31
+ /** Owes the run's fetch summaries in the caller's transaction (throws outside one). */
32
+ export function oweGitFetchAudit(outbox, runId, orgId) {
33
+ return outbox.add({
34
+ queue: MAINTENANCE_QUEUE_NAME,
35
+ name: GIT_FETCH_AUDIT_JOB,
36
+ jobId: gitFetchAuditJobId(runId),
37
+ data: { runId },
38
+ orgId,
39
+ });
40
+ }
21
41
  /** The Redis hash of a run's fetch counters: fields `<host>/<repo>|n` and `<host>/<repo>|bytes`. */
22
42
  export const gitFetchKey = (runId) => `git-fetch:${runId}`;
23
43
  /**
@@ -35,63 +55,88 @@ export async function recordGitFetch(redis, runId, host, repo, bytes, countReque
35
55
  m.hincrby(key, `${field}|bytes`, Math.max(0, Math.round(bytes)));
36
56
  await m.expire(key, FETCH_COUNTER_TTL_SECONDS).exec();
37
57
  }
38
- /** Reads and deletes a hash in one step, so a summary is written once. */
39
- const TAKE_HASH = `
40
- local all = redis.call('HGETALL', KEYS[1])
41
- redis.call('DEL', KEYS[1])
42
- return all
43
- `;
44
58
  let GitRunEnd = class GitRunEnd {
45
59
  tickets;
46
60
  db;
47
61
  redis;
48
62
  log;
49
- constructor(tickets, db, redis, log) {
63
+ txHost;
64
+ constructor(tickets, db, redis, log, txHost) {
50
65
  this.tickets = tickets;
51
66
  this.db = db;
52
67
  this.redis = redis;
53
68
  this.log = log;
69
+ this.txHost = txHost;
54
70
  }
55
- /** Run end: revokes the run's tickets and writes one `git.fetch` audit row per repository. */
56
- async onRunFinished(runId) {
57
- // both steps always run: a failing revocation must not lose the summaries, nor the reverse
58
- const results = await Promise.allSettled([
59
- this.tickets.revokeRun(runId),
60
- this.writeFetchSummaries(runId),
61
- ]);
62
- for (const r of results) {
63
- if (r.status === "rejected") {
64
- this.log.warn("git run end failed", {
65
- runId,
66
- error: r.reason instanceof Error ? r.reason.name : "unknown",
67
- });
68
- }
71
+ /**
72
+ * Whether the run counted any fetch, read in its terminal transaction: only then is a summary
73
+ * owed. A failed read owes it anyway (the job finds nothing to write).
74
+ */
75
+ async hasFetches(runId) {
76
+ try {
77
+ return (await this.redis.exists(gitFetchKey(runId))) === 1;
78
+ }
79
+ catch {
80
+ return true;
81
+ }
82
+ }
83
+ /** Run end, after the commit: revokes the run's tickets (a hint whose loss is harmless). */
84
+ async revokeTickets(runId) {
85
+ try {
86
+ await this.tickets.revokeRun(runId);
87
+ }
88
+ catch (err) {
89
+ this.log.warn("git ticket revocation at run end failed", {
90
+ runId,
91
+ error: err instanceof Error ? err.name : "unknown",
92
+ });
69
93
  }
70
94
  }
95
+ /**
96
+ * The {@link GIT_FETCH_AUDIT_JOB} body, in the run's org scope: one `git.fetch` audit row per
97
+ * repository from the run's counters, then the counters dropped. The rows commit before the
98
+ * delete, and a run that already has summaries gets none again, so a redelivery after a crash
99
+ * between the two writes no duplicate.
100
+ */
71
101
  async writeFetchSummaries(runId) {
72
- const flat = (await this.redis.eval(TAKE_HASH, 1, gitFetchKey(runId)));
102
+ const key = gitFetchKey(runId);
103
+ const flat = Object.entries(await this.redis.hgetall(key));
73
104
  if (flat.length === 0)
74
105
  return;
106
+ await this.insertSummaries(runId, flat);
107
+ await this.redis.del(key);
108
+ }
109
+ /** The rows, committed in their own transaction before the caller drops the counters. */
110
+ async insertSummaries(runId, fields) {
111
+ const run = await this.db
112
+ .selectFrom("runs")
113
+ .innerJoin("conversations", "conversations.id", "runs.conversation_id")
114
+ .select(["runs.conversation_id", "runs.trigger_account_id", "conversations.org_id"])
115
+ .where("runs.id", "=", runId)
116
+ .executeTakeFirst();
117
+ if (run === undefined)
118
+ return;
119
+ const written = await this.db
120
+ .selectFrom("audit_events")
121
+ .select("id")
122
+ .where("org_id", "=", run.org_id)
123
+ .where("action", "=", "git.fetch")
124
+ .where(sql `detail->>'runId'`, "=", runId)
125
+ .limit(1)
126
+ .executeTakeFirst();
127
+ if (written !== undefined)
128
+ return;
75
129
  const perRepo = new Map();
76
- for (let i = 0; i + 1 < flat.length; i += 2) {
77
- const field = String(flat[i]);
130
+ for (const [field, value] of fields) {
78
131
  const cut = field.lastIndexOf("|");
79
132
  const target = field.slice(0, cut);
80
133
  const entry = perRepo.get(target) ?? { count: 0, bytes: 0 };
81
134
  if (field.slice(cut + 1) === "n")
82
- entry.count = Number(flat[i + 1]);
135
+ entry.count = Number(value);
83
136
  else
84
- entry.bytes = Number(flat[i + 1]);
137
+ entry.bytes = Number(value);
85
138
  perRepo.set(target, entry);
86
139
  }
87
- const run = await this.db.db
88
- .selectFrom("runs")
89
- .innerJoin("conversations", "conversations.id", "runs.conversation_id")
90
- .select(["runs.conversation_id", "runs.trigger_account_id", "conversations.org_id"])
91
- .where("runs.id", "=", runId)
92
- .executeTakeFirst();
93
- if (run === undefined)
94
- return;
95
140
  for (const [target, { count, bytes }] of perRepo) {
96
141
  const slash = target.indexOf("/");
97
142
  await audit(this.db.db, {
@@ -111,11 +156,15 @@ let GitRunEnd = class GitRunEnd {
111
156
  }
112
157
  }
113
158
  };
159
+ __decorate([
160
+ Transactional({ propagation: "requires_new" })
161
+ ], GitRunEnd.prototype, "insertSummaries", null);
114
162
  GitRunEnd = __decorate([
115
163
  Injectable(),
116
164
  __param(0, Inject(GitTickets)),
117
165
  __param(1, Inject(KernelDb)),
118
166
  __param(2, Inject(REDIS)),
119
- __param(3, Inject(KERNEL_LOGGER))
167
+ __param(3, Inject(KERNEL_LOGGER)),
168
+ __param(4, Inject(TransactionHost))
120
169
  ], GitRunEnd);
121
170
  export { GitRunEnd };
@@ -55,6 +55,7 @@ import { EvalRunsController } from "../evals/runs.controller.js";
55
55
  import { EvalSetsController } from "../evals/sets.controller.js";
56
56
  import { TrajectoryController } from "../evals/trajectory.controller.js";
57
57
  import { ExtensionsModule } from "../extensions/extensions.module.js";
58
+ import { ExtensionPermissionsController } from "../extensions/permissions.controller.js";
58
59
  import { ExtensionPointDefaultsController } from "../extensions/point-defaults.controller.js";
59
60
  import { FilesModule } from "../files/files.module.js";
60
61
  import { LibraryFilesController } from "../files/library.controller.js";
@@ -151,6 +152,7 @@ const CONTROLLERS = [
151
152
  AdminOrgNetworkController,
152
153
  AdminLoginSourcesController,
153
154
  AdminExtensionsController,
155
+ ExtensionPermissionsController,
154
156
  AdminCatalogController,
155
157
  AdminComponentsController,
156
158
  MarketplacesController,
@@ -2,7 +2,8 @@ import type { KernelSchemaDb } from "../db/kernel-schema.js";
2
2
  /**
3
3
  * Writes one audit event (`action` is dotted lower-case English, e.g. `org.member.role_changed`)
4
4
  * through `db`: a service passes `this.db.db` (`KernelDb`: the context's transaction or the pool),
5
- * so the event commits or rolls back with the write it records.
5
+ * so the event commits or rolls back with the write it records. A full-access event is also copied
6
+ * into every org it affects (`audit/full-access.ts`, plan task 1.4c).
6
7
  */
7
8
  export declare function audit(db: KernelSchemaDb, e: {
8
9
  /** The acting account; absent or null for the kernel itself (a job such as the scope sync). */
@@ -1,23 +1,10 @@
1
- import { asPlatform } from "../infra/database/org-scope.js";
1
+ import { writeAuditEvent } from "../audit/full-access.js";
2
2
  /**
3
3
  * Writes one audit event (`action` is dotted lower-case English, e.g. `org.member.role_changed`)
4
4
  * through `db`: a service passes `this.db.db` (`KernelDb`: the context's transaction or the pool),
5
- * so the event commits or rolls back with the write it records.
5
+ * so the event commits or rolls back with the write it records. A full-access event is also copied
6
+ * into every org it affects (`audit/full-access.ts`, plan task 1.4c).
6
7
  */
7
8
  export async function audit(db, e) {
8
- const query = db.insertInto("audit_events").values({
9
- actor_account_id: e.actorAccountId ?? null,
10
- actor_token_id: e.actorTokenId ?? null,
11
- org_id: e.orgId ?? null,
12
- action: e.action,
13
- target: e.target ?? null,
14
- detail: JSON.stringify(e.detail ?? {}),
15
- });
16
- if (e.orgId === undefined) {
17
- // org-filter: deployment-wide audit events have no org and may originate inside an org call.
18
- await asPlatform("Record an audit event without an org", () => query.execute());
19
- }
20
- else {
21
- await query.execute();
22
- }
9
+ await writeAuditEvent(db, e);
23
10
  }
package/dist/index.d.ts CHANGED
@@ -4,7 +4,10 @@ export { type CatalogCli, openCatalogCli } from "./catalog/cli.js";
4
4
  export { GitSourceError, type ReadGitTreeOptions, readGitTree, } from "./catalog/git-source.js";
5
5
  export type { PluginConfirmResult, PluginReview } from "./catalog/plugin-import.js";
6
6
  export { type PluginPackage, PluginPackageError, type ReadPluginPackageOptions, readPluginPackage, } from "./catalog/plugin-package.js";
7
+ export { classifyPublisherEvidence, normalizePublisherIdentity, type PublisherEvidence, type PublisherEvidenceOutcome, refClass, samePublisher, } from "./catalog/provenance.js";
7
8
  export { gatewayReplicasKey } from "./channels/supervisor.js";
9
+ export { autoApproveRefusal, isOfficialImage, OFFICIAL_IMAGE_MARKER, } from "./config/auto-approve.js";
10
+ export { CAPACITY_PRESETS, type CapacityConfig, type CapacityPreset, type IsolatedCapacity, resolveCapacity, } from "./config/capacity-presets.js";
8
11
  export { envName, renderConfigDocs } from "./config/docs.js";
9
12
  export { envOverrides } from "./config/env.js";
10
13
  export { type ConfigField, changedPaths, configFields, secretValues } from "./config/fields.js";
@@ -36,19 +39,24 @@ export { type BootstrapEntryResult, BootstrapFailedError, type BootstrapFailure,
36
39
  export { BootstrapExtraMismatchError, type ExtraManifestTraces, hasExtraManifestTraces, loadBootstrapManifest, type MergedBootstrapManifest, mergeBootstrapManifests, missingExtraManifestMessage, readBootstrapExtraManifest, } from "./extensions/bootstrap-extra.js";
37
40
  export { BOOTSTRAP_MANIFEST_FILE, bootstrapManifestSha256, readBootstrapManifest, } from "./extensions/bootstrap-manifest.js";
38
41
  export { type BootstrapGitPlugin, type BootstrapResolveOptions, readBootstrapGitPlugin, resolveBootstrapPackages, } from "./extensions/bootstrap-packages.js";
42
+ export { type ApprovalVia, BOOTSTRAP_REVIEW_CONTRACT, type BootstrapApproval, type BootstrapEntryStatus, type BootstrapReview, type BootstrapReviewEntry, BootstrapReviewError, BootstrapReviewService, type BootstrapRevisionInput, type BootstrapStartGate, bootstrapBatchHash, bootstrapPinInputs, bootstrapRevisionDisplay, freshBootstrapReview, integrityHex, } from "./extensions/bootstrap-review.js";
39
43
  export { type ExtensionCli, openExtensionCli } from "./extensions/cli.js";
40
44
  export { DEPLOYMENT_SECRETS_ORG, type DeploymentConfigField, type DeploymentConfigView, ExtensionDeploymentConfigService, mergeDeploymentConfig, PLUGIN_DEPLOYMENT_CONFIG_TOPIC, readStoredDeploymentConfig, type SecretEntry, } from "./extensions/deployment-config.js";
45
+ export { CONFIG_SCHEMA_UNSUPPORTED_KEY, describeExecution, type ExecutionDecision, type ExecutionInput, executionDecision, fullAccessKeys, HOST_NO_ISOLATION_KEY, type HostIsolation, type RealmPlacement, } from "./extensions/execution-realm.js";
41
46
  export { assertSecretsReachable, ExtensionHost, type ExtensionLoadPlan, type InspectedExtension, type InstalledExtensionLoader, type InstallFailureReason, } from "./extensions/host.js";
42
47
  export { ExtensionUnloadedError, type InflightEntry, InflightTracker, PLUGIN_UNLOADED_TOOL_ERROR, type TrackOptions, trackCalls, } from "./extensions/inflight.js";
43
48
  export { type DesiredExtension, type ExtensionInstallRow, ExtensionInstalls, type IngestSource, type PackageReview, } from "./extensions/installs.js";
44
49
  export { DEFAULT_DISPOSE_TIMEOUT_MS, type DisposeOptions, ExtensionInstance, ImportTracker, type LoadDeps, loadInstance, ManifestMismatchError, type Registration, type RegistrationKind, UPGRADE_WARN_THRESHOLD, } from "./extensions/instance.js";
50
+ export { deploymentConfigIsolatable, isolatedDeploymentSchema, } from "./extensions/isolated/admission.js";
45
51
  export { ExtensionLifecycle, PLUGINS_RECONCILE_JOB, PLUGINS_RECONCILE_TOPIC, } from "./extensions/lifecycle.js";
46
52
  export { ensureMigrated, MIGRATE_LOCK_PREFIX, type MigrateLockDeps, PLUGINS_MIGRATED_TOPIC, unrunMigrations, } from "./extensions/migrate-lock.js";
47
53
  export { EXTENSION_PACKAGE_LIMITS, type ExtensionPackage, ExtensionPackageError, type ExtensionPackageLimits, type ExtensionPackageSection, extractExtensionPackage, HOST_ZOD_VERSION, permissionSetOfPackage, type ReadExtensionPackageOptions, readExtensionPackage, } from "./extensions/package.js";
48
- export { blockingKeys, computePermissionSet, diffPermissions, type PermissionSet, permissionKeys, WARNINGS_KEY_PREFIX, } from "./extensions/permission-set.js";
54
+ export { blockingKeys, buildPermissionSet, computePermissionSet, diffPermissions, type PermissionSet, permissionKeys, WARNINGS_KEY_PREFIX, } from "./extensions/permission-set.js";
49
55
  export { type AdminExtensionView, type DeploymentExtensionStatus, isSensitivePermissionKey, type PermissionGroup, type PermissionItem, permissionGroups, permissionKeyItems, reviewHash, SENSITIVE_EXTENSION_POINTS, type SensitiveReason, } from "./extensions/permission-view.js";
50
56
  export { ExtensionRegistry } from "./extensions/registry.js";
51
57
  export { ExtensionResolveError, resolveExtensions } from "./extensions/resolve.js";
58
+ export { fullAccessPurpose, grantPurposeRows, REVIEW_CONTRACT_VERSION, type ReviewDisplay, type ReviewInput, reviewDisplay, revisionReviewHash, } from "./extensions/review-hash.js";
59
+ export { type ApprovalScope, ExtensionRevisionGrants, type NewRevisionGrant, type PurposeRow, type RevisionGrant, type RevisionIdentity, } from "./extensions/revision-grants.js";
52
60
  export { type ExtensionLoadStatus, type ExtensionSource, newReplicaId, type PendingReason, ReplicaStatusStore, } from "./extensions/sources.js";
53
61
  export { syncPackage } from "./extensions/sync.js";
54
62
  export type { KernelHttp, KernelHttpApp } from "./http/app.js";
@@ -75,7 +83,7 @@ export { type Org, OrgsService } from "./orgs/orgs.service.js";
75
83
  export type { KernelOverride } from "./overrides.js";
76
84
  export { fetchNpmPackage, IntegrityMismatchError, type NpmFetchConfig, NpmFetchError, PackageTooLargeError, } from "./packages/npm.js";
77
85
  export { fetchOfficialPublisher } from "./packages/official-publisher.js";
78
- export { packPackageTgz } from "./packages/tgz.js";
86
+ export { packPackageTgz, unpackPackageTgz } from "./packages/tgz.js";
79
87
  export { checkInputParity, inputParity, type ParityFinding, type ParityOperation, } from "./platform/parity.js";
80
88
  export { PLATFORM_OPERATION_PROVIDERS } from "./platform/platform-ops.module.js";
81
89
  export { PlatformOperations } from "./platform/registry.js";
package/dist/index.js CHANGED
@@ -4,7 +4,10 @@ export { openCatalogCli } from "./catalog/cli.js";
4
4
  // The git reader marketplaces use; core's check:bootstrap reads the official marketplace with it.
5
5
  export { GitSourceError, readGitTree, } from "./catalog/git-source.js";
6
6
  export { PluginPackageError, readPluginPackage, } from "./catalog/plugin-package.js";
7
+ export { classifyPublisherEvidence, normalizePublisherIdentity, refClass, samePublisher, } from "./catalog/provenance.js";
7
8
  export { gatewayReplicasKey } from "./channels/supervisor.js";
9
+ export { autoApproveRefusal, isOfficialImage, OFFICIAL_IMAGE_MARKER, } from "./config/auto-approve.js";
10
+ export { CAPACITY_PRESETS, resolveCapacity, } from "./config/capacity-presets.js";
8
11
  export { envName, renderConfigDocs } from "./config/docs.js";
9
12
  export { envOverrides } from "./config/env.js";
10
13
  export { changedPaths, configFields, secretValues } from "./config/fields.js";
@@ -35,19 +38,24 @@ export { BootstrapFailedError, BootstrapService, } from "./extensions/bootstrap.
35
38
  export { BootstrapExtraMismatchError, hasExtraManifestTraces, loadBootstrapManifest, mergeBootstrapManifests, missingExtraManifestMessage, readBootstrapExtraManifest, } from "./extensions/bootstrap-extra.js";
36
39
  export { BOOTSTRAP_MANIFEST_FILE, bootstrapManifestSha256, readBootstrapManifest, } from "./extensions/bootstrap-manifest.js";
37
40
  export { readBootstrapGitPlugin, resolveBootstrapPackages, } from "./extensions/bootstrap-packages.js";
41
+ export { BOOTSTRAP_REVIEW_CONTRACT, BootstrapReviewError, BootstrapReviewService, bootstrapBatchHash, bootstrapPinInputs, bootstrapRevisionDisplay, freshBootstrapReview, integrityHex, } from "./extensions/bootstrap-review.js";
38
42
  export { openExtensionCli } from "./extensions/cli.js";
39
43
  export { DEPLOYMENT_SECRETS_ORG, ExtensionDeploymentConfigService, mergeDeploymentConfig, PLUGIN_DEPLOYMENT_CONFIG_TOPIC, readStoredDeploymentConfig, } from "./extensions/deployment-config.js";
44
+ export { CONFIG_SCHEMA_UNSUPPORTED_KEY, describeExecution, executionDecision, fullAccessKeys, HOST_NO_ISOLATION_KEY, } from "./extensions/execution-realm.js";
40
45
  export { assertSecretsReachable, ExtensionHost, } from "./extensions/host.js";
41
46
  export { ExtensionUnloadedError, InflightTracker, PLUGIN_UNLOADED_TOOL_ERROR, trackCalls, } from "./extensions/inflight.js";
42
47
  export { ExtensionInstalls, } from "./extensions/installs.js";
43
48
  export { DEFAULT_DISPOSE_TIMEOUT_MS, ExtensionInstance, ImportTracker, loadInstance, ManifestMismatchError, UPGRADE_WARN_THRESHOLD, } from "./extensions/instance.js";
49
+ export { deploymentConfigIsolatable, isolatedDeploymentSchema, } from "./extensions/isolated/admission.js";
44
50
  export { ExtensionLifecycle, PLUGINS_RECONCILE_JOB, PLUGINS_RECONCILE_TOPIC, } from "./extensions/lifecycle.js";
45
51
  export { ensureMigrated, MIGRATE_LOCK_PREFIX, PLUGINS_MIGRATED_TOPIC, unrunMigrations, } from "./extensions/migrate-lock.js";
46
52
  export { EXTENSION_PACKAGE_LIMITS, ExtensionPackageError, extractExtensionPackage, HOST_ZOD_VERSION, permissionSetOfPackage, readExtensionPackage, } from "./extensions/package.js";
47
- export { blockingKeys, computePermissionSet, diffPermissions, permissionKeys, WARNINGS_KEY_PREFIX, } from "./extensions/permission-set.js";
53
+ export { blockingKeys, buildPermissionSet, computePermissionSet, diffPermissions, permissionKeys, WARNINGS_KEY_PREFIX, } from "./extensions/permission-set.js";
48
54
  export { isSensitivePermissionKey, permissionGroups, permissionKeyItems, reviewHash, SENSITIVE_EXTENSION_POINTS, } from "./extensions/permission-view.js";
49
55
  export { ExtensionRegistry } from "./extensions/registry.js";
50
56
  export { ExtensionResolveError, resolveExtensions } from "./extensions/resolve.js";
57
+ export { fullAccessPurpose, grantPurposeRows, REVIEW_CONTRACT_VERSION, reviewDisplay, revisionReviewHash, } from "./extensions/review-hash.js";
58
+ export { ExtensionRevisionGrants, } from "./extensions/revision-grants.js";
51
59
  export { newReplicaId, ReplicaStatusStore, } from "./extensions/sources.js";
52
60
  export { syncPackage } from "./extensions/sync.js";
53
61
  export { AccountsModule, AccountsService } from "./identity/accounts.js";
@@ -72,7 +80,7 @@ export { OrgsService } from "./orgs/orgs.service.js";
72
80
  export { fetchNpmPackage, IntegrityMismatchError, NpmFetchError, PackageTooLargeError, } from "./packages/npm.js";
73
81
  export { fetchOfficialPublisher } from "./packages/official-publisher.js";
74
82
  // The canonical tgz of a package tree; `capybara-plugin bootstrap` pins git entries with it.
75
- export { packPackageTgz } from "./packages/tgz.js";
83
+ export { packPackageTgz, unpackPackageTgz } from "./packages/tgz.js";
76
84
  // Test seam: the Platform input-parity test in tools/checks (no runtime caller).
77
85
  export { checkInputParity, inputParity, } from "./platform/parity.js";
78
86
  // Test seam (the parity test builds every operation from these without a Nest app).
@@ -14,6 +14,12 @@ export declare class KernelConfigService {
14
14
  private readonly env;
15
15
  private readonly listeners;
16
16
  constructor(input: KernelConfigInput, log: KernelLogger);
17
+ /**
18
+ * Fields whose invalid value fell back (capacity to its preset, `metrics.*` to its default) and
19
+ * unknown capacity keys that were dropped while the config was parsed: never fatal, never
20
+ * silent. Logged at startup and after each reload that produced any.
21
+ */
22
+ private warnFallbacks;
17
23
  get(): KernelConfig;
18
24
  /**
19
25
  * Where the current value of a field without a schema default comes from: `env` when an