@boyingliu01/dsh-plugin-xp-gate 0.31.3 → 0.32.0

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.
Files changed (52) hide show
  1. package/lib/command.d.ts +11 -5
  2. package/lib/command.d.ts.map +1 -1
  3. package/lib/command.js +19 -13
  4. package/lib/command.js.map +1 -1
  5. package/lib/credentials.d.ts +39 -0
  6. package/lib/credentials.d.ts.map +1 -0
  7. package/lib/credentials.js +57 -0
  8. package/lib/credentials.js.map +1 -0
  9. package/lib/delphi-config.d.ts +34 -3
  10. package/lib/delphi-config.d.ts.map +1 -1
  11. package/lib/delphi-config.js +117 -48
  12. package/lib/delphi-config.js.map +1 -1
  13. package/lib/delphi-run.d.ts +1 -1
  14. package/lib/delphi-run.d.ts.map +1 -1
  15. package/lib/delphi-run.js +24 -3
  16. package/lib/delphi-run.js.map +1 -1
  17. package/lib/delphi.d.ts +6 -0
  18. package/lib/delphi.d.ts.map +1 -1
  19. package/lib/delphi.js +101 -55
  20. package/lib/delphi.js.map +1 -1
  21. package/lib/evidence.d.ts +70 -0
  22. package/lib/evidence.d.ts.map +1 -0
  23. package/lib/evidence.js +92 -0
  24. package/lib/evidence.js.map +1 -0
  25. package/lib/gate-runner.d.ts +33 -2
  26. package/lib/gate-runner.d.ts.map +1 -1
  27. package/lib/gate-runner.js +53 -4
  28. package/lib/gate-runner.js.map +1 -1
  29. package/lib/git-context.d.ts +26 -0
  30. package/lib/git-context.d.ts.map +1 -0
  31. package/lib/git-context.js +30 -0
  32. package/lib/git-context.js.map +1 -0
  33. package/lib/hooks.d.ts +42 -0
  34. package/lib/hooks.d.ts.map +1 -0
  35. package/lib/hooks.js +113 -0
  36. package/lib/hooks.js.map +1 -0
  37. package/lib/index.d.ts +16 -1
  38. package/lib/index.d.ts.map +1 -1
  39. package/lib/index.js +278 -10
  40. package/lib/index.js.map +1 -1
  41. package/lib/skill-provider.d.ts +15 -0
  42. package/lib/skill-provider.d.ts.map +1 -0
  43. package/lib/skill-provider.js +205 -0
  44. package/lib/skill-provider.js.map +1 -0
  45. package/lib/sprint.d.ts +60 -0
  46. package/lib/sprint.d.ts.map +1 -0
  47. package/lib/sprint.js +92 -0
  48. package/lib/sprint.js.map +1 -0
  49. package/package.json +14 -8
  50. package/skills/delphi-review/AGENTS.md +3 -3
  51. package/skills/sprint-flow/AGENTS.md +3 -3
  52. package/skills/test-specification-alignment/AGENTS.md +3 -3
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Minimal git context for evidence.
3
+ *
4
+ * @test REQ-DSH-012 delphi-review can produce Gate MW evidence
5
+ * @intent Read HEAD and the current branch name, which the walkthrough evidence must
6
+ * name exactly, without adding a git library dependency.
7
+ * @covers AC-DSH-012-02
8
+ *
9
+ * Spawned git, not a parsed .git directory: worktrees and detached HEAD have
10
+ * layouts that are easy to misread, and getting either wrong produces evidence the
11
+ * validator rejects at push time with no hint about why.
12
+ */
13
+ import { execFileSync } from "node:child_process";
14
+ /**
15
+ * Read HEAD and the branch.
16
+ *
17
+ * The validator compares `branch` to the name the push reports; a detached HEAD
18
+ * reports "HEAD", which is what git itself would say, so it is passed through
19
+ * rather than guessed at.
20
+ */
21
+ export function readGitContext(cwd) {
22
+ const run = (args) => execFileSync("git", args, { cwd, encoding: "utf8", stdio: ["ignore", "pipe", "pipe"] }).trim();
23
+ try {
24
+ return { head: run(["rev-parse", "HEAD"]), branch: run(["rev-parse", "--abbrev-ref", "HEAD"]) };
25
+ }
26
+ catch (error) {
27
+ throw new Error(`cannot read git context in ${cwd}: ${error.message}`);
28
+ }
29
+ }
30
+ //# sourceMappingURL=git-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git-context.js","sourceRoot":"","sources":["../src/git-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAQjD;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,GAAW;IACxC,MAAM,GAAG,GAAG,CAAC,IAAuB,EAAU,EAAE,CAC9C,YAAY,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,CAAA;IAEhG,IAAI,CAAC;QACH,OAAO,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC,WAAW,EAAE,cAAc,EAAE,MAAM,CAAC,CAAC,EAAE,CAAA;IACjG,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,8BAA8B,GAAG,KAAM,KAAe,CAAC,OAAO,EAAE,CAAC,CAAA;IACnF,CAAC;AACH,CAAC"}
package/lib/hooks.d.ts ADDED
@@ -0,0 +1,42 @@
1
+ /**
2
+ * DSH-native hooks: the delphi-review guard and the save-time principles check.
3
+ *
4
+ * @test REQ-DSH-015 sprint-phase writes are gated the way the IDE plugin gates them
5
+ * @intent Port the Claude Code guard and save-check to DSH's own pre/post-execute
6
+ * seams, keeping the degrade rules that made them safe there.
7
+ * @covers AC-DSH-015-01
8
+ *
9
+ * Degrade semantics are copied from plugins/claude-code/bin/delphi-review-guard.sh,
10
+ * which has been in use long enough to have settled them:
11
+ *
12
+ * no .sprint-state -> ALLOW (not a sprint project; gating it would punish every
13
+ * ordinary repo that installed the plugin)
14
+ * state, no verdict -> DENY (sprint is open, review not done)
15
+ * verdict != APPROVED-> DENY (reason names the actual verdict)
16
+ * APPROVED -> ALLOW
17
+ *
18
+ * The guard only ever inspects state. It must not throw: a throw inside pre-execute
19
+ * aborts the tool call, which is a worse failure than letting an edit through.
20
+ */
21
+ /** Denial the guard returns; shape matches DSH's PreToolDecision deny variant. */
22
+ export interface GuardDenial {
23
+ readonly kind: "deny";
24
+ readonly reason: string;
25
+ }
26
+ /** Does this tool modify files? */
27
+ export declare function isEditTool(name: string): boolean;
28
+ /**
29
+ * Should a save-time check run for this path?
30
+ *
31
+ * Documents and data files are excluded on purpose: they are a large share of the
32
+ * commits in repositories using xp-gate, and the engine has nothing to say about
33
+ * them. Skipping them removes most of the hook's cost.
34
+ */
35
+ export declare function isCheckablePath(path: string): boolean;
36
+ /**
37
+ * Decide whether an edit may proceed.
38
+ *
39
+ * Returns undefined to mean "allow" so the caller can `if (denial) return denial`.
40
+ */
41
+ export declare function delphiGuardDecision(root: string, toolName: string): GuardDenial | undefined;
42
+ //# sourceMappingURL=hooks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../src/hooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAYH,kFAAkF;AAClF,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CACxB;AAsBD,mCAAmC;AACnC,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEhD;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAKrD;AAgBD;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CA8B3F"}
package/lib/hooks.js ADDED
@@ -0,0 +1,113 @@
1
+ /**
2
+ * DSH-native hooks: the delphi-review guard and the save-time principles check.
3
+ *
4
+ * @test REQ-DSH-015 sprint-phase writes are gated the way the IDE plugin gates them
5
+ * @intent Port the Claude Code guard and save-check to DSH's own pre/post-execute
6
+ * seams, keeping the degrade rules that made them safe there.
7
+ * @covers AC-DSH-015-01
8
+ *
9
+ * Degrade semantics are copied from plugins/claude-code/bin/delphi-review-guard.sh,
10
+ * which has been in use long enough to have settled them:
11
+ *
12
+ * no .sprint-state -> ALLOW (not a sprint project; gating it would punish every
13
+ * ordinary repo that installed the plugin)
14
+ * state, no verdict -> DENY (sprint is open, review not done)
15
+ * verdict != APPROVED-> DENY (reason names the actual verdict)
16
+ * APPROVED -> ALLOW
17
+ *
18
+ * The guard only ever inspects state. It must not throw: a throw inside pre-execute
19
+ * aborts the tool call, which is a worse failure than letting an edit through.
20
+ */
21
+ import { existsSync, readFileSync } from "node:fs";
22
+ import { join } from "node:path";
23
+ /** Tools that modify files. Read-only tools are never gated. */
24
+ const EDIT_TOOLS = new Set(["write", "edit", "str_replace_editor"]);
25
+ /** Where Sprint Flow records the review verdict. */
26
+ const SPRINT_STATE_DIR = ".sprint-state";
27
+ const VERDICT_FILE = "delphi-reviewed.json";
28
+ /** The file extensions the principles engine actually covers. */
29
+ const CHECKABLE_EXTENSIONS = new Set([
30
+ ".ts",
31
+ ".tsx",
32
+ ".js",
33
+ ".jsx",
34
+ ".py",
35
+ ".go",
36
+ ".java",
37
+ ".kt",
38
+ ".c",
39
+ ".cpp",
40
+ ".h",
41
+ ".swift",
42
+ ".m",
43
+ ".dart",
44
+ ".sh",
45
+ ".ps1",
46
+ ]);
47
+ /** Does this tool modify files? */
48
+ export function isEditTool(name) {
49
+ return EDIT_TOOLS.has(name);
50
+ }
51
+ /**
52
+ * Should a save-time check run for this path?
53
+ *
54
+ * Documents and data files are excluded on purpose: they are a large share of the
55
+ * commits in repositories using xp-gate, and the engine has nothing to say about
56
+ * them. Skipping them removes most of the hook's cost.
57
+ */
58
+ export function isCheckablePath(path) {
59
+ const lowered = path.toLowerCase();
60
+ const dot = lowered.lastIndexOf(".");
61
+ if (dot < 0)
62
+ return false;
63
+ return CHECKABLE_EXTENSIONS.has(lowered.slice(dot));
64
+ }
65
+ /** Read the recorded verdict, or a reason it cannot be read. */
66
+ function readVerdict(root) {
67
+ const file = join(root, SPRINT_STATE_DIR, VERDICT_FILE);
68
+ try {
69
+ const parsed = JSON.parse(readFileSync(file, "utf8"));
70
+ const verdict = typeof parsed.verdict === "string" ? parsed.verdict : "";
71
+ return { verdict };
72
+ }
73
+ catch (error) {
74
+ // Corrupt JSON is a real state (a half-written file, a merge conflict). Treat it
75
+ // as "not reviewed" and say why, rather than throwing into the tool pipeline.
76
+ return { unreadable: error.message };
77
+ }
78
+ }
79
+ /**
80
+ * Decide whether an edit may proceed.
81
+ *
82
+ * Returns undefined to mean "allow" so the caller can `if (denial) return denial`.
83
+ */
84
+ export function delphiGuardDecision(root, toolName) {
85
+ if (!isEditTool(toolName))
86
+ return undefined;
87
+ if (!existsSync(join(root, SPRINT_STATE_DIR)))
88
+ return undefined;
89
+ const verdictFile = join(root, SPRINT_STATE_DIR, VERDICT_FILE);
90
+ if (!existsSync(verdictFile)) {
91
+ return {
92
+ kind: "deny",
93
+ reason: "delphi-review has not run for this sprint. Complete the Phase 2 delphi-review " +
94
+ "before modifying code, then retry.",
95
+ };
96
+ }
97
+ const { verdict, unreadable } = readVerdict(root);
98
+ if (unreadable !== undefined) {
99
+ return {
100
+ kind: "deny",
101
+ reason: `${VERDICT_FILE} is not readable as JSON (${unreadable}). Re-run delphi-review.`,
102
+ };
103
+ }
104
+ if (verdict !== "APPROVED") {
105
+ return {
106
+ kind: "deny",
107
+ reason: `delphi-review verdict is "${verdict || "(missing)"}", not APPROVED. ` +
108
+ "Address the findings and re-run delphi-review, then retry.",
109
+ };
110
+ }
111
+ return undefined;
112
+ }
113
+ //# sourceMappingURL=hooks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hooks.js","sourceRoot":"","sources":["../src/hooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,gEAAgE;AAChE,MAAM,UAAU,GAAwB,IAAI,GAAG,CAAC,C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AE,OAAO,EAAE,CAAA;IACpB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,iFAAiF;QACjF,8EAA8E;QAC9E,OAAO,EAAE,UAAU,EAAG,KAAe,CAAC,OAAO,EAAE,CAAA;IACjD,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAY,EAAE,QAAgB;IAChE,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;QAAE,OAAO,SAAS,CAAA;IAC3C,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;QAAE,OAAO,SAAS,CAAA;IAE/D,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,EAAE,gBAAgB,EAAE,YAAY,CAAC,CAAA;IAC9D,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;QAC7B,OAAO;YACL,IAAI,EAAE,MAAM;YACZ,MAAM,EACJ,gFAAgF;gBAChF,oCAAoC;SACvC,CAAA;IACH,CAAC;IAED,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,WAAW,CAAC,IAAI,CAAC,CAAA;IACjD,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC7B,OAAO;YACL,IAAI,EAAE,MAAM;YACZ,MAAM,EAAE,GAAG,YAAY,6BAA6B,UAAU,0BAA0B;SACzF,CAAA;IACH,CAAC;IACD,IAAI,OAAO,KAAK,UAAU,EAAE,CAAC;QAC3B,OAAO;YACL,IAAI,EAAE,MAAM;YACZ,MAAM,EACJ,6BAA6B,OAAO,IAAI,WAAW,mBAAmB;gBACtE,4DAA4D;SAC/D,CAAA;IACH,CAAC;IACD,OAAO,SAAS,CAAA;AAClB,CAAC"}
package/lib/index.d.ts CHANGED
@@ -1,5 +1,20 @@
1
+ import z from "@deepseek-ai/schemastery";
1
2
  import type { Context } from "@deepseek-ai/cordis";
2
3
  export declare const name = "tool-xp-gate";
3
4
  export declare const inject: string[];
4
- export declare function apply(ctx: Context, _config?: unknown): void;
5
+ /**
6
+ * Runtime schema for the keys above.
7
+ *
8
+ * Exported as a schema, not just a type: DSH validates against it and surfaces the
9
+ * keys in the profile schema, so a user can discover and set them. A bare interface
10
+ * is invisible to the harness.
11
+ */
12
+ export declare const Config: z<Schemastery.ObjectS<NoInfer<{
13
+ principlesCheck: z<"auto" | "off", "auto" | "off", "defined">;
14
+ delphiGuard: z<"auto" | "off", "auto" | "off", "defined">;
15
+ }>>, Schemastery.ObjectT<NoInfer<{
16
+ principlesCheck: z<"auto" | "off", "auto" | "off", "defined">;
17
+ delphiGuard: z<"auto" | "off", "auto" | "off", "defined">;
18
+ }>>, "plain">;
19
+ export declare function apply(ctx: Context, config?: unknown): void;
5
20
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAOlD,eAAO,MAAM,IAAI,iBAAiB,CAAA;AAClC,eAAO,MAAM,MAAM,UAAqB,CAAA;AAuKxC,wBAAgB,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,GAAE,OAAY,GAAG,IAAI,CAS/D"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,OAAO,CAAC,MAAM,0BAA0B,CAAA;AACxC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAgBlD,eAAO,MAAM,IAAI,iBAAiB,CAAA;AAGlC,eAAO,MAAM,MAAM,UAA+B,CAAA;AA0TlD;;;;;;GAMG;AACH,eAAO,MAAM,MAAM;;;;;;aAajB,CAAA;AAEF,wBAAgB,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,GAAE,OAAY,GAAG,IAAI,CA6B9D"}
package/lib/index.js CHANGED
@@ -1,14 +1,47 @@
1
+ import { writeFile } from "node:fs/promises";
2
+ import { join } from "node:path";
3
+ import { fileURLToPath } from "node:url";
1
4
  import { defineTool } from "@deepseek-ai/dsh-tools";
5
+ import z from "@deepseek-ai/schemastery";
2
6
  import { GATE_WHITELIST, buildCommand, detectDialect, resolveTarget } from "./command.js";
3
7
  import { runXpGate } from "./gate-runner.js";
4
- import { DelphiSetupError, loadDelphiConfig, toDelphiOptions } from "./delphi-config.js";
8
+ import { DelphiSetupError, listCredentialReferences, loadDelphiConfig, toDelphiOptions } from "./delphi-config.js";
5
9
  import { formatOutcome, runReview } from "./delphi-run.js";
10
+ import { buildEvidence } from "./evidence.js";
11
+ import { readGitContext } from "./git-context.js";
12
+ import { delphiGuardDecision, isCheckablePath, isEditTool } from "./hooks.js";
13
+ import { PHASE_STATUSES, SPRINT_SUBCOMMANDS, buildSprintCommand } from "./sprint.js";
14
+ import { createSkillProvider } from "./skill-provider.js";
15
+ import { createCredentialResolver } from "./credentials.js";
6
16
  export const name = "tool-xp-gate";
7
- export const inject = ["tools", "shell"];
17
+ // "skills" is required: the bundled skill provider registers during apply(), and
18
+ // without it ctx.skills may not be mounted yet when this plugin starts.
19
+ export const inject = ["tools", "shell", "skills"];
20
+ /**
21
+ * Absolute path to the skills directory shipped alongside this module.
22
+ *
23
+ * Resolved from `import.meta.url` rather than `process.cwd()`: after an npm
24
+ * install the plugin lives in the profile's node_modules, so the working
25
+ * directory says nothing about where its assets are. This is the same
26
+ * resolution the official `@deepseek-ai/dsh-skill-office` uses.
27
+ */
28
+ function bundledSkillsRoot() {
29
+ return fileURLToPath(new URL("../skills/", import.meta.url));
30
+ }
8
31
  const DEFAULT_TIMEOUT_MS = 120_000;
9
32
  // Multi-round reviews over large inputs are slow; the transport applies its
10
33
  // own per-request timeout on top of this ceiling.
11
34
  const DELPHI_TIMEOUT_MS = 900_000;
35
+ /** The document Gate MW reads at push time. */
36
+ const EVIDENCE_FILE = ".code-walkthrough-result.json";
37
+ /**
38
+ * Files already reported on in this process.
39
+ *
40
+ * Server-lifetime rather than session-lifetime on purpose: the addon outlives any
41
+ * one session, and re-reporting the same unchanged file to a second session would
42
+ * spend a subprocess to repeat something already said.
43
+ */
44
+ const checkedThisSession = new Set();
12
45
  // Boy Scout (#447): gate-check's `gates` parameter nests one level too deep
13
46
  // inline (parameters → gates → items), so the schema lives at module scope.
14
47
  const GATES_PARAMETER = {
@@ -100,12 +133,60 @@ function gateArchTool(shell, dialect) {
100
133
  // Boy Scout (#447): the review body used to sit inline in execute() at 5 brace
101
134
  // levels (defineTool → execute → try → runReview options). Module scope keeps
102
135
  // the try/catch semantics identical while dropping two levels.
103
- async function runDelphiReview(subject, addressed, maxRounds, cwd) {
136
+ /**
137
+ * Write .code-walkthrough-result.json for Gate MW, or explain why it cannot.
138
+ *
139
+ * Returns a suffix for the tool's output rather than throwing: the review itself
140
+ * succeeded, and losing its text because evidence could not be written would be a
141
+ * worse outcome than a clear note that the push gate will not be satisfied.
142
+ */
143
+ async function writeWalkthroughEvidence(cwd, cfg, outcome) {
144
+ try {
145
+ const lastRound = outcome.rounds[outcome.rounds.length - 1];
146
+ const seats = lastRound.verdicts.map((v) => ({
147
+ role: v.role,
148
+ model: v.requestedModel,
149
+ resolved: v.resolvedModel ?? "",
150
+ }));
151
+ const git = readGitContext(cwd);
152
+ const evidence = buildEvidence({
153
+ head: git.head,
154
+ branch: git.branch,
155
+ seats,
156
+ verdict: outcome.consensus ? "APPROVED" : "REQUEST_CHANGES",
157
+ now: new Date(),
158
+ baseUrl: cfg.baseUrl,
159
+ consensusRatio: outcome.finalRatio,
160
+ });
161
+ const target = join(cwd, EVIDENCE_FILE);
162
+ await writeFile(target, `${JSON.stringify(evidence, null, 2)}\n`, "utf8");
163
+ return `\nEvidence: ${EVIDENCE_FILE} written for ${evidence.commit.slice(0, 8)}.`;
164
+ }
165
+ catch (error) {
166
+ return `\nEvidence: not written — ${error.message}`;
167
+ }
168
+ }
169
+ async function runDelphiReview(subject, request) {
170
+ const { addressed, maxRounds, cwd, resolveApiKey, signal, writeEvidence } = request;
104
171
  try {
105
- const cfg = loadDelphiConfig(cwd);
106
- const outcome = await runReview({ ...toDelphiOptions(cfg), maxRounds: maxRounds ?? cfg.maxRounds }, subject, addressed);
172
+ // Resolve credentials BEFORE loading the config: the loader is synchronous and
173
+ // throws as soon as a referenced variable has no value. Reading the reference
174
+ // names first turns "the DSH process never inherited WHALECLOUD_API_KEY" from a
175
+ // hard failure into a lookup in the credential store.
176
+ const apiKeyOverrides = {};
177
+ for (const name of listCredentialReferences(cwd)) {
178
+ const value = await resolveApiKey(name);
179
+ if (value !== undefined && value.length > 0)
180
+ apiKeyOverrides[name] = value;
181
+ }
182
+ const cfg = loadDelphiConfig(cwd, process.env, undefined, apiKeyOverrides);
183
+ const options = toDelphiOptions(cfg);
184
+ const outcome = await runReview({ ...options, maxRounds: maxRounds ?? cfg.maxRounds }, subject, addressed, signal);
107
185
  const seats = cfg.seats.map((s) => s.model).join(", ");
108
- return `${formatOutcome(outcome)}\n\nProvider: ${cfg.provider}\nSeats: ${seats}`;
186
+ const suffix = writeEvidence
187
+ ? await writeWalkthroughEvidence(cwd, cfg, outcome)
188
+ : "";
189
+ return `${formatOutcome(outcome)}\n\nProvider: ${cfg.provider}\nSeats: ${seats}${suffix}`;
109
190
  }
110
191
  catch (e) {
111
192
  // Config problems are the common failure; report them as guidance
@@ -115,7 +196,7 @@ async function runDelphiReview(subject, addressed, maxRounds, cwd) {
115
196
  throw e;
116
197
  }
117
198
  }
118
- function delphiReviewTool() {
199
+ function delphiReviewTool(resolveApiKey) {
119
200
  return defineTool({
120
201
  name: "delphi-review",
121
202
  description: "Run a Delphi cross-review of a subject (a diff, a design, a spec) using three DISTINCT models from an external OpenAI-compatible provider configured in .delphi-config.json. Round 1 is anonymous and concurrent; later rounds feed back the aggregate until the approval ratio reaches the configured threshold (default 90%) or the round cap (default 5). Use this whenever a change needs independent multi-model review rather than a single model's opinion.",
@@ -137,6 +218,10 @@ function delphiReviewTool() {
137
218
  type: "string",
138
219
  description: "Project root containing .delphi-config.json (defaults to the session cwd).",
139
220
  },
221
+ writeEvidence: {
222
+ type: "boolean",
223
+ description: "Write .code-walkthrough-result.json for the Gate MW pre-push check. Off by default because it is a file side effect; requires an APPROVED review.",
224
+ },
140
225
  },
141
226
  output: {
142
227
  schema: { type: "string" },
@@ -145,18 +230,201 @@ function delphiReviewTool() {
145
230
  timeoutMs: DELPHI_TIMEOUT_MS,
146
231
  async execute(args, exec) {
147
232
  const cwd = args.cwd ?? exec.agent?.session?.header?.cwd ?? process.cwd();
148
- return runDelphiReview(args.subject, args.addressed ?? "", args.maxRounds, cwd);
233
+ return runDelphiReview(args.subject, {
234
+ addressed: args.addressed ?? "",
235
+ maxRounds: args.maxRounds,
236
+ cwd,
237
+ resolveApiKey,
238
+ signal: exec.signal,
239
+ writeEvidence: args.writeEvidence ?? false,
240
+ });
241
+ },
242
+ });
243
+ }
244
+ /**
245
+ * Sprint-flow state commands.
246
+ *
247
+ * The sprint-flow skill tells the model to run these by name; without a tool the
248
+ * instruction was unfollowable. Deliberately narrow: the subcommand and the
249
+ * phase-transition status are enumerated, and paths are quoted, so this does not
250
+ * become a passthrough to the whole CLI.
251
+ */
252
+ function sprintTool(shell, dialect) {
253
+ return defineTool({
254
+ name: "sprint",
255
+ description: "Inspect and advance XP-Gate Sprint Flow state: sprint-status, phase-transition, retro, ui-review, sprint-init, sprint-audit, next-sprint.",
256
+ parameters: {
257
+ subcommand: {
258
+ type: "string",
259
+ required: true,
260
+ description: `One of: ${SPRINT_SUBCOMMANDS.join(", ")}.`,
261
+ // Enumerated rather than free text: the schema rejects anything else before
262
+ // the value could ever reach a shell.
263
+ enum: SPRINT_SUBCOMMANDS.slice(),
264
+ },
265
+ phase: { type: "string", description: "phase-transition only: phase number, 1-6." },
266
+ status: {
267
+ type: "string",
268
+ description: "phase-transition only: phase status.",
269
+ enum: PHASE_STATUSES.slice(),
270
+ },
271
+ dir: { type: "string", description: "Project directory (absolute or relative)." },
272
+ json: { type: "boolean", description: "Request JSON output where supported." },
273
+ days: { type: "number", description: "retro only: days to look back." },
274
+ all: { type: "boolean", description: "retro only: cover every sprint." },
275
+ },
276
+ output: {
277
+ schema: { type: "string" },
278
+ render: (_args, value) => [{ type: "text", text: value }],
279
+ },
280
+ timeoutMs: DEFAULT_TIMEOUT_MS,
281
+ async execute(args, exec) {
282
+ const cwd = exec.agent?.session?.header?.cwd ?? process.cwd();
283
+ const command = buildSprintCommand(args.subcommand, args, dialect);
284
+ return runXpGate(shell, exec.signal, command, cwd, DEFAULT_TIMEOUT_MS);
149
285
  },
150
286
  });
151
287
  }
152
- export function apply(ctx, _config = {}) {
288
+ /**
289
+ * Runtime schema for the keys above.
290
+ *
291
+ * Exported as a schema, not just a type: DSH validates against it and surfaces the
292
+ * keys in the profile schema, so a user can discover and set them. A bare interface
293
+ * is invisible to the harness.
294
+ */
295
+ export const Config = z.object({
296
+ principlesCheck: z
297
+ .union([z.const("auto"), z.const("off")])
298
+ .default("auto")
299
+ .description("Save-time principles check: auto = on for source files, once per file; off = do not register the hook."),
300
+ delphiGuard: z
301
+ .union([z.const("auto"), z.const("off")])
302
+ .default("auto")
303
+ .description("Sprint write guard: auto = deny edits until delphi-review is APPROVED; off = do not register the hook."),
304
+ });
305
+ export function apply(ctx, config = {}) {
306
+ const cfg = config;
153
307
  // DSH runs a POSIX shell off-Windows and PowerShell on Windows; generating the
154
308
  // wrong dialect makes every tool fail to parse rather than degrade gracefully.
155
309
  const dialect = detectDialect();
156
310
  const shell = ctx.shell;
311
+ // ctx.credentials is optional: outside DSH there is no store, and the resolver
312
+ // then reads the process environment directly. Inside DSH this is what makes
313
+ // delphi-review work on a machine whose key lives in the credential store rather
314
+ // than in the host process's inherited environment.
315
+ //
316
+ // The cast is needed because the service is attached by a peer package's module
317
+ // augmentation, which only applies when that package is in the compilation; a
318
+ // consumer may install this plugin without it.
319
+ const credentials = ctx.credentials;
320
+ const resolveApiKey = createCredentialResolver(credentials, process.env);
157
321
  ctx.tools.register(gateCheckTool(shell, dialect));
158
322
  ctx.tools.register(gatePrinciplesTool(shell, dialect));
159
323
  ctx.tools.register(gateArchTool(shell, dialect));
160
- ctx.tools.register(delphiReviewTool());
324
+ ctx.tools.register(delphiReviewTool(resolveApiKey));
325
+ ctx.tools.register(sprintTool(shell, dialect));
326
+ // Publishing the 12 bundled skills is what makes them visible to the model.
327
+ // They ship in the tarball either way, but without a provider no discovery
328
+ // root points at the plugin directory and the model never sees them — the v1
329
+ // bug this provider exists to fix.
330
+ ctx.skills.registerProvider(() => createSkillProvider(bundledSkillsRoot()));
331
+ registerHooks(ctx, shell, dialect, cfg);
332
+ }
333
+ /**
334
+ * Attach the advisory principles result to an accepted tool result.
335
+ *
336
+ * Best effort by contract: a throwing post-execute fails the tool call, which is a
337
+ * much worse outcome than skipping one advisory check, so nothing here propagates.
338
+ */
339
+ async function enrichWithPrinciples(shell, dialect, exec, result, next) {
340
+ try {
341
+ const note = await principlesNote(shell, dialect, exec, result);
342
+ if (note === undefined)
343
+ return next();
344
+ const accepted = await next();
345
+ if (accepted.kind !== "accept" || accepted.value !== undefined)
346
+ return accepted;
347
+ // Appended to the tool's own output rather than as a separate message: the model
348
+ // reads it immediately, with no dependency on message identity.
349
+ return {
350
+ ...accepted,
351
+ content: [...(accepted.content ?? []), { type: "text", text: note }],
352
+ };
353
+ }
354
+ catch {
355
+ return next();
356
+ }
357
+ }
358
+ /**
359
+ * Register the pre/post-execute hooks.
360
+ *
361
+ * Both default to on and are individually switchable, because each is a policy a
362
+ * repository may reasonably reject: the guard blocks writes, and the save check
363
+ * costs a subprocess per file.
364
+ */
365
+ function registerHooks(ctx, shell, dialect, cfg) {
366
+ if (cfg.delphiGuard !== "off") {
367
+ ctx.on("tools/pre-execute", async (exec, next) => {
368
+ const cwd = sessionCwd(exec) ?? process.cwd();
369
+ // Deny before dispatch so the edit never reaches the filesystem.
370
+ return delphiGuardDecision(cwd, exec.name) ?? next();
371
+ });
372
+ }
373
+ if (cfg.principlesCheck !== "off") {
374
+ ctx.on("tools/post-execute", (exec, result, next) => enrichWithPrinciples(shell, dialect, exec, result, next));
375
+ }
376
+ }
377
+ /** The session cwd, if the execution carries one. */
378
+ function sessionCwd(exec) {
379
+ return exec.agent?.session?.header?.cwd;
380
+ }
381
+ /**
382
+ * Advisory principles result for a just-written file, or undefined to stay silent.
383
+ *
384
+ * Cost is the whole design here. `xp-gate principles` is a Node CLI with a
385
+ * 200-400ms cold start, and an editing session makes dozens of edits, so two
386
+ * filters cut nearly all of the calls:
387
+ *
388
+ * - extension allowlist: the engine covers source files, not .md/.json/.yaml,
389
+ * which are a large share of the edits in repositories that use xp-gate
390
+ * - per-process dedupe: the model often edits the same file ten times in a row, and
391
+ * those later edits are it fixing what the first check reported
392
+ *
393
+ * Anything unexpected returns undefined. Blocking the tool call to report an
394
+ * advisory violation would be far worse than missing the report.
395
+ */
396
+ async function principlesNote(shell, dialect, exec, result) {
397
+ if (!isEditTool(exec.name) || result.isError)
398
+ return undefined;
399
+ const path = writtenPath(exec.arguments);
400
+ if (path === undefined || !isCheckablePath(path))
401
+ return undefined;
402
+ const cwd = sessionCwd(exec) ?? process.cwd();
403
+ const absolute = resolveTarget(path, cwd);
404
+ if (checkedThisSession.has(absolute))
405
+ return undefined;
406
+ checkedThisSession.add(absolute);
407
+ try {
408
+ // No caller signal reaches a post-execute hook; the hook's own ceiling is enough,
409
+ // and it is the shell that enforces it.
410
+ const report = await runXpGate(shell, AbortSignal.timeout(DEFAULT_TIMEOUT_MS), buildCommand({ subcommand: "principles", target: absolute, dialect }), cwd, DEFAULT_TIMEOUT_MS);
411
+ return `[XP-Gate] principles for ${path}:\n${report}`;
412
+ }
413
+ catch {
414
+ return undefined;
415
+ }
416
+ }
417
+ /**
418
+ * The file a write/edit touched.
419
+ *
420
+ * Both shapes appear across DSH's file tools, so both are read rather than assuming
421
+ * one: `file_path` from the fs tools, `path` from str-replace-editor.
422
+ */
423
+ function writtenPath(args) {
424
+ if (typeof args !== "object" || args === null)
425
+ return undefined;
426
+ const record = args;
427
+ const candidate = record.file_path ?? record.path;
428
+ return typeof candidate === "string" && candidate.length > 0 ? candidate : undefined;
161
429
  }
162
430
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAGnD,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AACzF,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC5C,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACxF,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE1D,MAAM,CAAC,MAAM,IAAI,GAAG,cAAc,CAAA;AAClC,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;AAExC,MAAM,kBAAkB,GAAG,OAAO,CAAA;AAClC,4EAA4E;AAC5E,kDAAkD;AAClD,MAAM,iBAAiB,GAAG,OAAO,CAAA;AAEjC,4EAA4E;AAC5E,4EAA4E;AAC5E,MAAM,eAAe,GAAG;IACtB,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,cAAc,EAAE;IAC/C,WAAW,EAAE,4DAA4D;CACjE,CAAA;AAEV,4EAA4E;AAC5E,8EAA8E;AAC9E,0BAA0B;AAC1B,SAAS,aAAa,CAAC,KAAuB,EAAE,OAAqB;IACnE,OAAO,UAAU,CAAC;QAChB,IAAI,EAAE,YAAY;QAClB,WAAW,EACT,2LAA2L;QAC7L,UAAU,EAAE;YACV,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAA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IAC/D,MAAM,MAAM,GAAG,IAA+C,CAAA;IAC9D,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,IAAI,MAAM,CAAC,IAAI,CAAA;IACjD,OAAO,OAAO,SAAS,KAAK,QAAQ,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAA;AACtF,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { SkillCandidate, SkillProvider } from "@deepseek-ai/dsh-skill";
2
+ /**
3
+ * Build the DSH skill candidates for every skill bundled under `root`.
4
+ * Exposed for tests and for callers that need the catalog without a provider.
5
+ */
6
+ export declare function listBundledSkills(root: string): SkillCandidate[];
7
+ /**
8
+ * Create the XP-Gate skill provider for a given skills root.
9
+ *
10
+ * Mirrors the shape of the official `@deepseek-ai/dsh-skill-office` provider:
11
+ * candidates are scanned once, bodies are re-read on every `get()` so editing a
12
+ * skill takes effect without restarting the host.
13
+ */
14
+ export declare function createSkillProvider(root: string): SkillProvider;
15
+ //# sourceMappingURL=skill-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skill-provider.d.ts","sourceRoot":"","sources":["../src/skill-provider.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,cAAc,EAGd,aAAa,EACd,MAAM,wBAAwB,CAAA;AA8I/B;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,EAAE,CAahE;AA6CD;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,CAS/D"}