@yourtechbudstudio/isagi-workflow-verifier 0.0.1 → 0.1.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/LICENSE +198 -4
- package/README.md +4 -4
- package/dist/cli.js +107 -31
- package/dist/cli.js.map +1 -1
- package/dist/closed-bundle.d.ts +2 -0
- package/dist/closed-bundle.js +393 -0
- package/dist/closed-bundle.js.map +1 -0
- package/dist/receipt.d.ts +16 -4
- package/dist/receipt.js +35 -5
- package/dist/receipt.js.map +1 -1
- package/dist/structure.d.ts +84 -0
- package/dist/structure.js +580 -0
- package/dist/structure.js.map +1 -0
- package/package.json +15 -6
package/LICENSE
CHANGED
|
@@ -1,7 +1,201 @@
|
|
|
1
|
-
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
1. Definitions.
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -6,12 +6,12 @@ Verify an already-built Isagi workflow package and write its build receipt:
|
|
|
6
6
|
isagi-workflow-verify --workflow .
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
The verifier has one job: raise the probability that the Isagi runtime loads the workflow build without errors. It checks ahead of time exactly what the runtime checks at load time — exact SDK and verifier pins, symlink-free sources,
|
|
9
|
+
The verifier has one job: raise the probability that the Isagi runtime loads the workflow build without errors. It checks ahead of time exactly what the runtime checks at load time — exact SDK and verifier pins, symlink-free sources, a `dist/index.js` bundle that default-exports a loadable workflow definition with a valid `command()` manifest (validated in a bounded child process), a structurally valid graph, and a closed bundle that carries every executable dependency it needs. When every gate passes it writes the declared structure to `dist/isagi-workflow-structure.json` and then fingerprints the sources, the artifact, and that structure into `dist/isagi-workflow-build.json`; the runtime re-checks that receipt and refuses to run a workflow whose source or artifact no longer matches it. How the package installs dependencies is deliberately outside this contract.
|
|
10
10
|
|
|
11
|
-
The workflow package owns compilation and quality. Run the canonical `build` script before verification, and run your own `typecheck` and `test` scripts before that: the verifier never compiles, installs dependencies, or runs package scripts, and it does not gate on tests. The current versions are `@yourtechbudstudio/isagi-workflow-sdk@0.0
|
|
11
|
+
The workflow package owns compilation and quality. Run the canonical `build` script before verification, and run your own `typecheck` and `test` scripts before that: the verifier never compiles, installs dependencies, or runs package scripts, and it does not gate on tests. The current versions are `@yourtechbudstudio/isagi-workflow-sdk@0.1.0`, `@yourtechbudstudio/isagi-workflow-verifier@0.1.0`, and `esbuild@0.28.0`. For the full authoring guide, use Isagi's installed `isagi-docs` skill.
|
|
12
12
|
|
|
13
13
|
## Trust boundary
|
|
14
14
|
|
|
15
|
-
A verified artifact is self-contained with respect to its statically discoverable package import graph. Workflows remain trusted Node.js code and may intentionally access runtime files, processes, network resources, and Node built-ins. Verification is lifecycle containment, not a sandbox.
|
|
15
|
+
A verified artifact is self-contained with respect to its statically discoverable package import graph: the verifier parses `dist/index.js` and rejects residual external imports, deferred `import()` loads, and ordinary deferred-load constructs. Loader calls are resolved against the binding actually visible at the call site, so an alias of `createRequire` is caught however it was spelled or ordered, while a parameter, local, or named function expression that merely shares a name with a global is not. It does not resist adversarial indirection, and it does not try to. Workflows remain trusted Node.js code and may intentionally access runtime files, processes, network resources, and Node built-ins. Verification is lifecycle containment, not a sandbox.
|
|
16
16
|
|
|
17
|
-
The `./receipt` export contains pure manifest parsing, canonical serialization, path policy, compatibility constants, and hash primitives for consumers that need to check a receipt without executing verifier operations.
|
|
17
|
+
The `./receipt` export contains pure manifest parsing, canonical serialization, path policy, compatibility constants, and hash primitives for consumers that need to check a receipt without executing verifier operations. The `./structure` export contains the single structural inspection algorithm — descriptor extraction, validation diagnostics, canonicalization, and hashing — which the Isagi runtime re-runs against the imported artifact so a receipt cannot describe a different graph than the one that executes.
|
package/dist/cli.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { spawn } from 'node:child_process';
|
|
3
3
|
import { randomUUID } from 'node:crypto';
|
|
4
|
-
import { lstat, mkdtemp, readFile, readdir, rename, rm, stat, writeFile } from 'node:fs/promises';
|
|
4
|
+
import { lstat, mkdtemp, readFile, readdir, rename, rm, stat, unlink, writeFile, } from 'node:fs/promises';
|
|
5
5
|
import { tmpdir } from 'node:os';
|
|
6
|
-
import { join, resolve } from 'node:path';
|
|
7
|
-
import { pathToFileURL } from 'node:url';
|
|
6
|
+
import { dirname, join, resolve } from 'node:path';
|
|
7
|
+
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
8
|
+
import { scanDeferredExecutableDependencies } from './closed-bundle.js';
|
|
8
9
|
import { hashArtifact, hashWorkflowInputs, isWorkflowSourcePath, serializeWorkflowBuildManifest, supportedWorkflowContractVersion, workflowBuildManifestVersion, workflowSdkPackage, workflowSdkVersion, workflowVerifierPackage, workflowVerifierVersion, } from './receipt.js';
|
|
10
|
+
import { canonicalizeDescriptor, hashDescriptor, } from './structure.js';
|
|
9
11
|
const outputLimit = 128 * 1024;
|
|
10
12
|
const subprocessTimeoutMs = 120_000;
|
|
11
13
|
class VerificationError extends Error {
|
|
@@ -90,12 +92,21 @@ function terminateTree(pid) {
|
|
|
90
92
|
*/
|
|
91
93
|
export async function verifyWorkflow(workflowArgument, runner = runProcess) {
|
|
92
94
|
const root = resolve(workflowArgument);
|
|
95
|
+
// Remove any receipt an earlier run left behind before any work that can fail, so a failed
|
|
96
|
+
// verification can never leave a previous success standing as if it certified this attempt. The
|
|
97
|
+
// explicit --workflow argument already scopes this to one path, and nothing else is touched.
|
|
98
|
+
await removeStaleReceipt(root);
|
|
93
99
|
const packageJson = await readPackageJson(root);
|
|
94
100
|
requirePins(packageJson);
|
|
95
101
|
const sourceHash = hashWorkflowInputs(await readSourceInputs(root));
|
|
96
102
|
const artifactPath = join(root, 'dist', 'index.js');
|
|
97
103
|
const artifactBytes = await readArtifact(artifactPath);
|
|
98
|
-
|
|
104
|
+
requireClosedBundle(artifactBytes);
|
|
105
|
+
const descriptor = await validateArtifact(root, artifactPath, runner);
|
|
106
|
+
const structureHash = hashDescriptor(descriptor);
|
|
107
|
+
// The structure file is written for every structurally valid bundle, so an author always has a
|
|
108
|
+
// machine-readable description of what they built.
|
|
109
|
+
await writeAtomic(join(root, 'dist', 'isagi-workflow-structure.json'), `${canonicalizeDescriptor(descriptor)}\n`, 'the workflow structure description');
|
|
99
110
|
const manifest = {
|
|
100
111
|
manifestVersion: workflowBuildManifestVersion,
|
|
101
112
|
workflowContractVersion: supportedWorkflowContractVersion,
|
|
@@ -103,8 +114,63 @@ export async function verifyWorkflow(workflowArgument, runner = runProcess) {
|
|
|
103
114
|
verifier: { name: workflowVerifierPackage, version: workflowVerifierVersion },
|
|
104
115
|
source: { sha256: sourceHash },
|
|
105
116
|
artifact: { entry: 'dist/index.js', sha256: hashArtifact(artifactBytes) },
|
|
117
|
+
structure: {
|
|
118
|
+
descriptorVersion: descriptor.descriptorVersion,
|
|
119
|
+
sha256: structureHash,
|
|
120
|
+
rootGraphKey: descriptor.rootGraphKey,
|
|
121
|
+
graphCount: descriptor.graphs.length,
|
|
122
|
+
},
|
|
106
123
|
};
|
|
107
|
-
|
|
124
|
+
// The receipt is written last, so a receipt never exists without its structure description.
|
|
125
|
+
await writeAtomic(join(root, 'dist', 'isagi-workflow-build.json'), serializeWorkflowBuildManifest(manifest), 'the build receipt');
|
|
126
|
+
}
|
|
127
|
+
function receiptPath(root) {
|
|
128
|
+
return join(root, 'dist', 'isagi-workflow-build.json');
|
|
129
|
+
}
|
|
130
|
+
async function removeStaleReceipt(root) {
|
|
131
|
+
try {
|
|
132
|
+
await unlink(receiptPath(root));
|
|
133
|
+
}
|
|
134
|
+
catch (cause) {
|
|
135
|
+
// Absence is the normal case. Anything else — a permission problem, a directory in its place —
|
|
136
|
+
// must fail here rather than leave a misleading receipt in reach.
|
|
137
|
+
if (cause.code === 'ENOENT')
|
|
138
|
+
return;
|
|
139
|
+
throw new VerificationError(`Could not remove the previous build receipt ${receiptPath(root)}: ${message(cause)}`);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
function requireClosedBundle(artifactBytes) {
|
|
143
|
+
const diagnostics = scanDeferredExecutableDependencies(artifactBytes.toString('utf8'));
|
|
144
|
+
if (diagnostics.length === 0)
|
|
145
|
+
return;
|
|
146
|
+
throw new VerificationError(`dist/index.js is not a closed bundle. One artifact hash must pin one executable structure, so everything the artifact runs has to be inside it:\n${formatDiagnostics(diagnostics)}`);
|
|
147
|
+
}
|
|
148
|
+
function formatDiagnostics(diagnostics) {
|
|
149
|
+
return diagnostics
|
|
150
|
+
.map((diagnostic) => {
|
|
151
|
+
const at = [
|
|
152
|
+
diagnostic.at.graphKey && `graph ${diagnostic.at.graphKey}`,
|
|
153
|
+
diagnostic.at.nodeId && `node ${diagnostic.at.nodeId}`,
|
|
154
|
+
diagnostic.at.edgeId && `edge ${diagnostic.at.edgeId}`,
|
|
155
|
+
diagnostic.at.outcomeId && `outcome ${diagnostic.at.outcomeId}`,
|
|
156
|
+
diagnostic.at.field && `field ${diagnostic.at.field}`,
|
|
157
|
+
]
|
|
158
|
+
.filter(Boolean)
|
|
159
|
+
.join(' · ');
|
|
160
|
+
return ` [${diagnostic.code}]${at ? ` ${at}:` : ''} ${diagnostic.message}`;
|
|
161
|
+
})
|
|
162
|
+
.join('\n');
|
|
163
|
+
}
|
|
164
|
+
async function writeAtomic(path, contents, what) {
|
|
165
|
+
const temporary = `${path}.${randomUUID()}.tmp`;
|
|
166
|
+
try {
|
|
167
|
+
await writeFile(temporary, contents, { flag: 'wx' });
|
|
168
|
+
await rename(temporary, path);
|
|
169
|
+
}
|
|
170
|
+
catch (cause) {
|
|
171
|
+
await rm(temporary, { force: true }).catch(() => undefined);
|
|
172
|
+
throw new VerificationError(`Could not write ${what} ${path}: ${message(cause)}`);
|
|
173
|
+
}
|
|
108
174
|
}
|
|
109
175
|
async function readPackageJson(root) {
|
|
110
176
|
const path = join(root, 'package.json');
|
|
@@ -198,10 +264,10 @@ async function readArtifact(path) {
|
|
|
198
264
|
return readFile(path);
|
|
199
265
|
}
|
|
200
266
|
/**
|
|
201
|
-
* Imports the built artifact in an isolated child process the way the runtime loader will,
|
|
202
|
-
* checks the exported workflow definition and its command() manifest.
|
|
203
|
-
* result file rather than stdout, so workflow code that logs during
|
|
204
|
-
* corrupt the report.
|
|
267
|
+
* Imports the built artifact in an isolated child process the way the runtime loader will, reads
|
|
268
|
+
* its declared structure, and checks the exported workflow definition and its command() manifest.
|
|
269
|
+
* The child reports through a result file rather than stdout, so workflow code that logs during
|
|
270
|
+
* import or command() cannot corrupt the report.
|
|
205
271
|
*/
|
|
206
272
|
async function validateArtifact(root, artifact, runner) {
|
|
207
273
|
const isolatedRoot = await mkdtemp(join(tmpdir(), 'isagi-workflow-validation-'));
|
|
@@ -210,7 +276,7 @@ async function validateArtifact(root, artifact, runner) {
|
|
|
210
276
|
await writeFile(isolatedArtifact, await readFile(artifact));
|
|
211
277
|
const resultPath = join(isolatedRoot, 'result.json');
|
|
212
278
|
const validatorPath = join(isolatedRoot, 'validate.mjs');
|
|
213
|
-
await writeFile(validatorPath, validatorSource(isolatedArtifact, resultPath, root));
|
|
279
|
+
await writeFile(validatorPath, validatorSource(isolatedArtifact, resultPath, root, structureModulePath()));
|
|
214
280
|
try {
|
|
215
281
|
await runner({
|
|
216
282
|
command: process.execPath,
|
|
@@ -229,29 +295,51 @@ async function validateArtifact(root, artifact, runner) {
|
|
|
229
295
|
catch {
|
|
230
296
|
throw new VerificationError('dist/index.js failed the artifact check: the bundle terminated the validation process (for example via process.exit) before the check finished. Workflow code must not exit the process.');
|
|
231
297
|
}
|
|
232
|
-
if (!report || typeof report !== 'object' || report.ok !== true)
|
|
233
|
-
|
|
298
|
+
if (!report || typeof report !== 'object' || report.ok !== true) {
|
|
299
|
+
const diagnostics = report?.diagnostics;
|
|
300
|
+
const detail = Array.isArray(diagnostics) && diagnostics.length > 0
|
|
301
|
+
? formatDiagnostics(diagnostics)
|
|
302
|
+
: String(report?.error ?? 'The validation report is malformed.');
|
|
303
|
+
throw new VerificationError(`dist/index.js failed the artifact check that mirrors how the Isagi runtime loads workflows:\n${detail}\nFix the workflow source, rebuild, and re-run verification.`);
|
|
304
|
+
}
|
|
305
|
+
// The child returns the descriptor as data. The parent canonicalizes and hashes it itself
|
|
306
|
+
// rather than trusting a hash produced inside the process that imported workflow code.
|
|
307
|
+
const descriptor = report.descriptor;
|
|
308
|
+
if (!descriptor || typeof descriptor !== 'object') {
|
|
309
|
+
throw new VerificationError('dist/index.js failed the artifact check: the validation process reported success without a structure description.');
|
|
310
|
+
}
|
|
311
|
+
return descriptor;
|
|
234
312
|
}
|
|
235
313
|
finally {
|
|
236
314
|
await rm(isolatedRoot, { recursive: true, force: true });
|
|
237
315
|
}
|
|
238
316
|
}
|
|
239
|
-
|
|
317
|
+
/**
|
|
318
|
+
* The installed structure module, resolved as a real file URL so a packed installation works
|
|
319
|
+
* outside this monorepo. The validator child is a plain Node process, so it imports this path
|
|
320
|
+
* directly; CLI integration tests therefore run against the built CLI, whose sibling is `dist`.
|
|
321
|
+
*/
|
|
322
|
+
function structureModulePath() {
|
|
323
|
+
return join(dirname(fileURLToPath(import.meta.url)), 'structure.js');
|
|
324
|
+
}
|
|
325
|
+
function validatorSource(artifactPath, resultPath, worktreePath, structurePath) {
|
|
240
326
|
return [
|
|
241
327
|
`import { writeFileSync } from 'node:fs';`,
|
|
242
328
|
`const finish = (report) => { writeFileSync(${JSON.stringify(resultPath)}, JSON.stringify(report)); process.exit(0); };`,
|
|
243
329
|
`const describe = (value) => (Array.isArray(value) ? 'an array' : value === null ? 'null' : typeof value);`,
|
|
244
330
|
`const cause = (error) => String((error && error.stack) || error);`,
|
|
331
|
+
`let structure;`,
|
|
332
|
+
`try { structure = await import(${JSON.stringify(pathToFileURL(structurePath).href)}); }`,
|
|
333
|
+
`catch (error) { finish({ ok: false, error: 'The verifier could not load its own structure module:\\n' + cause(error) }); }`,
|
|
245
334
|
`let artifact;`,
|
|
246
335
|
`try { artifact = await import(${JSON.stringify(pathToFileURL(artifactPath).href)}); }`,
|
|
247
336
|
`catch (error) { finish({ ok: false, error: 'Importing the bundle threw before any workflow definition could be read:\\n' + cause(error) }); }`,
|
|
337
|
+
`const result = structure.describeWorkflowModule(artifact);`,
|
|
338
|
+
`if (!result.ok) finish({ ok: false, error: 'The bundle does not declare a valid workflow structure.', diagnostics: result.diagnostics });`,
|
|
248
339
|
`const workflow = artifact.default;`,
|
|
249
|
-
`if (!workflow || typeof workflow !== 'object') finish({ ok: false, error: 'The bundle must default-export the workflow definition object returned by defineWorkflow(); its default export is ' + describe(workflow) + '.' });`,
|
|
250
|
-
`const missing = ['command', 'validate', 'init', 'step'].filter((name) => typeof workflow[name] !== 'function');`,
|
|
251
|
-
`if (missing.length) finish({ ok: false, error: 'The default-exported workflow definition is missing required function(s): ' + missing.join(', ') + '. Default-export the object returned by defineWorkflow() from src/index.ts.' });`,
|
|
252
340
|
`let manifest;`,
|
|
253
|
-
`try { manifest = await workflow.command({ worktreeId: 0, worktreePath: ${JSON.stringify(worktreePath)}, surfaceId:
|
|
254
|
-
`catch (error) { finish({ ok: false, error: 'command() threw when called with a minimal
|
|
341
|
+
`try { manifest = await workflow.command({ worktreeId: 0, worktreePath: ${JSON.stringify(worktreePath)}, surfaceId: null, paneId: null, agentSessionId: null }); }`,
|
|
342
|
+
`catch (error) { finish({ ok: false, error: 'command() threw when called with a minimal origin. command() must succeed without optional surface, pane or agent-session context.\\n' + cause(error) }); }`,
|
|
255
343
|
`const problems = [];`,
|
|
256
344
|
`if (!manifest || typeof manifest !== 'object' || Array.isArray(manifest)) problems.push('command() must return a manifest object; it returned ' + describe(manifest) + '.');`,
|
|
257
345
|
`else {`,
|
|
@@ -270,22 +358,10 @@ function validatorSource(artifactPath, resultPath, worktreePath) {
|
|
|
270
358
|
` }`,
|
|
271
359
|
` }`,
|
|
272
360
|
`}`,
|
|
273
|
-
`finish(problems.length ? { ok: false, error: problems.join('\\n') } : { ok: true });`,
|
|
361
|
+
`finish(problems.length ? { ok: false, error: problems.join('\\n') } : { ok: true, descriptor: result.descriptor });`,
|
|
274
362
|
``,
|
|
275
363
|
].join('\n');
|
|
276
364
|
}
|
|
277
|
-
async function writeReceipt(root, manifest) {
|
|
278
|
-
const receiptPath = join(root, 'dist', 'isagi-workflow-build.json');
|
|
279
|
-
const temporary = `${receiptPath}.${randomUUID()}.tmp`;
|
|
280
|
-
try {
|
|
281
|
-
await writeFile(temporary, serializeWorkflowBuildManifest(manifest), { flag: 'wx' });
|
|
282
|
-
await rename(temporary, receiptPath);
|
|
283
|
-
}
|
|
284
|
-
catch (cause) {
|
|
285
|
-
await rm(temporary, { force: true }).catch(() => undefined);
|
|
286
|
-
throw new VerificationError(`Could not write the build receipt ${receiptPath}: ${message(cause)}`);
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
365
|
async function exists(path) {
|
|
290
366
|
try {
|
|
291
367
|
await stat(path);
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClG,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAA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