opensip-cli 0.1.8 → 0.1.10
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/bootstrap/admit-tool-package.d.ts +51 -11
- package/dist/bootstrap/admit-tool-package.d.ts.map +1 -1
- package/dist/bootstrap/admit-tool-package.js +46 -12
- package/dist/bootstrap/admit-tool-package.js.map +1 -1
- package/dist/bootstrap/baseline-seams.js +1 -1
- package/dist/bootstrap/baseline-seams.js.map +1 -1
- package/dist/bootstrap/bind-external-dispatch.d.ts +36 -0
- package/dist/bootstrap/bind-external-dispatch.d.ts.map +1 -0
- package/dist/bootstrap/bind-external-dispatch.js +81 -0
- package/dist/bootstrap/bind-external-dispatch.js.map +1 -0
- package/dist/bootstrap/build-command-registration-input.d.ts +13 -2
- package/dist/bootstrap/build-command-registration-input.d.ts.map +1 -1
- package/dist/bootstrap/build-command-registration-input.js +29 -2
- package/dist/bootstrap/build-command-registration-input.js.map +1 -1
- package/dist/bootstrap/build-per-run-scope.d.ts.map +1 -1
- package/dist/bootstrap/build-per-run-scope.js +19 -2
- package/dist/bootstrap/build-per-run-scope.js.map +1 -1
- package/dist/bootstrap/config-and-capabilities.d.ts +21 -6
- package/dist/bootstrap/config-and-capabilities.d.ts.map +1 -1
- package/dist/bootstrap/config-and-capabilities.js +79 -23
- package/dist/bootstrap/config-and-capabilities.js.map +1 -1
- package/dist/bootstrap/dispatch-external-tool-command.d.ts +67 -0
- package/dist/bootstrap/dispatch-external-tool-command.d.ts.map +1 -0
- package/dist/bootstrap/dispatch-external-tool-command.js +79 -0
- package/dist/bootstrap/dispatch-external-tool-command.js.map +1 -0
- package/dist/bootstrap/dispatch-external-tool-hook.d.ts +47 -0
- package/dist/bootstrap/dispatch-external-tool-hook.d.ts.map +1 -0
- package/dist/bootstrap/dispatch-external-tool-hook.js +49 -0
- package/dist/bootstrap/dispatch-external-tool-hook.js.map +1 -0
- package/dist/bootstrap/dispatch-fork-core.d.ts +48 -0
- package/dist/bootstrap/dispatch-fork-core.d.ts.map +1 -0
- package/dist/bootstrap/dispatch-fork-core.js +208 -0
- package/dist/bootstrap/dispatch-fork-core.js.map +1 -0
- package/dist/bootstrap/dispatch-host-rpc-handler.d.ts +27 -0
- package/dist/bootstrap/dispatch-host-rpc-handler.d.ts.map +1 -0
- package/dist/bootstrap/dispatch-host-rpc-handler.js +175 -0
- package/dist/bootstrap/dispatch-host-rpc-handler.js.map +1 -0
- package/dist/bootstrap/dispatch-replay-result.d.ts +51 -0
- package/dist/bootstrap/dispatch-replay-result.d.ts.map +1 -0
- package/dist/bootstrap/dispatch-replay-result.js +76 -0
- package/dist/bootstrap/dispatch-replay-result.js.map +1 -0
- package/dist/bootstrap/execute-post-bailout-bootstrap.d.ts.map +1 -1
- package/dist/bootstrap/execute-post-bailout-bootstrap.js +3 -1
- package/dist/bootstrap/execute-post-bailout-bootstrap.js.map +1 -1
- package/dist/bootstrap/owning-tool-init.d.ts +8 -2
- package/dist/bootstrap/owning-tool-init.d.ts.map +1 -1
- package/dist/bootstrap/owning-tool-init.js +11 -1
- package/dist/bootstrap/owning-tool-init.js.map +1 -1
- package/dist/bootstrap/register-authored-tools.d.ts +49 -0
- package/dist/bootstrap/register-authored-tools.d.ts.map +1 -0
- package/dist/bootstrap/register-authored-tools.js +132 -0
- package/dist/bootstrap/register-authored-tools.js.map +1 -0
- package/dist/bootstrap/register-tools-discovery.d.ts +0 -32
- package/dist/bootstrap/register-tools-discovery.d.ts.map +1 -1
- package/dist/bootstrap/register-tools-discovery.js +36 -100
- package/dist/bootstrap/register-tools-discovery.js.map +1 -1
- package/dist/bootstrap/register-tools-mount.d.ts.map +1 -1
- package/dist/bootstrap/register-tools-mount.js +20 -44
- package/dist/bootstrap/register-tools-mount.js.map +1 -1
- package/dist/bootstrap/register-tools.d.ts +2 -1
- package/dist/bootstrap/register-tools.d.ts.map +1 -1
- package/dist/bootstrap/register-tools.js +2 -1
- package/dist/bootstrap/register-tools.js.map +1 -1
- package/dist/bootstrap/run-plane.d.ts +11 -0
- package/dist/bootstrap/run-plane.d.ts.map +1 -1
- package/dist/bootstrap/run-plane.js.map +1 -1
- package/dist/bootstrap/synthesize-external-tool.d.ts +45 -0
- package/dist/bootstrap/synthesize-external-tool.d.ts.map +1 -0
- package/dist/bootstrap/synthesize-external-tool.js +112 -0
- package/dist/bootstrap/synthesize-external-tool.js.map +1 -0
- package/dist/bootstrap/tool-command-dispatch-types.d.ts +280 -0
- package/dist/bootstrap/tool-command-dispatch-types.d.ts.map +1 -0
- package/dist/bootstrap/tool-command-dispatch-types.js +34 -0
- package/dist/bootstrap/tool-command-dispatch-types.js.map +1 -0
- package/dist/bootstrap/tool-command-worker-config-pass.d.ts +24 -0
- package/dist/bootstrap/tool-command-worker-config-pass.d.ts.map +1 -0
- package/dist/bootstrap/tool-command-worker-config-pass.js +52 -0
- package/dist/bootstrap/tool-command-worker-config-pass.js.map +1 -0
- package/dist/bootstrap/tool-command-worker-context.d.ts +55 -0
- package/dist/bootstrap/tool-command-worker-context.d.ts.map +1 -0
- package/dist/bootstrap/tool-command-worker-context.js +163 -0
- package/dist/bootstrap/tool-command-worker-context.js.map +1 -0
- package/dist/bootstrap/tool-command-worker-entry.d.ts +66 -0
- package/dist/bootstrap/tool-command-worker-entry.d.ts.map +1 -0
- package/dist/bootstrap/tool-command-worker-entry.js +298 -0
- package/dist/bootstrap/tool-command-worker-entry.js.map +1 -0
- package/dist/bootstrap/tool-command-worker-rpc.d.ts +53 -0
- package/dist/bootstrap/tool-command-worker-rpc.d.ts.map +1 -0
- package/dist/bootstrap/tool-command-worker-rpc.js +78 -0
- package/dist/bootstrap/tool-command-worker-rpc.js.map +1 -0
- package/dist/bootstrap/tool-provenance.d.ts +85 -0
- package/dist/bootstrap/tool-provenance.d.ts.map +1 -0
- package/dist/bootstrap/tool-provenance.js +101 -0
- package/dist/bootstrap/tool-provenance.js.map +1 -0
- package/dist/cli-context.d.ts +17 -0
- package/dist/cli-context.d.ts.map +1 -1
- package/dist/cli-context.js +62 -1
- package/dist/cli-context.js.map +1 -1
- package/dist/commands/completion.d.ts.map +1 -1
- package/dist/commands/completion.js +3 -0
- package/dist/commands/completion.js.map +1 -1
- package/dist/commands/host-command-specs.d.ts +13 -15
- package/dist/commands/host-command-specs.d.ts.map +1 -1
- package/dist/commands/host-command-specs.js +27 -27
- package/dist/commands/host-command-specs.js.map +1 -1
- package/dist/commands/host-subcommand-groups.d.ts.map +1 -1
- package/dist/commands/host-subcommand-groups.js +63 -5
- package/dist/commands/host-subcommand-groups.js.map +1 -1
- package/dist/commands/internal-command-visibility.d.ts +13 -4
- package/dist/commands/internal-command-visibility.d.ts.map +1 -1
- package/dist/commands/internal-command-visibility.js +14 -5
- package/dist/commands/internal-command-visibility.js.map +1 -1
- package/dist/commands/mount-command-spec.d.ts.map +1 -1
- package/dist/commands/mount-command-spec.js +31 -0
- package/dist/commands/mount-command-spec.js.map +1 -1
- package/dist/commands/session-show.d.ts.map +1 -1
- package/dist/commands/session-show.js +4 -1
- package/dist/commands/session-show.js.map +1 -1
- package/dist/commands/tools/data-purge.js +2 -2
- package/dist/commands/tools/data-purge.js.map +1 -1
- package/dist/commands/tools/validate.js +1 -1
- package/dist/env/host-env-specs.d.ts.map +1 -1
- package/dist/env/host-env-specs.js +6 -0
- package/dist/env/host-env-specs.js.map +1 -1
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/dist/report-compose.d.ts.map +1 -1
- package/dist/report-compose.js +85 -19
- package/dist/report-compose.js.map +1 -1
- package/dist/session-replay-registry.d.ts +33 -6
- package/dist/session-replay-registry.d.ts.map +1 -1
- package/dist/session-replay-registry.js +43 -6
- package/dist/session-replay-registry.js.map +1 -1
- package/dist/telemetry/profiling.d.ts +30 -0
- package/dist/telemetry/profiling.d.ts.map +1 -1
- package/dist/telemetry/profiling.js +16 -1
- package/dist/telemetry/profiling.js.map +1 -1
- package/package.json +32 -32
|
@@ -21,12 +21,16 @@
|
|
|
21
21
|
* not-yet-trusted package) pass `staticOnly: true` here and run the runtime
|
|
22
22
|
* sections in a child-process probe instead.
|
|
23
23
|
*
|
|
24
|
-
* ADR-0054
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* bundled
|
|
28
|
-
*
|
|
29
|
-
*
|
|
24
|
+
* ADR-0054 M4-G (capstone): external tool runtimes NEVER import in the host
|
|
25
|
+
* process. The capstone invariant is mechanized at the type level: a HOST import
|
|
26
|
+
* policy ({@link ToolRuntimeImportPolicy}) is `{ source: 'bundled' }` ONLY —
|
|
27
|
+
* `hostRuntimeImportPolicyFor` accepts only `'bundled'`, so a non-bundled host
|
|
28
|
+
* import is a COMPILE error, not a runtime guard. The forked dispatch worker (the
|
|
29
|
+
* isolation boundary) imports the untrusted external runtime via the distinct
|
|
30
|
+
* {@link workerRuntimeImportPolicyFor} (`{ source, inDispatchWorker: true }`),
|
|
31
|
+
* named for what it is. The host registers a manifest-derived synthetic Tool for
|
|
32
|
+
* external provenance (see `synthesize-external-tool.ts`) and never loads its
|
|
33
|
+
* runtime; the worker imports it when a command dispatches.
|
|
30
34
|
*/
|
|
31
35
|
import { type RawToolPluginManifest, type Tool, type ToolPluginManifest, type ToolProvenance, type ToolSource } from '@opensip-cli/core';
|
|
32
36
|
/**
|
|
@@ -44,13 +48,44 @@ export type ToolRuntimeLoad = {
|
|
|
44
48
|
readonly reason: 'no-entry' | 'invalid-shape' | 'import-failed';
|
|
45
49
|
readonly detail?: string;
|
|
46
50
|
};
|
|
47
|
-
|
|
51
|
+
/**
|
|
52
|
+
* The HOST import policy (ADR-0054 M4-G capstone). A host-process tool runtime
|
|
53
|
+
* import is `{ source: 'bundled' }` ONLY — bundled tools are the trusted
|
|
54
|
+
* computing base. External provenance can NOT produce a host policy: the type
|
|
55
|
+
* makes the external host-import unrepresentable (a compile error), not merely a
|
|
56
|
+
* runtime guard. External runtimes load only behind the worker boundary (see
|
|
57
|
+
* {@link WorkerRuntimeImportPolicy}).
|
|
58
|
+
*/
|
|
59
|
+
export interface ToolRuntimeImportPolicy {
|
|
48
60
|
readonly source: 'bundled';
|
|
49
|
-
}
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* The WORKER import policy (ADR-0054 M4-G). Inside the forked dispatch worker —
|
|
64
|
+
* the isolation boundary — importing the untrusted external runtime IS the goal.
|
|
65
|
+
* A worker import is either the bundled host policy (the worker re-runs the same
|
|
66
|
+
* bootstrap, which imports bundled tools too) or the named external worker policy
|
|
67
|
+
* (`{ source, inDispatchWorker: true }`). It is constructed ONLY by
|
|
68
|
+
* {@link workerRuntimeImportPolicyFor} on the worker-owned discovery path; the
|
|
69
|
+
* fitness check confines its use to the worker plane.
|
|
70
|
+
*/
|
|
71
|
+
export type WorkerRuntimeImportPolicy = ToolRuntimeImportPolicy | {
|
|
50
72
|
readonly source: Exclude<ToolSource, 'bundled'>;
|
|
51
|
-
readonly
|
|
73
|
+
readonly inDispatchWorker: true;
|
|
52
74
|
};
|
|
53
|
-
|
|
75
|
+
/**
|
|
76
|
+
* The bundled-only HOST import policy constructor. Accepts ONLY `'bundled'` — a
|
|
77
|
+
* `hostRuntimeImportPolicyFor('installed')` is a COMPILE error (the capstone
|
|
78
|
+
* invariant, type-enforced). External provenance never reaches a host import.
|
|
79
|
+
*/
|
|
80
|
+
export declare function hostRuntimeImportPolicyFor(source: 'bundled'): ToolRuntimeImportPolicy;
|
|
81
|
+
/**
|
|
82
|
+
* The WORKER import policy constructor (ADR-0054 M4-G). Used ONLY on the
|
|
83
|
+
* worker-owned discovery path (inside the forked `__tool-command-worker`, gated
|
|
84
|
+
* on `OPENSIP_CLI_IN_TOOL_WORKER`). A bundled source produces the plain host
|
|
85
|
+
* policy; an external source produces the named `inDispatchWorker` policy — the
|
|
86
|
+
* legitimate place untrusted external runtime loads.
|
|
87
|
+
*/
|
|
88
|
+
export declare function workerRuntimeImportPolicyFor(source: ToolSource): WorkerRuntimeImportPolicy;
|
|
54
89
|
/**
|
|
55
90
|
* Resolve a tool package's entry, DYNAMIC-IMPORT it, and validate the exported
|
|
56
91
|
* `tool` shape. This is the ONE runtime-load path every installation source
|
|
@@ -61,9 +96,14 @@ export declare function hostRuntimeImportPolicyFor(source: ToolSource): ToolRunt
|
|
|
61
96
|
* module-resolution path still loads. A third-party tool is an untrusted
|
|
62
97
|
* boundary, so `isValidTool` gates the exported symbol before it is touched.
|
|
63
98
|
*
|
|
99
|
+
* ADR-0054 M4-G: the `policy` is `{ source: 'bundled' }` for a HOST import or the
|
|
100
|
+
* `inDispatchWorker` worker policy for an external import inside the dispatch
|
|
101
|
+
* worker. A bare external source can no longer be expressed (the type forbids it);
|
|
102
|
+
* the runtime check is defense-in-depth.
|
|
103
|
+
*
|
|
64
104
|
* Never throws: returns a discriminated result the caller acts on.
|
|
65
105
|
*/
|
|
66
|
-
export declare function importToolRuntime(dir: string, policy:
|
|
106
|
+
export declare function importToolRuntime(dir: string, policy: WorkerRuntimeImportPolicy): Promise<ToolRuntimeLoad>;
|
|
67
107
|
/** The named conformance sections of the admission pipeline, in run order. */
|
|
68
108
|
export type AdmissionSection = 'manifest' | 'compatibility' | 'runtime-load' | 'tool-shape' | 'manifest-runtime-coherence';
|
|
69
109
|
/** One section's verdict. `diagnostic` is present on failure (and only then). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admit-tool-package.d.ts","sourceRoot":"","sources":["../../src/bootstrap/admit-tool-package.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"admit-tool-package.d.ts","sourceRoot":"","sources":["../../src/bootstrap/admit-tool-package.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAIH,OAAO,EAKL,KAAK,qBAAqB,EAC1B,KAAK,IAAI,EACT,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,UAAU,EAChB,MAAM,mBAAmB,CAAC;AAI3B;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,GACvB;IAAE,Q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*
|
|
27
|
-
* bundled
|
|
28
|
-
*
|
|
29
|
-
*
|
|
24
|
+
* ADR-0054 M4-G (capstone): external tool runtimes NEVER import in the host
|
|
25
|
+
* process. The capstone invariant is mechanized at the type level: a HOST import
|
|
26
|
+
* policy ({@link ToolRuntimeImportPolicy}) is `{ source: 'bundled' }` ONLY —
|
|
27
|
+
* `hostRuntimeImportPolicyFor` accepts only `'bundled'`, so a non-bundled host
|
|
28
|
+
* import is a COMPILE error, not a runtime guard. The forked dispatch worker (the
|
|
29
|
+
* isolation boundary) imports the untrusted external runtime via the distinct
|
|
30
|
+
* {@link workerRuntimeImportPolicyFor} (`{ source, inDispatchWorker: true }`),
|
|
31
|
+
* named for what it is. The host registers a manifest-derived synthetic Tool for
|
|
32
|
+
* external provenance (see `synthesize-external-tool.ts`) and never loads its
|
|
33
|
+
* runtime; the worker imports it when a command dispatches.
|
|
30
34
|
*/
|
|
31
35
|
import { pathToFileURL } from 'node:url';
|
|
32
36
|
import { admitTool, assertManifestMatchesTool, loadToolManifest, readToolPackageMetadata, } from '@opensip-cli/core';
|
|
33
37
|
import { isValidTool, toolValidationFailure } from './validate-tool.js';
|
|
38
|
+
/**
|
|
39
|
+
* The bundled-only HOST import policy constructor. Accepts ONLY `'bundled'` — a
|
|
40
|
+
* `hostRuntimeImportPolicyFor('installed')` is a COMPILE error (the capstone
|
|
41
|
+
* invariant, type-enforced). External provenance never reaches a host import.
|
|
42
|
+
*/
|
|
34
43
|
export function hostRuntimeImportPolicyFor(source) {
|
|
44
|
+
return { source };
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The WORKER import policy constructor (ADR-0054 M4-G). Used ONLY on the
|
|
48
|
+
* worker-owned discovery path (inside the forked `__tool-command-worker`, gated
|
|
49
|
+
* on `OPENSIP_CLI_IN_TOOL_WORKER`). A bundled source produces the plain host
|
|
50
|
+
* policy; an external source produces the named `inDispatchWorker` policy — the
|
|
51
|
+
* legitimate place untrusted external runtime loads.
|
|
52
|
+
*/
|
|
53
|
+
export function workerRuntimeImportPolicyFor(source) {
|
|
35
54
|
if (source === 'bundled')
|
|
36
55
|
return { source };
|
|
37
|
-
return { source,
|
|
56
|
+
return { source, inDispatchWorker: true };
|
|
57
|
+
}
|
|
58
|
+
/** Whether a runtime import policy authorizes loading the runtime (defense-in-depth). */
|
|
59
|
+
function isAuthorizedImportPolicy(policy) {
|
|
60
|
+
return policy.source === 'bundled' || policy.inDispatchWorker === true;
|
|
38
61
|
}
|
|
39
62
|
/**
|
|
40
63
|
* Resolve a tool package's entry, DYNAMIC-IMPORT it, and validate the exported
|
|
@@ -46,15 +69,20 @@ export function hostRuntimeImportPolicyFor(source) {
|
|
|
46
69
|
* module-resolution path still loads. A third-party tool is an untrusted
|
|
47
70
|
* boundary, so `isValidTool` gates the exported symbol before it is touched.
|
|
48
71
|
*
|
|
72
|
+
* ADR-0054 M4-G: the `policy` is `{ source: 'bundled' }` for a HOST import or the
|
|
73
|
+
* `inDispatchWorker` worker policy for an external import inside the dispatch
|
|
74
|
+
* worker. A bare external source can no longer be expressed (the type forbids it);
|
|
75
|
+
* the runtime check is defense-in-depth.
|
|
76
|
+
*
|
|
49
77
|
* Never throws: returns a discriminated result the caller acts on.
|
|
50
78
|
*/
|
|
51
79
|
export async function importToolRuntime(dir, policy) {
|
|
52
|
-
if (policy
|
|
80
|
+
if (!isAuthorizedImportPolicy(policy)) {
|
|
53
81
|
return {
|
|
54
82
|
ok: false,
|
|
55
83
|
reason: 'import-failed',
|
|
56
|
-
detail: 'external tool runtime import attempted without
|
|
57
|
-
'load through the worker boundary instead',
|
|
84
|
+
detail: 'external tool runtime import attempted without a bundled or worker policy; ' +
|
|
85
|
+
'load through the worker boundary instead (ADR-0054 M4-G capstone)',
|
|
58
86
|
};
|
|
59
87
|
}
|
|
60
88
|
const meta = readToolPackageMetadata(dir);
|
|
@@ -134,8 +162,14 @@ export async function admitToolPackage(opts) {
|
|
|
134
162
|
};
|
|
135
163
|
}
|
|
136
164
|
// Section 3+4 — runtime load + tool shape: dynamic import (UNTRUSTED code
|
|
137
|
-
// executes here) and the exported-symbol gate.
|
|
138
|
-
|
|
165
|
+
// executes here) and the exported-symbol gate. ADR-0054 M4-G: this section
|
|
166
|
+
// runs ONLY in an isolation context — the bundled host bootstrap (source
|
|
167
|
+
// `'bundled'`) or the child-process `runtime-probe-entry` for `tools validate`
|
|
168
|
+
// (a separate process, like the dispatch worker). `workerRuntimeImportPolicyFor`
|
|
169
|
+
// produces the bundled host policy for `'bundled'` and the named
|
|
170
|
+
// `inDispatchWorker` policy for an external candidate in the probe child — never
|
|
171
|
+
// a bare external host import (the type forbids that).
|
|
172
|
+
const load = await importToolRuntime(opts.dir, workerRuntimeImportPolicyFor(opts.source));
|
|
139
173
|
if (!load.ok) {
|
|
140
174
|
if (load.reason === 'invalid-shape') {
|
|
141
175
|
sections.push({ section: 'runtime-load', ok: true }, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admit-tool-package.js","sourceRoot":"","sources":["../../src/bootstrap/admit-tool-package.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"admit-tool-package.js","sourceRoot":"","sources":["../../src/bootstrap/admit-tool-package.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EACL,SAAS,EACT,yBAAyB,EACzB,gBAAgB,EAChB,uBAAuB,GAMxB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AA6CxE;;;;GAIG;AACH,MAAM,UAAU,0BAA0B,CAAC,MAAiB;IAC1D,OAAO,EAAE,MAAM,EAAE,CAAC;AACpB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,4BAA4B,CAAC,MAAkB;IAC7D,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,E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 @@ export function buildBaselineSeams(deps) {
|
|
|
109
109
|
// are not recoverable without storing the full original envelope).
|
|
110
110
|
const synthetic = {
|
|
111
111
|
schemaVersion: 2,
|
|
112
|
-
tool
|
|
112
|
+
tool,
|
|
113
113
|
runId: `baseline:${tool}`,
|
|
114
114
|
createdAt: new Date(capturedAt).toISOString(),
|
|
115
115
|
verdict: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baseline-seams.js","sourceRoot":"","sources":["../../src/bootstrap/baseline-seams.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EACL,kBAAkB,EAGlB,cAAc,GAEf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAkB,MAAM,wBAAwB,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAY3D,uFAAuF;AACvF,SAAS,eAAe,CAAC,IAAY;IACnC,OAAO,IAAI,kBAAkB,CAC3B,0BAA0B,IAAI,oDAAoD;QAChF,+EAA+E;QAC/E,wEAAwE;QACxE,iBAAiB,IAAI,uDAAuD;QAC5E,iFAAiF;QACjF,eAAe,EACjB,EAAE,IAAI,EAAE,qCAAqC,EAAE,CAChD,CAAC;AACJ,CAAC;AAED,oFAAoF;AACpF,4NAA4N;AAC5N,SAAS,qBAAqB,CAC5B,IAAY,EACZ,OAA0B;IAE1B,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;QACvB,IAAI,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;YACnB,MAAM,IAAI,kBAAkB,CAC1B,gBAAgB,IAAI,aAAa,CAAC,CAAC,MAAM,6CAA6C;gBACpF,uFAAuF,E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Aa,CAAC,CAAC,CAAC,CAAC,CAAC;YACvF,MAAM,IAAI,GAAG;gBACX,OAAO,EAAE,GAAG;gBACZ,IAAI;gBACJ,UAAU,EAAE,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC,WAAW,EAAE;gBAC9C,oEAAoE;gBACpE,2EAA2E;gBAC3E,sEAAsE;gBACtE,sEAAsE;gBACtE,IAAI,EAAE,sFAAsF;gBAC5F,WAAW,EAAE,YAAY,CAAC,MAAM;gBAChC,YAAY;aACb,CAAC;YACF,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;YACjD,MAAM,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YAChD,MAAM,SAAS,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;QAC5C,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* bind-external-dispatch — per-tool wiring of the ADR-0054 out-of-process
|
|
3
|
+
* dispatch hook (`RunActionHooks.maybeDispatchExternal`).
|
|
4
|
+
*
|
|
5
|
+
* `mountOneTool` calls {@link buildMaybeDispatchExternal} to bind a dispatch
|
|
6
|
+
* hook to one tool. At dispatch time the hook resolves the tool's provenance
|
|
7
|
+
* from `currentScope().toolProvenance` (recorded by the bootstrap, paired with
|
|
8
|
+
* the tool registry by stable id):
|
|
9
|
+
*
|
|
10
|
+
* - BUNDLED provenance (or no provenance recorded) → returns `false`; the
|
|
11
|
+
* command action runs the handler in-process, byte-identical to before.
|
|
12
|
+
* Bundled tools are the trusted computing base (ADR-0054 trust tiers).
|
|
13
|
+
* - EXTERNAL provenance (installed / project-local / user-global) → forks the
|
|
14
|
+
* worker via {@link dispatchExternalToolCommand}, which imports the untrusted
|
|
15
|
+
* runtime in the worker, runs the handler, and replays the slim result
|
|
16
|
+
* through the host seams; returns `true` so the action skips the in-process
|
|
17
|
+
* path.
|
|
18
|
+
*
|
|
19
|
+
* ADR-0054 M4-E trust-tier flip: external tools fork the worker **by default**.
|
|
20
|
+
* The former `OPENSIP_CLI_EXTERNAL_WORKER` opt-in gate is retired (M4-C landed
|
|
21
|
+
* the full host-RPC seam surface, closing the parity gap that blocked the flip).
|
|
22
|
+
* `OPENSIP_CLI_NO_WORKER` is now BUNDLED-ONLY — it never lets an external tool
|
|
23
|
+
* run in-host (an external tool that cannot fork is a hard error, raised by the
|
|
24
|
+
* supervisor, not a silent in-process fallback).
|
|
25
|
+
*
|
|
26
|
+
* Resolving provenance from the scope (not threading it through the mount chain)
|
|
27
|
+
* keeps this additive: the mount signature is unchanged and host commands — whose
|
|
28
|
+
* lean context has no run plane — never carry the hook.
|
|
29
|
+
*/
|
|
30
|
+
import { type Tool, type ToolCliContext } from '@opensip-cli/core';
|
|
31
|
+
/**
|
|
32
|
+
* Build the `maybeDispatchExternal` hook bound to one tool + its host context.
|
|
33
|
+
* The returned hook is merged onto the bound `ToolCliContext` by `mountOneTool`.
|
|
34
|
+
*/
|
|
35
|
+
export declare function buildMaybeDispatchExternal(tool: Tool, ctx: ToolCliContext): (commandName: string, opts: Record<string, unknown>, positionals: readonly unknown[]) => Promise<boolean>;
|
|
36
|
+
//# sourceMappingURL=bind-external-dispatch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bind-external-dispatch.d.ts","sourceRoot":"","sources":["../../src/bootstrap/bind-external-dispatch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAEL,KAAK,IAAI,EACT,KAAK,cAAc,EAEpB,MAAM,mBAAmB,CAAC;AA4B3B;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,cAAc,GAClB,CACD,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,WAAW,EAAE,SAAS,OAAO,EAAE,KAC5B,OAAO,CAAC,OAAO,CAAC,CAuBpB"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* bind-external-dispatch — per-tool wiring of the ADR-0054 out-of-process
|
|
3
|
+
* dispatch hook (`RunActionHooks.maybeDispatchExternal`).
|
|
4
|
+
*
|
|
5
|
+
* `mountOneTool` calls {@link buildMaybeDispatchExternal} to bind a dispatch
|
|
6
|
+
* hook to one tool. At dispatch time the hook resolves the tool's provenance
|
|
7
|
+
* from `currentScope().toolProvenance` (recorded by the bootstrap, paired with
|
|
8
|
+
* the tool registry by stable id):
|
|
9
|
+
*
|
|
10
|
+
* - BUNDLED provenance (or no provenance recorded) → returns `false`; the
|
|
11
|
+
* command action runs the handler in-process, byte-identical to before.
|
|
12
|
+
* Bundled tools are the trusted computing base (ADR-0054 trust tiers).
|
|
13
|
+
* - EXTERNAL provenance (installed / project-local / user-global) → forks the
|
|
14
|
+
* worker via {@link dispatchExternalToolCommand}, which imports the untrusted
|
|
15
|
+
* runtime in the worker, runs the handler, and replays the slim result
|
|
16
|
+
* through the host seams; returns `true` so the action skips the in-process
|
|
17
|
+
* path.
|
|
18
|
+
*
|
|
19
|
+
* ADR-0054 M4-E trust-tier flip: external tools fork the worker **by default**.
|
|
20
|
+
* The former `OPENSIP_CLI_EXTERNAL_WORKER` opt-in gate is retired (M4-C landed
|
|
21
|
+
* the full host-RPC seam surface, closing the parity gap that blocked the flip).
|
|
22
|
+
* `OPENSIP_CLI_NO_WORKER` is now BUNDLED-ONLY — it never lets an external tool
|
|
23
|
+
* run in-host (an external tool that cannot fork is a hard error, raised by the
|
|
24
|
+
* supervisor, not a silent in-process fallback).
|
|
25
|
+
*
|
|
26
|
+
* Resolving provenance from the scope (not threading it through the mount chain)
|
|
27
|
+
* keeps this additive: the mount signature is unchanged and host commands — whose
|
|
28
|
+
* lean context has no run plane — never carry the hook.
|
|
29
|
+
*/
|
|
30
|
+
import { currentScope, } from '@opensip-cli/core';
|
|
31
|
+
import { dispatchExternalToolCommand } from './dispatch-external-tool-command.js';
|
|
32
|
+
import { provenanceRecordFor } from './tool-provenance.js';
|
|
33
|
+
/** Find the admitted manifest for `tool` (same stable-id-then-name match). */
|
|
34
|
+
function manifestFor(tool) {
|
|
35
|
+
/* v8 ignore next -- defensive: `manifestFor` is only reached from the external-dispatch arm, which has already resolved an EXTERNAL provenance record off `currentScope()?.toolProvenance` (so a scope exists for this synchronous hook body), and `RunScope` always initializes `toolManifests` to `[]` — so `currentScope()?.toolManifests` is never undefined here and the `?? []` arm cannot execute. */
|
|
36
|
+
const recorded = currentScope()?.toolManifests ?? [];
|
|
37
|
+
return (recorded.find((m) => m.stableId !== undefined && m.stableId === tool.metadata.id) ??
|
|
38
|
+
recorded.find((m) => m.id === tool.metadata.name));
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Resolve the tool's RAW config namespace block for the WORKER deep pass
|
|
42
|
+
* (ADR-0054 M4-E). The namespace is the tool's manifest config descriptor key;
|
|
43
|
+
* the block is read from the host-validated document (`scope.configDocument`).
|
|
44
|
+
* `undefined` when the tool declares no descriptor or the document has no block —
|
|
45
|
+
* the worker then runs no deep pass for it.
|
|
46
|
+
*/
|
|
47
|
+
function deepConfigBlockFor(tool) {
|
|
48
|
+
const namespace = manifestFor(tool)?.config?.namespace;
|
|
49
|
+
if (namespace === undefined)
|
|
50
|
+
return undefined;
|
|
51
|
+
return currentScope()?.configDocument?.[namespace];
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Build the `maybeDispatchExternal` hook bound to one tool + its host context.
|
|
55
|
+
* The returned hook is merged onto the bound `ToolCliContext` by `mountOneTool`.
|
|
56
|
+
*/
|
|
57
|
+
export function buildMaybeDispatchExternal(tool, ctx) {
|
|
58
|
+
return async (commandName, opts, positionals) => {
|
|
59
|
+
const provenance = provenanceRecordFor(tool, currentScope()?.toolProvenance ?? []);
|
|
60
|
+
if (provenance === undefined || provenance.source === 'bundled') {
|
|
61
|
+
// No external provenance recorded (or bundled) → in-process (the trusted /
|
|
62
|
+
// unknown path), byte-identical to before. ADR-0054 trust tiers: bundled
|
|
63
|
+
// tools are the trusted computing base.
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
// ADR-0054 M4-E trust-tier flip: an external tool ALWAYS forks the worker
|
|
67
|
+
// (no opt-in gate). `OPENSIP_CLI_NO_WORKER` does not apply here — it is
|
|
68
|
+
// bundled-only; the supervisor hard-errors if the fork fails (never an
|
|
69
|
+
// in-host run of untrusted code).
|
|
70
|
+
await dispatchExternalToolCommand({
|
|
71
|
+
provenance,
|
|
72
|
+
commandName,
|
|
73
|
+
opts,
|
|
74
|
+
positionals,
|
|
75
|
+
ctx,
|
|
76
|
+
config: deepConfigBlockFor(tool),
|
|
77
|
+
});
|
|
78
|
+
return true;
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=bind-external-dispatch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bind-external-dispatch.js","sourceRoot":"","sources":["../../src/bootstrap/bind-external-dispatch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EACL,YAAY,GAIb,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAClF,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE3D,8EAA8E;AAC9E,SAAS,WAAW,CAAC,IAAU;IAC7B,6YAA6Y;IAC7Y,MAAM,QAAQ,GAAG,YAAY,EAAE,EAAE,aAAa,IAAI,EAAE,CAAC;IACrD,OAAO,CACL,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,SAAS,IAAI,CAAC,CAAC,QAAQ,KAAK,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;QACjF,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAClD,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,SAAS,kBAAkB,CAAC,IAAU;IACpC,MAAM,SAAS,GAAG,WAAW,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC;IACvD,IAAI,SAAS,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC9C,OAAO,YAAY,EAAE,EAAE,cAAc,EAAE,CAAC,SAAS,CAAC,CAAC;AACrD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,0BAA0B,CACxC,IAAU,EACV,GAAmB;IAMnB,OAAO,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE;QAC9C,MAAM,UAAU,GAAG,mBAAmB,CAAC,IAAI,EAAE,YAAY,EAAE,EAAE,cAAc,IAAI,EAAE,CAAC,CAAC;QACnF,IAAI,UAAU,KAAK,SAAS,IAAI,UAAU,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;YAChE,2EAA2E;YAC3E,yEAAyE;YACzE,wCAAwC;YACxC,OAAO,KAAK,CAAC;QACf,CAAC;QACD,0EAA0E;QAC1E,wEAAwE;QACxE,uEAAuE;QACvE,kCAAkC;QAClC,MAAM,2BAA2B,CAAC;YAChC,UAAU;YACV,WAAW;YACX,IAAI;YACJ,WAAW;YACX,GAAG;YACH,MAAM,EAAE,kBAAkB,CAAC,IAAI,CAAC;SACjC,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* sequencing (registries, bootstrap, mounting, registration, dispatch).
|
|
12
12
|
*/
|
|
13
13
|
import { SessionReplayRegistry } from '../session-replay-registry.js';
|
|
14
|
-
import type { CommandSpec, PluginLayout, ScaffoldContext, ScaffoldFile, ToolCliContext, ToolRegistry } from '@opensip-cli/core';
|
|
14
|
+
import type { CommandSpec, PluginLayout, ScaffoldContext, ScaffoldFile, ToolCliContext, ToolProvenance, ToolRegistry } from '@opensip-cli/core';
|
|
15
15
|
/** The structured input consumed by `registerCliCommands`. */
|
|
16
16
|
export interface CommandRegistrationInput {
|
|
17
17
|
readonly pluginLayouts: readonly NonNullable<PluginLayout>[];
|
|
@@ -37,5 +37,16 @@ export interface CommandRegistrationInput {
|
|
|
37
37
|
* are absent (this warning is intentionally loud when a bundled tool is
|
|
38
38
|
* missing, as it affects `init` scaffolding).
|
|
39
39
|
*/
|
|
40
|
-
export declare function buildCommandRegistrationInput(registry: ToolRegistry
|
|
40
|
+
export declare function buildCommandRegistrationInput(registry: ToolRegistry,
|
|
41
|
+
/**
|
|
42
|
+
* ADR-0054 M4-F: the admitted-tool provenance + project cwd, threaded so the
|
|
43
|
+
* session-replay registry gives an EXTERNAL tool a WORKER-backed `replaySession`
|
|
44
|
+
* (its untrusted runtime never executes in the host). Bundled tools replay
|
|
45
|
+
* in-host. Defaulted so the registry stays buildable without them (replay then
|
|
46
|
+
* treats every tool as bundled — the pre-M4-F behavior).
|
|
47
|
+
*/
|
|
48
|
+
opts?: {
|
|
49
|
+
readonly provenance?: readonly ToolProvenance[];
|
|
50
|
+
readonly cwd?: string;
|
|
51
|
+
}): CommandRegistrationInput;
|
|
41
52
|
//# sourceMappingURL=build-command-registration-input.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-command-registration-input.d.ts","sourceRoot":"","sources":["../../src/bootstrap/build-command-registration-input.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;
|
|
1
|
+
{"version":3,"file":"build-command-registration-input.d.ts","sourceRoot":"","sources":["../../src/bootstrap/build-command-registration-input.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAMH,OAAO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import { logger, resolveToolHooks } from '@opensip-cli/core';
|
|
14
|
+
import { buildHostDispatchCtx } from '../cli-context.js';
|
|
14
15
|
import { internalCommandNames } from '../commands/internal-command-visibility.js';
|
|
15
16
|
import { SessionReplayRegistry } from '../session-replay-registry.js';
|
|
17
|
+
import { dispatchExternalToolHook } from './dispatch-external-tool-hook.js';
|
|
16
18
|
import { EXPECTED_SCAFFOLDING_TOOL_IDS } from './register-tools.js';
|
|
17
19
|
/**
|
|
18
20
|
* Collects the registry-derived data needed for CLI command registration.
|
|
@@ -20,7 +22,15 @@ import { EXPECTED_SCAFFOLDING_TOOL_IDS } from './register-tools.js';
|
|
|
20
22
|
* are absent (this warning is intentionally loud when a bundled tool is
|
|
21
23
|
* missing, as it affects `init` scaffolding).
|
|
22
24
|
*/
|
|
23
|
-
export function buildCommandRegistrationInput(registry
|
|
25
|
+
export function buildCommandRegistrationInput(registry,
|
|
26
|
+
/**
|
|
27
|
+
* ADR-0054 M4-F: the admitted-tool provenance + project cwd, threaded so the
|
|
28
|
+
* session-replay registry gives an EXTERNAL tool a WORKER-backed `replaySession`
|
|
29
|
+
* (its untrusted runtime never executes in the host). Bundled tools replay
|
|
30
|
+
* in-host. Defaulted so the registry stays buildable without them (replay then
|
|
31
|
+
* treats every tool as bundled — the pre-M4-F behavior).
|
|
32
|
+
*/
|
|
33
|
+
opts) {
|
|
24
34
|
// Source the plugin-supporting domains from the registered tools'
|
|
25
35
|
// declared layouts — the kernel never enumerates them (ADR-0009).
|
|
26
36
|
const pluginLayouts = registry
|
|
@@ -60,7 +70,24 @@ export function buildCommandRegistrationInput(registry) {
|
|
|
60
70
|
});
|
|
61
71
|
}
|
|
62
72
|
}
|
|
63
|
-
|
|
73
|
+
// ADR-0054 M4-F: inject the external-replay dispatcher (forks the replay HOOK
|
|
74
|
+
// worker) so `session-replay-registry.ts` need not import the dispatch chain
|
|
75
|
+
// (that would form a module cycle). Bundled tools replay in-host.
|
|
76
|
+
const cwd = opts?.cwd;
|
|
77
|
+
const sessionReplayRegistry = SessionReplayRegistry.fromTools(registry, {
|
|
78
|
+
provenance: opts?.provenance ?? [],
|
|
79
|
+
...(cwd === undefined
|
|
80
|
+
? {}
|
|
81
|
+
: {
|
|
82
|
+
dispatchExternalReplay: (provenance, stored) => dispatchExternalToolHook({
|
|
83
|
+
provenance,
|
|
84
|
+
hook: 'sessionReplay',
|
|
85
|
+
hookArg: stored,
|
|
86
|
+
cwd,
|
|
87
|
+
ctx: buildHostDispatchCtx(),
|
|
88
|
+
}),
|
|
89
|
+
}),
|
|
90
|
+
});
|
|
64
91
|
// The live tool command surface, sourced from the populated registry so the
|
|
65
92
|
// `completion` command derives its flags from the same specs the runtime
|
|
66
93
|
// mounts (no hand-maintained flag list to drift).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-command-registration-input.js","sourceRoot":"","sources":["../../src/bootstrap/build-command-registration-input.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AAClF,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAEtE,OAAO,EAAE,6BAA6B,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"build-command-registration-input.js","sourceRoot":"","sources":["../../src/bootstrap/build-command-registration-input.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AAClF,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAEtE,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAC5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,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,EAAE;QACX,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;KACrC,CAAC;CACH;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,GAAG,QAAQ,CAyLvE"}
|
|
@@ -24,6 +24,7 @@ import { resolveSignalSink } from '@opensip-cli/output';
|
|
|
24
24
|
import { buildDatastoreThunk } from '../cli-context.js';
|
|
25
25
|
import { buildTargets } from './build-targets.js';
|
|
26
26
|
import { composeAndValidateToolConfig, wireCapabilityRegistry } from './config-and-capabilities.js';
|
|
27
|
+
import { shouldRunHookInHost } from './tool-provenance.js';
|
|
27
28
|
const FORBIDDEN_SCOPE_CONTRIBUTION_KEYS = new Set(['__proto__', 'prototype', 'constructor']);
|
|
28
29
|
/**
|
|
29
30
|
* @throws {PluginIncompatibleError} When a tool returns an invalid scope
|
|
@@ -97,6 +98,10 @@ export function buildPerRunScope(input) {
|
|
|
97
98
|
const { config: toolConfig, document: configDocument } = composeAndValidateToolConfig({
|
|
98
99
|
tools,
|
|
99
100
|
manifests,
|
|
101
|
+
// ADR-0054 M4-E: provenance drives the two-pass fold — bundled tools' Zod is
|
|
102
|
+
// composed host-side; external tools validate from their manifest descriptor
|
|
103
|
+
// (coarse, no Zod import); the deep Zod pass runs in the worker.
|
|
104
|
+
provenance,
|
|
100
105
|
configPath: project.scope === 'project' ? project.configPath : undefined,
|
|
101
106
|
env: process.env,
|
|
102
107
|
});
|
|
@@ -157,7 +162,16 @@ export function buildPerRunScope(input) {
|
|
|
157
162
|
// --json consumers and the uniform diagnostics snapshot see the full
|
|
158
163
|
// per-run construction (addresses architecture review findings on observability
|
|
159
164
|
// of steps 6/7 and blast-radius files).
|
|
160
|
-
|
|
165
|
+
// ADR-0054 M4-F: the HOST process never executes an EXTERNAL tool's
|
|
166
|
+
// `contributeScope` (running its runtime closure is the load-time hole the ADR
|
|
167
|
+
// rejects). External subscopes are contributed worker-side — the dispatch
|
|
168
|
+
// worker re-runs this SAME builder with the host-skip INACTIVE, so the
|
|
169
|
+
// dispatched external tool's subscope is installed there (the isolation
|
|
170
|
+
// boundary). Bundled tools contribute in-host exactly as before. The
|
|
171
|
+
// diagnostics count only the tools whose hook actually runs in-host.
|
|
172
|
+
const contributing = tools
|
|
173
|
+
.list()
|
|
174
|
+
.filter((t) => !!resolveToolHooks(t).contributeScope && shouldRunHookInHost(t, provenance));
|
|
161
175
|
scope.diagnostics.event('load', 'debug', `${contributing.length} tool(s) contributed subscope`, {
|
|
162
176
|
tools: contributing.map((t) => t.metadata.id ?? t.metadata.name),
|
|
163
177
|
});
|
|
@@ -172,7 +186,7 @@ export function buildPerRunScope(input) {
|
|
|
172
186
|
// (`{ contribution, onDispose }`); we install `contribution` and register
|
|
173
187
|
// `onDispose` on `scope.onDispose(...)` so `dispose()` reclaims the resource.
|
|
174
188
|
// The bare-`ScopeContribution` form (graph/simulation) carries no disposer.
|
|
175
|
-
for (const tool of
|
|
189
|
+
for (const tool of contributing) {
|
|
176
190
|
const result = resolveToolHooks(tool).contributeScope?.();
|
|
177
191
|
if (!result)
|
|
178
192
|
continue;
|
|
@@ -186,10 +200,13 @@ export function buildPerRunScope(input) {
|
|
|
186
200
|
}
|
|
187
201
|
}
|
|
188
202
|
// §5.3 Phase 4: per-run capability registry (manifest domains → real registrars).
|
|
203
|
+
// M4-F: pass provenance so the registry installs an external tool's REAL
|
|
204
|
+
// registrar in-host only when the host-skip is inactive (i.e. in the worker).
|
|
189
205
|
const capabilities = wireCapabilityRegistry({
|
|
190
206
|
tools,
|
|
191
207
|
manifests,
|
|
192
208
|
registry: createCapabilityRegistry(logger),
|
|
209
|
+
provenance,
|
|
193
210
|
});
|
|
194
211
|
const wired = capabilities.listDomains().map((d) => d.id);
|
|
195
212
|
scope.diagnostics.event('load', 'debug', `wired ${wired.length} capability domain(s)`, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-per-run-scope.js","sourceRoot":"","sources":["../../src/bootstrap/build-per-run-scope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,EAAE,aAAa,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,EACL,wBAAwB,EACxB,kBAAkB,EAClB,0BAA0B,EAG1B,uBAAuB,EAGvB,gBAAgB,EAChB,QAAQ,EACR,gBAAgB,GAMjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,4BAA4B,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"build-per-run-scope.js","sourceRoot":"","sources":["../../src/bootstrap/build-per-run-scope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,EAAE,aAAa,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,EACL,wBAAwB,EACxB,kBAAkB,EAClB,0BAA0B,EAG1B,uBAAuB,EAGvB,gBAAgB,EAChB,QAAQ,EACR,gBAAgB,GAMjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,EAAE,YAAY,EAAE,MAAM,o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