gsd-pi 2.72.0-dev.3118184 → 2.72.0-dev.4f3264a
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/dist/resources/extensions/async-jobs/await-tool.js +4 -7
- package/dist/resources/extensions/async-jobs/job-manager.js +3 -28
- package/dist/resources/extensions/claude-code-cli/stream-adapter.js +26 -27
- package/dist/resources/extensions/gsd/auto/loop.js +1 -84
- package/dist/resources/extensions/gsd/auto-post-unit.js +0 -6
- package/dist/resources/extensions/gsd/auto.js +19 -25
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +11 -9
- package/dist/resources/extensions/gsd/commands-handlers.js +1 -4
- package/dist/resources/extensions/gsd/context-injector.js +1 -1
- package/dist/resources/extensions/gsd/custom-workflow-engine.js +7 -3
- package/dist/resources/extensions/gsd/gsd-db.js +5 -47
- package/dist/resources/extensions/gsd/key-manager.js +0 -2
- package/dist/resources/extensions/gsd/preferences-skills.js +34 -2
- package/dist/resources/extensions/gsd/preferences-types.js +0 -15
- package/dist/resources/extensions/gsd/preferences.js +3 -16
- package/dist/resources/extensions/gsd/prompt-loader.js +1 -4
- package/dist/resources/extensions/gsd/state.js +1 -21
- package/dist/resources/extensions/gsd/write-intercept.js +1 -10
- package/dist/resources/extensions/ollama/index.js +5 -4
- package/dist/resources/extensions/ollama/ollama-client.js +6 -35
- package/dist/resources/extensions/ollama/ollama-discovery.js +6 -32
- package/dist/web/standalone/.next/BUILD_ID +1 -1
- package/dist/web/standalone/.next/app-path-routes-manifest.json +12 -12
- package/dist/web/standalone/.next/build-manifest.json +2 -2
- package/dist/web/standalone/.next/prerender-manifest.json +3 -3
- package/dist/web/standalone/.next/server/app/_global-error/page.js +3 -3
- package/dist/web/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.html +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found/page.js +2 -2
- package/dist/web/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/api/boot/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/browse-directories/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/captures/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/cleanup/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/dev-mode/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/doctor/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/experimental/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/export-data/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/files/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/forensics/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/git/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/history/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/hooks/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/inspect/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/knowledge/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/live-state/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/notifications/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/onboarding/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/preferences/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/projects/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/recovery/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/remote-questions/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/session/browser/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/command/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/events/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/session/manage/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/settings-data/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/shutdown/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/skill-health/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/steer/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/switch-root/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/input/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/terminal/resize/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/terminal/sessions/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/terminal/stream/route.js +3 -3
- package/dist/web/standalone/.next/server/app/api/terminal/upload/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/undo/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/update/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/visualizer/route.js +1 -1
- package/dist/web/standalone/.next/server/app/index.html +1 -1
- package/dist/web/standalone/.next/server/app/index.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/page.js +2 -2
- package/dist/web/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app-paths-manifest.json +12 -12
- package/dist/web/standalone/.next/server/chunks/2331.js +16 -16
- package/dist/web/standalone/.next/server/chunks/4741.js +12 -12
- package/dist/web/standalone/.next/server/chunks/5822.js +2 -2
- package/dist/web/standalone/.next/server/chunks/63.js +8 -8
- package/dist/web/standalone/.next/server/chunks/6897.js +3 -3
- package/dist/web/standalone/.next/server/functions-config-manifest.json +9 -0
- package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
- package/dist/web/standalone/.next/server/middleware-manifest.json +2 -29
- package/dist/web/standalone/.next/server/middleware.js +12 -4
- package/dist/web/standalone/.next/server/pages/404.html +1 -1
- package/dist/web/standalone/.next/server/pages/500.html +1 -1
- package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
- package/dist/web/standalone/.next/server/webpack-runtime.js +1 -1
- package/package.json +1 -1
- package/packages/pi-ai/dist/env-api-keys.js +0 -1
- package/packages/pi-ai/dist/env-api-keys.js.map +1 -1
- package/packages/pi-ai/dist/models.custom.d.ts +0 -105
- package/packages/pi-ai/dist/models.custom.d.ts.map +1 -1
- package/packages/pi-ai/dist/models.custom.js +0 -97
- package/packages/pi-ai/dist/models.custom.js.map +1 -1
- package/packages/pi-ai/dist/models.generated.d.ts +140 -648
- package/packages/pi-ai/dist/models.generated.d.ts.map +1 -1
- package/packages/pi-ai/dist/models.generated.js +364 -861
- package/packages/pi-ai/dist/models.generated.js.map +1 -1
- package/packages/pi-ai/dist/models.test.js +0 -105
- package/packages/pi-ai/dist/models.test.js.map +1 -1
- package/packages/pi-ai/dist/types.d.ts +1 -1
- package/packages/pi-ai/dist/types.d.ts.map +1 -1
- package/packages/pi-ai/dist/types.js.map +1 -1
- package/packages/pi-ai/src/env-api-keys.ts +0 -1
- package/packages/pi-ai/src/models.custom.ts +0 -98
- package/packages/pi-ai/src/models.generated.ts +364 -861
- package/packages/pi-ai/src/models.test.ts +0 -135
- package/packages/pi-ai/src/types.ts +0 -1
- package/packages/pi-coding-agent/dist/core/model-resolver.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-resolver.js +0 -1
- package/packages/pi-coding-agent/dist/core/model-resolver.js.map +1 -1
- package/packages/pi-coding-agent/src/core/model-resolver.ts +0 -1
- package/src/resources/extensions/async-jobs/await-tool.test.ts +7 -40
- package/src/resources/extensions/async-jobs/await-tool.ts +4 -7
- package/src/resources/extensions/async-jobs/job-manager.ts +3 -33
- package/src/resources/extensions/claude-code-cli/stream-adapter.ts +26 -27
- package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +2 -20
- package/src/resources/extensions/gsd/auto/loop.ts +1 -89
- package/src/resources/extensions/gsd/auto-post-unit.ts +0 -7
- package/src/resources/extensions/gsd/auto.ts +20 -25
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +10 -8
- package/src/resources/extensions/gsd/commands-handlers.ts +1 -5
- package/src/resources/extensions/gsd/context-injector.ts +1 -1
- package/src/resources/extensions/gsd/custom-workflow-engine.ts +8 -4
- package/src/resources/extensions/gsd/gsd-db.ts +5 -52
- package/src/resources/extensions/gsd/key-manager.ts +0 -2
- package/src/resources/extensions/gsd/preferences-skills.ts +36 -2
- package/src/resources/extensions/gsd/preferences-types.ts +0 -16
- package/src/resources/extensions/gsd/preferences.ts +6 -19
- package/src/resources/extensions/gsd/prompt-loader.ts +1 -6
- package/src/resources/extensions/gsd/state.ts +0 -20
- package/src/resources/extensions/gsd/tests/gsd-db.test.ts +0 -74
- package/src/resources/extensions/gsd/tests/key-manager.test.ts +0 -63
- package/src/resources/extensions/gsd/tests/preferences.test.ts +0 -53
- package/src/resources/extensions/gsd/write-intercept.ts +1 -10
- package/src/resources/extensions/ollama/index.ts +5 -4
- package/src/resources/extensions/ollama/ollama-client.ts +6 -35
- package/src/resources/extensions/ollama/ollama-discovery.ts +6 -37
- package/src/resources/extensions/ollama/tests/ollama-discovery.test.ts +0 -54
- package/dist/resources/extensions/gsd/definition-io.js +0 -15
- package/dist/web/standalone/.next/server/edge-runtime-webpack.js +0 -2
- package/packages/pi-ai/dist/models.generated.test.d.ts +0 -2
- package/packages/pi-ai/dist/models.generated.test.d.ts.map +0 -1
- package/packages/pi-ai/dist/models.generated.test.js +0 -334
- package/packages/pi-ai/dist/models.generated.test.js.map +0 -1
- package/packages/pi-ai/src/models.generated.test.ts +0 -373
- package/src/resources/extensions/gsd/definition-io.ts +0 -18
- package/src/resources/extensions/gsd/tests/auto-paused-ui-cleanup.test.ts +0 -27
- package/src/resources/extensions/gsd/tests/block-db-writes.test.ts +0 -63
- package/src/resources/extensions/gsd/tests/definition-io.test.ts +0 -57
- package/src/resources/extensions/gsd/tests/doctor-heal-fixable-warnings.test.ts +0 -14
- package/src/resources/extensions/gsd/tests/false-degraded-mode-warning.test.ts +0 -104
- package/src/resources/extensions/gsd/tests/memory-pressure-stuck-state.test.ts +0 -54
- package/src/resources/extensions/gsd/tests/post-unit-state-rebuild.test.ts +0 -34
- package/src/resources/extensions/gsd/tests/preferences-formatting.test.ts +0 -87
- package/src/resources/extensions/gsd/tests/prompt-loader-working-directory.test.ts +0 -19
- package/src/resources/extensions/gsd/tests/register-hooks-depth-verification.test.ts +0 -97
- package/src/resources/extensions/gsd/tests/stale-slice-rows.test.ts +0 -41
- /package/dist/web/standalone/.next/static/{NzO79SOz9jHX-VY5-0t2O → vr6Pbde48w4rMUplqDdh_}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{NzO79SOz9jHX-VY5-0t2O → vr6Pbde48w4rMUplqDdh_}/_ssgManifest.js +0 -0
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Regression tests for memory pressure monitoring (#3331) and
|
|
3
|
-
* stuck detection persistence (#3704) in auto/loop.ts.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import { describe, test } from "node:test";
|
|
7
|
-
import assert from "node:assert/strict";
|
|
8
|
-
import { readFileSync } from "node:fs";
|
|
9
|
-
import { join, dirname } from "node:path";
|
|
10
|
-
import { fileURLToPath } from "node:url";
|
|
11
|
-
|
|
12
|
-
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
13
|
-
const loopSource = readFileSync(join(__dirname, "..", "auto", "loop.ts"), "utf-8");
|
|
14
|
-
|
|
15
|
-
describe("memory pressure monitoring (#3331)", () => {
|
|
16
|
-
test("checkMemoryPressure function exists", () => {
|
|
17
|
-
assert.match(loopSource, /function checkMemoryPressure/);
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
test("MEMORY_PRESSURE_THRESHOLD constant is defined", () => {
|
|
21
|
-
assert.match(loopSource, /MEMORY_PRESSURE_THRESHOLD\s*=\s*0\.\d+/);
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
test("memory check runs every MEMORY_CHECK_INTERVAL iterations", () => {
|
|
25
|
-
assert.match(loopSource, /iteration\s*%\s*MEMORY_CHECK_INTERVAL\s*===\s*0/);
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
test("memory pressure triggers graceful stopAuto", () => {
|
|
29
|
-
assert.match(loopSource, /mem\.pressured/);
|
|
30
|
-
assert.match(loopSource, /Stopping gracefully to prevent OOM/);
|
|
31
|
-
});
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
describe("stuck detection persistence (#3704)", () => {
|
|
35
|
-
test("loadStuckState function exists", () => {
|
|
36
|
-
assert.match(loopSource, /function loadStuckState/);
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
test("saveStuckState function exists", () => {
|
|
40
|
-
assert.match(loopSource, /function saveStuckState/);
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
test("loopState initialized from persisted state", () => {
|
|
44
|
-
assert.match(loopSource, /loadStuckState\(s\.basePath\)/);
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
test("stuck state saved after each iteration", () => {
|
|
48
|
-
assert.match(loopSource, /saveStuckState\(s\.basePath,\s*loopState\)/);
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
test("stuck state file path uses runtime directory", () => {
|
|
52
|
-
assert.match(loopSource, /stuck-state\.json/);
|
|
53
|
-
});
|
|
54
|
-
});
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Regression test for #3869: normal post-unit flow should rebuild STATE.md
|
|
3
|
-
* before syncing worktree state back to the project root.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import test from "node:test";
|
|
7
|
-
import assert from "node:assert/strict";
|
|
8
|
-
import { readFileSync } from "node:fs";
|
|
9
|
-
import { join } from "node:path";
|
|
10
|
-
|
|
11
|
-
const source = readFileSync(join(import.meta.dirname, "..", "auto-post-unit.ts"), "utf-8");
|
|
12
|
-
|
|
13
|
-
test("auto-post-unit imports rebuildState", () => {
|
|
14
|
-
assert.ok(
|
|
15
|
-
source.includes('import { rebuildState } from "./doctor.js";'),
|
|
16
|
-
"auto-post-unit.ts should import rebuildState from doctor.ts",
|
|
17
|
-
);
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
test("postUnitPreVerification rebuilds STATE.md before worktree sync", () => {
|
|
21
|
-
const fnStart = source.indexOf("export async function postUnitPreVerification");
|
|
22
|
-
assert.ok(fnStart > 0, "postUnitPreVerification should exist");
|
|
23
|
-
|
|
24
|
-
const section = source.slice(fnStart, fnStart + 8000);
|
|
25
|
-
const rebuildIdx = section.indexOf('await runSafely("postUnit", "state-rebuild"');
|
|
26
|
-
const syncIdx = section.indexOf('await runSafely("postUnit", "worktree-sync"');
|
|
27
|
-
|
|
28
|
-
assert.ok(rebuildIdx > 0, "postUnitPreVerification should rebuild STATE.md after unit completion");
|
|
29
|
-
assert.ok(syncIdx > 0, "postUnitPreVerification should sync worktree state back to the project root");
|
|
30
|
-
assert.ok(
|
|
31
|
-
rebuildIdx < syncIdx,
|
|
32
|
-
"STATE.md rebuild should happen before worktree sync so synced state is fresh",
|
|
33
|
-
);
|
|
34
|
-
});
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tests for formatSkillRef — pure formatting logic for skill references
|
|
3
|
-
* in the system prompt. Moved from preferences-skills.ts to preferences-types.ts
|
|
4
|
-
* to break the preferences ↔ preferences-skills circular dependency.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import { describe, test } from "node:test";
|
|
8
|
-
import assert from "node:assert/strict";
|
|
9
|
-
|
|
10
|
-
import { formatSkillRef } from "../preferences-types.ts";
|
|
11
|
-
import type { SkillResolution } from "../preferences-types.ts";
|
|
12
|
-
|
|
13
|
-
function makeResolutions(entries: [string, Partial<SkillResolution>][]): Map<string, SkillResolution> {
|
|
14
|
-
const map = new Map<string, SkillResolution>();
|
|
15
|
-
for (const [key, partial] of entries) {
|
|
16
|
-
map.set(key, {
|
|
17
|
-
original: partial.original ?? key,
|
|
18
|
-
resolvedPath: partial.resolvedPath ?? null,
|
|
19
|
-
method: partial.method ?? "unresolved",
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
return map;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
describe("formatSkillRef", () => {
|
|
26
|
-
test("marks unresolved references with a warning", () => {
|
|
27
|
-
const resolutions = makeResolutions([
|
|
28
|
-
["my-skill", { method: "unresolved" }],
|
|
29
|
-
]);
|
|
30
|
-
const result = formatSkillRef("my-skill", resolutions);
|
|
31
|
-
assert.match(result, /my-skill/);
|
|
32
|
-
assert.match(result, /not found/);
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
test("marks unknown references (not in map) with a warning", () => {
|
|
36
|
-
const resolutions = new Map<string, SkillResolution>();
|
|
37
|
-
const result = formatSkillRef("unknown-skill", resolutions);
|
|
38
|
-
assert.match(result, /unknown-skill/);
|
|
39
|
-
assert.match(result, /not found/);
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
test("returns bare ref for absolute-path resolution", () => {
|
|
43
|
-
const resolutions = makeResolutions([
|
|
44
|
-
["/home/user/skills/SKILL.md", {
|
|
45
|
-
method: "absolute-path",
|
|
46
|
-
resolvedPath: "/home/user/skills/SKILL.md",
|
|
47
|
-
}],
|
|
48
|
-
]);
|
|
49
|
-
const result = formatSkillRef("/home/user/skills/SKILL.md", resolutions);
|
|
50
|
-
assert.equal(result, "/home/user/skills/SKILL.md");
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
test("returns bare ref for absolute-dir resolution", () => {
|
|
54
|
-
const resolutions = makeResolutions([
|
|
55
|
-
["/home/user/skills/my-skill", {
|
|
56
|
-
method: "absolute-dir",
|
|
57
|
-
resolvedPath: "/home/user/skills/my-skill/SKILL.md",
|
|
58
|
-
}],
|
|
59
|
-
]);
|
|
60
|
-
const result = formatSkillRef("/home/user/skills/my-skill", resolutions);
|
|
61
|
-
assert.equal(result, "/home/user/skills/my-skill");
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
test("shows resolved path for user-skill resolution", () => {
|
|
65
|
-
const resolutions = makeResolutions([
|
|
66
|
-
["code-review", {
|
|
67
|
-
method: "user-skill",
|
|
68
|
-
resolvedPath: "/home/user/.claude/skills/code-review/SKILL.md",
|
|
69
|
-
}],
|
|
70
|
-
]);
|
|
71
|
-
const result = formatSkillRef("code-review", resolutions);
|
|
72
|
-
assert.match(result, /code-review/);
|
|
73
|
-
assert.match(result, /\.claude\/skills\/code-review\/SKILL\.md/);
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
test("shows resolved path for project-skill resolution", () => {
|
|
77
|
-
const resolutions = makeResolutions([
|
|
78
|
-
["lint-fix", {
|
|
79
|
-
method: "project-skill",
|
|
80
|
-
resolvedPath: "/repo/.gsd/skills/lint-fix/SKILL.md",
|
|
81
|
-
}],
|
|
82
|
-
]);
|
|
83
|
-
const result = formatSkillRef("lint-fix", resolutions);
|
|
84
|
-
assert.match(result, /lint-fix/);
|
|
85
|
-
assert.match(result, /\.gsd\/skills\/lint-fix\/SKILL\.md/);
|
|
86
|
-
});
|
|
87
|
-
});
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import test from "node:test";
|
|
2
|
-
import assert from "node:assert/strict";
|
|
3
|
-
|
|
4
|
-
import { loadPrompt } from "../prompt-loader.ts";
|
|
5
|
-
|
|
6
|
-
test("loadPrompt normalizes workingDirectory backslashes for bash-friendly prompts (#4048)", () => {
|
|
7
|
-
const prompt = loadPrompt("research-milestone", {
|
|
8
|
-
milestoneId: "M001",
|
|
9
|
-
milestoneTitle: "Windows path fix",
|
|
10
|
-
workingDirectory: "C:\\Dev\\NB\\TR",
|
|
11
|
-
inlinedContext: "context",
|
|
12
|
-
skillActivation: "skill activation",
|
|
13
|
-
skillDiscoveryMode: "off",
|
|
14
|
-
skillDiscoveryInstructions: " disabled",
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
assert.match(prompt, /Your working directory is `C:\/Dev\/NB\/TR`/);
|
|
18
|
-
assert.doesNotMatch(prompt, /C:\\Dev\\NB\\TR/);
|
|
19
|
-
});
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import test from "node:test";
|
|
2
|
-
import assert from "node:assert/strict";
|
|
3
|
-
import { mkdirSync, rmSync } from "node:fs";
|
|
4
|
-
import { join } from "node:path";
|
|
5
|
-
import { tmpdir } from "node:os";
|
|
6
|
-
|
|
7
|
-
import { registerHooks } from "../bootstrap/register-hooks.ts";
|
|
8
|
-
import {
|
|
9
|
-
getPendingGate,
|
|
10
|
-
resetWriteGateState,
|
|
11
|
-
shouldBlockContextArtifactSave,
|
|
12
|
-
} from "../bootstrap/write-gate.ts";
|
|
13
|
-
|
|
14
|
-
function makeTempDir(prefix: string): string {
|
|
15
|
-
const dir = join(
|
|
16
|
-
tmpdir(),
|
|
17
|
-
`gsd-depth-gate-${prefix}-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,
|
|
18
|
-
);
|
|
19
|
-
mkdirSync(dir, { recursive: true });
|
|
20
|
-
return dir;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
test("register-hooks unlocks milestone depth verification from question id without guided-flow state (#4047)", async (t) => {
|
|
24
|
-
const dir = makeTempDir("manual");
|
|
25
|
-
const originalCwd = process.cwd();
|
|
26
|
-
process.chdir(dir);
|
|
27
|
-
resetWriteGateState();
|
|
28
|
-
|
|
29
|
-
t.after(() => {
|
|
30
|
-
resetWriteGateState();
|
|
31
|
-
process.chdir(originalCwd);
|
|
32
|
-
rmSync(dir, { recursive: true, force: true });
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
const handlers = new Map<string, Array<(event: any, ctx?: any) => Promise<void> | void>>();
|
|
36
|
-
const pi = {
|
|
37
|
-
on(event: string, handler: (event: any, ctx?: any) => Promise<void> | void) {
|
|
38
|
-
const existing = handlers.get(event) ?? [];
|
|
39
|
-
existing.push(handler);
|
|
40
|
-
handlers.set(event, existing);
|
|
41
|
-
},
|
|
42
|
-
} as any;
|
|
43
|
-
|
|
44
|
-
registerHooks(pi);
|
|
45
|
-
|
|
46
|
-
const questionId = "depth_verification_M001_confirm";
|
|
47
|
-
const questions = [
|
|
48
|
-
{
|
|
49
|
-
id: questionId,
|
|
50
|
-
question: "Do you agree?",
|
|
51
|
-
options: [
|
|
52
|
-
{ label: "Yes, you got it (Recommended)" },
|
|
53
|
-
{ label: "Needs adjustment" },
|
|
54
|
-
],
|
|
55
|
-
},
|
|
56
|
-
];
|
|
57
|
-
|
|
58
|
-
const toolCallHandlers = handlers.get("tool_call");
|
|
59
|
-
const toolResultHandlers = handlers.get("tool_result");
|
|
60
|
-
assert.ok(toolCallHandlers?.length, "tool_call handler should be registered");
|
|
61
|
-
assert.ok(toolResultHandlers?.length, "tool_result handler should be registered");
|
|
62
|
-
|
|
63
|
-
for (const handler of toolCallHandlers ?? []) {
|
|
64
|
-
await handler({
|
|
65
|
-
toolName: "ask_user_questions",
|
|
66
|
-
input: { questions },
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
assert.equal(getPendingGate(), questionId, "gate should be set even without guided-flow state");
|
|
71
|
-
assert.equal(
|
|
72
|
-
shouldBlockContextArtifactSave("CONTEXT", "M001").block,
|
|
73
|
-
true,
|
|
74
|
-
"milestone context should still be blocked before confirmation",
|
|
75
|
-
);
|
|
76
|
-
|
|
77
|
-
for (const handler of toolResultHandlers ?? []) {
|
|
78
|
-
await handler({
|
|
79
|
-
toolName: "ask_user_questions",
|
|
80
|
-
input: { questions },
|
|
81
|
-
details: {
|
|
82
|
-
response: {
|
|
83
|
-
answers: {
|
|
84
|
-
[questionId]: { selected: "Yes, you got it (Recommended)" },
|
|
85
|
-
},
|
|
86
|
-
},
|
|
87
|
-
},
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
assert.equal(getPendingGate(), null, "confirming the depth question should clear the pending gate");
|
|
92
|
-
assert.equal(
|
|
93
|
-
shouldBlockContextArtifactSave("CONTEXT", "M001").block,
|
|
94
|
-
false,
|
|
95
|
-
"question-id milestone inference should unlock the matching milestone context write",
|
|
96
|
-
);
|
|
97
|
-
});
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* stale-slice-rows.test.ts — #3658
|
|
3
|
-
*
|
|
4
|
-
* Verify that state.ts contains slice-level status reconciliation that
|
|
5
|
-
* updates stale DB rows (status "pending") when disk artifacts (SUMMARY)
|
|
6
|
-
* prove the slice is complete. Without this, the dependency resolver builds
|
|
7
|
-
* doneSliceIds from stale DB rows and downstream slices stay blocked.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import { describe, test } from "node:test";
|
|
11
|
-
import assert from "node:assert/strict";
|
|
12
|
-
import { readFileSync } from "node:fs";
|
|
13
|
-
import { join, dirname } from "node:path";
|
|
14
|
-
import { fileURLToPath } from "node:url";
|
|
15
|
-
|
|
16
|
-
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
17
|
-
const sourceFile = join(__dirname, "..", "state.ts");
|
|
18
|
-
|
|
19
|
-
describe("stale slice row reconciliation (#3658)", () => {
|
|
20
|
-
const source = readFileSync(sourceFile, "utf-8");
|
|
21
|
-
|
|
22
|
-
test("imports updateSliceStatus from gsd-db", () => {
|
|
23
|
-
assert.match(source, /import\s*\{[^}]*updateSliceStatus[^}]*\}\s*from/);
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
test("checks isStatusDone before reconciling slice rows", () => {
|
|
27
|
-
assert.match(source, /isStatusDone\(dbSlice\.status\)/);
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
test("resolves SUMMARY file to detect completed slices on disk", () => {
|
|
31
|
-
assert.match(source, /resolveSliceFile\(basePath,\s*mid,\s*dbSlice\.id,\s*["']SUMMARY["']\)/);
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
test("calls updateSliceStatus to reconcile stale rows", () => {
|
|
35
|
-
assert.match(source, /updateSliceStatus\(mid,\s*dbSlice\.id,\s*["']complete["']\)/);
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
test("references issue #3599 in reconciliation comment", () => {
|
|
39
|
-
assert.match(source, /#3599/);
|
|
40
|
-
});
|
|
41
|
-
});
|
|
File without changes
|
|
File without changes
|