@aviaratech/ai-delivery 0.3.25 → 0.3.26
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/README.md +104 -9
- package/dist/agent.d.ts +2 -0
- package/dist/agent.js +1 -0
- package/dist/agent.js.map +1 -1
- package/dist/agentReadiness.test.js +61 -123
- package/dist/agentReadiness.test.js.map +1 -1
- package/dist/cli.js +121 -32
- package/dist/cli.js.map +1 -1
- package/dist/config/deliveryConfig.js +5 -1
- package/dist/config/deliveryConfig.js.map +1 -1
- package/dist/deliveryHealth.test.d.ts +1 -0
- package/dist/deliveryHealth.test.js +167 -0
- package/dist/deliveryHealth.test.js.map +1 -0
- package/dist/dispatch.d.ts +1 -0
- package/dist/dispatch.js +47 -4
- package/dist/dispatch.js.map +1 -1
- package/dist/fixtures/inertEntrypointChild.d.ts +1 -0
- package/dist/fixtures/inertEntrypointChild.js +62 -0
- package/dist/fixtures/inertEntrypointChild.js.map +1 -0
- package/dist/fixtures/inertEntrypoints.d.ts +49 -0
- package/dist/fixtures/inertEntrypoints.js +276 -0
- package/dist/fixtures/inertEntrypoints.js.map +1 -0
- package/dist/fixtures/inertTarget.d.ts +643 -0
- package/dist/fixtures/inertTarget.js +713 -0
- package/dist/fixtures/inertTarget.js.map +1 -0
- package/dist/fixtures/issue63.d.ts +68 -0
- package/dist/fixtures/issue63.js +272 -0
- package/dist/fixtures/issue63.js.map +1 -0
- package/dist/github/client.d.ts +2 -0
- package/dist/github/client.js +94 -12
- package/dist/github/client.js.map +1 -1
- package/dist/github/issueHistory.d.ts +40 -0
- package/dist/github/issueHistory.js +144 -0
- package/dist/github/issueHistory.js.map +1 -0
- package/dist/github/machineAuth.d.ts +9 -0
- package/dist/github/machineAuth.js +135 -0
- package/dist/github/machineAuth.js.map +1 -0
- package/dist/github/machineAuth.test.d.ts +1 -0
- package/dist/github/machineAuth.test.js +409 -0
- package/dist/github/machineAuth.test.js.map +1 -0
- package/dist/github/projectDelivery.d.ts +2 -0
- package/dist/github/projectDelivery.js +6 -0
- package/dist/github/projectDelivery.js.map +1 -1
- package/dist/github/relationships.d.ts +9 -2
- package/dist/github/relationships.js +6 -2
- package/dist/github/relationships.js.map +1 -1
- package/dist/investigationCompletion.test.d.ts +1 -0
- package/dist/investigationCompletion.test.js +728 -0
- package/dist/investigationCompletion.test.js.map +1 -0
- package/dist/issue.d.ts +22 -6
- package/dist/issue.js +152 -21
- package/dist/issue.js.map +1 -1
- package/dist/issue63History.test.d.ts +1 -0
- package/dist/issue63History.test.js +45 -0
- package/dist/issue63History.test.js.map +1 -0
- package/dist/issue63Routes.test.d.ts +1 -0
- package/dist/issue63Routes.test.js +153 -0
- package/dist/issue63Routes.test.js.map +1 -0
- package/dist/issueBlockerGuard.test.d.ts +1 -0
- package/dist/issueBlockerGuard.test.js +162 -0
- package/dist/issueBlockerGuard.test.js.map +1 -0
- package/dist/issueContract.d.ts +230 -0
- package/dist/issueContract.js +341 -0
- package/dist/issueContract.js.map +1 -0
- package/dist/issueContract.test.d.ts +27 -0
- package/dist/issueContract.test.js +314 -0
- package/dist/issueContract.test.js.map +1 -0
- package/dist/issueIntake.test.d.ts +1 -0
- package/dist/issueIntake.test.js +649 -0
- package/dist/issueIntake.test.js.map +1 -0
- package/dist/issueJournal.d.ts +1 -1
- package/dist/issueTracking.test.js +16 -8
- package/dist/issueTracking.test.js.map +1 -1
- package/dist/mcp/tools.d.ts +135 -11
- package/dist/mcp/tools.js +85 -33
- package/dist/mcp/tools.js.map +1 -1
- package/dist/pluginAuthProbe.d.ts +6 -0
- package/dist/pluginAuthProbe.js +53 -0
- package/dist/pluginAuthProbe.js.map +1 -0
- package/dist/pluginAuthProbe.test.d.ts +1 -0
- package/dist/pluginAuthProbe.test.js +66 -0
- package/dist/pluginAuthProbe.test.js.map +1 -0
- package/dist/pluginCredentials.test.d.ts +1 -0
- package/dist/pluginCredentials.test.js +277 -0
- package/dist/pluginCredentials.test.js.map +1 -0
- package/dist/pluginDoctor.test.d.ts +1 -0
- package/dist/pluginDoctor.test.js +627 -0
- package/dist/pluginDoctor.test.js.map +1 -0
- package/dist/pluginInstaller.d.ts +36 -0
- package/dist/pluginInstaller.js +231 -10
- package/dist/pluginInstaller.js.map +1 -1
- package/dist/pluginInstaller.test.js +29 -0
- package/dist/pluginInstaller.test.js.map +1 -1
- package/dist/pluginPackaging.test.js +23 -3
- package/dist/pluginPackaging.test.js.map +1 -1
- package/dist/pr.d.ts +70 -0
- package/dist/pr.js +238 -1
- package/dist/pr.js.map +1 -1
- package/dist/services/agentReadinessService.d.ts +9 -8
- package/dist/services/agentReadinessService.js +32 -224
- package/dist/services/agentReadinessService.js.map +1 -1
- package/dist/services/blockerGuardService.d.ts +17 -0
- package/dist/services/blockerGuardService.js +194 -0
- package/dist/services/blockerGuardService.js.map +1 -0
- package/dist/services/deliveryAdmission.js +22 -19
- package/dist/services/deliveryAdmission.js.map +1 -1
- package/dist/services/deliveryHealthService.d.ts +84 -0
- package/dist/services/deliveryHealthService.js +206 -0
- package/dist/services/deliveryHealthService.js.map +1 -0
- package/dist/services/worktreeRegistry.d.ts +84 -0
- package/dist/services/worktreeRegistry.js +265 -1
- package/dist/services/worktreeRegistry.js.map +1 -1
- package/dist/setup.test.js +97 -3
- package/dist/setup.test.js.map +1 -1
- package/dist/start.test.js +30 -3
- package/dist/start.test.js.map +1 -1
- package/dist/stdoutRegression.test.js +36 -6
- package/dist/stdoutRegression.test.js.map +1 -1
- package/dist/targetPolicyEntrypoints.test.d.ts +1 -0
- package/dist/targetPolicyEntrypoints.test.js +275 -0
- package/dist/targetPolicyEntrypoints.test.js.map +1 -0
- package/dist/targetPolicyLocal.test.d.ts +1 -0
- package/dist/targetPolicyLocal.test.js +707 -0
- package/dist/targetPolicyLocal.test.js.map +1 -0
- package/dist/targetPolicyRoutes.test.d.ts +1 -0
- package/dist/targetPolicyRoutes.test.js +298 -0
- package/dist/targetPolicyRoutes.test.js.map +1 -0
- package/dist/verification.js +48 -12
- package/dist/verification.js.map +1 -1
- package/dist/verificationGate.test.d.ts +1 -0
- package/dist/verificationGate.test.js +106 -0
- package/dist/verificationGate.test.js.map +1 -0
- package/dist/worktree.d.ts +6 -1
- package/dist/worktree.js +90 -3
- package/dist/worktree.js.map +1 -1
- package/dist/worktreeTransition.test.js +1 -1
- package/dist/worktreeTransition.test.js.map +1 -1
- package/package.json +1 -1
- package/plugins/ai-delivery/.claude-plugin/plugin.json +2 -2
- package/plugins/ai-delivery/README.md +160 -1
- package/plugins/ai-delivery/plugin.json +1 -1
- package/plugins/ai-delivery/runtime/dist/cli.js +83 -49
- package/plugins/ai-delivery/runtime/package.json +1 -1
- package/plugins/ai-delivery/skills/intake-create/SKILL.md +45 -30
- package/plugins/ai-delivery/skills/pr-handoff/SKILL.md +20 -0
|
@@ -0,0 +1,707 @@
|
|
|
1
|
+
import assert from 'node:assert/strict';
|
|
2
|
+
import { execFileSync } from 'node:child_process';
|
|
3
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
4
|
+
import { dirname, join } from 'node:path';
|
|
5
|
+
import { afterEach, beforeEach, describe, test } from 'vitest';
|
|
6
|
+
import { loadDeliveryConfig } from './config/deliveryConfig.js';
|
|
7
|
+
import { digestBytes, digestValue } from './delivery/common.js';
|
|
8
|
+
import { investigationAcceptanceBody, investigationAuthorityBody } from './pr.js';
|
|
9
|
+
import { readInvestigationPreparation } from './services/worktreeRegistry.js';
|
|
10
|
+
import { WorktreeTransitionPlanSchema } from './worktreeTransition.js';
|
|
11
|
+
import { fixtureGit, inertTarget } from './fixtures/inertTarget.js';
|
|
12
|
+
// Each scoped case owns its fixture, signal bridge, operation promises and disposal.
|
|
13
|
+
// A hook deadline can reject before the real MCP handler settles; join never releases
|
|
14
|
+
// fixture globals until the existing active-handler drain completes.
|
|
15
|
+
function runtimeScope() {
|
|
16
|
+
const controller = new AbortController();
|
|
17
|
+
const pending = new Set();
|
|
18
|
+
const unlink = new Set();
|
|
19
|
+
let cleanup;
|
|
20
|
+
let joined;
|
|
21
|
+
const scope = {
|
|
22
|
+
controller,
|
|
23
|
+
signal: controller.signal,
|
|
24
|
+
pending,
|
|
25
|
+
fixture: undefined,
|
|
26
|
+
forward(signal) {
|
|
27
|
+
const abort = () => controller.abort(signal.reason);
|
|
28
|
+
if (signal.aborted)
|
|
29
|
+
abort();
|
|
30
|
+
else {
|
|
31
|
+
signal.addEventListener('abort', abort, { once: true });
|
|
32
|
+
unlink.add(() => signal.removeEventListener('abort', abort));
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
acquire() {
|
|
36
|
+
controller.signal.throwIfAborted();
|
|
37
|
+
assert.equal(scope.fixture, undefined, 'Each case acquires exactly one fixture');
|
|
38
|
+
scope.fixture = inertTarget(controller.signal, (ownedCleanup) => {
|
|
39
|
+
cleanup = ownedCleanup;
|
|
40
|
+
});
|
|
41
|
+
return scope.fixture;
|
|
42
|
+
},
|
|
43
|
+
join() {
|
|
44
|
+
joined ??= (async () => {
|
|
45
|
+
controller.abort(new Error('Owned scoped runtime case finished'));
|
|
46
|
+
try {
|
|
47
|
+
while (pending.size)
|
|
48
|
+
await Promise.allSettled(pending);
|
|
49
|
+
await cleanup?.();
|
|
50
|
+
}
|
|
51
|
+
finally {
|
|
52
|
+
for (const remove of unlink)
|
|
53
|
+
remove();
|
|
54
|
+
unlink.clear();
|
|
55
|
+
}
|
|
56
|
+
})();
|
|
57
|
+
return joined;
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
return scope;
|
|
61
|
+
}
|
|
62
|
+
async function scopedPhase(scope, name, budgetMs, operation) {
|
|
63
|
+
scope.signal.throwIfAborted();
|
|
64
|
+
const started = performance.now();
|
|
65
|
+
const timeout = new Error(`Owned ${name} deadline exceeded (${budgetMs}ms)`);
|
|
66
|
+
const timer = setTimeout(() => scope.controller.abort(timeout), budgetMs);
|
|
67
|
+
const pending = Promise.resolve().then(async () => {
|
|
68
|
+
scope.signal.throwIfAborted();
|
|
69
|
+
const value = await operation();
|
|
70
|
+
// Synchronous owned subprocesses may delay timers. Late settlement still fails.
|
|
71
|
+
if (performance.now() - started >= budgetMs)
|
|
72
|
+
scope.controller.abort(timeout);
|
|
73
|
+
scope.signal.throwIfAborted();
|
|
74
|
+
return value;
|
|
75
|
+
});
|
|
76
|
+
scope.pending.add(pending);
|
|
77
|
+
try {
|
|
78
|
+
return await pending;
|
|
79
|
+
}
|
|
80
|
+
finally {
|
|
81
|
+
clearTimeout(timer);
|
|
82
|
+
scope.pending.delete(pending);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
async function prepareScope(scope, prepare, budgetMs = 15_000) {
|
|
86
|
+
try {
|
|
87
|
+
return await scopedPhase(scope, 'setup', budgetMs, prepare);
|
|
88
|
+
}
|
|
89
|
+
catch (error) {
|
|
90
|
+
scope.controller.abort(error);
|
|
91
|
+
await scope.join();
|
|
92
|
+
throw error;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
function scopedRuntimeCase(name, prepare, observe) {
|
|
96
|
+
describe('per-case runtime preparation (15s setup, 15s asserted body)', () => {
|
|
97
|
+
let owned;
|
|
98
|
+
beforeEach(async ({ signal }) => {
|
|
99
|
+
assert.equal(owned, undefined, 'Previous case must finish owned teardown');
|
|
100
|
+
const scope = runtimeScope();
|
|
101
|
+
owned = { scope, ready: false };
|
|
102
|
+
scope.forward(signal);
|
|
103
|
+
owned.prepared = await prepareScope(scope, () => prepare(scope));
|
|
104
|
+
owned.ready = true;
|
|
105
|
+
}, 15_000);
|
|
106
|
+
afterEach(async () => {
|
|
107
|
+
const current = owned;
|
|
108
|
+
if (current) {
|
|
109
|
+
await current.scope.join();
|
|
110
|
+
owned = undefined;
|
|
111
|
+
}
|
|
112
|
+
}, 15_000);
|
|
113
|
+
test(name, async ({ signal }) => {
|
|
114
|
+
const current = owned;
|
|
115
|
+
assert.ok(current?.ready, 'Real case prerequisites must finish before the asserted body');
|
|
116
|
+
assert.ok(current.prepared);
|
|
117
|
+
const prepared = current.prepared;
|
|
118
|
+
current.scope.forward(signal);
|
|
119
|
+
try {
|
|
120
|
+
await scopedPhase(current.scope, 'asserted body', 15_000, () => observe(prepared));
|
|
121
|
+
}
|
|
122
|
+
finally {
|
|
123
|
+
await current.scope.join();
|
|
124
|
+
}
|
|
125
|
+
}, 15_000);
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
async function runtimeFixture(f) {
|
|
129
|
+
f.signal.throwIfAborted();
|
|
130
|
+
const packageRoot = join(f.base, 'archive', 'package');
|
|
131
|
+
const lifecycleSentinel = join(f.base, 'lifecycle-executed');
|
|
132
|
+
const files = {
|
|
133
|
+
'package.json': JSON.stringify({
|
|
134
|
+
name: '@aviaratech/ai-delivery',
|
|
135
|
+
version: '0.3.5',
|
|
136
|
+
type: 'module',
|
|
137
|
+
bin: { 'ai-delivery': './dist/cli.js' },
|
|
138
|
+
scripts: { preinstall: 'node lifecycle.cjs', postinstall: 'node lifecycle.cjs' },
|
|
139
|
+
}),
|
|
140
|
+
'lifecycle.cjs': `require('node:fs').appendFileSync(${JSON.stringify(lifecycleSentinel)},'executed\\n');\n`,
|
|
141
|
+
'dist/cli.js': "#!/usr/bin/env node\nconsole.log('0.3.5');\n",
|
|
142
|
+
'dist/agent.js': 'export const fictional = true;\n',
|
|
143
|
+
'plugins/ai-delivery/dist/mcp-launcher.js': '/* Owned inert launcher bytes. */\n',
|
|
144
|
+
'plugins/ai-delivery/.claude-plugin/plugin.json': JSON.stringify({
|
|
145
|
+
name: 'ai-delivery',
|
|
146
|
+
packageVersion: '0.3.5',
|
|
147
|
+
deliveryCapabilityVersion: 2,
|
|
148
|
+
}),
|
|
149
|
+
};
|
|
150
|
+
for (const [path, bytes] of Object.entries(files)) {
|
|
151
|
+
const file = join(packageRoot, path);
|
|
152
|
+
mkdirSync(dirname(file), { recursive: true });
|
|
153
|
+
writeFileSync(file, bytes);
|
|
154
|
+
}
|
|
155
|
+
const archivePath = join(f.base, 'inert.tgz');
|
|
156
|
+
execFileSync('tar', ['-czf', archivePath, '-C', dirname(packageRoot), 'package'], {
|
|
157
|
+
timeout: 5_000,
|
|
158
|
+
maxBuffer: 64 * 1024,
|
|
159
|
+
});
|
|
160
|
+
const loaded = await loadDeliveryConfig(f.root, {
|
|
161
|
+
repository: 'example/widget',
|
|
162
|
+
signal: f.signal,
|
|
163
|
+
clients: { graphql: f.graphql },
|
|
164
|
+
});
|
|
165
|
+
const runtimeDirectory = join(f.base, 'runtime');
|
|
166
|
+
const common = { expectedSourceCommit: f.head, expectedConfigDigest: loaded.configDigest, runtimeDirectory };
|
|
167
|
+
return {
|
|
168
|
+
archivePath,
|
|
169
|
+
lifecycleSentinel,
|
|
170
|
+
common,
|
|
171
|
+
stage: {
|
|
172
|
+
...common,
|
|
173
|
+
authority: 'runtime:stage',
|
|
174
|
+
archivePath,
|
|
175
|
+
expectedArchiveSha256: digestBytes(readFileSync(archivePath)),
|
|
176
|
+
packageVersion: '0.3.5',
|
|
177
|
+
resourceBounds: {
|
|
178
|
+
maxAggregateRssBytes: 384 * 1024 ** 2,
|
|
179
|
+
minFreeDiskBytes: 8 * 1024 ** 2,
|
|
180
|
+
maxNewOutputBytes: 8 * 1024 ** 2,
|
|
181
|
+
maxCapturedOutputBytes: 64 * 1024,
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
cli: join(runtimeDirectory, 'node_modules/@aviaratech/ai-delivery/dist/cli.js'),
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
test('fixture cancellation drains the real MCP handler before releasing global ownership', async ({ signal }) => {
|
|
188
|
+
const cancellation = new AbortController();
|
|
189
|
+
const f = inertTarget(AbortSignal.any([signal, cancellation.signal]));
|
|
190
|
+
let connection;
|
|
191
|
+
let next;
|
|
192
|
+
let nextConnection;
|
|
193
|
+
let release;
|
|
194
|
+
let entered;
|
|
195
|
+
const held = new Promise((resolve) => {
|
|
196
|
+
release = resolve;
|
|
197
|
+
});
|
|
198
|
+
const reached = new Promise((resolve) => {
|
|
199
|
+
entered = resolve;
|
|
200
|
+
});
|
|
201
|
+
const get = f.rest.issues.get;
|
|
202
|
+
let portSettled = false;
|
|
203
|
+
f.rest.issues.get = async (input) => {
|
|
204
|
+
entered();
|
|
205
|
+
await held;
|
|
206
|
+
portSettled = true;
|
|
207
|
+
return get(input);
|
|
208
|
+
};
|
|
209
|
+
try {
|
|
210
|
+
f.policy('tracked');
|
|
211
|
+
connection = await f.connect();
|
|
212
|
+
const pending = connection.call('issue_info', { issueNumber: 17 });
|
|
213
|
+
const rejected = assert.rejects(pending, /Controlled fixture cancellation/u);
|
|
214
|
+
await reached;
|
|
215
|
+
cancellation.abort(new Error('Controlled fixture cancellation'));
|
|
216
|
+
const disposal = f.dispose(connection);
|
|
217
|
+
assert.equal(f.dispose(connection), disposal, 'All disposal callers must join the same promise');
|
|
218
|
+
let disposed = false;
|
|
219
|
+
void disposal.then(() => {
|
|
220
|
+
disposed = true;
|
|
221
|
+
});
|
|
222
|
+
await rejected;
|
|
223
|
+
assert.equal(portSettled, false);
|
|
224
|
+
assert.equal(disposed, false, 'Transport cancellation must not be treated as handler settlement');
|
|
225
|
+
assert.equal(existsSync(f.root), true, 'Files remain owned until the handler settles');
|
|
226
|
+
assert.throws(() => inertTarget(signal), /previous fixture must finish disposal/u);
|
|
227
|
+
release();
|
|
228
|
+
await disposal;
|
|
229
|
+
assert.equal(portSettled, true);
|
|
230
|
+
assert.equal(existsSync(f.base), false);
|
|
231
|
+
next = inertTarget(signal);
|
|
232
|
+
next.policy('tracked');
|
|
233
|
+
nextConnection = await next.connect();
|
|
234
|
+
await f.dispose(connection);
|
|
235
|
+
const result = await nextConnection.call('issue_info', { issueNumber: 17 });
|
|
236
|
+
assert.notEqual(result.response.isError, true, result.text);
|
|
237
|
+
assert.ok(next.calls.some((call) => call.name === 'issues.get'));
|
|
238
|
+
}
|
|
239
|
+
finally {
|
|
240
|
+
release();
|
|
241
|
+
try {
|
|
242
|
+
await f.dispose(connection);
|
|
243
|
+
}
|
|
244
|
+
finally {
|
|
245
|
+
await next?.dispose(nextConnection);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}, 5_000);
|
|
249
|
+
test('fixture disposal closes a cancelled MCP connection', async ({ signal }) => {
|
|
250
|
+
const f = inertTarget(signal);
|
|
251
|
+
const cancellation = new AbortController();
|
|
252
|
+
cancellation.abort(new Error('Controlled connection cancellation'));
|
|
253
|
+
try {
|
|
254
|
+
await assert.rejects(f.connect({ signal: cancellation.signal }), /Controlled connection cancellation/u);
|
|
255
|
+
}
|
|
256
|
+
finally {
|
|
257
|
+
await f.dispose(undefined);
|
|
258
|
+
}
|
|
259
|
+
assert.equal(existsSync(f.base), false);
|
|
260
|
+
const next = inertTarget(signal);
|
|
261
|
+
try {
|
|
262
|
+
const loaded = await loadDeliveryConfig(next.root, {
|
|
263
|
+
repository: 'example/widget',
|
|
264
|
+
clients: { graphql: next.graphql },
|
|
265
|
+
});
|
|
266
|
+
assert.ok(loaded.configDigest);
|
|
267
|
+
}
|
|
268
|
+
finally {
|
|
269
|
+
await next.dispose(undefined);
|
|
270
|
+
}
|
|
271
|
+
}, 5_000);
|
|
272
|
+
async function stageAndAdmit(f, c) {
|
|
273
|
+
const runtime = await runtimeFixture(f);
|
|
274
|
+
const staged = await c.call('runtime_stage', runtime.stage);
|
|
275
|
+
assert.notEqual(staged.response.isError, true, staged.text);
|
|
276
|
+
const admitted = await c.call('runtime_admit', {
|
|
277
|
+
...runtime.common,
|
|
278
|
+
authority: 'runtime:admit',
|
|
279
|
+
stageId: staged.value.stageId,
|
|
280
|
+
expectedPriorAdmissionSha256: null,
|
|
281
|
+
});
|
|
282
|
+
assert.notEqual(admitted.response.isError, true, admitted.text);
|
|
283
|
+
return { ...runtime, stageId: staged.value.stageId, admission: admitted.value.admission };
|
|
284
|
+
}
|
|
285
|
+
for (const cancellation of ['hook signal', 'owned setup deadline']) {
|
|
286
|
+
test(`scoped runtime setup ${cancellation} aborts and drains a real handler before releasing globals`, async ({ signal, }) => {
|
|
287
|
+
const scope = runtimeScope();
|
|
288
|
+
const hook = new AbortController();
|
|
289
|
+
scope.forward(signal);
|
|
290
|
+
scope.forward(hook.signal);
|
|
291
|
+
const f = scope.acquire();
|
|
292
|
+
let release;
|
|
293
|
+
let entered;
|
|
294
|
+
const held = new Promise((resolve) => {
|
|
295
|
+
release = resolve;
|
|
296
|
+
});
|
|
297
|
+
const reached = new Promise((resolve) => {
|
|
298
|
+
entered = resolve;
|
|
299
|
+
});
|
|
300
|
+
const get = f.rest.issues.get;
|
|
301
|
+
let handlerSettled = false;
|
|
302
|
+
f.rest.issues.get = async (input) => {
|
|
303
|
+
entered();
|
|
304
|
+
await held;
|
|
305
|
+
handlerSettled = true;
|
|
306
|
+
return get(input);
|
|
307
|
+
};
|
|
308
|
+
try {
|
|
309
|
+
f.policy('tracked');
|
|
310
|
+
const c = await f.connect();
|
|
311
|
+
let callOutcome;
|
|
312
|
+
const setup = prepareScope(scope, async () => {
|
|
313
|
+
const call = c.call('issue_info', { issueNumber: 17 });
|
|
314
|
+
callOutcome = call.then(() => undefined, (error) => error);
|
|
315
|
+
return call;
|
|
316
|
+
}, cancellation === 'owned setup deadline' ? 1_000 : 15_000);
|
|
317
|
+
// Observe both outcomes immediately; failures before release must not create
|
|
318
|
+
// an unhandled assertion promise while the held real handler is drained.
|
|
319
|
+
const setupOutcome = setup.then(() => undefined, (error) => error);
|
|
320
|
+
let setupSettled = false;
|
|
321
|
+
void setupOutcome.then(() => {
|
|
322
|
+
setupSettled = true;
|
|
323
|
+
});
|
|
324
|
+
await reached;
|
|
325
|
+
if (cancellation === 'hook signal')
|
|
326
|
+
hook.abort(new Error('Controlled hook cancellation'));
|
|
327
|
+
assert.match(String(await callOutcome), /Controlled hook cancellation|Owned setup deadline exceeded/u);
|
|
328
|
+
assert.equal(handlerSettled, false);
|
|
329
|
+
assert.equal(setupSettled, false, 'Rejected transport is not joined setup completion');
|
|
330
|
+
const disposal = scope.join();
|
|
331
|
+
assert.equal(scope.join(), disposal, 'All cleanup paths join one owned disposal');
|
|
332
|
+
let disposed = false;
|
|
333
|
+
void disposal.then(() => {
|
|
334
|
+
disposed = true;
|
|
335
|
+
}, () => { });
|
|
336
|
+
await Promise.resolve();
|
|
337
|
+
assert.equal(disposed, false);
|
|
338
|
+
assert.equal(existsSync(f.root), true);
|
|
339
|
+
assert.throws(() => inertTarget(signal), /previous fixture must finish disposal/u);
|
|
340
|
+
release();
|
|
341
|
+
assert.match(String(await setupOutcome), /Controlled hook cancellation|Owned setup deadline exceeded/u);
|
|
342
|
+
await disposal;
|
|
343
|
+
assert.equal(handlerSettled, true);
|
|
344
|
+
assert.equal(existsSync(f.base), false);
|
|
345
|
+
const next = inertTarget(signal);
|
|
346
|
+
try {
|
|
347
|
+
next.policy('tracked');
|
|
348
|
+
const nextConnection = await next.connect();
|
|
349
|
+
const result = await nextConnection.call('issue_info', { issueNumber: 17 });
|
|
350
|
+
assert.notEqual(result.response.isError, true, result.text);
|
|
351
|
+
}
|
|
352
|
+
finally {
|
|
353
|
+
await next.dispose(undefined);
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
finally {
|
|
357
|
+
release();
|
|
358
|
+
await scope.join();
|
|
359
|
+
}
|
|
360
|
+
}, 5_000);
|
|
361
|
+
}
|
|
362
|
+
test('scoped runtime setup failure after connection acquisition drains and restores only owned globals', async ({ signal, }) => {
|
|
363
|
+
const scope = runtimeScope();
|
|
364
|
+
scope.forward(signal);
|
|
365
|
+
let f;
|
|
366
|
+
try {
|
|
367
|
+
await assert.rejects(prepareScope(scope, async () => {
|
|
368
|
+
f = scope.acquire();
|
|
369
|
+
f.policy('tracked');
|
|
370
|
+
const c = await f.connect();
|
|
371
|
+
const result = await c.call('issue_info', { issueNumber: 17 });
|
|
372
|
+
assert.notEqual(result.response.isError, true, result.text);
|
|
373
|
+
throw new Error('Controlled failure after owned connection');
|
|
374
|
+
}), /Controlled failure after owned connection/u);
|
|
375
|
+
assert.ok(f);
|
|
376
|
+
assert.equal(existsSync(f.base), false);
|
|
377
|
+
const next = inertTarget(signal);
|
|
378
|
+
try {
|
|
379
|
+
next.policy('tracked');
|
|
380
|
+
const c = await next.connect();
|
|
381
|
+
await scope.join();
|
|
382
|
+
const result = await c.call('issue_info', { issueNumber: 17 });
|
|
383
|
+
assert.notEqual(result.response.isError, true, result.text);
|
|
384
|
+
}
|
|
385
|
+
finally {
|
|
386
|
+
await next.dispose(undefined);
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
finally {
|
|
390
|
+
await scope.join();
|
|
391
|
+
}
|
|
392
|
+
}, 5_000);
|
|
393
|
+
async function lifecycleControl(f, runtime) {
|
|
394
|
+
// Same archive, real npm and same environment; explicitly enabled scripts establish the lifecycle control.
|
|
395
|
+
f.signal.throwIfAborted();
|
|
396
|
+
execFileSync('npm', [
|
|
397
|
+
'install',
|
|
398
|
+
'--prefix',
|
|
399
|
+
join(f.base, 'control-install'),
|
|
400
|
+
'--omit=dev',
|
|
401
|
+
'--ignore-scripts=false',
|
|
402
|
+
'--offline',
|
|
403
|
+
'--no-audit',
|
|
404
|
+
'--no-fund',
|
|
405
|
+
'--package-lock=false',
|
|
406
|
+
'--cache',
|
|
407
|
+
join(f.base, 'control-cache'),
|
|
408
|
+
'--userconfig',
|
|
409
|
+
'/dev/null',
|
|
410
|
+
'--globalconfig',
|
|
411
|
+
join(f.base, 'fictional-global.npmrc'),
|
|
412
|
+
runtime.archivePath,
|
|
413
|
+
], { env: process.env, cwd: f.base, timeout: 10_000, maxBuffer: 64 * 1024 });
|
|
414
|
+
assert.match(readFileSync(runtime.lifecycleSentinel, 'utf8'), /executed/u);
|
|
415
|
+
}
|
|
416
|
+
async function prepareStage(scope) {
|
|
417
|
+
const f = scope.acquire();
|
|
418
|
+
const runtime = await runtimeFixture(f);
|
|
419
|
+
f.policy('tracked');
|
|
420
|
+
const c = await f.connect();
|
|
421
|
+
const staged = await c.call('runtime_stage', runtime.stage);
|
|
422
|
+
assert.notEqual(staged.response.isError, true, staged.text);
|
|
423
|
+
assert.ok(existsSync(runtime.cli));
|
|
424
|
+
assert.equal(existsSync(runtime.lifecycleSentinel), false);
|
|
425
|
+
assert.equal(existsSync(join(f.root, '.git/ai-delivery/runtime-admission.json')), false, 'Staging must not admit');
|
|
426
|
+
return { f, c, runtime, staged };
|
|
427
|
+
}
|
|
428
|
+
async function prepareTransition(f) {
|
|
429
|
+
f.worktree();
|
|
430
|
+
let c = await f.connect();
|
|
431
|
+
const runtime = await stageAndAdmit(f, c);
|
|
432
|
+
await c.close();
|
|
433
|
+
c = await f.connect({ runtimeEntryPath: runtime.cli });
|
|
434
|
+
return { f, c, runtime };
|
|
435
|
+
}
|
|
436
|
+
async function observeTransition(f, c, runtime, kind) {
|
|
437
|
+
const row = {
|
|
438
|
+
branch: 'issue/17',
|
|
439
|
+
path: f.target,
|
|
440
|
+
issueNumber: 17,
|
|
441
|
+
identity: 'author',
|
|
442
|
+
type: 'issue',
|
|
443
|
+
status: 'active',
|
|
444
|
+
createdAt: '2026-01-01',
|
|
445
|
+
updatedAt: '2026-01-01',
|
|
446
|
+
};
|
|
447
|
+
writeFileSync(join(f.root, '.issue-cli/worktrees.json'), JSON.stringify({ worktrees: [row] }));
|
|
448
|
+
f.policy(kind, f.target);
|
|
449
|
+
const digest = digestValue('Owned synthetic closure placeholder; not operational attestation.');
|
|
450
|
+
const content = {
|
|
451
|
+
schemaVersion: 'ai-delivery.worktree-transition-plan@1',
|
|
452
|
+
repository: 'example/widget',
|
|
453
|
+
repoRoot: f.root,
|
|
454
|
+
row,
|
|
455
|
+
purpose: 'active-resume',
|
|
456
|
+
disposition: 'retain',
|
|
457
|
+
terminalPrNumber: null,
|
|
458
|
+
head: { sha: f.head, tree: f.tree },
|
|
459
|
+
lineage: [],
|
|
460
|
+
remoteRefs: null,
|
|
461
|
+
retainedHoldCommentIds: [],
|
|
462
|
+
holdEvidence: [],
|
|
463
|
+
inventory: [],
|
|
464
|
+
inventoryId: digestValue([]),
|
|
465
|
+
historicalProducer: 'UNKNOWN',
|
|
466
|
+
closure: {
|
|
467
|
+
family: 'public-ai-delivery-0.3.5-posix@1',
|
|
468
|
+
admissionPath: join(f.base, 'retained-admission.json'),
|
|
469
|
+
archivePath: runtime.archivePath,
|
|
470
|
+
admission: runtime.admission,
|
|
471
|
+
admissionBytesDigest: digest,
|
|
472
|
+
producerDigest: digest,
|
|
473
|
+
runManifestIds: [digest],
|
|
474
|
+
},
|
|
475
|
+
currentRuntime: runtime.admission,
|
|
476
|
+
policyDigest: digestBytes(readFileSync(join(f.root, 'ai-delivery.policy.mjs'))),
|
|
477
|
+
operator: { actorLogin: 'operator', credentialIdentity: 'user:42' },
|
|
478
|
+
reviewerActor: 'reviewer[bot]',
|
|
479
|
+
};
|
|
480
|
+
const plan = WorktreeTransitionPlanSchema.parse({ ...content, planId: digestValue(content) });
|
|
481
|
+
const planPath = join(f.base, 'transition.json');
|
|
482
|
+
writeFileSync(planPath, JSON.stringify(plan), { mode: 0o600 });
|
|
483
|
+
const result = await c.call('issue_worktree_transition_apply', {
|
|
484
|
+
authority: 'worktree:transition',
|
|
485
|
+
planPath,
|
|
486
|
+
expectedPlanId: plan.planId,
|
|
487
|
+
relinquishmentCommentId: 201,
|
|
488
|
+
acceptanceCommentId: 202,
|
|
489
|
+
});
|
|
490
|
+
assert.equal(result.response.isError, true);
|
|
491
|
+
assert.match(result.text, /Historical repository configuration binding is unsupported/u);
|
|
492
|
+
assert.equal(existsSync(f.target), true);
|
|
493
|
+
assert.equal(existsSync(join(f.root, '.git/ai-delivery/worktree-transitions', plan.planId.slice(7), 'intent.json')), false);
|
|
494
|
+
assert.equal(existsSync(runtime.lifecycleSentinel), false);
|
|
495
|
+
}
|
|
496
|
+
for (const kind of ['tracked', 'edited']) {
|
|
497
|
+
if (kind === 'tracked') {
|
|
498
|
+
scopedRuntimeCase('public MCP runtime_stage asserts first install in 15s setup and exact reuse/lifecycle control in 15s body with tracked policy inert', prepareStage, async ({ f, c, runtime, staged }) => {
|
|
499
|
+
const reused = await c.call('runtime_stage', runtime.stage);
|
|
500
|
+
assert.notEqual(reused.response.isError, true, reused.text);
|
|
501
|
+
assert.equal(reused.value.stageId, staged.value.stageId);
|
|
502
|
+
assert.equal(reused.value.reused, true);
|
|
503
|
+
await lifecycleControl(f, runtime);
|
|
504
|
+
});
|
|
505
|
+
scopedRuntimeCase('public MCP runtime_admit binds and reuses exact stage bytes after 15s real stage setup and leaves tracked policy inert', prepareStage, async ({ f, c, runtime, staged }) => {
|
|
506
|
+
const args = {
|
|
507
|
+
...runtime.common,
|
|
508
|
+
authority: 'runtime:admit',
|
|
509
|
+
stageId: staged.value.stageId,
|
|
510
|
+
expectedPriorAdmissionSha256: null,
|
|
511
|
+
};
|
|
512
|
+
const admitted = await c.call('runtime_admit', args);
|
|
513
|
+
assert.notEqual(admitted.response.isError, true, admitted.text);
|
|
514
|
+
const disk = JSON.parse(readFileSync(join(f.root, '.git/ai-delivery/runtime-admission.json'), 'utf8'));
|
|
515
|
+
assert.deepEqual(disk, admitted.value.admission);
|
|
516
|
+
const reused = await c.call('runtime_admit', args);
|
|
517
|
+
assert.notEqual(reused.response.isError, true, reused.text);
|
|
518
|
+
assert.equal(reused.value.reused, true);
|
|
519
|
+
assert.deepEqual(reused.value.admission, disk);
|
|
520
|
+
assert.equal(existsSync(runtime.lifecycleSentinel), false);
|
|
521
|
+
});
|
|
522
|
+
}
|
|
523
|
+
else {
|
|
524
|
+
test('public MCP runtime_stage refuses primary source edits and leaves edited policy inert', async ({ signal }) => {
|
|
525
|
+
const f = inertTarget(signal);
|
|
526
|
+
let c;
|
|
527
|
+
try {
|
|
528
|
+
const runtime = await runtimeFixture(f);
|
|
529
|
+
f.policy('edited');
|
|
530
|
+
c = await f.connect();
|
|
531
|
+
const result = await c.call('runtime_stage', runtime.stage);
|
|
532
|
+
assert.equal(result.response.isError, true);
|
|
533
|
+
assert.match(result.text, /Delivery requires an exact clean worktree\./u);
|
|
534
|
+
assert.equal(existsSync(runtime.common.runtimeDirectory), false);
|
|
535
|
+
}
|
|
536
|
+
finally {
|
|
537
|
+
await f.dispose(c);
|
|
538
|
+
}
|
|
539
|
+
}, 15_000);
|
|
540
|
+
test('public MCP runtime_admit refuses primary source edits and leaves edited policy inert', async ({ signal }) => {
|
|
541
|
+
const f = inertTarget(signal);
|
|
542
|
+
let c;
|
|
543
|
+
try {
|
|
544
|
+
const runtime = await runtimeFixture(f);
|
|
545
|
+
f.policy('tracked');
|
|
546
|
+
c = await f.connect();
|
|
547
|
+
const staged = await c.call('runtime_stage', runtime.stage);
|
|
548
|
+
assert.notEqual(staged.response.isError, true, staged.text);
|
|
549
|
+
f.policy('edited');
|
|
550
|
+
const admitted = await c.call('runtime_admit', {
|
|
551
|
+
...runtime.common,
|
|
552
|
+
authority: 'runtime:admit',
|
|
553
|
+
stageId: staged.value.stageId,
|
|
554
|
+
expectedPriorAdmissionSha256: null,
|
|
555
|
+
});
|
|
556
|
+
assert.equal(admitted.response.isError, true);
|
|
557
|
+
assert.match(admitted.text, /Delivery requires an exact clean worktree\./u);
|
|
558
|
+
assert.equal(existsSync(join(f.root, '.git/ai-delivery/runtime-admission.json')), false);
|
|
559
|
+
assert.equal(existsSync(runtime.lifecycleSentinel), false);
|
|
560
|
+
}
|
|
561
|
+
finally {
|
|
562
|
+
await f.dispose(c);
|
|
563
|
+
}
|
|
564
|
+
}, 15_000);
|
|
565
|
+
}
|
|
566
|
+
test(`public MCP investigation start ${kind === 'tracked' ? 'registers exact selected source' : 'refuses selected worktree edits'} with ${kind} policy`, async ({ signal, }) => {
|
|
567
|
+
const f = inertTarget(signal);
|
|
568
|
+
let c;
|
|
569
|
+
try {
|
|
570
|
+
f.worktree();
|
|
571
|
+
f.policy(kind, f.target);
|
|
572
|
+
assert.equal(fixtureGit(f.root, 'status', '--porcelain'), '');
|
|
573
|
+
c = await f.connect();
|
|
574
|
+
const args = { issueNumber: 17, investigationWorktree: f.target, expectedHeadSha: f.head };
|
|
575
|
+
const result = await c.call('issue_start', args);
|
|
576
|
+
if (kind === 'edited') {
|
|
577
|
+
assert.equal(result.response.isError, true);
|
|
578
|
+
assert.match(result.text, /Delivery requires an exact clean worktree\./u);
|
|
579
|
+
assert.equal(readInvestigationPreparation(f.root, 17), undefined);
|
|
580
|
+
}
|
|
581
|
+
else {
|
|
582
|
+
assert.notEqual(result.response.isError, true, result.text);
|
|
583
|
+
const preparation = readInvestigationPreparation(f.root, 17);
|
|
584
|
+
assert.equal(preparation.head.sha, f.head);
|
|
585
|
+
assert.equal(preparation.row.path, f.target);
|
|
586
|
+
assert.equal(f.comments.length, 1);
|
|
587
|
+
const again = await c.call('issue_start', args);
|
|
588
|
+
assert.notEqual(again.response.isError, true, again.text);
|
|
589
|
+
assert.equal(f.comments.length, 1);
|
|
590
|
+
assert.deepEqual(again.value.preparation, result.value.preparation);
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
finally {
|
|
594
|
+
await f.dispose(c);
|
|
595
|
+
}
|
|
596
|
+
}, 15_000);
|
|
597
|
+
test(`public MCP investigation finish ${kind === 'tracked' ? 'removes only acknowledged selected custody' : 'refuses selected worktree edits'} with ${kind} policy`, async ({ signal, }) => {
|
|
598
|
+
const f = inertTarget(signal);
|
|
599
|
+
let c;
|
|
600
|
+
try {
|
|
601
|
+
f.worktree();
|
|
602
|
+
f.policy('tracked', f.target);
|
|
603
|
+
c = await f.connect();
|
|
604
|
+
const start = await c.call('issue_start', {
|
|
605
|
+
issueNumber: 17,
|
|
606
|
+
investigationWorktree: f.target,
|
|
607
|
+
expectedHeadSha: f.head,
|
|
608
|
+
});
|
|
609
|
+
assert.notEqual(start.response.isError, true, start.text);
|
|
610
|
+
const preparation = readInvestigationPreparation(f.root, 17);
|
|
611
|
+
const resultPath = join(f.base, 'durable-result.txt');
|
|
612
|
+
writeFileSync(resultPath, 'Fictional result: unchanged source; all producers stopped.\n', { mode: 0o600 });
|
|
613
|
+
const resultDigest = digestBytes(readFileSync(resultPath));
|
|
614
|
+
f.state.issueState = 'closed';
|
|
615
|
+
f.addComment(201, investigationAuthorityBody(preparation, resultDigest));
|
|
616
|
+
f.addComment(202, investigationAcceptanceBody(preparation, resultDigest, 201), true);
|
|
617
|
+
if (kind === 'edited')
|
|
618
|
+
f.policy('edited', f.target);
|
|
619
|
+
assert.equal(fixtureGit(f.root, 'status', '--porcelain'), '');
|
|
620
|
+
const args = {
|
|
621
|
+
issueNumber: 17,
|
|
622
|
+
investigation: true,
|
|
623
|
+
resultPath,
|
|
624
|
+
authorityCommentId: 201,
|
|
625
|
+
acceptanceCommentId: 202,
|
|
626
|
+
};
|
|
627
|
+
const result = await c.call('issue_finish', args);
|
|
628
|
+
if (kind === 'edited') {
|
|
629
|
+
assert.equal(result.response.isError, true);
|
|
630
|
+
assert.match(result.text, /Delivery requires an exact clean worktree\./u);
|
|
631
|
+
assert.equal(existsSync(f.target), true);
|
|
632
|
+
}
|
|
633
|
+
else {
|
|
634
|
+
assert.notEqual(result.response.isError, true, result.text);
|
|
635
|
+
assert.equal(result.value.completed, true);
|
|
636
|
+
assert.equal(existsSync(f.target), false);
|
|
637
|
+
assert.equal(fixtureGit(f.root, 'rev-parse', 'refs/heads/issue/17'), f.head);
|
|
638
|
+
assert.equal(existsSync(resultPath), true);
|
|
639
|
+
const replay = await c.call('issue_finish', args);
|
|
640
|
+
assert.notEqual(replay.response.isError, true, replay.text);
|
|
641
|
+
assert.equal(replay.value.replayed, true);
|
|
642
|
+
}
|
|
643
|
+
assert.equal(f.state.closedCount, 0);
|
|
644
|
+
assert.equal(f.calls.some((value) => value.name === 'pulls.merge'), false);
|
|
645
|
+
}
|
|
646
|
+
finally {
|
|
647
|
+
await f.dispose(c);
|
|
648
|
+
}
|
|
649
|
+
}, 15_000);
|
|
650
|
+
test(`public MCP transition inspect inventories legacy custody and names reached guard with ${kind} policy`, async ({ signal, }) => {
|
|
651
|
+
const f = inertTarget(signal);
|
|
652
|
+
let c;
|
|
653
|
+
try {
|
|
654
|
+
f.worktree();
|
|
655
|
+
const row = {
|
|
656
|
+
branch: 'issue/17',
|
|
657
|
+
path: f.target,
|
|
658
|
+
issueNumber: 17,
|
|
659
|
+
identity: 'author',
|
|
660
|
+
type: 'issue',
|
|
661
|
+
status: 'active',
|
|
662
|
+
createdAt: '2026-01-01',
|
|
663
|
+
updatedAt: '2026-01-01',
|
|
664
|
+
};
|
|
665
|
+
writeFileSync(join(f.root, '.issue-cli/worktrees.json'), JSON.stringify({ worktrees: [row] }));
|
|
666
|
+
mkdirSync(join(f.root, '.issue-cli/issues/17'), { recursive: true });
|
|
667
|
+
writeFileSync(join(f.root, '.issue-cli/issues/17', 'fictional.txt'), 'Preserved original evidence.\n');
|
|
668
|
+
f.policy(kind, f.target);
|
|
669
|
+
c = await f.connect();
|
|
670
|
+
const result = await c.call('issue_worktree_transition_inspect', {
|
|
671
|
+
issueNumber: 17,
|
|
672
|
+
purpose: 'active-resume',
|
|
673
|
+
disposition: 'retain',
|
|
674
|
+
});
|
|
675
|
+
assert.notEqual(result.response.isError, true, result.text);
|
|
676
|
+
assert.equal(result.value.ready, false);
|
|
677
|
+
assert.equal(result.value.plan, null);
|
|
678
|
+
assert.ok(result.value.inventory.length > 0, 'Inventory owner must be reached');
|
|
679
|
+
assert.match(JSON.stringify(result.value.blockers), kind === 'tracked'
|
|
680
|
+
? /Missing retained supported public producer admission\/archive/u
|
|
681
|
+
: /Delivery requires an exact clean worktree\./u);
|
|
682
|
+
assert.equal(existsSync(f.target), true);
|
|
683
|
+
assert.equal(readFileSync(join(f.root, '.issue-cli/issues/17/fictional.txt'), 'utf8'), 'Preserved original evidence.\n');
|
|
684
|
+
}
|
|
685
|
+
finally {
|
|
686
|
+
await f.dispose(c);
|
|
687
|
+
}
|
|
688
|
+
}, 15_000);
|
|
689
|
+
if (kind === 'tracked') {
|
|
690
|
+
scopedRuntimeCase('public MCP transition apply reaches unsupported historical binding after 15s real stage/admit/reconnect setup without loading tracked policy', async (scope) => prepareTransition(scope.acquire()), async ({ f, c, runtime }) => observeTransition(f, c, runtime, 'tracked'));
|
|
691
|
+
}
|
|
692
|
+
else {
|
|
693
|
+
test('public MCP transition apply reaches unsupported historical binding without loading edited policy', async ({ signal, }) => {
|
|
694
|
+
const f = inertTarget(signal);
|
|
695
|
+
let c;
|
|
696
|
+
try {
|
|
697
|
+
const prepared = await prepareTransition(f);
|
|
698
|
+
c = prepared.c;
|
|
699
|
+
await observeTransition(f, c, prepared.runtime, 'edited');
|
|
700
|
+
}
|
|
701
|
+
finally {
|
|
702
|
+
await f.dispose(c);
|
|
703
|
+
}
|
|
704
|
+
}, 15_000);
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
//# sourceMappingURL=targetPolicyLocal.test.js.map
|