@aviaratech/ai-delivery 0.3.35 → 0.3.37
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 +56 -554
- package/dist/agent.d.ts +1 -3
- package/dist/agent.js +74 -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 +1651 -1590
- package/dist/boardReconcile.test.js.map +7 -1
- package/dist/build.test.js +130 -0
- package/dist/build.test.js.map +7 -0
- package/dist/callerErrors.test.js +91 -0
- package/dist/callerErrors.test.js.map +7 -0
- package/dist/cli.js +389 -517
- package/dist/cli.js.map +7 -1
- package/dist/cliResult.d.ts +2 -2
- package/dist/cliResult.js +42 -45
- package/dist/cliResult.js.map +7 -1
- package/dist/cliResult.test.js +424 -369
- package/dist/cliResult.test.js.map +7 -1
- package/dist/config/deliveryConfig.d.ts +288 -14
- package/dist/config/deliveryConfig.js +472 -390
- package/dist/config/deliveryConfig.js.map +7 -1
- package/dist/config/deliveryConfig.test.js +773 -649
- 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 -479
- 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.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 +16 -11
- package/dist/dispatch.js +316 -354
- package/dist/dispatch.js.map +7 -1
- package/dist/errors.d.ts +3 -3
- package/dist/errors.js +103 -96
- 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 +63 -23
- 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.d.ts +0 -3
- package/dist/git.js +59 -76
- 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 +42 -52
- package/dist/github/commandIdentityPolicy.js.map +7 -1
- package/dist/github/discovery.d.ts +1 -0
- package/dist/github/discovery.js +197 -215
- 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 +18 -2
- package/dist/github/projectDelivery.js +615 -557
- package/dist/github/projectDelivery.js.map +7 -1
- package/dist/github/relationships.js +433 -389
- 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 +40 -9
- package/dist/issue.js +2102 -1742
- 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 +989 -885
- 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 +1938 -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 +1059 -989
- 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 -94
- package/dist/mcp/index.js.map +7 -1
- package/dist/mcp/tools.d.ts +252 -310
- package/dist/mcp/tools.js +235 -342
- 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 -1229
- package/dist/pluginInstaller.js.map +7 -1
- package/dist/pluginInstaller.test.js +1842 -1423
- package/dist/pluginInstaller.test.js.map +7 -1
- package/dist/pluginPackaging.test.js +417 -413
- package/dist/pluginPackaging.test.js.map +7 -1
- package/dist/pr.d.ts +114 -131
- package/dist/pr.js +1314 -1327
- package/dist/pr.js.map +7 -1
- package/dist/pr.test.js +967 -653
- 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 +123 -89
- package/dist/prDispatch.test.js.map +7 -1
- package/dist/readView.d.ts +184 -0
- package/dist/readView.js +218 -0
- package/dist/readView.js.map +7 -0
- package/dist/readView.test.d.ts +1 -0
- package/dist/readView.test.js +146 -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 +125 -125
- package/dist/services/boardReconcileService.js +1295 -1421
- package/dist/services/boardReconcileService.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/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 +321 -358
- 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 +274 -281
- package/dist/targetPolicyRoutes.test.js.map +7 -1
- package/dist/targetRepositoryExecution.test.d.ts +1 -0
- package/dist/targetRepositoryExecution.test.js +451 -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.d.ts +0 -2
- package/dist/utils/atomicJson.js +81 -77
- package/dist/utils/atomicJson.js.map +7 -1
- package/dist/utils/filesystem.d.ts +0 -8
- package/dist/utils/filesystem.js +5 -19
- 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 -54
- package/dist/verification.js +976 -1941
- 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.js +45 -24
- package/dist/version.js.map +7 -1
- package/package.json +9 -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 +238 -44
- package/plugins/ai-delivery/runtime/dist/cli.js +351 -115
- 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/services/deliveryAdmission.d.ts +0 -49
- package/dist/services/deliveryAdmission.js +0 -165
- package/dist/services/deliveryAdmission.js.map +0 -1
- package/dist/services/worktreeRegistry.d.ts +0 -434
- package/dist/services/worktreeRegistry.js +0 -1248
- package/dist/services/worktreeRegistry.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 -3329
- package/dist/setup.test.js.map +0 -1
- package/dist/worktree.d.ts +0 -28
- package/dist/worktree.js +0 -188
- package/dist/worktree.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 → build.test.d.ts} +0 -0
- /package/dist/{setup.test.d.ts → callerErrors.test.d.ts} +0 -0
- /package/dist/{worktreeTransition.test.d.ts → deliveryBoard.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.js
CHANGED
|
@@ -1,25 +1,46 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
packageManifestDigest: fileDigest(manifest),
|
|
22
|
-
packageDistDigest: directoryDigest(distribution),
|
|
23
|
-
};
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { lstatSync, readFileSync, readdirSync } from "node:fs";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
import { digestValue } from "./delivery/common.js";
|
|
6
|
+
import { DeliveryError } from "./errors.js";
|
|
7
|
+
const packageMetadata = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
|
|
8
|
+
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))
|
|
9
|
+
throw new Error("The adjacent ai-delivery package identity must contain a stable version.");
|
|
10
|
+
const PACKAGE_VERSION = packageMetadata.version;
|
|
11
|
+
function readPackageArtifactIdentity() {
|
|
12
|
+
const manifest = fileURLToPath(new URL("../package.json", import.meta.url));
|
|
13
|
+
const distribution = fileURLToPath(new URL(".", import.meta.url));
|
|
14
|
+
if (!lstatSync(manifest).isFile() || !lstatSync(distribution).isDirectory())
|
|
15
|
+
throw new DeliveryError("Executing package identity contains an unsupported link or file type.");
|
|
16
|
+
return {
|
|
17
|
+
packageVersion: PACKAGE_VERSION,
|
|
18
|
+
packageManifestDigest: fileDigest(manifest),
|
|
19
|
+
packageDistDigest: directoryDigest(distribution)
|
|
20
|
+
};
|
|
24
21
|
}
|
|
25
|
-
|
|
22
|
+
function fileDigest(path) {
|
|
23
|
+
return `sha256:${createHash("sha256").update(readFileSync(path)).digest("hex")}`;
|
|
24
|
+
}
|
|
25
|
+
function directoryDigest(path) {
|
|
26
|
+
const entries = [];
|
|
27
|
+
const visit = (directory, relative) => {
|
|
28
|
+
for (const entry of readdirSync(directory, { withFileTypes: true }).sort(
|
|
29
|
+
(left, right) => left.name < right.name ? -1 : left.name > right.name ? 1 : 0
|
|
30
|
+
)) {
|
|
31
|
+
const child = join(directory, entry.name);
|
|
32
|
+
const childRelative = relative ? `${relative}/${entry.name}` : entry.name;
|
|
33
|
+
if (entry.isDirectory()) visit(child, childRelative);
|
|
34
|
+
else if (entry.isFile()) entries.push({ path: childRelative, sha256: fileDigest(child) });
|
|
35
|
+
else throw new DeliveryError("Runtime distribution contains an unsupported link or file type.");
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
visit(path, "");
|
|
39
|
+
if (entries.length === 0) throw new DeliveryError("Runtime distribution is empty.");
|
|
40
|
+
return digestValue(entries);
|
|
41
|
+
}
|
|
42
|
+
export {
|
|
43
|
+
PACKAGE_VERSION,
|
|
44
|
+
readPackageArtifactIdentity
|
|
45
|
+
};
|
|
46
|
+
//# 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 { createHash } from 'node:crypto';\nimport { lstatSync, readFileSync, readdirSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { digestValue } from './delivery/common.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\nfunction fileDigest(path: string): string {\n return `sha256:${createHash('sha256').update(readFileSync(path)).digest('hex')}`;\n}\n\nfunction directoryDigest(path: string): string {\n const entries: { path: string; sha256: string }[] = [];\n const visit = (directory: string, relative: string): void => {\n for (const entry of readdirSync(directory, { withFileTypes: true }).sort((left, right) =>\n left.name < right.name ? -1 : left.name > right.name ? 1 : 0,\n )) {\n const child = join(directory, entry.name);\n const childRelative = relative ? `${relative}/${entry.name}` : entry.name;\n if (entry.isDirectory()) visit(child, childRelative);\n else if (entry.isFile()) entries.push({ path: childRelative, sha256: fileDigest(child) });\n else throw new DeliveryError('Runtime distribution contains an unsupported link or file type.');\n }\n };\n visit(path, '');\n if (entries.length === 0) throw new DeliveryError('Runtime distribution is empty.');\n return digestValue(entries);\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,kBAAkB;AAC3B,SAAS,WAAW,cAAc,mBAAmB;AACrD,SAAS,YAAY;AACrB,SAAS,qBAAqB;AAC9B,SAAS,mBAAmB;AAC5B,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;AAEA,SAAS,WAAW,MAAsB;AACxC,SAAO,UAAU,WAAW,QAAQ,EAAE,OAAO,aAAa,IAAI,CAAC,EAAE,OAAO,KAAK,CAAC;AAChF;AAEA,SAAS,gBAAgB,MAAsB;AAC7C,QAAM,UAA8C,CAAC;AACrD,QAAM,QAAQ,CAAC,WAAmB,aAA2B;AAC3D,eAAW,SAAS,YAAY,WAAW,EAAE,eAAe,KAAK,CAAC,EAAE;AAAA,MAAK,CAAC,MAAM,UAC9E,KAAK,OAAO,MAAM,OAAO,KAAK,KAAK,OAAO,MAAM,OAAO,IAAI;AAAA,IAC7D,GAAG;AACD,YAAM,QAAQ,KAAK,WAAW,MAAM,IAAI;AACxC,YAAM,gBAAgB,WAAW,GAAG,QAAQ,IAAI,MAAM,IAAI,KAAK,MAAM;AACrE,UAAI,MAAM,YAAY,EAAG,OAAM,OAAO,aAAa;AAAA,eAC1C,MAAM,OAAO,EAAG,SAAQ,KAAK,EAAE,MAAM,eAAe,QAAQ,WAAW,KAAK,EAAE,CAAC;AAAA,UACnF,OAAM,IAAI,cAAc,iEAAiE;AAAA,IAChG;AAAA,EACF;AACA,QAAM,MAAM,EAAE;AACd,MAAI,QAAQ,WAAW,EAAG,OAAM,IAAI,cAAc,gCAAgC;AAClF,SAAO,YAAY,OAAO;AAC5B;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aviaratech/ai-delivery",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.37",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Generic GitHub issue and pull request delivery CLI and MCP server",
|
|
6
6
|
"homepage": "https://github.com/aviaratech/ai-delivery#readme",
|
|
@@ -46,14 +46,14 @@
|
|
|
46
46
|
"access": "public"
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|
|
49
|
-
"format": "oxfmt
|
|
50
|
-
"format:check": "oxfmt --
|
|
51
|
-
"lint": "oxlint
|
|
49
|
+
"format": "oxfmt src scripts package.json tsconfig.json tsconfig.build.json vitest.config.ts .oxlintrc.json .oxfmtrc.json",
|
|
50
|
+
"format:check": "oxfmt --check src scripts package.json tsconfig.json tsconfig.build.json vitest.config.ts .oxlintrc.json .oxfmtrc.json",
|
|
51
|
+
"lint": "oxlint",
|
|
52
52
|
"typecheck": "tsc -p tsconfig.json",
|
|
53
|
-
"build": "
|
|
54
|
-
"postbuild": "node -e \"require('node:fs').chmodSync('dist/cli.js', 0o755)\"",
|
|
53
|
+
"build": "node scripts/build.mjs --clean --declarations --plugin",
|
|
55
54
|
"test": "npm run build && vitest run",
|
|
56
|
-
"checks": "node scripts/
|
|
55
|
+
"checks": "node scripts/checks.mjs",
|
|
56
|
+
"checks:release": "node scripts/current-qualification.mjs",
|
|
57
57
|
"checks:fast": "node scripts/checks.mjs --fast",
|
|
58
58
|
"checks:producer": "node scripts/current-qualification.mjs --producer-only",
|
|
59
59
|
"checks:resume": "node scripts/current-qualification.mjs"
|
|
@@ -72,10 +72,11 @@
|
|
|
72
72
|
"devDependencies": {
|
|
73
73
|
"@types/node": "^25.9.1",
|
|
74
74
|
"@types/proper-lockfile": "^4.1.4",
|
|
75
|
+
"esbuild": "0.28.2",
|
|
75
76
|
"oxfmt": "0.70.0",
|
|
76
77
|
"oxlint": "1.85.0",
|
|
77
78
|
"oxlint-tsgolint": "7.0.2003",
|
|
78
|
-
"typescript": "
|
|
79
|
+
"typescript": "7.0.2",
|
|
79
80
|
"vitest": "5.0.1"
|
|
80
81
|
},
|
|
81
82
|
"engines": {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ai-delivery",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.37",
|
|
4
4
|
"description": "GitHub issue and pull request delivery tools for prepared worktrees and evidence-based handoff.",
|
|
5
5
|
"author": { "name": "AviaraTech", "url": "https://github.com/aviaratech" },
|
|
6
6
|
"homepage": "https://github.com/aviaratech/ai-delivery#readme",
|
|
7
7
|
"repository": "https://github.com/aviaratech/ai-delivery",
|
|
8
8
|
"license": "MIT",
|
|
9
9
|
"deliveryCapabilityVersion": 2,
|
|
10
|
-
"packageVersion": "0.3.
|
|
10
|
+
"packageVersion": "0.3.37"
|
|
11
11
|
}
|