@aviaratech/ai-delivery 0.3.34 → 0.3.36
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/CONTRIBUTING.md +12 -206
- package/README.md +57 -506
- package/dist/agent.d.ts +0 -2
- package/dist/agent.js +76 -16
- package/dist/agent.js.map +7 -1
- package/dist/agentReadiness.test.js +73 -67
- package/dist/agentReadiness.test.js.map +7 -1
- package/dist/boardReconcile.test.js +1746 -0
- package/dist/boardReconcile.test.js.map +7 -0
- package/dist/build.test.js +130 -0
- package/dist/build.test.js.map +7 -0
- package/dist/callerErrors.test.js +105 -0
- package/dist/callerErrors.test.js.map +7 -0
- package/dist/cli.js +406 -485
- package/dist/cli.js.map +7 -1
- package/dist/cliResult.d.ts +2 -2
- package/dist/cliResult.js +42 -25
- package/dist/cliResult.js.map +7 -1
- package/dist/cliResult.test.js +434 -297
- package/dist/cliResult.test.js.map +7 -1
- package/dist/config/deliveryConfig.d.ts +320 -14
- package/dist/config/deliveryConfig.js +472 -385
- package/dist/config/deliveryConfig.js.map +7 -1
- package/dist/config/deliveryConfig.test.js +775 -584
- package/dist/config/deliveryConfig.test.js.map +7 -1
- package/dist/contributorChecks.test.js +1694 -916
- package/dist/contributorChecks.test.js.map +7 -1
- package/dist/currentConsumer.test.js +819 -737
- package/dist/currentConsumer.test.js.map +7 -1
- package/dist/currentTrackingScenario.test.js +499 -477
- package/dist/currentTrackingScenario.test.js.map +7 -1
- package/dist/delivery/common.js +160 -172
- package/dist/delivery/common.js.map +7 -1
- package/dist/delivery/delivery.test.js +509 -431
- package/dist/delivery/delivery.test.js.map +7 -1
- package/dist/delivery/evidence.d.ts +2 -2
- package/dist/delivery/evidence.js +133 -120
- package/dist/delivery/evidence.js.map +7 -1
- package/dist/delivery/index.js +7 -2
- package/dist/delivery/index.js.map +7 -1
- package/dist/delivery/legacy.js +65 -5
- package/dist/delivery/legacy.js.map +7 -1
- package/dist/delivery/policy.d.ts +10 -10
- package/dist/delivery/policy.js +211 -238
- package/dist/delivery/policy.js.map +7 -1
- package/dist/delivery/stage.d.ts +18 -18
- package/dist/delivery/stage.js +220 -235
- package/dist/delivery/stage.js.map +7 -1
- package/dist/deliveryBoard.d.ts +74 -0
- package/dist/deliveryBoard.js +644 -0
- package/dist/deliveryBoard.js.map +7 -0
- package/dist/deliveryBoard.test.d.ts +1 -0
- package/dist/deliveryBoard.test.js +649 -0
- package/dist/deliveryBoard.test.js.map +7 -0
- package/dist/deliveryHealth.test.js +179 -155
- package/dist/deliveryHealth.test.js.map +7 -1
- package/dist/dependencyCompatibility.test.js +154 -140
- package/dist/dependencyCompatibility.test.js.map +7 -1
- package/dist/directoryIndependent.test.js +417 -383
- package/dist/directoryIndependent.test.js.map +7 -1
- package/dist/dispatch.d.ts +17 -12
- package/dist/dispatch.js +330 -322
- package/dist/dispatch.js.map +7 -1
- package/dist/errors.d.ts +16 -3
- package/dist/errors.js +104 -82
- package/dist/errors.js.map +7 -1
- package/dist/fixtures/deliveryBoardReplay.d.ts +56 -0
- package/dist/fixtures/deliveryBoardReplay.js +617 -0
- package/dist/fixtures/deliveryBoardReplay.js.map +7 -0
- package/dist/fixtures/discovery.d.ts +59 -19
- package/dist/fixtures/discovery.js +96 -90
- package/dist/fixtures/discovery.js.map +7 -1
- package/dist/fixtures/inertEntrypointChild.js +57 -56
- package/dist/fixtures/inertEntrypointChild.js.map +7 -1
- package/dist/fixtures/inertEntrypoints.d.ts +1 -1
- package/dist/fixtures/inertEntrypoints.js +321 -276
- package/dist/fixtures/inertEntrypoints.js.map +7 -1
- package/dist/fixtures/inertTarget.d.ts +78 -7
- package/dist/fixtures/inertTarget.js +769 -691
- package/dist/fixtures/inertTarget.js.map +7 -1
- package/dist/fixtures/issue63.d.ts +4 -3
- package/dist/fixtures/issue63.js +260 -274
- package/dist/fixtures/issue63.js.map +7 -1
- package/dist/fixtures/issueProjectItems.d.ts +20 -0
- package/dist/fixtures/issueProjectItems.js +15 -0
- package/dist/fixtures/issueProjectItems.js.map +7 -0
- package/dist/fixtures/readView.d.ts +120 -0
- package/dist/fixtures/readView.js +172 -0
- package/dist/fixtures/readView.js.map +7 -0
- package/dist/fixtures/recordedGitHubFlows.d.ts +120 -0
- package/dist/fixtures/recordedGitHubFlows.js +109 -0
- package/dist/fixtures/recordedGitHubFlows.js.map +7 -0
- package/dist/genericCompatibility.test.js +64 -55
- package/dist/genericCompatibility.test.js.map +7 -1
- package/dist/git.js +73 -67
- package/dist/git.js.map +7 -1
- package/dist/gitProcess.d.ts +1 -1
- package/dist/gitProcess.js +58 -53
- package/dist/gitProcess.js.map +7 -1
- package/dist/github/client.d.ts +2 -2
- package/dist/github/client.js +484 -379
- package/dist/github/client.js.map +7 -1
- package/dist/github/commandIdentityPolicy.js +44 -51
- package/dist/github/commandIdentityPolicy.js.map +7 -1
- package/dist/github/discovery.d.ts +3 -0
- package/dist/github/discovery.js +197 -201
- package/dist/github/discovery.js.map +7 -1
- package/dist/github/discovery.test.js +223 -177
- package/dist/github/discovery.test.js.map +7 -1
- package/dist/github/issueHistory.d.ts +2 -2
- package/dist/github/issueHistory.js +117 -125
- package/dist/github/issueHistory.js.map +7 -1
- package/dist/github/machineAuth.d.ts +1 -1
- package/dist/github/machineAuth.js +126 -117
- package/dist/github/machineAuth.js.map +7 -1
- package/dist/github/machineAuth.test.js +755 -639
- package/dist/github/machineAuth.test.js.map +7 -1
- package/dist/github/nativeIssueMetadata.js +286 -273
- package/dist/github/nativeIssueMetadata.js.map +7 -1
- package/dist/github/projectDelivery.d.ts +53 -1
- package/dist/github/projectDelivery.js +623 -460
- package/dist/github/projectDelivery.js.map +7 -1
- package/dist/github/relationships.d.ts +5 -2
- package/dist/github/relationships.js +434 -333
- package/dist/github/relationships.js.map +7 -1
- package/dist/github/repo.d.ts +1 -0
- package/dist/github/repo.js +123 -96
- package/dist/github/repo.js.map +7 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +7 -1
- package/dist/issue.d.ts +103 -7
- package/dist/issue.js +2104 -1547
- package/dist/issue.js.map +7 -1
- package/dist/issue63History.test.js +40 -42
- package/dist/issue63History.test.js.map +7 -1
- package/dist/issue63Routes.test.js +154 -143
- package/dist/issue63Routes.test.js.map +7 -1
- package/dist/issueBatchUpdate.test.js +1004 -683
- package/dist/issueBatchUpdate.test.js.map +7 -1
- package/dist/issueBlockerGuard.test.js +262 -226
- package/dist/issueBlockerGuard.test.js.map +7 -1
- package/dist/issueContract.d.ts +23 -4
- package/dist/issueContract.js +416 -395
- package/dist/issueContract.js.map +7 -1
- package/dist/issueContract.test.d.ts +4 -3
- package/dist/issueContract.test.js +358 -321
- package/dist/issueContract.test.js.map +7 -1
- package/dist/issueDates.test.js +235 -233
- package/dist/issueDates.test.js.map +7 -1
- package/dist/issueInfoReadback.test.js +304 -190
- package/dist/issueInfoReadback.test.js.map +7 -1
- package/dist/issueIntake.test.js +1945 -1732
- package/dist/issueIntake.test.js.map +7 -1
- package/dist/issueJournal.d.ts +40 -19
- package/dist/issueJournal.js +229 -138
- package/dist/issueJournal.js.map +7 -1
- package/dist/issueJournal.test.js +605 -422
- package/dist/issueJournal.test.js.map +7 -1
- package/dist/issueRollup.test.d.ts +1 -0
- package/dist/issueRollup.test.js +476 -0
- package/dist/issueRollup.test.js.map +7 -0
- package/dist/issueTracking.test.js +1088 -593
- package/dist/issueTracking.test.js.map +7 -1
- package/dist/issueWriteRecovery.test.d.ts +1 -0
- package/dist/issueWriteRecovery.test.js +260 -0
- package/dist/issueWriteRecovery.test.js.map +7 -0
- package/dist/lifecycle.test.js +112 -441
- package/dist/lifecycle.test.js.map +7 -1
- package/dist/logger.js +80 -74
- package/dist/logger.js.map +7 -1
- package/dist/mcp/index.js +116 -90
- package/dist/mcp/index.js.map +7 -1
- package/dist/mcp/tools.d.ts +790 -220
- package/dist/mcp/tools.js +267 -333
- package/dist/mcp/tools.js.map +7 -1
- package/dist/pluginAuthProbe.js +63 -52
- package/dist/pluginAuthProbe.js.map +7 -1
- package/dist/pluginAuthProbe.test.js +85 -62
- package/dist/pluginAuthProbe.test.js.map +7 -1
- package/dist/pluginCredentials.test.js +282 -259
- package/dist/pluginCredentials.test.js.map +7 -1
- package/dist/pluginDoctor.test.js +653 -588
- package/dist/pluginDoctor.test.js.map +7 -1
- package/dist/pluginInstaller.d.ts +7 -5
- package/dist/pluginInstaller.js +1173 -1231
- package/dist/pluginInstaller.js.map +7 -1
- package/dist/pluginInstaller.test.js +1822 -1283
- package/dist/pluginInstaller.test.js.map +7 -1
- package/dist/pluginPackaging.test.js +485 -305
- package/dist/pluginPackaging.test.js.map +7 -1
- package/dist/pr.d.ts +132 -94
- package/dist/pr.js +1521 -1323
- package/dist/pr.js.map +7 -1
- package/dist/pr.test.js +1678 -632
- package/dist/pr.test.js.map +7 -1
- package/dist/prAssociation.test.js +2419 -1788
- package/dist/prAssociation.test.js.map +7 -1
- package/dist/prDispatch.test.js +150 -89
- package/dist/prDispatch.test.js.map +7 -1
- package/dist/readView.d.ts +183 -0
- package/dist/readView.js +217 -0
- package/dist/readView.js.map +7 -0
- package/dist/readView.test.d.ts +1 -0
- package/dist/readView.test.js +119 -0
- package/dist/readView.test.js.map +7 -0
- package/dist/releaseReconciliation.test.js +267 -288
- package/dist/releaseReconciliation.test.js.map +7 -1
- package/dist/releaseWorkflow.test.js +2493 -422
- package/dist/releaseWorkflow.test.js.map +7 -1
- package/dist/review.d.ts +738 -2
- package/dist/review.js +601 -348
- package/dist/review.js.map +7 -1
- package/dist/review.test.js +1218 -812
- package/dist/review.test.js.map +7 -1
- package/dist/reviewSubmit.test.d.ts +1 -0
- package/dist/reviewSubmit.test.js +747 -0
- package/dist/reviewSubmit.test.js.map +7 -0
- package/dist/services/agentReadinessService.js +42 -37
- package/dist/services/agentReadinessService.js.map +7 -1
- package/dist/services/blockerGuardService.js +188 -188
- package/dist/services/blockerGuardService.js.map +7 -1
- package/dist/services/boardReconcileService.d.ts +1204 -0
- package/dist/services/boardReconcileService.js +1445 -0
- package/dist/services/boardReconcileService.js.map +7 -0
- package/dist/services/deliveryAdmission.d.ts +2 -0
- package/dist/services/deliveryAdmission.js +129 -152
- package/dist/services/deliveryAdmission.js.map +7 -1
- package/dist/services/deliveryHealthService.js +197 -199
- package/dist/services/deliveryHealthService.js.map +7 -1
- package/dist/services/legacyIssueMigration.js +263 -277
- package/dist/services/legacyIssueMigration.js.map +7 -1
- package/dist/services/worktreeRegistry.d.ts +27 -119
- package/dist/services/worktreeRegistry.js +765 -1182
- package/dist/services/worktreeRegistry.js.map +7 -1
- package/dist/stagedChecks.test.js +396 -194
- package/dist/stagedChecks.test.js.map +7 -1
- package/dist/start.test.js +99 -95
- package/dist/start.test.js.map +7 -1
- package/dist/stdoutRegression.test.js +354 -350
- package/dist/stdoutRegression.test.js.map +7 -1
- package/dist/targetPolicyDiscovery.test.js +141 -143
- package/dist/targetPolicyDiscovery.test.js.map +7 -1
- package/dist/targetPolicyEntrypoints.test.js +308 -269
- package/dist/targetPolicyEntrypoints.test.js.map +7 -1
- package/dist/targetPolicyLocal.test.js +580 -1051
- package/dist/targetPolicyLocal.test.js.map +7 -1
- package/dist/targetPolicyRoutes.test.js +305 -281
- package/dist/targetPolicyRoutes.test.js.map +7 -1
- package/dist/targetRepositoryExecution.test.d.ts +1 -0
- package/dist/targetRepositoryExecution.test.js +463 -0
- package/dist/targetRepositoryExecution.test.js.map +7 -0
- package/dist/terminalMessages.js +41 -35
- package/dist/terminalMessages.js.map +7 -1
- package/dist/toolOutput.d.ts +2 -0
- package/dist/toolOutput.js +36 -0
- package/dist/toolOutput.js.map +7 -0
- package/dist/toolOutput.test.d.ts +1 -0
- package/dist/toolOutput.test.js +240 -0
- package/dist/toolOutput.test.js.map +7 -0
- package/dist/utils/atomicJson.js +84 -76
- package/dist/utils/atomicJson.js.map +7 -1
- package/dist/utils/filesystem.js +15 -18
- package/dist/utils/filesystem.js.map +7 -1
- package/dist/utils/lockfile.js +68 -71
- package/dist/utils/lockfile.js.map +7 -1
- package/dist/verification.d.ts +1 -19
- package/dist/verification.js +1020 -1929
- package/dist/verification.js.map +7 -1
- package/dist/verificationGate.test.js +127 -117
- package/dist/verificationGate.test.js.map +7 -1
- package/dist/version.d.ts +6 -0
- package/dist/version.js +24 -10
- package/dist/version.js.map +7 -1
- package/dist/worktree.d.ts +3 -15
- package/dist/worktree.js +97 -177
- package/dist/worktree.js.map +7 -1
- package/package.json +10 -8
- package/plugins/ai-delivery/.claude-plugin/plugin.json +2 -2
- package/plugins/ai-delivery/README.md +47 -156
- package/plugins/ai-delivery/plugin.json +1 -1
- package/plugins/ai-delivery/runtime/dist/THIRD-PARTY-NOTICES.md +261 -43
- package/plugins/ai-delivery/runtime/dist/cli.js +369 -125
- package/plugins/ai-delivery/runtime/package.json +1 -1
- package/plugins/ai-delivery/skills/intake-create/SKILL.md +14 -78
- package/plugins/ai-delivery/skills/pr-handoff/SKILL.md +35 -36
- package/plugins/ai-delivery/skills/worktree-lifecycle/SKILL.md +14 -15
- package/dist/investigationCompletion.test.js +0 -728
- package/dist/investigationCompletion.test.js.map +0 -1
- package/dist/setup.d.ts +0 -60
- package/dist/setup.js +0 -585
- package/dist/setup.js.map +0 -1
- package/dist/setup.test.js +0 -3058
- package/dist/setup.test.js.map +0 -1
- package/dist/worktreeTransition.d.ts +0 -211
- package/dist/worktreeTransition.js +0 -1037
- package/dist/worktreeTransition.js.map +0 -1
- package/dist/worktreeTransition.test.js +0 -1191
- package/dist/worktreeTransition.test.js.map +0 -1
- /package/dist/{investigationCompletion.test.d.ts → boardReconcile.test.d.ts} +0 -0
- /package/dist/{setup.test.d.ts → build.test.d.ts} +0 -0
- /package/dist/{worktreeTransition.test.d.ts → callerErrors.test.d.ts} +0 -0
|
@@ -1,129 +1,139 @@
|
|
|
1
|
-
import assert from
|
|
2
|
-
import { randomUUID } from
|
|
3
|
-
import { existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from
|
|
4
|
-
import { tmpdir } from
|
|
5
|
-
import { join } from
|
|
6
|
-
import { afterEach, test, vi } from
|
|
7
|
-
const observation = vi.hoisted(() => ({ mode:
|
|
8
|
-
vi.mock(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
};
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import { randomUUID } from "node:crypto";
|
|
3
|
+
import { existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
4
|
+
import { tmpdir } from "node:os";
|
|
5
|
+
import { join } from "node:path";
|
|
6
|
+
import { afterEach, test, vi } from "vitest";
|
|
7
|
+
const observation = vi.hoisted(() => ({ mode: "healthy", directory: "", calls: 0 }));
|
|
8
|
+
vi.mock("node:child_process", async (original) => {
|
|
9
|
+
const actual = await original();
|
|
10
|
+
return {
|
|
11
|
+
...actual,
|
|
12
|
+
spawnSync: (...args) => {
|
|
13
|
+
if (args[0] !== "/usr/bin/ps" && args[0] !== "/bin/ps") return actual.spawnSync(...args);
|
|
14
|
+
observation.calls++;
|
|
15
|
+
if (observation.mode === "unavailable" || observation.mode === "partial-unavailable" || observation.mode === "after-lock" && existsSync(join(observation.directory, "held")))
|
|
16
|
+
return {
|
|
17
|
+
status: null,
|
|
18
|
+
error: Object.assign(new Error("synthetic observation timeout"), { code: "ETIMEDOUT" }),
|
|
19
|
+
signal: "SIGTERM",
|
|
20
|
+
stdout: observation.mode === "partial-unavailable" ? "1 0 1 1 S birth\n2 0" : "",
|
|
21
|
+
stderr: ""
|
|
22
|
+
};
|
|
23
|
+
return {
|
|
24
|
+
status: 0,
|
|
25
|
+
signal: null,
|
|
26
|
+
stdout: `${process.pid} ${process.ppid} ${process.pid} 32 S current birth
|
|
27
|
+
999999 0 999999 32 S unrelated birth
|
|
28
|
+
`,
|
|
29
|
+
stderr: ""
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
};
|
|
34
33
|
});
|
|
35
|
-
const { processSnapshot, withVerificationFilesystemFixture } = await import(
|
|
34
|
+
const { processSnapshot, withVerificationFilesystemFixture } = await import("./verification.js");
|
|
36
35
|
const directories = [];
|
|
37
36
|
afterEach(() => {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
rmSync(directory, { recursive: true, force: true });
|
|
37
|
+
vi.unstubAllEnvs();
|
|
38
|
+
for (const directory of directories.splice(0)) rmSync(directory, { recursive: true, force: true });
|
|
41
39
|
});
|
|
42
40
|
function gate(unrelated = false) {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
41
|
+
const directory = mkdtempSync(join(tmpdir(), "ai-delivery-gate-refusal-"));
|
|
42
|
+
directories.push(directory);
|
|
43
|
+
mkdirSync(join(directory, "requests"), { mode: 448 });
|
|
44
|
+
const capability = {
|
|
45
|
+
directory,
|
|
46
|
+
id: randomUUID(),
|
|
47
|
+
owner: unrelated ? { pid: 999999, identity: "unrelated birth" } : { pid: process.pid, identity: "current birth" }
|
|
48
|
+
};
|
|
49
|
+
writeFileSync(join(directory, "gate.json"), JSON.stringify(capability), { mode: 384 });
|
|
50
|
+
vi.stubEnv("AI_DELIVERY_OUTPUT_OBSERVATION_GATE", JSON.stringify(capability));
|
|
51
|
+
observation.directory = directory;
|
|
52
|
+
observation.mode = "healthy";
|
|
53
|
+
observation.calls = 0;
|
|
54
|
+
return capability;
|
|
57
55
|
}
|
|
58
|
-
for (const mode of [
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
});
|
|
56
|
+
for (const mode of ["unavailable", "partial-unavailable"]) {
|
|
57
|
+
test(`observer failure preserves bounded numeric provenance for ${mode}`, () => {
|
|
58
|
+
observation.mode = mode;
|
|
59
|
+
assert.throws(processSnapshot, (error) => {
|
|
60
|
+
assert.ok(error instanceof Error);
|
|
61
|
+
const prefix = "Owned process resource observation failed. ";
|
|
62
|
+
assert.ok(error.message.startsWith(prefix));
|
|
63
|
+
const metadata = JSON.parse(error.message.slice(prefix.length));
|
|
64
|
+
assert.equal(metadata.status, null);
|
|
65
|
+
assert.equal(metadata.errorCode, "ETIMEDOUT");
|
|
66
|
+
assert.equal(metadata.signal, "SIGTERM");
|
|
67
|
+
assert.equal(metadata.stdoutPresent, true);
|
|
68
|
+
assert.equal(metadata.stdoutTerminated, false);
|
|
69
|
+
assert.ok(typeof metadata.elapsedMs === "number" && Number.isSafeInteger(metadata.elapsedMs));
|
|
70
|
+
assert.ok(metadata.elapsedMs >= 0);
|
|
71
|
+
assert.equal(metadata.stdoutBytes, mode === "unavailable" ? 0 : 19);
|
|
72
|
+
assert.equal(metadata.completeLines, mode === "unavailable" ? 0 : 1);
|
|
73
|
+
assert.equal(error.message.includes("birth"), false);
|
|
74
|
+
return true;
|
|
78
75
|
});
|
|
76
|
+
});
|
|
79
77
|
}
|
|
80
|
-
test(
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
78
|
+
test("filesystem gate refuses unavailable full observation before invoking its fixture", async () => {
|
|
79
|
+
const current = gate();
|
|
80
|
+
observation.mode = "unavailable";
|
|
81
|
+
let invoked = false;
|
|
82
|
+
await assert.rejects(
|
|
83
|
+
withVerificationFilesystemFixture(() => {
|
|
84
|
+
invoked = true;
|
|
85
|
+
}),
|
|
86
|
+
/observation failed/u
|
|
87
|
+
);
|
|
88
|
+
assert.equal(invoked, false);
|
|
89
|
+
assert.equal(existsSync(join(current.directory, "held")), false);
|
|
89
90
|
});
|
|
90
|
-
test(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
91
|
+
test("filesystem gate still observes after lock publication and releases its own lock on refusal", async () => {
|
|
92
|
+
const current = gate();
|
|
93
|
+
observation.mode = "after-lock";
|
|
94
|
+
let invoked = false;
|
|
95
|
+
await assert.rejects(
|
|
96
|
+
withVerificationFilesystemFixture(() => {
|
|
97
|
+
invoked = true;
|
|
98
|
+
}),
|
|
99
|
+
/observation failed/u
|
|
100
|
+
);
|
|
101
|
+
assert.equal(invoked, false);
|
|
102
|
+
assert.equal(existsSync(join(current.directory, "held")), false);
|
|
103
|
+
assert.equal(existsSync(join(current.directory, "gate.json")), true);
|
|
100
104
|
});
|
|
101
|
-
test(
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
105
|
+
test("filesystem gate preserves an abandoned scan request and never invokes the fixture", async () => {
|
|
106
|
+
const current = gate();
|
|
107
|
+
const requestId = randomUUID();
|
|
108
|
+
const path = join(current.directory, "requests", requestId + ".json");
|
|
109
|
+
const bytes = JSON.stringify({
|
|
110
|
+
gateId: current.id,
|
|
111
|
+
id: requestId,
|
|
112
|
+
kind: "scan",
|
|
113
|
+
owner: { pid: 999998, identity: "absent birth" }
|
|
114
|
+
});
|
|
115
|
+
writeFileSync(path, bytes, { mode: 384 });
|
|
116
|
+
let invoked = false;
|
|
117
|
+
await assert.rejects(
|
|
118
|
+
withVerificationFilesystemFixture(() => {
|
|
119
|
+
invoked = true;
|
|
120
|
+
}),
|
|
121
|
+
/scan request was abandoned/u
|
|
122
|
+
);
|
|
123
|
+
assert.equal(invoked, false);
|
|
124
|
+
assert.equal(readFileSync(path, "utf8"), bytes);
|
|
125
|
+
assert.equal(existsSync(join(current.directory, "held")), false);
|
|
119
126
|
});
|
|
120
|
-
test(
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
127
|
+
test("filesystem gate refuses a live unrelated owner that is not an inherited ancestor", async () => {
|
|
128
|
+
const current = gate(true);
|
|
129
|
+
let invoked = false;
|
|
130
|
+
await assert.rejects(
|
|
131
|
+
withVerificationFilesystemFixture(() => {
|
|
132
|
+
invoked = true;
|
|
133
|
+
}),
|
|
134
|
+
/not an inherited ancestor/u
|
|
135
|
+
);
|
|
136
|
+
assert.equal(invoked, false);
|
|
137
|
+
assert.equal(existsSync(join(current.directory, "held")), false);
|
|
128
138
|
});
|
|
129
|
-
//# sourceMappingURL=verificationGate.test.js.map
|
|
139
|
+
//# sourceMappingURL=verificationGate.test.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/verificationGate.test.ts"],
|
|
4
|
+
"sourcesContent": ["import assert from 'node:assert/strict';\nimport { randomUUID } from 'node:crypto';\nimport { existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs';\nimport { tmpdir } from 'node:os';\nimport { join } from 'node:path';\nimport { afterEach, test, vi } from 'vitest';\n\nconst observation = vi.hoisted(() => ({ mode: 'healthy', directory: '', calls: 0 }));\nvi.mock('node:child_process', async (original) => {\n const actual = await original<typeof import('node:child_process')>();\n return {\n ...actual,\n spawnSync: (...args: Parameters<typeof actual.spawnSync>) => {\n if (args[0] !== '/usr/bin/ps' && args[0] !== '/bin/ps') return actual.spawnSync(...args);\n observation.calls++;\n if (\n observation.mode === 'unavailable' ||\n observation.mode === 'partial-unavailable' ||\n (observation.mode === 'after-lock' && existsSync(join(observation.directory, 'held')))\n )\n return {\n status: null,\n error: Object.assign(new Error('synthetic observation timeout'), { code: 'ETIMEDOUT' }),\n signal: 'SIGTERM',\n stdout: observation.mode === 'partial-unavailable' ? '1 0 1 1 S birth\\n2 0' : '',\n stderr: '',\n };\n return {\n status: 0,\n signal: null,\n stdout: `${process.pid} ${process.ppid} ${process.pid} 32 S current birth\\n999999 0 999999 32 S unrelated birth\\n`,\n stderr: '',\n };\n },\n };\n});\nconst { processSnapshot, withVerificationFilesystemFixture } = await import('./verification.js');\n\nconst directories: string[] = [];\nafterEach(() => {\n vi.unstubAllEnvs();\n for (const directory of directories.splice(0)) rmSync(directory, { recursive: true, force: true });\n});\nfunction gate(unrelated = false) {\n const directory = mkdtempSync(join(tmpdir(), 'ai-delivery-gate-refusal-'));\n directories.push(directory);\n mkdirSync(join(directory, 'requests'), { mode: 0o700 });\n const capability = {\n directory,\n id: randomUUID(),\n owner: unrelated ? { pid: 999999, identity: 'unrelated birth' } : { pid: process.pid, identity: 'current birth' },\n };\n writeFileSync(join(directory, 'gate.json'), JSON.stringify(capability), { mode: 0o600 });\n vi.stubEnv('AI_DELIVERY_OUTPUT_OBSERVATION_GATE', JSON.stringify(capability));\n observation.directory = directory;\n observation.mode = 'healthy';\n observation.calls = 0;\n return capability;\n}\n\nfor (const mode of ['unavailable', 'partial-unavailable'] as const) {\n test(`observer failure preserves bounded numeric provenance for ${mode}`, () => {\n observation.mode = mode;\n assert.throws(processSnapshot, (error: unknown) => {\n assert.ok(error instanceof Error);\n const prefix = 'Owned process resource observation failed. ';\n assert.ok(error.message.startsWith(prefix));\n const metadata = JSON.parse(error.message.slice(prefix.length)) as Record<string, unknown>;\n assert.equal(metadata.status, null);\n assert.equal(metadata.errorCode, 'ETIMEDOUT');\n assert.equal(metadata.signal, 'SIGTERM');\n assert.equal(metadata.stdoutPresent, true);\n assert.equal(metadata.stdoutTerminated, false);\n assert.ok(typeof metadata.elapsedMs === 'number' && Number.isSafeInteger(metadata.elapsedMs));\n assert.ok(metadata.elapsedMs >= 0);\n assert.equal(metadata.stdoutBytes, mode === 'unavailable' ? 0 : 19);\n assert.equal(metadata.completeLines, mode === 'unavailable' ? 0 : 1);\n assert.equal(error.message.includes('birth'), false);\n return true;\n });\n });\n}\n\ntest('filesystem gate refuses unavailable full observation before invoking its fixture', async () => {\n const current = gate();\n observation.mode = 'unavailable';\n let invoked = false;\n await assert.rejects(\n withVerificationFilesystemFixture(() => {\n invoked = true;\n }),\n /observation failed/u,\n );\n assert.equal(invoked, false);\n assert.equal(existsSync(join(current.directory, 'held')), false);\n});\n\ntest('filesystem gate still observes after lock publication and releases its own lock on refusal', async () => {\n const current = gate();\n observation.mode = 'after-lock';\n let invoked = false;\n await assert.rejects(\n withVerificationFilesystemFixture(() => {\n invoked = true;\n }),\n /observation failed/u,\n );\n assert.equal(invoked, false);\n assert.equal(existsSync(join(current.directory, 'held')), false);\n assert.equal(existsSync(join(current.directory, 'gate.json')), true);\n});\n\ntest('filesystem gate preserves an abandoned scan request and never invokes the fixture', async () => {\n const current = gate();\n const requestId = randomUUID();\n const path = join(current.directory, 'requests', requestId + '.json');\n const bytes = JSON.stringify({\n gateId: current.id,\n id: requestId,\n kind: 'scan',\n owner: { pid: 999998, identity: 'absent birth' },\n });\n writeFileSync(path, bytes, { mode: 0o600 });\n let invoked = false;\n await assert.rejects(\n withVerificationFilesystemFixture(() => {\n invoked = true;\n }),\n /scan request was abandoned/u,\n );\n assert.equal(invoked, false);\n assert.equal(readFileSync(path, 'utf8'), bytes);\n assert.equal(existsSync(join(current.directory, 'held')), false);\n});\n\ntest('filesystem gate refuses a live unrelated owner that is not an inherited ancestor', async () => {\n const current = gate(true);\n let invoked = false;\n await assert.rejects(\n withVerificationFilesystemFixture(() => {\n invoked = true;\n }),\n /not an inherited ancestor/u,\n );\n assert.equal(invoked, false);\n assert.equal(existsSync(join(current.directory, 'held')), false);\n});\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
1
|
export declare const PACKAGE_VERSION: string;
|
|
2
|
+
/** Module-relative identity of the executing distribution, including the single bundled CLI layout. */
|
|
3
|
+
export declare function readPackageArtifactIdentity(): {
|
|
4
|
+
packageVersion: string;
|
|
5
|
+
packageManifestDigest: string;
|
|
6
|
+
packageDistDigest: string;
|
|
7
|
+
};
|
package/dist/version.js
CHANGED
|
@@ -1,10 +1,24 @@
|
|
|
1
|
-
import { readFileSync } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { lstatSync, readFileSync } from "node:fs";
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
3
|
+
import { fileDigest, directoryDigest } from "./services/deliveryAdmission.js";
|
|
4
|
+
import { DeliveryError } from "./errors.js";
|
|
5
|
+
const packageMetadata = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
|
|
6
|
+
if (typeof packageMetadata !== "object" || packageMetadata === null || !("version" in packageMetadata) || typeof packageMetadata.version !== "string" || !/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/u.test(packageMetadata.version))
|
|
7
|
+
throw new Error("The adjacent ai-delivery package identity must contain a stable version.");
|
|
8
|
+
const PACKAGE_VERSION = packageMetadata.version;
|
|
9
|
+
function readPackageArtifactIdentity() {
|
|
10
|
+
const manifest = fileURLToPath(new URL("../package.json", import.meta.url));
|
|
11
|
+
const distribution = fileURLToPath(new URL(".", import.meta.url));
|
|
12
|
+
if (!lstatSync(manifest).isFile() || !lstatSync(distribution).isDirectory())
|
|
13
|
+
throw new DeliveryError("Executing package identity contains an unsupported link or file type.");
|
|
14
|
+
return {
|
|
15
|
+
packageVersion: PACKAGE_VERSION,
|
|
16
|
+
packageManifestDigest: fileDigest(manifest),
|
|
17
|
+
packageDistDigest: directoryDigest(distribution)
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
PACKAGE_VERSION,
|
|
22
|
+
readPackageArtifactIdentity
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=version.js.map
|
package/dist/version.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/version.ts"],
|
|
4
|
+
"sourcesContent": ["import { lstatSync, readFileSync } from 'node:fs';\nimport { fileURLToPath } from 'node:url';\nimport { fileDigest, directoryDigest } from './services/deliveryAdmission.js';\nimport { DeliveryError } from './errors.js';\n\nconst packageMetadata: unknown = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8'));\nif (\n typeof packageMetadata !== 'object' ||\n packageMetadata === null ||\n !('version' in packageMetadata) ||\n typeof packageMetadata.version !== 'string' ||\n !/^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$/u.test(packageMetadata.version)\n)\n throw new Error('The adjacent ai-delivery package identity must contain a stable version.');\n\nexport const PACKAGE_VERSION = packageMetadata.version;\n\n/** Module-relative identity of the executing distribution, including the single bundled CLI layout. */\nexport function readPackageArtifactIdentity(): {\n packageVersion: string;\n packageManifestDigest: string;\n packageDistDigest: string;\n} {\n const manifest = fileURLToPath(new URL('../package.json', import.meta.url));\n const distribution = fileURLToPath(new URL('.', import.meta.url));\n if (!lstatSync(manifest).isFile() || !lstatSync(distribution).isDirectory())\n throw new DeliveryError('Executing package identity contains an unsupported link or file type.');\n return {\n packageVersion: PACKAGE_VERSION,\n packageManifestDigest: fileDigest(manifest),\n packageDistDigest: directoryDigest(distribution),\n };\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,WAAW,oBAAoB;AACxC,SAAS,qBAAqB;AAC9B,SAAS,YAAY,uBAAuB;AAC5C,SAAS,qBAAqB;AAE9B,MAAM,kBAA2B,KAAK,MAAM,aAAa,IAAI,IAAI,mBAAmB,YAAY,GAAG,GAAG,MAAM,CAAC;AAC7G,IACE,OAAO,oBAAoB,YAC3B,oBAAoB,QACpB,EAAE,aAAa,oBACf,OAAO,gBAAgB,YAAY,YACnC,CAAC,8CAA8C,KAAK,gBAAgB,OAAO;AAE3E,QAAM,IAAI,MAAM,0EAA0E;AAErF,MAAM,kBAAkB,gBAAgB;AAGxC,SAAS,8BAId;AACA,QAAM,WAAW,cAAc,IAAI,IAAI,mBAAmB,YAAY,GAAG,CAAC;AAC1E,QAAM,eAAe,cAAc,IAAI,IAAI,KAAK,YAAY,GAAG,CAAC;AAChE,MAAI,CAAC,UAAU,QAAQ,EAAE,OAAO,KAAK,CAAC,UAAU,YAAY,EAAE,YAAY;AACxE,UAAM,IAAI,cAAc,uEAAuE;AACjG,SAAO;AAAA,IACL,gBAAgB;AAAA,IAChB,uBAAuB,WAAW,QAAQ;AAAA,IAC1C,mBAAmB,gBAAgB,YAAY;AAAA,EACjD;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/worktree.d.ts
CHANGED
|
@@ -1,18 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import { type WorktreeEntry, type InvestigationPreparation } from './services/worktreeRegistry.js';
|
|
1
|
+
import type { WorktreeEntry } from './services/worktreeRegistry.js';
|
|
3
2
|
/** @internal Shared physical custody check for preparation and same-owner continuation. */
|
|
4
3
|
export declare function assertIssueWorktreeLocation(row: WorktreeEntry, root: string): void;
|
|
5
|
-
/** @internal Preservation-only refusal for callers of the removed issue-worktree API. */
|
|
6
|
-
export declare function prepareIssueWorktree(input: {
|
|
7
|
-
identity: string;
|
|
8
|
-
issueNumber: number;
|
|
9
|
-
repoRoot: string;
|
|
10
|
-
}): Promise<WorktreeEntry>;
|
|
11
|
-
/** Observe a host-created, restricted worktree; registration never creates or adopts legacy source. */
|
|
12
|
-
export declare function investigationSourceIdentity(root: string, issueNumber: number): Pick<InvestigationPreparation, 'head' | 'physical'>;
|
|
13
|
-
/** Commit equality refuses new same-tree commits as well as source changes and unpushed history. */
|
|
14
|
-
export declare function assertInvestigationSource(preparation: InvestigationPreparation, launchDirectory: string, allowAbsent?: boolean): void;
|
|
15
|
-
export declare function removeInvestigationSource(preparation: InvestigationPreparation, launchDirectory: string): void;
|
|
16
4
|
export interface MergeCleanupAttestation {
|
|
17
5
|
baseBranch: string;
|
|
18
6
|
baseSha: string;
|
|
@@ -24,5 +12,5 @@ export interface MergeCleanupAttestation {
|
|
|
24
12
|
remoteHeadSha: string | null;
|
|
25
13
|
strategy: 'merge' | 'squash' | 'rebase';
|
|
26
14
|
}
|
|
27
|
-
/**
|
|
28
|
-
export declare function
|
|
15
|
+
/** Remove only a finished, retained source and its exact local branch; never force Git removal. */
|
|
16
|
+
export declare function removeFinishedIssueSource(row: WorktreeEntry, root: string, headSha: string, attestation?: MergeCleanupAttestation): void;
|