gentle-pi 2.6.0 → 2.6.2
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 +183 -943
- package/contracts/review-provider-contract-mirror/provider-contract.lock.json +9 -8
- package/contracts/review-provider-contract-mirror/v1.2.0/bundle/manifest.json +3 -3
- package/contracts/review-provider-contract-mirror/v1.2.0/bundle/orchestration/pi.md +7 -2
- package/contracts/review-provider-contract-mirror/v1.2.0/bundle/schemas/lens.schema.json +2 -2
- package/contracts/review-provider-contract-mirror/v1.2.0/bundle/schemas/targeted-validator.schema.json +1 -1
- package/contracts/review-provider-contract-mirror/v1.2.0/generated/provider-capabilities.baseline.json +1 -1
- package/contracts/review-provider-contract-mirror/v1.2.0/generated/provider-roles.baseline.json +2 -2
- package/contracts/telemetry/runtime-aggregate-v1.schema.json +8 -6
- package/docs/assets/brand/gentle-pi-banner.png +0 -0
- package/docs/assets/brand/gentle-pi-banner.svg +33 -0
- package/docs/assets/brand/terminal-divider.svg +17 -0
- package/docs/assets/diagrams/agent-orchestration.svg +19 -0
- package/docs/assets/diagrams/gentleman-workflow.svg +15 -0
- package/docs/assets/diagrams/native-review.svg +16 -0
- package/docs/assets/diagrams/sdd-cycle.svg +14 -0
- package/docs/assets/features/gentle-shell.png +0 -0
- package/docs/gentle-shell.md +151 -0
- package/docs/readme-reference.md +868 -0
- package/extensions/gentle-agents.ts +4 -5
- package/extensions/gentle-ai.ts +65 -22
- package/extensions/runtime-metrics.ts +10 -19
- package/lib/agents-history.ts +7 -1
- package/lib/native-review-cli.ts +14 -0
- package/lib/runtime-metrics-children.ts +3 -5
- package/lib/runtime-metrics-native.ts +17 -9
- package/lib/runtime-metrics.ts +95 -42
- package/package.json +1 -1
- package/runtime/native-review-cli.mjs +14 -0
- package/scripts/gentle-ai-installer.mjs +10 -10
- package/scripts/types-baseline.json +1 -5
- package/scripts/verify-package-files.mjs +3 -3
- package/tests/fixtures/runtime-metrics-native-batches.json +1 -1
- package/tests/gentle-agents.test.ts +22 -6
- package/tests/gentle-ai-binary.test.ts +1 -1
- package/tests/gentle-ai-installer.test.ts +47 -47
- package/tests/gentle-ai.test.ts +3 -2
- package/tests/native-review-capability-contract.test.ts +24 -1
- package/tests/package-manifest.test.ts +19 -18
- package/tests/review-authority-recovery-docs.test.ts +13 -13
- package/tests/review-controller-native-routing.test.ts +49 -0
- package/tests/review-ledger-contract.test.ts +7 -5
- package/tests/runtime-metrics-children.test.ts +4 -3
- package/tests/runtime-metrics-extension.test.ts +40 -31
- package/tests/runtime-metrics-model.test.ts +76 -0
- package/tests/runtime-metrics-native.test.ts +73 -7
- package/tests/runtime-metrics.test.ts +22 -19
- package/tests/sdd-managed-runtime-settlement.test.ts +37 -0
- package/tests/sdd-selection-transport.test.ts +57 -0
- package/tests/skill-collision-prefixes.test.ts +2 -2
- package/lib/runtime-metrics-pi-identity.ts +0 -113
- package/tests/runtime-metrics-pi-identity.test.ts +0 -113
|
@@ -36,7 +36,7 @@ const WINDOWS_SYSTEM_ROOT = "C:\\Windows";
|
|
|
36
36
|
// version check below) derives from this constant instead of repeating the
|
|
37
37
|
// literal, so a pin bump cannot leave a stale copy behind. See
|
|
38
38
|
// scripts/install-gentle-ai.mjs for the incident that motivated this.
|
|
39
|
-
export const INSTALLER_VERSION = "2.8.
|
|
39
|
+
export const INSTALLER_VERSION = "2.8.2";
|
|
40
40
|
export const RELEASE_BASE_URL = `https://github.com/Gentleman-Programming/gentle-ai/releases/download/v${INSTALLER_VERSION}/`;
|
|
41
41
|
export const GENTLE_AI_INSTALL_METHOD = Object.freeze({
|
|
42
42
|
SIGNED_RELEASE_ASSET: "signed-release-asset",
|
|
@@ -45,10 +45,10 @@ export const GENTLE_AI_INSTALL_METHOD = Object.freeze({
|
|
|
45
45
|
export const GENTLE_AI_WINDOWS_SOURCE_PACKAGE_PATH = "github.com/gentleman-programming/gentle-ai/v2/cmd/gentle-ai";
|
|
46
46
|
export const GENTLE_AI_WINDOWS_SOURCE_MODULE = "github.com/gentleman-programming/gentle-ai/v2";
|
|
47
47
|
export const GENTLE_AI_WINDOWS_SOURCE_TAG = `v${INSTALLER_VERSION}`;
|
|
48
|
-
// `go mod download -json github.com/gentleman-programming/gentle-ai/v2@v2.8.
|
|
48
|
+
// `go mod download -json github.com/gentleman-programming/gentle-ai/v2@v2.8.2`
|
|
49
49
|
// with GOSUMDB=sum.golang.org reports this exact module SumDB checksum, and the
|
|
50
|
-
// tag resolves to commit
|
|
51
|
-
export const GENTLE_AI_WINDOWS_SOURCE_MODULE_CHECKSUM = "h1:
|
|
50
|
+
// tag resolves to commit e3f53de6, the published v2.8.2 release head.
|
|
51
|
+
export const GENTLE_AI_WINDOWS_SOURCE_MODULE_CHECKSUM = "h1:54VJ0ruRiPc6MbNw4iFmlcBkQFOyF5D8iHY0A54Ivug=";
|
|
52
52
|
export const GENTLE_AI_WINDOWS_SOURCE_PACKAGE = `${GENTLE_AI_WINDOWS_SOURCE_PACKAGE_PATH}@${GENTLE_AI_WINDOWS_SOURCE_TAG}`;
|
|
53
53
|
export const GENTLE_AI_WINDOWS_MINIMUM_GO_VERSION = "1.25.10";
|
|
54
54
|
export const GENTLE_AI_GO_TOOLCHAIN_UNAVAILABLE_CODE = "GENTLE_AI_GO_TOOLCHAIN_UNAVAILABLE";
|
|
@@ -67,7 +67,7 @@ export class GentleAiInstallerError extends Error {
|
|
|
67
67
|
// Sentinel used while a re-pinned gentle-ai release is not yet published. A
|
|
68
68
|
// sentinel digest can never match a real SHA-256, so installation fails closed,
|
|
69
69
|
// and verify-package-files.mjs refuses to pack/publish while any digest below
|
|
70
|
-
// still holds it. The v2.8.
|
|
70
|
+
// still holds it. The v2.8.2 digests are pinned from the published release:
|
|
71
71
|
// archive sha256 values verified against the minisign-signed checksums.txt and
|
|
72
72
|
// freshly computed hashes; binary sha256 values computed from the extracted
|
|
73
73
|
// executables.
|
|
@@ -109,15 +109,15 @@ async function downloadPinnedGentleAiAsset(asset, destination, options) {
|
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
// Windows is absent from signed release archives on purpose. gentle-ai stopped
|
|
112
|
-
// distributing unsigned Windows builds in c4b764d0, so v2.8.
|
|
112
|
+
// distributing unsigned Windows builds in c4b764d0, so v2.8.2 publishes signed
|
|
113
113
|
// Darwin/Linux archives only. Windows x64/arm64 uses the separately verified
|
|
114
114
|
// exact-tag Go SumDB source-build path below; restore archive rows only when
|
|
115
115
|
// upstream ships signed Windows assets.
|
|
116
116
|
export const GENTLE_AI_RELEASE_ASSETS = Object.freeze({
|
|
117
|
-
"darwin/amd64": asset("gentle-ai_2.8.
|
|
118
|
-
"darwin/arm64": asset("gentle-ai_2.8.
|
|
119
|
-
"linux/amd64": asset("gentle-ai_2.8.
|
|
120
|
-
"linux/arm64": asset("gentle-ai_2.8.
|
|
117
|
+
"darwin/amd64": asset("gentle-ai_2.8.2_darwin_amd64.tar.gz", "0daa28897e6e54ce584f12ccefebf0d0df84e4ea8fbbd3a07e596ca82b079fa2", "17069156869ceda8e23eaa4fe5d7565cd57c1d78528f121dabba7301b82a0c14", "gentle-ai"),
|
|
118
|
+
"darwin/arm64": asset("gentle-ai_2.8.2_darwin_arm64.tar.gz", "12265017e0fb6d5dd1ddb1751f188fa8c47d95a95d7c7515ae174394da5f6e97", "491542e4b60e432048d4074f21c1b04417b980cf77eb34cd0a2e7447ca57dd77", "gentle-ai"),
|
|
119
|
+
"linux/amd64": asset("gentle-ai_2.8.2_linux_amd64.tar.gz", "5b95b184606168685a4ff576c103b051ceb23346a7f81ba557e047fa4d744146", "a55f4d2e114128866810c25195e5efecdded4502660e9a9c35c0b7a41c909dd8", "gentle-ai"),
|
|
120
|
+
"linux/arm64": asset("gentle-ai_2.8.2_linux_arm64.tar.gz", "a33c91ca0f5c5c85a4fd69f5169138089eb53e0a92c6ab80de5094d0688debb7", "e2759aca09ffe97638e984491319e43c9477d1ae117726ecbdf20d29d44c8950", "gentle-ai"),
|
|
121
121
|
});
|
|
122
122
|
|
|
123
123
|
// A pinned asset is either a signed archive or, for a prerelease pin only,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"note": "Recorded TypeScript diagnostics. Regenerate with `node scripts/check-types.mjs --update` after fixing or deliberately accepting diagnostics. This file may only shrink without a review decision.",
|
|
3
|
-
"total":
|
|
3
|
+
"total": 200,
|
|
4
4
|
"byFileAndCode": {
|
|
5
5
|
"extensions/codegraph-tools.ts TS2339": 1,
|
|
6
6
|
"extensions/codegraph-tools.ts TS2345": 1,
|
|
@@ -36,8 +36,6 @@
|
|
|
36
36
|
"tests/agents-runner-process.test.ts TS2322": 1,
|
|
37
37
|
"tests/devbinary/native-review-parity.devtest.ts TS2339": 1,
|
|
38
38
|
"tests/devbinary/pi-host-relay.devtest.ts TS2339": 3,
|
|
39
|
-
"tests/gentle-agents.test.ts TS2339": 1,
|
|
40
|
-
"tests/gentle-agents.test.ts TS2352": 2,
|
|
41
39
|
"tests/gentle-ai-binary.test.ts TS2339": 2,
|
|
42
40
|
"tests/gentle-ai-installer.test.ts TS2339": 7,
|
|
43
41
|
"tests/gentle-ai-installer.test.ts TS2556": 1,
|
|
@@ -87,8 +85,6 @@
|
|
|
87
85
|
"tests/runtime-metrics-extension.test.ts TS2345": 1,
|
|
88
86
|
"tests/sdd-preflight.test.ts TS2352": 1,
|
|
89
87
|
"tests/sdd-preflight.test.ts TS2554": 2,
|
|
90
|
-
"tests/sdd-research-capabilities.test.ts TS2339": 1,
|
|
91
|
-
"tests/sdd-research-capabilities.test.ts TS2698": 1,
|
|
92
88
|
"tests/sdd-research-live.test.ts TS2322": 1,
|
|
93
89
|
"tests/shell-sidebar-layout.test.ts TS2339": 1,
|
|
94
90
|
"tests/shell-sidebar-layout.test.ts TS2345": 1,
|
|
@@ -181,7 +181,7 @@ const contractHashes = {
|
|
|
181
181
|
"contracts/review-integration/v2/schemas/repair.schema.json": "98a85fd45a8ae7f6211ffeeb3f9c478fa1dd1c17f385751f15f2111e6c3ab167",
|
|
182
182
|
"contracts/review-integration/v2/schemas/start.schema.json": "2991e3fcca672d9257d61b6a336fb34e58b15a8e03f8a09a7adf892cae6a8085",
|
|
183
183
|
"contracts/review-integration/v2/schemas/status.schema.json": "c4dcc736cfc6300560a3c4262d2d982368529d5c49d58d499552a3b0beef9212",
|
|
184
|
-
"contracts/telemetry/runtime-aggregate-v1.schema.json": "
|
|
184
|
+
"contracts/telemetry/runtime-aggregate-v1.schema.json": "eb0f2993d9271f55cb42eca343e6fbb601a733fb90bd40daeebc92ee60ae1ba9",
|
|
185
185
|
"docs/review-integration.md": "95a3df92785bc4d9f3b99e702aaf817ae0440bd16c83218d2c3f2aca67c280fb",
|
|
186
186
|
};
|
|
187
187
|
|
|
@@ -340,7 +340,7 @@ async function main() {
|
|
|
340
340
|
});
|
|
341
341
|
|
|
342
342
|
if (driftedContracts.length > 0) {
|
|
343
|
-
console.error("gentle-pi packaged review-integration/v1 and review-integration/v2 contract bytes drifted from the pinned v2.8.
|
|
343
|
+
console.error("gentle-pi packaged review-integration/v1 and review-integration/v2 contract bytes drifted from the pinned v2.8.2 runtime's vendored Gentle AI contract artifacts:");
|
|
344
344
|
for (const drift of driftedContracts) console.error(`- ${drift.relativePath}: expected ${drift.expected}, got ${drift.actual}`);
|
|
345
345
|
process.exit(1);
|
|
346
346
|
}
|
|
@@ -385,7 +385,7 @@ async function main() {
|
|
|
385
385
|
process.exit(1);
|
|
386
386
|
}
|
|
387
387
|
|
|
388
|
-
console.log(`gentle-pi package resource check passed (${requiredPaths.length} files; ${Object.keys(contractHashes).length} exact byte-pinned contract artifacts for the v2.8.
|
|
388
|
+
console.log(`gentle-pi package resource check passed (${requiredPaths.length} files; ${Object.keys(contractHashes).length} exact byte-pinned contract artifacts for the v2.8.2 runtime).`);
|
|
389
389
|
}
|
|
390
390
|
|
|
391
391
|
const isMainModule = process.argv[1] !== undefined && import.meta.url === pathToFileURL(process.argv[1]).href;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"schema_sha256": "
|
|
2
|
+
"schema_sha256": "eb0f2993d9271f55cb42eca343e6fbb601a733fb90bd40daeebc92ee60ae1ba9",
|
|
3
3
|
"batches": [
|
|
4
4
|
"{\"schema\":\"gentle-ai.telemetry-runtime-aggregate/v1\",\"registry\":1,\"host\":\"pi\",\"rows\":[{\"model\":{\"provider\":\"openai\",\"id\":\"gpt-5.4\"},\"model_evidence\":\"response\",\"agent_kind\":\"built_in\",\"agent_class\":\"worker\",\"selected_effort\":\"high\",\"effective_effort\":\"low\",\"launches\":null,\"responses\":1,\"input_tokens\":{\"reported\":1,\"unavailable\":0,\"unsupported\":0,\"sum\":7},\"output_tokens\":{\"reported\":1,\"unavailable\":0,\"unsupported\":0,\"sum\":7},\"cache_read_tokens\":{\"reported\":1,\"unavailable\":0,\"unsupported\":0,\"sum\":7},\"cache_creation_tokens\":{\"reported\":1,\"unavailable\":0,\"unsupported\":0,\"sum\":7},\"reasoning_tokens\":{\"reported\":1,\"unavailable\":0,\"unsupported\":0,\"sum\":7},\"total_tokens\":{\"reported\":1,\"unavailable\":0,\"unsupported\":0,\"sum\":7},\"error_category\":\"none\",\"duration\":{\"kind\":\"unavailable\",\"measured_count\":0,\"sum_ms\":null}}]}"
|
|
5
5
|
]
|
|
@@ -369,11 +369,6 @@ for (const boundary of ["allowed", "env", "session", "replacement", "bus-throws"
|
|
|
369
369
|
});
|
|
370
370
|
const h = fakePi();
|
|
371
371
|
const runtime = deps();
|
|
372
|
-
let catalogAttempts = 0;
|
|
373
|
-
if (boundary === "allowed") runtime.deps.lookupPiCatalogName = () => {
|
|
374
|
-
catalogAttempts++;
|
|
375
|
-
return new Promise(() => {});
|
|
376
|
-
};
|
|
377
372
|
const context = fakeContext();
|
|
378
373
|
const spawn = runtime.deps.spawn!;
|
|
379
374
|
runtime.deps.spawn = (...args) => {
|
|
@@ -408,7 +403,6 @@ for (const boundary of ["allowed", "env", "session", "replacement", "bus-throws"
|
|
|
408
403
|
const result = h.tools.get("subagent_run")!.execute("call", { agent: "gentle-ai-worker", task: "private task", mode: "task" }, undefined, undefined, context.ctx);
|
|
409
404
|
await tick();
|
|
410
405
|
assert.equal(runtime.children.length, 1);
|
|
411
|
-
if (boundary === "allowed") assert.equal(catalogAttempts, 1, "child launch does not await catalog loading");
|
|
412
406
|
const child = runtime.children[0];
|
|
413
407
|
const launchedCalls = calls;
|
|
414
408
|
for (let i = 0; i < 10; i++) child.emit({ type: "message_update", assistantMessageEvent: { type: "text_delta", delta: "private streamed text" } });
|
|
@@ -2166,3 +2160,25 @@ test("R3/R4 host reload refuses retained acquire/actor uncertainty without anoth
|
|
|
2166
2160
|
await h.fire("session_shutdown", ctx);
|
|
2167
2161
|
}
|
|
2168
2162
|
});
|
|
2163
|
+
|
|
2164
|
+
test("R3/R4 a known native-blocked settlement lets native admission decide the next attempt; an uncertain one still refuses locally", async () => {
|
|
2165
|
+
for (const uncertain of [false, true]) {
|
|
2166
|
+
const h = fakePi(), runtime = deps(), fixtureHome = join(root, `remediation-settlement-${uncertain}`);
|
|
2167
|
+
mkdirSync(join(fixtureHome, ".pi", "agent", "agents"), { recursive: true });
|
|
2168
|
+
writeFileSync(join(fixtureHome, ".pi", "agent", "agents", "sdd-remediate.md"), readFileSync("assets/agents/sdd-remediate.md"));
|
|
2169
|
+
const revision = `sha256:${"a".repeat(64)}`;
|
|
2170
|
+
const acquire = { workspaceRoot: cwd, changeName: "alpha", requestId: "retained", workUnit: "correct", evidenceGoal: "Observed correction", remediatesEvidenceRevision: revision };
|
|
2171
|
+
await saveTask(historyDir(fixtureHome), { id: "retained", agent: "sdd-remediate", cwd, status: "failed", createdAt: 1, sddRemediation: uncertain
|
|
2172
|
+
? { acquire, settlementUncertain: true, settle: { requestId: "exact" } }
|
|
2173
|
+
: { acquire, settlement: { state: "blocked", reason: "maintainer_decision" } } } as never, emptyThread());
|
|
2174
|
+
let acquisitions = 0, confirmations = 0;
|
|
2175
|
+
gentleAgents(h.pi, {}, { ...runtime.deps, home: fixtureHome, nativeSdd: { sddStatus: async () => ({ schemaName: "gentle-ai.sdd-status", schemaVersion: 2, changeName: "alpha", artifactStore: "openspec", planningHome: { mode: "repo-local", path: join(cwd, "openspec") }, changeRoot: join(cwd, "openspec/changes/alpha"), actionContext: { mode: "repo-local", workspaceRoot: cwd, allowedEditRoots: [cwd] }, dependencies: Object.fromEntries(["proposal", "specs", "design", "tasks", "apply", "verify", "archive"].map(key => [key, "ready"])), phaseInstructions: { apply: [], verify: [], remediate: ["Correct evidence"], archive: [] }, blockedReasons: [], nextRecommended: "remediate", remediationState: { required: true, complete: false, failedEvidenceRevision: revision } }), sddAttemptSettle: async () => ({ state: "proceed" as const }), sddAttemptAcquire: async () => { acquisitions++; return { state: "blocked" }; } } as unknown as NativeReviewCli });
|
|
2176
|
+
const { ctx } = fakeContext(fakeTui, async () => { confirmations++; return true; });
|
|
2177
|
+
await h.fire("session_start", ctx);
|
|
2178
|
+
await assert.rejects(h.tools.get("subagent_run").execute("again", { agent: "sdd-remediate", task: "Correct alpha", context: PARENT_CONFIRMED_SDD_CONTEXT, mode: "background", sdd_change: { changeName: "alpha", workspaceRoot: cwd, phase: "remediate", failedEvidenceRevision: revision }, remediation: { attempt: { ...acquire, requestId: "different" }, plan: { cwd, commands: ["pnpm test"], runtimeHarness: { naReason: "Not applicable because this fixture has no runtime boundary." }, rollback: { boundary: "Revert fixture", command: "git diff --check" } } } }, undefined, undefined, ctx), uncertain ? /reconcile exact history without actor replay/ : /no actor started/);
|
|
2179
|
+
assert.equal(acquisitions, uncertain ? 0 : 1, "native admission is consulted once local unresolved history is not uncertain");
|
|
2180
|
+
assert.equal(confirmations, uncertain ? 0 : 1);
|
|
2181
|
+
assert.equal(runtime.spawned.length, 0);
|
|
2182
|
+
await h.fire("session_shutdown", ctx);
|
|
2183
|
+
}
|
|
2184
|
+
});
|
|
@@ -97,7 +97,7 @@ async function writeWindowsSourceBinary(packageRoot: string): Promise<{ binaryPa
|
|
|
97
97
|
method: "go-sumdb-source-build",
|
|
98
98
|
package: "github.com/gentleman-programming/gentle-ai/v2/cmd/gentle-ai",
|
|
99
99
|
module: "github.com/gentleman-programming/gentle-ai/v2",
|
|
100
|
-
tag: "v2.8.
|
|
100
|
+
tag: "v2.8.2",
|
|
101
101
|
architecture: process.arch === "x64" ? "x64" : "arm64",
|
|
102
102
|
binarySha256: createHash("sha256").update(binary).digest("hex"),
|
|
103
103
|
moduleChecksum: GENTLE_AI_WINDOWS_SOURCE_MODULE_CHECKSUM,
|
|
@@ -20,14 +20,14 @@ import {
|
|
|
20
20
|
trustedSystemExtractor,
|
|
21
21
|
} from "../scripts/gentle-ai-installer.mjs";
|
|
22
22
|
|
|
23
|
-
// v2.8.
|
|
23
|
+
// v2.8.2 digests pinned from the published release: archive digests verified
|
|
24
24
|
// against the minisign-signed checksums.txt and freshly computed hashes; binary
|
|
25
25
|
// digests computed from the extracted executables.
|
|
26
26
|
const EXPECTED_ASSETS = {
|
|
27
|
-
"darwin/amd64": { name: "gentle-ai_2.8.
|
|
28
|
-
"darwin/arm64": { name: "gentle-ai_2.8.
|
|
29
|
-
"linux/amd64": { name: "gentle-ai_2.8.
|
|
30
|
-
"linux/arm64": { name: "gentle-ai_2.8.
|
|
27
|
+
"darwin/amd64": { name: "gentle-ai_2.8.2_darwin_amd64.tar.gz", sha256: "0daa28897e6e54ce584f12ccefebf0d0df84e4ea8fbbd3a07e596ca82b079fa2", binarySha256: "17069156869ceda8e23eaa4fe5d7565cd57c1d78528f121dabba7301b82a0c14" },
|
|
28
|
+
"darwin/arm64": { name: "gentle-ai_2.8.2_darwin_arm64.tar.gz", sha256: "12265017e0fb6d5dd1ddb1751f188fa8c47d95a95d7c7515ae174394da5f6e97", binarySha256: "491542e4b60e432048d4074f21c1b04417b980cf77eb34cd0a2e7447ca57dd77" },
|
|
29
|
+
"linux/amd64": { name: "gentle-ai_2.8.2_linux_amd64.tar.gz", sha256: "5b95b184606168685a4ff576c103b051ceb23346a7f81ba557e047fa4d744146", binarySha256: "a55f4d2e114128866810c25195e5efecdded4502660e9a9c35c0b7a41c909dd8" },
|
|
30
|
+
"linux/arm64": { name: "gentle-ai_2.8.2_linux_arm64.tar.gz", sha256: "a33c91ca0f5c5c85a4fd69f5169138089eb53e0a92c6ab80de5094d0688debb7", binarySha256: "e2759aca09ffe97638e984491319e43c9477d1ae117726ecbdf20d29d44c8950" },
|
|
31
31
|
} as const;
|
|
32
32
|
|
|
33
33
|
test("default installer package root is the package containing scripts, not its parent", () => {
|
|
@@ -38,15 +38,15 @@ test("default installer package root is the package containing scripts, not its
|
|
|
38
38
|
assert.notEqual(resolveGentleAiInstallerPackageRoot(), dirname(expectedPackageRoot));
|
|
39
39
|
});
|
|
40
40
|
|
|
41
|
-
test("release mapping selects only the supported official v2.8.
|
|
41
|
+
test("release mapping selects only the supported official v2.8.2 assets and pinned digests", () => {
|
|
42
42
|
assert.deepEqual(
|
|
43
43
|
Object.fromEntries(Object.entries(GENTLE_AI_RELEASE_ASSETS).map(([key, asset]) => [key, { name: asset.name, sha256: asset.sha256, binarySha256: asset.binarySha256 }])),
|
|
44
44
|
EXPECTED_ASSETS,
|
|
45
45
|
);
|
|
46
|
-
assert.equal(resolveGentleAiReleaseAsset("linux", "x64").name, "gentle-ai_2.8.
|
|
47
|
-
assert.equal(resolveGentleAiReleaseAsset("darwin", "arm64").name, "gentle-ai_2.8.
|
|
46
|
+
assert.equal(resolveGentleAiReleaseAsset("linux", "x64").name, "gentle-ai_2.8.2_linux_amd64.tar.gz");
|
|
47
|
+
assert.equal(resolveGentleAiReleaseAsset("darwin", "arm64").name, "gentle-ai_2.8.2_darwin_arm64.tar.gz");
|
|
48
48
|
for (const asset of Object.values(GENTLE_AI_RELEASE_ASSETS)) {
|
|
49
|
-
assert.match(asset.url, /^https:\/\/github\.com\/Gentleman-Programming\/gentle-ai\/releases\/download\/v2\.8\.
|
|
49
|
+
assert.match(asset.url, /^https:\/\/github\.com\/Gentleman-Programming\/gentle-ai\/releases\/download\/v2\.8\.2\//);
|
|
50
50
|
}
|
|
51
51
|
});
|
|
52
52
|
|
|
@@ -56,7 +56,7 @@ test("raw release assets are admitted only under a prerelease pin", () => {
|
|
|
56
56
|
assert.equal(gentleAiAssetForm("gentle-ai_2.5.0-rc.3_windows_amd64.exe", "2.5.0-rc.3"), "raw-binary");
|
|
57
57
|
// A raw binary under a stable pin means the pin itself is wrong: stable
|
|
58
58
|
// releases publish signed archives only, so this fails closed pre-download.
|
|
59
|
-
assert.throws(() => gentleAiAssetForm("gentle-ai_2.8.
|
|
59
|
+
assert.throws(() => gentleAiAssetForm("gentle-ai_2.8.2_linux_amd64", "2.8.2"), /only admitted for a prerelease pin/);
|
|
60
60
|
assert.throws(() => gentleAiAssetForm("gentle-ai.dmg", "2.5.0-rc.3"), /unsupported Gentle AI release asset form/);
|
|
61
61
|
// The current stable pin admits every pinned asset row through the same
|
|
62
62
|
// gate the installer uses at download time (default installerVersion
|
|
@@ -83,7 +83,7 @@ test("release digests are all-or-none and install fails closed while any digest
|
|
|
83
83
|
}),
|
|
84
84
|
/checksum mismatch/,
|
|
85
85
|
);
|
|
86
|
-
assert.equal(existsSync(join(packageRoot, ".gentle-ai", "v2.8.
|
|
86
|
+
assert.equal(existsSync(join(packageRoot, ".gentle-ai", "v2.8.2", "gentle-ai")), false);
|
|
87
87
|
}
|
|
88
88
|
});
|
|
89
89
|
|
|
@@ -112,7 +112,7 @@ function windowsGoFixture(fixtureOptions: WindowsGoFixtureOptions = {}) {
|
|
|
112
112
|
const metadata = [
|
|
113
113
|
"gentle-ai.exe: go1.25.10",
|
|
114
114
|
"\tpath\tgithub.com/gentleman-programming/gentle-ai/v2/cmd/gentle-ai",
|
|
115
|
-
`\tmod\tgithub.com/gentleman-programming/gentle-ai/v2\tv2.8.
|
|
115
|
+
`\tmod\tgithub.com/gentleman-programming/gentle-ai/v2\tv2.8.2\t${GENTLE_AI_WINDOWS_SOURCE_MODULE_CHECKSUM}`,
|
|
116
116
|
"\tbuild\t-buildmode=exe", "\tbuild\t-compiler=gc", "\tbuild\tCGO_ENABLED=0", `\tbuild\tGOARCH=${fixtureOptions.goArchitecture ?? "amd64"}`, "\tbuild\tGOOS=windows",
|
|
117
117
|
].join("\n");
|
|
118
118
|
const run = async (file: string, arguments_: string[], options: WindowsGoCall["options"]) => {
|
|
@@ -130,7 +130,7 @@ function windowsGoFixture(fixtureOptions: WindowsGoFixtureOptions = {}) {
|
|
|
130
130
|
return { stdout: "", stderr: "" };
|
|
131
131
|
}
|
|
132
132
|
if (file === goExecutable && arguments_[0] === "version" && arguments_[1] === "-m") return { stdout: metadata, stderr: "" };
|
|
133
|
-
if (arguments_.length === 1 && arguments_[0] === "version") return { stdout: fixtureOptions.reportedVersion ?? "gentle-ai 2.8.
|
|
133
|
+
if (arguments_.length === 1 && arguments_[0] === "version") return { stdout: fixtureOptions.reportedVersion ?? "gentle-ai 2.8.2\n", stderr: "" };
|
|
134
134
|
throw new Error(`unexpected command: ${file} ${arguments_.join(" ")}`);
|
|
135
135
|
};
|
|
136
136
|
return { calls, run, setGoExecutable: (path: string) => { goExecutable = path; } };
|
|
@@ -146,7 +146,7 @@ test("win32 x64 and arm64 install the exact Go SumDB source tag without archive
|
|
|
146
146
|
const result = await installGentleAi({ packageRoot, platform: "win32", arch, execFile: fixture.run, resolveGoExecutable: async () => goPath });
|
|
147
147
|
assert.equal(result.installed, true);
|
|
148
148
|
assert.deepEqual(fixture.calls.filter((call) => call.file === goPath).map((call) => call.arguments_.slice(0, 2)), [
|
|
149
|
-
["version"], ["install", "github.com/gentleman-programming/gentle-ai/v2/cmd/gentle-ai@v2.8.
|
|
149
|
+
["version"], ["install", "github.com/gentleman-programming/gentle-ai/v2/cmd/gentle-ai@v2.8.2"], ["version", "-m"],
|
|
150
150
|
]);
|
|
151
151
|
}
|
|
152
152
|
});
|
|
@@ -165,7 +165,7 @@ test("Windows source install reports missing or too-old Go without publishing a
|
|
|
165
165
|
() => installGentleAi({ packageRoot, platform: "win32", arch: "x64", execFile: fixture.run, resolveGoExecutable: async () => goPath }),
|
|
166
166
|
(error: unknown) => error instanceof Error && "code" in error && error.code === fixtureOptions.expectedCode,
|
|
167
167
|
);
|
|
168
|
-
assert.equal(existsSync(join(packageRoot, ".gentle-ai", "v2.8.
|
|
168
|
+
assert.equal(existsSync(join(packageRoot, ".gentle-ai", "v2.8.2", "gentle-ai.exe")), false);
|
|
169
169
|
assert.deepEqual((await readdir(packageRoot)).filter((entry) => entry.includes("install-")), []);
|
|
170
170
|
}
|
|
171
171
|
});
|
|
@@ -184,7 +184,7 @@ test("Windows source install cleans staging after Go failure or wrong built vers
|
|
|
184
184
|
() => installGentleAi({ packageRoot, platform: "win32", arch: "x64", execFile: fixture.run, resolveGoExecutable: async () => goPath }),
|
|
185
185
|
(error: unknown) => error instanceof Error && "code" in error && error.code === fixtureOptions.expectedCode,
|
|
186
186
|
);
|
|
187
|
-
const runtimeDirectory = join(packageRoot, ".gentle-ai", "v2.8.
|
|
187
|
+
const runtimeDirectory = join(packageRoot, ".gentle-ai", "v2.8.2");
|
|
188
188
|
assert.ok(fixture.calls.some((call) => call.arguments_[0] === "install"));
|
|
189
189
|
assert.equal(existsSync(join(runtimeDirectory, "gentle-ai.exe")), false);
|
|
190
190
|
assert.equal(existsSync(runtimeDirectory) && (await readdir(runtimeDirectory)).some((entry) => entry.startsWith(".go-install-") || entry.endsWith(".tmp")), false);
|
|
@@ -205,7 +205,7 @@ test("Windows source installs reuse only a fully verified package-local binary",
|
|
|
205
205
|
assert.equal(reused.installed, false);
|
|
206
206
|
assert.ok(reuse.calls.every((call) => call.file !== "gentle-ai"), "the installer must never fall back to ambient gentle-ai on PATH");
|
|
207
207
|
|
|
208
|
-
await writeFile(join(packageRoot, ".gentle-ai", "v2.8.
|
|
208
|
+
await writeFile(join(packageRoot, ".gentle-ai", "v2.8.2", "integrity.json"), "{}\n");
|
|
209
209
|
const repaired = windowsGoFixture();
|
|
210
210
|
repaired.setGoExecutable(goPath);
|
|
211
211
|
assert.equal((await installGentleAi({ packageRoot, platform: "win32", arch: "x64", execFile: repaired.run, resolveGoExecutable: async () => goPath })).installed, true);
|
|
@@ -247,7 +247,7 @@ async function hardenedWindowsGoFixture(packageRoot: string, fixtureOptions: Har
|
|
|
247
247
|
const metadata = fixtureOptions.metadataOverride ?? [
|
|
248
248
|
"gentle-ai.exe: go1.25.10",
|
|
249
249
|
"\tpath\tgithub.com/gentleman-programming/gentle-ai/v2/cmd/gentle-ai",
|
|
250
|
-
`\tmod\tgithub.com/gentleman-programming/gentle-ai/v2\tv2.8.
|
|
250
|
+
`\tmod\tgithub.com/gentleman-programming/gentle-ai/v2\tv2.8.2\t${GENTLE_AI_WINDOWS_SOURCE_MODULE_CHECKSUM}`,
|
|
251
251
|
"\tbuild\t-buildmode=exe",
|
|
252
252
|
"\tbuild\t-compiler=gc",
|
|
253
253
|
"\tbuild\tCGO_ENABLED=0",
|
|
@@ -267,7 +267,7 @@ async function hardenedWindowsGoFixture(packageRoot: string, fixtureOptions: Har
|
|
|
267
267
|
return { stdout: "", stderr: "" };
|
|
268
268
|
}
|
|
269
269
|
if (file === goPath && arguments_[0] === "version" && arguments_[1] === "-m") return { stdout: metadata, stderr: "" };
|
|
270
|
-
if (arguments_.length === 1 && arguments_[0] === "version") return { stdout: "gentle-ai 2.8.
|
|
270
|
+
if (arguments_.length === 1 && arguments_[0] === "version") return { stdout: "gentle-ai 2.8.2\n", stderr: "" };
|
|
271
271
|
throw new Error(`unexpected command: ${file} ${arguments_.join(" ")}`);
|
|
272
272
|
};
|
|
273
273
|
return {
|
|
@@ -309,7 +309,7 @@ test("Windows source installation resolves one validated Go executable and seals
|
|
|
309
309
|
const goCalls = fixture.calls.filter((call) => call.file === fixture.goPath);
|
|
310
310
|
assert.deepEqual(goCalls.map((call) => call.arguments_.slice(0, 2)), [
|
|
311
311
|
["version"],
|
|
312
|
-
["install", "github.com/gentleman-programming/gentle-ai/v2/cmd/gentle-ai@v2.8.
|
|
312
|
+
["install", "github.com/gentleman-programming/gentle-ai/v2/cmd/gentle-ai@v2.8.2"],
|
|
313
313
|
["version", "-m"],
|
|
314
314
|
]);
|
|
315
315
|
for (const call of goCalls) {
|
|
@@ -335,14 +335,14 @@ test("Windows source manifest binds verified Go metadata and architecture", asyn
|
|
|
335
335
|
const packageRoot = await mkdtemp(join(tmpdir(), "gentle-pi-installer-provenance-"));
|
|
336
336
|
const fixture = await hardenedWindowsGoFixture(packageRoot, { architecture: "arm64" });
|
|
337
337
|
const result = await installGentleAi({ packageRoot, platform: "win32", arch: "arm64", execFile: fixture.run, resolveGoExecutable: fixture.resolveGoExecutable });
|
|
338
|
-
const manifest = JSON.parse(await readFile(join(packageRoot, ".gentle-ai", "v2.8.
|
|
338
|
+
const manifest = JSON.parse(await readFile(join(packageRoot, ".gentle-ai", "v2.8.2", "integrity.json"), "utf8")) as Record<string, string>;
|
|
339
339
|
assert.equal(result.installed, true);
|
|
340
340
|
assert.deepEqual(manifest, {
|
|
341
|
-
version: "2.8.
|
|
341
|
+
version: "2.8.2",
|
|
342
342
|
method: "go-sumdb-source-build",
|
|
343
343
|
package: "github.com/gentleman-programming/gentle-ai/v2/cmd/gentle-ai",
|
|
344
344
|
module: "github.com/gentleman-programming/gentle-ai/v2",
|
|
345
|
-
tag: "v2.8.
|
|
345
|
+
tag: "v2.8.2",
|
|
346
346
|
architecture: "arm64",
|
|
347
347
|
binarySha256: createHash("sha256").update("trusted Windows source build").digest("hex"),
|
|
348
348
|
moduleChecksum: GENTLE_AI_WINDOWS_SOURCE_MODULE_CHECKSUM,
|
|
@@ -362,12 +362,12 @@ test("Windows source installation rejects Go metadata for a different architectu
|
|
|
362
362
|
() => installGentleAi({ packageRoot, platform: "win32", arch: "x64", execFile: fixture.run, resolveGoExecutable: fixture.resolveGoExecutable }),
|
|
363
363
|
(error: unknown) => error instanceof Error && "code" in error && error.code === "GENTLE_AI_GO_INSTALL_FAILED",
|
|
364
364
|
);
|
|
365
|
-
assert.equal(existsSync(join(packageRoot, ".gentle-ai", "v2.8.
|
|
365
|
+
assert.equal(existsSync(join(packageRoot, ".gentle-ai", "v2.8.2", "gentle-ai.exe")), false);
|
|
366
366
|
});
|
|
367
367
|
|
|
368
368
|
test("Windows source installation treats a fresh ownerless lock as active", async () => {
|
|
369
369
|
const packageRoot = await mkdtemp(join(tmpdir(), "gentle-pi-installer-ownerless-lock-"));
|
|
370
|
-
const lockPath = join(packageRoot, ".gentle-ai", ".v2.8.
|
|
370
|
+
const lockPath = join(packageRoot, ".gentle-ai", ".v2.8.2.install.lock");
|
|
371
371
|
await mkdir(lockPath, { recursive: true });
|
|
372
372
|
const fixture = await hardenedWindowsGoFixture(packageRoot);
|
|
373
373
|
await assertManualLockRecoveryRequired(packageRoot, fixture);
|
|
@@ -375,7 +375,7 @@ test("Windows source installation treats a fresh ownerless lock as active", asyn
|
|
|
375
375
|
|
|
376
376
|
test("Windows source installation preserves a lock whose owner nonce changed before release", async () => {
|
|
377
377
|
const packageRoot = await mkdtemp(join(tmpdir(), "gentle-pi-installer-owner-lock-"));
|
|
378
|
-
const lockOwnerPath = join(packageRoot, ".gentle-ai", ".v2.8.
|
|
378
|
+
const lockOwnerPath = join(packageRoot, ".gentle-ai", ".v2.8.2.install.lock", "owner.json");
|
|
379
379
|
const fixture = await hardenedWindowsGoFixture(packageRoot);
|
|
380
380
|
let replacedOwner = false;
|
|
381
381
|
const run = async (...arguments_: Parameters<typeof fixture.run>) => {
|
|
@@ -392,7 +392,7 @@ test("Windows source installation preserves a lock whose owner nonce changed bef
|
|
|
392
392
|
});
|
|
393
393
|
|
|
394
394
|
async function assertManualLockRecoveryRequired(packageRoot: string, fixture: Awaited<ReturnType<typeof hardenedWindowsGoFixture>>, options: Record<string, unknown> = {}) {
|
|
395
|
-
const lockPath = join(packageRoot, ".gentle-ai", ".v2.8.
|
|
395
|
+
const lockPath = join(packageRoot, ".gentle-ai", ".v2.8.2.install.lock");
|
|
396
396
|
await assert.rejects(
|
|
397
397
|
() => installGentleAi({ packageRoot, platform: "win32", arch: "x64", execFile: fixture.run, resolveGoExecutable: fixture.resolveGoExecutable, ...options }),
|
|
398
398
|
(error: unknown) => error instanceof Error && error.message.includes(lockPath) && /confirm no installer is active.*remove.*manually/i.test(error.message),
|
|
@@ -402,18 +402,18 @@ async function assertManualLockRecoveryRequired(packageRoot: string, fixture: Aw
|
|
|
402
402
|
}
|
|
403
403
|
|
|
404
404
|
function tombstonePath(packageRoot: string, nonce: string): string {
|
|
405
|
-
return join(packageRoot, ".gentle-ai", `.v2.8.
|
|
405
|
+
return join(packageRoot, ".gentle-ai", `.v2.8.2.install.tombstone-${nonce}`);
|
|
406
406
|
}
|
|
407
407
|
|
|
408
408
|
async function tombstones(packageRoot: string): Promise<string[]> {
|
|
409
409
|
const runtimeRoot = join(packageRoot, ".gentle-ai");
|
|
410
410
|
return existsSync(runtimeRoot)
|
|
411
|
-
? (await readdir(runtimeRoot)).filter((entry) => entry.startsWith(".v2.8.
|
|
411
|
+
? (await readdir(runtimeRoot)).filter((entry) => entry.startsWith(".v2.8.2.install.tombstone-"))
|
|
412
412
|
: [];
|
|
413
413
|
}
|
|
414
414
|
|
|
415
415
|
function backupBundlePath(packageRoot: string, nonce: string): string {
|
|
416
|
-
return join(packageRoot, ".gentle-ai", `.v2.8.
|
|
416
|
+
return join(packageRoot, ".gentle-ai", `.v2.8.2.backup-${nonce}`);
|
|
417
417
|
}
|
|
418
418
|
|
|
419
419
|
async function copyWindowsBundle(source: string, destination: string): Promise<void> {
|
|
@@ -424,7 +424,7 @@ async function copyWindowsBundle(source: string, destination: string): Promise<v
|
|
|
424
424
|
|
|
425
425
|
test("Windows source installation fails closed for an ownerless lock even after the stale threshold", async () => {
|
|
426
426
|
const packageRoot = await mkdtemp(join(tmpdir(), "gentle-pi-installer-ownerless-stale-lock-"));
|
|
427
|
-
const lockPath = join(packageRoot, ".gentle-ai", ".v2.8.
|
|
427
|
+
const lockPath = join(packageRoot, ".gentle-ai", ".v2.8.2.install.lock");
|
|
428
428
|
await mkdir(lockPath, { recursive: true });
|
|
429
429
|
const fixture = await hardenedWindowsGoFixture(packageRoot);
|
|
430
430
|
await assertManualLockRecoveryRequired(packageRoot, fixture, { now: () => Date.now() + 10 * 60_000 });
|
|
@@ -432,7 +432,7 @@ test("Windows source installation fails closed for an ownerless lock even after
|
|
|
432
432
|
|
|
433
433
|
test("Windows source installation fails closed for a stale owner lock", async () => {
|
|
434
434
|
const packageRoot = await mkdtemp(join(tmpdir(), "gentle-pi-installer-stale-lock-"));
|
|
435
|
-
const lockPath = join(packageRoot, ".gentle-ai", ".v2.8.
|
|
435
|
+
const lockPath = join(packageRoot, ".gentle-ai", ".v2.8.2.install.lock");
|
|
436
436
|
await mkdir(lockPath, { recursive: true });
|
|
437
437
|
await writeFile(join(lockPath, "owner.json"), `${JSON.stringify({ createdAt: 0, nonce: "0".repeat(64) })}\n`);
|
|
438
438
|
const fixture = await hardenedWindowsGoFixture(packageRoot);
|
|
@@ -484,7 +484,7 @@ test("Windows source acquisition fails closed when a tombstone appears after its
|
|
|
484
484
|
(error: unknown) => error instanceof Error && error.message.includes(foreignTombstone),
|
|
485
485
|
);
|
|
486
486
|
assert.equal(existsSync(foreignTombstone), true);
|
|
487
|
-
assert.equal(existsSync(join(packageRoot, ".gentle-ai", ".v2.8.
|
|
487
|
+
assert.equal(existsSync(join(packageRoot, ".gentle-ai", ".v2.8.2.install.lock")), false);
|
|
488
488
|
assert.equal(fixture.calls.some((call) => call.arguments_[0] === "install"), false);
|
|
489
489
|
});
|
|
490
490
|
|
|
@@ -492,7 +492,7 @@ test("Windows source release deletes its matching tombstone and allows reuse", a
|
|
|
492
492
|
const packageRoot = await mkdtemp(join(tmpdir(), "gentle-pi-installer-owned-lock-release-"));
|
|
493
493
|
const fixture = await hardenedWindowsGoFixture(packageRoot);
|
|
494
494
|
await installGentleAi({ packageRoot, platform: "win32", arch: "x64", execFile: fixture.run, resolveGoExecutable: fixture.resolveGoExecutable });
|
|
495
|
-
assert.equal(existsSync(join(packageRoot, ".gentle-ai", ".v2.8.
|
|
495
|
+
assert.equal(existsSync(join(packageRoot, ".gentle-ai", ".v2.8.2.install.lock")), false);
|
|
496
496
|
assert.deepEqual(await tombstones(packageRoot), []);
|
|
497
497
|
const reuse = await hardenedWindowsGoFixture(packageRoot);
|
|
498
498
|
assert.equal((await installGentleAi({ packageRoot, platform: "win32", arch: "x64", execFile: reuse.run, resolveGoExecutable: reuse.resolveGoExecutable })).installed, false);
|
|
@@ -502,7 +502,7 @@ test("Windows source recovers a valid backup after a crash between publication r
|
|
|
502
502
|
const packageRoot = await mkdtemp(join(tmpdir(), "gentle-pi-installer-backup-crash-"));
|
|
503
503
|
const initial = await hardenedWindowsGoFixture(packageRoot);
|
|
504
504
|
await installGentleAi({ packageRoot, platform: "win32", arch: "x64", execFile: initial.run, resolveGoExecutable: initial.resolveGoExecutable });
|
|
505
|
-
const live = join(packageRoot, ".gentle-ai", "v2.8.
|
|
505
|
+
const live = join(packageRoot, ".gentle-ai", "v2.8.2");
|
|
506
506
|
const backup = backupBundlePath(packageRoot, "crash");
|
|
507
507
|
await rename(live, backup);
|
|
508
508
|
const recovery = await hardenedWindowsGoFixture(packageRoot);
|
|
@@ -538,7 +538,7 @@ test("Windows source cleans one validated backup only when the live bundle is va
|
|
|
538
538
|
const packageRoot = await mkdtemp(join(tmpdir(), "gentle-pi-installer-backup-valid-live-"));
|
|
539
539
|
const initial = await hardenedWindowsGoFixture(packageRoot);
|
|
540
540
|
await installGentleAi({ packageRoot, platform: "win32", arch: "x64", execFile: initial.run, resolveGoExecutable: initial.resolveGoExecutable });
|
|
541
|
-
const live = join(packageRoot, ".gentle-ai", "v2.8.
|
|
541
|
+
const live = join(packageRoot, ".gentle-ai", "v2.8.2");
|
|
542
542
|
const backup = backupBundlePath(packageRoot, "valid");
|
|
543
543
|
await copyWindowsBundle(live, backup);
|
|
544
544
|
const reuse = await hardenedWindowsGoFixture(packageRoot);
|
|
@@ -551,7 +551,7 @@ test("Windows source preserves a valid backup when the live bundle is invalid",
|
|
|
551
551
|
const packageRoot = await mkdtemp(join(tmpdir(), "gentle-pi-installer-backup-invalid-live-"));
|
|
552
552
|
const initial = await hardenedWindowsGoFixture(packageRoot);
|
|
553
553
|
await installGentleAi({ packageRoot, platform: "win32", arch: "x64", execFile: initial.run, resolveGoExecutable: initial.resolveGoExecutable });
|
|
554
|
-
const live = join(packageRoot, ".gentle-ai", "v2.8.
|
|
554
|
+
const live = join(packageRoot, ".gentle-ai", "v2.8.2");
|
|
555
555
|
const backup = backupBundlePath(packageRoot, "valid");
|
|
556
556
|
await copyWindowsBundle(live, backup);
|
|
557
557
|
await writeFile(join(live, "integrity.json"), "{}\n");
|
|
@@ -569,7 +569,7 @@ test("Windows concurrent installs fail closed until normal release, then reuse t
|
|
|
569
569
|
const fixture = await hardenedWindowsGoFixture(packageRoot, { blockInstall: true });
|
|
570
570
|
const first = installGentleAi({ packageRoot, platform: "win32", arch: "x64", execFile: fixture.run, resolveGoExecutable: fixture.resolveGoExecutable });
|
|
571
571
|
await fixture.waitForInstall();
|
|
572
|
-
const lockPath = join(packageRoot, ".gentle-ai", ".v2.8.
|
|
572
|
+
const lockPath = join(packageRoot, ".gentle-ai", ".v2.8.2.install.lock");
|
|
573
573
|
await assert.rejects(
|
|
574
574
|
() => installGentleAi({ packageRoot, platform: "win32", arch: "x64", execFile: fixture.run, resolveGoExecutable: fixture.resolveGoExecutable }),
|
|
575
575
|
(error: unknown) => error instanceof Error && error.message.includes(lockPath),
|
|
@@ -583,7 +583,7 @@ test("Windows concurrent installs fail closed until normal release, then reuse t
|
|
|
583
583
|
|
|
584
584
|
test("Windows source publication rolls back a prior bundle when final directory swap fails", async () => {
|
|
585
585
|
const packageRoot = await mkdtemp(join(tmpdir(), "gentle-pi-installer-rollback-"));
|
|
586
|
-
const versionDirectory = join(packageRoot, ".gentle-ai", "v2.8.
|
|
586
|
+
const versionDirectory = join(packageRoot, ".gentle-ai", "v2.8.2");
|
|
587
587
|
await mkdir(versionDirectory, { recursive: true });
|
|
588
588
|
await writeFile(join(versionDirectory, "old.txt"), "previous bundle");
|
|
589
589
|
const fixture = await hardenedWindowsGoFixture(packageRoot);
|
|
@@ -620,7 +620,7 @@ test("Darwin/Linux signed bundles retain their four-field manifest and reusable
|
|
|
620
620
|
},
|
|
621
621
|
};
|
|
622
622
|
await installGentleAi(options);
|
|
623
|
-
const manifestPath = join(packageRoot, ".gentle-ai", "v2.8.
|
|
623
|
+
const manifestPath = join(packageRoot, ".gentle-ai", "v2.8.2", "integrity.json");
|
|
624
624
|
const manifest = JSON.parse(await readFile(manifestPath, "utf8")) as Record<string, string>;
|
|
625
625
|
assert.deepEqual(Object.keys(manifest), ["version", "asset", "assetSha256", "binarySha256"]);
|
|
626
626
|
assert.equal((await installGentleAi({ ...options, download: async () => { throw new Error("signed bundle must be reused"); } })).installed, false);
|
|
@@ -633,7 +633,7 @@ test("a pinned asset falls back to its gentle-pi mirror only on download failure
|
|
|
633
633
|
// under the current stable pin, whose form gate refuses raw binaries.
|
|
634
634
|
const payload = Buffer.from("signed archive fixture");
|
|
635
635
|
const binary = "mirrored binary";
|
|
636
|
-
const baseAsset = { name: "gentle-ai_2.8.
|
|
636
|
+
const baseAsset = { name: "gentle-ai_2.8.2_linux_amd64.tar.gz", sha256: createHash("sha256").update(payload).digest("hex"), binarySha256: createHash("sha256").update(binary).digest("hex"), url: "https://example.invalid/upstream", mirrorUrl: "https://example.invalid/mirror", executable: "gentle-ai" };
|
|
637
637
|
const extractArchive = async (_archive: string, destination: string) => {
|
|
638
638
|
await mkdir(destination, { recursive: true });
|
|
639
639
|
await writeFile(join(destination, "gentle-ai"), binary);
|
|
@@ -751,7 +751,7 @@ test("checksum mismatch cleans temporary state without promoting a binary", asyn
|
|
|
751
751
|
}),
|
|
752
752
|
/checksum mismatch/,
|
|
753
753
|
);
|
|
754
|
-
assert.equal(existsSync(join(packageRoot, ".gentle-ai", "v2.8.
|
|
754
|
+
assert.equal(existsSync(join(packageRoot, ".gentle-ai", "v2.8.2", "gentle-ai")), false);
|
|
755
755
|
assert.deepEqual((await readdir(packageRoot)).filter((entry) => entry.startsWith(".gentle-ai-install-")), []);
|
|
756
756
|
});
|
|
757
757
|
|
|
@@ -773,7 +773,7 @@ test("installer promotes only the expected regular executable with executable PO
|
|
|
773
773
|
await chmod(extracted, 0o700);
|
|
774
774
|
},
|
|
775
775
|
});
|
|
776
|
-
const binary = join(packageRoot, ".gentle-ai", "v2.8.
|
|
776
|
+
const binary = join(packageRoot, ".gentle-ai", "v2.8.2", "gentle-ai");
|
|
777
777
|
assert.equal(existsSync(binary), true);
|
|
778
778
|
assert.equal(await readFile(binary, "utf8"), "native executable");
|
|
779
779
|
assert.ok(((await stat(binary)).mode & 0o111) !== 0);
|
|
@@ -804,7 +804,7 @@ test("installer rejects an extracted binary that differs from its pinned digest"
|
|
|
804
804
|
}),
|
|
805
805
|
/binary checksum mismatch/,
|
|
806
806
|
);
|
|
807
|
-
assert.equal(existsSync(join(packageRoot, ".gentle-ai", "v2.8.
|
|
807
|
+
assert.equal(existsSync(join(packageRoot, ".gentle-ai", "v2.8.2", "gentle-ai")), false);
|
|
808
808
|
});
|
|
809
809
|
|
|
810
810
|
test("installer repairs a valid non-executable POSIX binary instead of reusing it", async (t) => {
|
|
@@ -827,7 +827,7 @@ test("installer repairs a valid non-executable POSIX binary instead of reusing i
|
|
|
827
827
|
},
|
|
828
828
|
};
|
|
829
829
|
await installGentleAi(options);
|
|
830
|
-
const binary = join(packageRoot, ".gentle-ai", "v2.8.
|
|
830
|
+
const binary = join(packageRoot, ".gentle-ai", "v2.8.2", "gentle-ai");
|
|
831
831
|
await chmod(binary, 0o600);
|
|
832
832
|
const repaired = await installGentleAi(options);
|
|
833
833
|
assert.equal(repaired.installed, true);
|
|
@@ -864,7 +864,7 @@ test("installer rejects archives with multiple expected executable entries", asy
|
|
|
864
864
|
}),
|
|
865
865
|
/exactly one regular gentle-ai/,
|
|
866
866
|
);
|
|
867
|
-
assert.equal(existsSync(join(packageRoot, ".gentle-ai", "v2.8.
|
|
867
|
+
assert.equal(existsSync(join(packageRoot, ".gentle-ai", "v2.8.2", "gentle-ai")), false);
|
|
868
868
|
});
|
|
869
869
|
|
|
870
870
|
test("installer rejects an archive without the expected regular executable", async () => {
|
|
@@ -882,7 +882,7 @@ test("installer rejects an archive without the expected regular executable", asy
|
|
|
882
882
|
}),
|
|
883
883
|
/non-regular gentle-ai/,
|
|
884
884
|
);
|
|
885
|
-
assert.equal(existsSync(join(packageRoot, ".gentle-ai", "v2.8.
|
|
885
|
+
assert.equal(existsSync(join(packageRoot, ".gentle-ai", "v2.8.2", "gentle-ai")), false);
|
|
886
886
|
});
|
|
887
887
|
|
|
888
888
|
// #400: a clean Windows source build measured 232 s on a cold module cache,
|
package/tests/gentle-ai.test.ts
CHANGED
|
@@ -800,8 +800,9 @@ test("a later alias keeps managed-root precedence and manifest ownership", (t) =
|
|
|
800
800
|
assert.equal(manifest.assets["agents/sdd-apply.md"], createHash("sha256").update(routed).digest("hex"));
|
|
801
801
|
});
|
|
802
802
|
|
|
803
|
-
test("runtime guidance keeps review policy out of the static orchestrator", () => {
|
|
804
|
-
const staticReferences = ["
|
|
803
|
+
test("runtime guidance keeps review policy out of the static orchestrator and technical reference", () => {
|
|
804
|
+
const staticReferences = ["docs/readme-reference.md", "skills/gentle-ai/SKILL.md"];
|
|
805
|
+
assert.match(readFileSync("README.md", "utf8"), /\]\(docs\/readme-reference\.md(?:#[^)]+)?\)/);
|
|
805
806
|
const forbiddenGenericRoutes = [
|
|
806
807
|
/fresh-context `reviewer`/,
|
|
807
808
|
/fresh reviewer audits/,
|
|
@@ -193,11 +193,34 @@ test("2.8.0 repeats 2.7.0 because the negotiated lane Pi consumes is unchanged",
|
|
|
193
193
|
assert.deepEqual(contract, NATIVE_CLI_CONTRACTS["2.7.0"] as Record<string, boolean>);
|
|
194
194
|
});
|
|
195
195
|
|
|
196
|
+
test("2.8.1 repeats 2.8.0 because the negotiated lane Pi consumes is unchanged", () => {
|
|
197
|
+
// v2.8.1 only changed runtime telemetry model attribution (gentle-ai#4536);
|
|
198
|
+
// the closed fields Pi consumes did not change between 2.8.0 and 2.8.1, so
|
|
199
|
+
// this row repeats 2.8.0. riskEvidence and hint remain dark because neither
|
|
200
|
+
// is proven to reach Pi's negotiated START path.
|
|
201
|
+
const contract = NATIVE_CLI_CONTRACTS["2.8.1"] as Record<string, boolean>;
|
|
202
|
+
assert.equal(contract.riskEvidence, false);
|
|
203
|
+
assert.equal(contract.hint, false);
|
|
204
|
+
assert.deepEqual(contract, NATIVE_CLI_CONTRACTS["2.8.0"] as Record<string, boolean>);
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
test("2.8.2 repeats 2.8.1 because the negotiated lane Pi consumes is unchanged", () => {
|
|
208
|
+
// v2.8.2 only shipped OpenCode SDD preflight plugin fixes, community-tools
|
|
209
|
+
// RTK acquisition, and Claude Code Stop telemetry (no review/SDD contract
|
|
210
|
+
// changes); the closed fields Pi consumes did not change between 2.8.1 and
|
|
211
|
+
// 2.8.2, so this row repeats 2.8.1. riskEvidence and hint remain dark
|
|
212
|
+
// because neither is proven to reach Pi's negotiated START path.
|
|
213
|
+
const contract = NATIVE_CLI_CONTRACTS["2.8.2"] as Record<string, boolean>;
|
|
214
|
+
assert.equal(contract.riskEvidence, false);
|
|
215
|
+
assert.equal(contract.hint, false);
|
|
216
|
+
assert.deepEqual(contract, NATIVE_CLI_CONTRACTS["2.8.1"] as Record<string, boolean>);
|
|
217
|
+
});
|
|
218
|
+
|
|
196
219
|
test("no shipped version key was added beyond the pin bump", () => {
|
|
197
220
|
// Rows are promises to consumers, so a new key only ever appears in a
|
|
198
221
|
// dedicated commit alongside a pin bump, never as a side effect. v2.2.4 and
|
|
199
222
|
// v2.3.0 shipped upstream while Pi stayed on 2.2.3 and were never pinned,
|
|
200
223
|
// so they get no row: a row asserts ground truth measured against a binary
|
|
201
224
|
// Pi actually ran, and the table only has to be ascending, not gapless.
|
|
202
|
-
assert.deepEqual(Object.keys(NATIVE_CLI_CONTRACTS), [...DARK_VERSIONS, "2.2.0", "2.2.1", "2.2.2", "2.2.3", "2.4.0", "2.5.0-rc.3", "2.5.0", "2.6.0", "2.7.0", "2.8.0"]);
|
|
225
|
+
assert.deepEqual(Object.keys(NATIVE_CLI_CONTRACTS), [...DARK_VERSIONS, "2.2.0", "2.2.1", "2.2.2", "2.2.3", "2.4.0", "2.5.0-rc.3", "2.5.0", "2.6.0", "2.7.0", "2.8.0", "2.8.1", "2.8.2"]);
|
|
203
226
|
});
|