@lannguyensi/harness 0.13.0 → 0.15.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.
- package/CHANGELOG.md +55 -0
- package/README.md +11 -1
- package/dist/cli/approve/understanding.d.ts +15 -0
- package/dist/cli/approve/understanding.js +26 -6
- package/dist/cli/approve/understanding.js.map +1 -1
- package/dist/cli/explain.js +11 -1
- package/dist/cli/explain.js.map +1 -1
- package/dist/cli/index.js +9 -2
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/init/composer.d.ts +29 -0
- package/dist/cli/init/composer.js +377 -0
- package/dist/cli/init/composer.js.map +1 -0
- package/dist/cli/init/dependencies.d.ts +25 -0
- package/dist/cli/init/dependencies.js +100 -10
- package/dist/cli/init/dependencies.js.map +1 -1
- package/dist/cli/init/index.d.ts +18 -1
- package/dist/cli/init/index.js +17 -7
- package/dist/cli/init/index.js.map +1 -1
- package/dist/cli/init/interactive.d.ts +31 -2
- package/dist/cli/init/interactive.js +321 -79
- package/dist/cli/init/interactive.js.map +1 -1
- package/dist/cli/init/templates.d.ts +1 -1
- package/dist/cli/init/templates.js +60 -9
- package/dist/cli/init/templates.js.map +1 -1
- package/dist/cli/pack/hook-codex-pre-tool-use.d.ts +2 -0
- package/dist/cli/pack/hook-codex-pre-tool-use.js +35 -9
- package/dist/cli/pack/hook-codex-pre-tool-use.js.map +1 -1
- package/dist/cli/pack/hook-pre-tool-use.d.ts +1 -1
- package/dist/cli/pack/hook-pre-tool-use.js +80 -25
- package/dist/cli/pack/hook-pre-tool-use.js.map +1 -1
- package/dist/cli/validate/checks.d.ts +1 -1
- package/dist/cli/validate/checks.js +1 -7
- package/dist/cli/validate/checks.js.map +1 -1
- package/dist/io/harness-lock.js +1 -9
- package/dist/io/harness-lock.js.map +1 -1
- package/dist/policies/index.d.ts +1 -1
- package/dist/policies/index.js +1 -1
- package/dist/policies/index.js.map +1 -1
- package/dist/policies/ledger-client.js +3 -9
- package/dist/policies/ledger-client.js.map +1 -1
- package/dist/policies/producers.d.ts +12 -0
- package/dist/policies/producers.js +61 -0
- package/dist/policies/producers.js.map +1 -0
- package/dist/policies/requires.d.ts +23 -0
- package/dist/policies/requires.js +39 -0
- package/dist/policies/requires.js.map +1 -1
- package/dist/policy-packs/builtin/understanding-before-execution-runtime.d.ts +44 -6
- package/dist/policy-packs/builtin/understanding-before-execution-runtime.js +126 -10
- package/dist/policy-packs/builtin/understanding-before-execution-runtime.js.map +1 -1
- package/dist/runtime/expand-home.d.ts +14 -0
- package/dist/runtime/expand-home.js +54 -0
- package/dist/runtime/expand-home.js.map +1 -0
- package/dist/runtime/intercept.d.ts +8 -0
- package/dist/runtime/intercept.js +24 -1
- package/dist/runtime/intercept.js.map +1 -1
- package/dist/runtime/ledger-add.js +10 -3
- package/dist/runtime/ledger-add.js.map +1 -1
- package/dist/runtime/ledger-record.js +11 -10
- package/dist/runtime/ledger-record.js.map +1 -1
- package/dist/schema/index.d.ts +281 -101
- package/dist/schema/permission-profiles.d.ts +125 -125
- package/dist/schema/policies.d.ts +261 -0
- package/dist/schema/policies.js +50 -0
- package/dist/schema/policies.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,377 @@
|
|
|
1
|
+
// À la carte manifest composer for `harness init --interactive` Custom
|
|
2
|
+
// profile (tasks 31d2fbb5 + 5dd3d8a6). The composer turns a discrete
|
|
3
|
+
// checkbox selection into a YAML manifest that `harness validate`
|
|
4
|
+
// accepts.
|
|
5
|
+
//
|
|
6
|
+
// Current surface (parity with FULL_TEMPLATE): one policy pack
|
|
7
|
+
// (understanding-before-execution), four MCPs (agent-tasks,
|
|
8
|
+
// grounding-mcp, memory-router — wired under memory.router, NOT
|
|
9
|
+
// tools.mcp[] — and codebase-oracle), and six reference policies
|
|
10
|
+
// (review-before-merge, preflight-before-investigation,
|
|
11
|
+
// review-subagent-before-pr-create, preflight-before-push,
|
|
12
|
+
// dogfood-before-release, two-reviewers-required). The opencode pack
|
|
13
|
+
// stays disabled in the wire-now multiselect until its runtime adapter
|
|
14
|
+
// (agent-tasks/f34eb233) lands.
|
|
15
|
+
//
|
|
16
|
+
// Design: build a plain object matching the Manifest schema, then
|
|
17
|
+
// serialise via the `yaml` library. The shared `init()` path
|
|
18
|
+
// (validateBeforeWrite, file lock, overwrite guard) handles persistence
|
|
19
|
+
// so Custom rejoins the same write/validate semantics as
|
|
20
|
+
// solo/team/full.
|
|
21
|
+
import { stringify } from "yaml";
|
|
22
|
+
export const COMPOSABLE_PACKS = [
|
|
23
|
+
{
|
|
24
|
+
key: "understanding-before-execution",
|
|
25
|
+
label: "understanding-before-execution",
|
|
26
|
+
description: "Force agents to expose their interpretation and wait for approval before any write-capable tool fires.",
|
|
27
|
+
},
|
|
28
|
+
];
|
|
29
|
+
export const COMPOSABLE_MCPS = [
|
|
30
|
+
{
|
|
31
|
+
key: "agent-tasks",
|
|
32
|
+
label: "agent-tasks",
|
|
33
|
+
description: "Backlog + PR workflow MCP bridge (agent-tasks-mcp-bridge).",
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
key: "grounding-mcp",
|
|
37
|
+
label: "grounding-mcp",
|
|
38
|
+
description: "Evidence ledger + understanding-gate approval surface.",
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
key: "memory-router",
|
|
42
|
+
label: "memory-router (wired under memory.router, not tools.mcp[])",
|
|
43
|
+
description: "Cross-conversation memory routing via UserPromptSubmit.",
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
key: "codebase-oracle",
|
|
47
|
+
label: "codebase-oracle (needs ORACLE_SCAN_ROOT + OPENAI_API_KEY env vars)",
|
|
48
|
+
description: "Multi-repo semantic search MCP server. Set ORACLE_SCAN_ROOT to an absolute path (tilde is NOT expanded) and an embedding-provider key before the first call.",
|
|
49
|
+
},
|
|
50
|
+
];
|
|
51
|
+
export const COMPOSABLE_POLICIES = [
|
|
52
|
+
{
|
|
53
|
+
key: "review-before-merge",
|
|
54
|
+
label: "review-before-merge",
|
|
55
|
+
description: "Block mcp__agent-tasks__pull_requests_merge unless a review:<pr-number> ledger entry exists.",
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
key: "preflight-before-investigation",
|
|
59
|
+
label: "preflight-before-investigation",
|
|
60
|
+
description: "Block git status/log/diff/branch unless preflight:<repo> ledger entry exists for this repo (within 1h).",
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
key: "review-subagent-before-pr-create",
|
|
64
|
+
label: "review-subagent-before-pr-create",
|
|
65
|
+
description: "Block mcp__agent-tasks__pull_requests_create unless a review-subagent:<task-id> ledger entry exists.",
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
key: "preflight-before-push",
|
|
69
|
+
label: "preflight-before-push",
|
|
70
|
+
description: "Block git push unless preflight:<branch> ledger entry exists for the current branch (within 10m).",
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
key: "dogfood-before-release",
|
|
74
|
+
label: "dogfood-before-release",
|
|
75
|
+
description: "Block npm publish / git tag v* unless a dogfood:<session-id> ledger entry exists in this session (within 24h).",
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
key: "two-reviewers-required",
|
|
79
|
+
label: "two-reviewers-required (warn-level companion to review-before-merge)",
|
|
80
|
+
description: "Warn when PR-merge runs without TWO distinct review:<pr-number> ledger entries. Enforcement: warn.",
|
|
81
|
+
},
|
|
82
|
+
];
|
|
83
|
+
const HOOK_FOR_POLICY = {
|
|
84
|
+
"review-before-merge": {
|
|
85
|
+
name: "require-review-evidence",
|
|
86
|
+
event: "PreToolUse",
|
|
87
|
+
match: "mcp__agent-tasks__pull_requests_merge",
|
|
88
|
+
command: "harness policy intercept",
|
|
89
|
+
blocking: "hard",
|
|
90
|
+
budget_ms: 2000,
|
|
91
|
+
},
|
|
92
|
+
"preflight-before-investigation": {
|
|
93
|
+
name: "require-preflight-evidence",
|
|
94
|
+
event: "PreToolUse",
|
|
95
|
+
match: "Bash",
|
|
96
|
+
bash_match: "(^|\\n|;|\\||&&|\\()\\s*(\\w+=\\S+\\s+)*git( -C \\S+)* (status|log|diff|branch)\\b",
|
|
97
|
+
command: "harness policy intercept",
|
|
98
|
+
blocking: "hard",
|
|
99
|
+
budget_ms: 1000,
|
|
100
|
+
},
|
|
101
|
+
"review-subagent-before-pr-create": {
|
|
102
|
+
name: "require-review-subagent-evidence",
|
|
103
|
+
event: "PreToolUse",
|
|
104
|
+
match: "mcp__agent-tasks__pull_requests_create",
|
|
105
|
+
command: "harness policy intercept",
|
|
106
|
+
blocking: "hard",
|
|
107
|
+
budget_ms: 2000,
|
|
108
|
+
},
|
|
109
|
+
"preflight-before-push": {
|
|
110
|
+
name: "require-preflight-push-evidence",
|
|
111
|
+
event: "PreToolUse",
|
|
112
|
+
match: "Bash",
|
|
113
|
+
bash_match: "(^|\\n|;|\\||&&|\\()\\s*(\\w+=\\S+\\s+)*git( -C \\S+)* push\\b",
|
|
114
|
+
command: "harness policy intercept",
|
|
115
|
+
blocking: "hard",
|
|
116
|
+
budget_ms: 1000,
|
|
117
|
+
},
|
|
118
|
+
"dogfood-before-release": {
|
|
119
|
+
name: "require-dogfood-evidence",
|
|
120
|
+
event: "PreToolUse",
|
|
121
|
+
match: "Bash",
|
|
122
|
+
bash_match: "(^|\\n|;|\\||&&|\\()\\s*(\\w+=\\S+\\s+)*(npm publish\\b|git( -C \\S+)* tag v)",
|
|
123
|
+
command: "harness policy intercept",
|
|
124
|
+
blocking: "hard",
|
|
125
|
+
budget_ms: 2000,
|
|
126
|
+
},
|
|
127
|
+
// two-reviewers-required shares review-before-merge's hook; the policy
|
|
128
|
+
// intercept engine evaluates both policies under the same trigger and
|
|
129
|
+
// each enforces independently (block vs warn). We still need a hook
|
|
130
|
+
// entry so the policy's `hook:` field round-trips through validate,
|
|
131
|
+
// but it's the same row as require-review-evidence.
|
|
132
|
+
"two-reviewers-required": {
|
|
133
|
+
name: "require-review-evidence",
|
|
134
|
+
event: "PreToolUse",
|
|
135
|
+
match: "mcp__agent-tasks__pull_requests_merge",
|
|
136
|
+
command: "harness policy intercept",
|
|
137
|
+
blocking: "hard",
|
|
138
|
+
budget_ms: 2000,
|
|
139
|
+
},
|
|
140
|
+
};
|
|
141
|
+
const POLICY = {
|
|
142
|
+
"review-before-merge": {
|
|
143
|
+
name: "review-before-merge",
|
|
144
|
+
description: "Block PR merges unless a ledger entry tagged review:<pr-number> exists for this session.",
|
|
145
|
+
trigger: {
|
|
146
|
+
event: "PreToolUse",
|
|
147
|
+
match: "mcp__agent-tasks__pull_requests_merge",
|
|
148
|
+
extract: { PR_NUMBER: "toolArgs.prNumber" },
|
|
149
|
+
},
|
|
150
|
+
requires: { ledger_tag: "review:${PR_NUMBER}" },
|
|
151
|
+
hook: "require-review-evidence",
|
|
152
|
+
enforcement: "block",
|
|
153
|
+
},
|
|
154
|
+
"preflight-before-investigation": {
|
|
155
|
+
name: "preflight-before-investigation",
|
|
156
|
+
description: "Block investigative git reads (status/log/diff/branch) when agent-preflight has not run recently with ready:true for the current repo.",
|
|
157
|
+
trigger: {
|
|
158
|
+
event: "PreToolUse",
|
|
159
|
+
match: "Bash",
|
|
160
|
+
bash_match: "(^|\\n|;|\\||&&|\\()\\s*(\\w+=\\S+\\s+)*git( -C \\S+)* (status|log|diff|branch)\\b",
|
|
161
|
+
},
|
|
162
|
+
requires: { ledger_tag: "preflight:${REPO}", within: "1h" },
|
|
163
|
+
hook: "require-preflight-evidence",
|
|
164
|
+
enforcement: "block",
|
|
165
|
+
},
|
|
166
|
+
"review-subagent-before-pr-create": {
|
|
167
|
+
name: "review-subagent-before-pr-create",
|
|
168
|
+
description: "Block agent-tasks PR creation unless a review-subagent ledger entry tagged for this task already exists. Forces the rigorous review BEFORE the PR opens, not after.",
|
|
169
|
+
trigger: {
|
|
170
|
+
event: "PreToolUse",
|
|
171
|
+
match: "mcp__agent-tasks__pull_requests_create",
|
|
172
|
+
extract: { TASK_ID: "toolArgs.taskId" },
|
|
173
|
+
},
|
|
174
|
+
requires: { ledger_tag: "review-subagent:${TASK_ID}" },
|
|
175
|
+
hook: "require-review-subagent-evidence",
|
|
176
|
+
enforcement: "block",
|
|
177
|
+
},
|
|
178
|
+
"preflight-before-push": {
|
|
179
|
+
name: "preflight-before-push",
|
|
180
|
+
description: "Block git push unless a fresh preflight ledger entry exists for the current branch. Catches the stale-checkout class of incident at the last reversible step.",
|
|
181
|
+
trigger: {
|
|
182
|
+
event: "PreToolUse",
|
|
183
|
+
match: "Bash",
|
|
184
|
+
bash_match: "(^|\\n|;|\\||&&|\\()\\s*(\\w+=\\S+\\s+)*git( -C \\S+)* push\\b",
|
|
185
|
+
},
|
|
186
|
+
requires: { ledger_tag: "preflight:${BRANCH}", within: "10m" },
|
|
187
|
+
hook: "require-preflight-push-evidence",
|
|
188
|
+
enforcement: "block",
|
|
189
|
+
},
|
|
190
|
+
"dogfood-before-release": {
|
|
191
|
+
name: "dogfood-before-release",
|
|
192
|
+
description: "Block npm publish / git tag v* without a recent dogfood ledger entry.",
|
|
193
|
+
trigger: {
|
|
194
|
+
event: "PreToolUse",
|
|
195
|
+
match: "Bash",
|
|
196
|
+
bash_match: "(^|\\n|;|\\||&&|\\()\\s*(\\w+=\\S+\\s+)*(npm publish\\b|git( -C \\S+)* tag v)",
|
|
197
|
+
},
|
|
198
|
+
requires: { ledger_tag: "dogfood:${SESSION_ID}", within: "24h" },
|
|
199
|
+
hook: "require-dogfood-evidence",
|
|
200
|
+
enforcement: "block",
|
|
201
|
+
},
|
|
202
|
+
"two-reviewers-required": {
|
|
203
|
+
name: "two-reviewers-required",
|
|
204
|
+
description: "At least two distinct reviewer ledger entries must exist for the PR.",
|
|
205
|
+
trigger: {
|
|
206
|
+
event: "PreToolUse",
|
|
207
|
+
match: "mcp__agent-tasks__pull_requests_merge",
|
|
208
|
+
extract: { PR_NUMBER: "toolArgs.prNumber" },
|
|
209
|
+
},
|
|
210
|
+
requires: { ledger_tag: "review:${PR_NUMBER}", count: { min: 2 } },
|
|
211
|
+
hook: "require-review-evidence",
|
|
212
|
+
enforcement: "warn",
|
|
213
|
+
},
|
|
214
|
+
};
|
|
215
|
+
const MCP_ENTRY = {
|
|
216
|
+
"agent-tasks": {
|
|
217
|
+
name: "agent-tasks",
|
|
218
|
+
command: ["agent-tasks-mcp-bridge"],
|
|
219
|
+
min_version: "0.6.0",
|
|
220
|
+
health: { verb: "projects_list", timeout_ms: 5000 },
|
|
221
|
+
enabled: true,
|
|
222
|
+
},
|
|
223
|
+
"grounding-mcp": {
|
|
224
|
+
name: "grounding-mcp",
|
|
225
|
+
command: ["grounding-mcp"],
|
|
226
|
+
min_version: "0.2.0",
|
|
227
|
+
health: { verb: "ledger_status", timeout_ms: 5000 },
|
|
228
|
+
enabled: true,
|
|
229
|
+
},
|
|
230
|
+
// codebase-oracle: harness wires the MCP entry but cannot prompt for
|
|
231
|
+
// the absolute ORACLE_SCAN_ROOT path or the OPENAI_API_KEY (or any
|
|
232
|
+
// other embedding-provider key). The wizard emits a composer.warning
|
|
233
|
+
// when this is picked so the operator knows the env vars still need
|
|
234
|
+
// to be set in their shell or settings.json before the first call.
|
|
235
|
+
// Note: passing a literal tilde in env values bypasses shell expansion
|
|
236
|
+
// (see grounding-mcp incident in FULL_TEMPLATE comments), so the
|
|
237
|
+
// wizard does NOT auto-default ORACLE_SCAN_ROOT to ~/code — the
|
|
238
|
+
// operator must supply an absolute path themselves.
|
|
239
|
+
"codebase-oracle": {
|
|
240
|
+
name: "codebase-oracle",
|
|
241
|
+
command: ["codebase-oracle", "mcp"],
|
|
242
|
+
enabled: true,
|
|
243
|
+
},
|
|
244
|
+
};
|
|
245
|
+
const HEADER = [
|
|
246
|
+
"# ~/.claude/harness.yaml",
|
|
247
|
+
"#",
|
|
248
|
+
"# Bootstrapped by `harness init --interactive` (Custom profile).",
|
|
249
|
+
"#",
|
|
250
|
+
"# Composed à la carte from your checkbox picks. Re-run the wizard",
|
|
251
|
+
"# or edit by hand to add / remove components.",
|
|
252
|
+
"",
|
|
253
|
+
].join("\n");
|
|
254
|
+
export function composeCustom(sel) {
|
|
255
|
+
const warnings = [];
|
|
256
|
+
const mcpSet = new Set(sel.mcps);
|
|
257
|
+
// Producer-consistency advisories: each policy's `requires.ledger_tag`
|
|
258
|
+
// implies some producer must populate that tag. agent-tasks-coupled
|
|
259
|
+
// policies need the agent-tasks MCP wired; preflight-coupled policies
|
|
260
|
+
// need either grounding-mcp (so ledger_add reaches the gate) or a
|
|
261
|
+
// SessionStart preflight hook. The Custom v1 surface does not expose
|
|
262
|
+
// the SessionStart hook yet, so only check the MCP coupling.
|
|
263
|
+
if (sel.policies.includes("review-before-merge") && !mcpSet.has("agent-tasks")) {
|
|
264
|
+
warnings.push("policy review-before-merge fires on agent-tasks MCP verbs; selecting it without the agent-tasks MCP is allowed but the gate has no event to evaluate.");
|
|
265
|
+
}
|
|
266
|
+
if (sel.policies.includes("review-subagent-before-pr-create") &&
|
|
267
|
+
!mcpSet.has("agent-tasks")) {
|
|
268
|
+
warnings.push("policy review-subagent-before-pr-create fires on agent-tasks MCP verbs; selecting it without the agent-tasks MCP is allowed but the gate has no event to evaluate.");
|
|
269
|
+
}
|
|
270
|
+
if (sel.policies.includes("two-reviewers-required") && !mcpSet.has("agent-tasks")) {
|
|
271
|
+
warnings.push("policy two-reviewers-required fires on agent-tasks MCP verbs; selecting it without the agent-tasks MCP is allowed but the gate has no event to evaluate.");
|
|
272
|
+
}
|
|
273
|
+
// Note: understanding-before-execution does NOT produce preflight tags
|
|
274
|
+
// (it produces the operator-approve marker, a different gate signal).
|
|
275
|
+
// The pack is therefore NOT a substitute for grounding-mcp here; the
|
|
276
|
+
// only Custom-surface producer the wizard can wire is grounding-mcp's
|
|
277
|
+
// ledger_add.
|
|
278
|
+
if (sel.policies.includes("preflight-before-investigation") &&
|
|
279
|
+
!mcpSet.has("grounding-mcp")) {
|
|
280
|
+
warnings.push("policy preflight-before-investigation requires a producer that writes preflight:<repo> tags to the evidence ledger. Without grounding-mcp (ledger_add) or a separate SessionStart preflight hook (not in the Custom surface), the gate stays closed forever.");
|
|
281
|
+
}
|
|
282
|
+
if (sel.policies.includes("preflight-before-push") && !mcpSet.has("grounding-mcp")) {
|
|
283
|
+
warnings.push("policy preflight-before-push requires a producer that writes preflight:<branch> tags to the evidence ledger. Without grounding-mcp (ledger_add) or a separate SessionStart preflight hook (not in the Custom surface), the gate stays closed forever.");
|
|
284
|
+
}
|
|
285
|
+
if (sel.policies.includes("dogfood-before-release") && !mcpSet.has("grounding-mcp")) {
|
|
286
|
+
warnings.push("policy dogfood-before-release requires a producer that writes dogfood:<session-id> tags to the evidence ledger. Without grounding-mcp (ledger_add) the gate stays closed forever — every npm publish / git tag v* will be blocked.");
|
|
287
|
+
}
|
|
288
|
+
if (mcpSet.has("codebase-oracle")) {
|
|
289
|
+
warnings.push("MCP codebase-oracle requires ORACLE_SCAN_ROOT (absolute path; tilde is NOT expanded) and OPENAI_API_KEY (or ORACLE_LLM_PROVIDER + the matching provider key) set in your shell or in Claude's settings.json env block before the first call. The wizard does NOT prompt for these.");
|
|
290
|
+
}
|
|
291
|
+
const manifest = {
|
|
292
|
+
version: 1,
|
|
293
|
+
grounding: {
|
|
294
|
+
session: { auto_start: true, id_format: "gs-{repo}-{rand:8}" },
|
|
295
|
+
evidence_ledger: { path: "~/.evidence-ledger/ledger.db", retention_days: 90 },
|
|
296
|
+
},
|
|
297
|
+
tools: {
|
|
298
|
+
builtin: {
|
|
299
|
+
known: ["Read", "Edit", "Write", "Bash", "Agent", "Skill", "TaskCreate", "Glob", "Grep"],
|
|
300
|
+
},
|
|
301
|
+
},
|
|
302
|
+
memory: {
|
|
303
|
+
directories: [
|
|
304
|
+
{ path: sel.memoryDir ?? "~/.claude/projects/{project}/memory", scope: "project" },
|
|
305
|
+
],
|
|
306
|
+
retention: { staleness_days: 180, broken_refs: "warn" },
|
|
307
|
+
scopes: { default: "project", allowed: ["project", "user"] },
|
|
308
|
+
},
|
|
309
|
+
};
|
|
310
|
+
// tools.mcp[] only for non-memory-router MCP picks (memory-router
|
|
311
|
+
// routes user-prompts and is structurally a different slot under
|
|
312
|
+
// memory.router; treating it as a tools.mcp[] entry would fail
|
|
313
|
+
// validation).
|
|
314
|
+
const mcpEntries = sel.mcps
|
|
315
|
+
.filter((m) => m !== "memory-router")
|
|
316
|
+
.map((k) => MCP_ENTRY[k]);
|
|
317
|
+
if (mcpEntries.length > 0) {
|
|
318
|
+
manifest.tools.mcp = mcpEntries;
|
|
319
|
+
}
|
|
320
|
+
if (mcpSet.has("memory-router")) {
|
|
321
|
+
manifest.memory.router = {
|
|
322
|
+
command: ["memory-router-user-prompt-submit"],
|
|
323
|
+
min_version: "0.3.0",
|
|
324
|
+
enabled: true,
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
if (sel.policies.length > 0) {
|
|
328
|
+
// Dedup hooks by name: two-reviewers-required + review-before-merge
|
|
329
|
+
// both reference `require-review-evidence`, but the schema's
|
|
330
|
+
// superRefine rejects duplicate hook names (each hook entry must be
|
|
331
|
+
// unique). Emit each hook at most once; the same row services every
|
|
332
|
+
// referencing policy.
|
|
333
|
+
const seenHookName = new Set();
|
|
334
|
+
const hooks = [];
|
|
335
|
+
for (const p of sel.policies) {
|
|
336
|
+
const h = HOOK_FOR_POLICY[p];
|
|
337
|
+
if (seenHookName.has(h.name))
|
|
338
|
+
continue;
|
|
339
|
+
seenHookName.add(h.name);
|
|
340
|
+
hooks.push(h);
|
|
341
|
+
}
|
|
342
|
+
manifest.hooks = hooks;
|
|
343
|
+
manifest.policies = sel.policies.map((p) => POLICY[p]);
|
|
344
|
+
}
|
|
345
|
+
if (sel.packs.length > 0) {
|
|
346
|
+
manifest.policy_packs = sel.packs.map((k) => {
|
|
347
|
+
// Single-pack switch today; expand when the pack surface grows.
|
|
348
|
+
if (k === "understanding-before-execution") {
|
|
349
|
+
return {
|
|
350
|
+
name: "understanding-before-execution",
|
|
351
|
+
source: "builtin",
|
|
352
|
+
enabled: true,
|
|
353
|
+
description: "Force agents to expose their task interpretation and wait for explicit human approval before any write-capable tool fires.",
|
|
354
|
+
config: {
|
|
355
|
+
mode: "grill_me",
|
|
356
|
+
producers: [
|
|
357
|
+
{
|
|
358
|
+
kind: "ask",
|
|
359
|
+
command: "harness approve understanding",
|
|
360
|
+
description: "Bare command, no pipes or chaining. The hook recognises it via isEscapeCommand and emits permissionDecision:ask; the operator's go on that prompt IS the gate approval. Golden path.",
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
kind: "bash",
|
|
364
|
+
command: "harness approve understanding",
|
|
365
|
+
description: "Same command from any un-hooked terminal (operator only, not reachable from inside the gated session). Writes the canonical marker at harness.generated/.approvals/${SESSION_ID}.",
|
|
366
|
+
},
|
|
367
|
+
],
|
|
368
|
+
},
|
|
369
|
+
};
|
|
370
|
+
}
|
|
371
|
+
throw new Error(`composer: unknown pack ${String(k)}`);
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
const yaml = `${HEADER}\n${stringify(manifest, { lineWidth: 100 })}`;
|
|
375
|
+
return { yaml, warnings };
|
|
376
|
+
}
|
|
377
|
+
//# sourceMappingURL=composer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"composer.js","sourceRoot":"","sources":["../../../src/cli/init/composer.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,qEAAqE;AACrE,kEAAkE;AAClE,WAAW;AACX,EAAE;AACF,+DAA+D;AAC/D,4DAA4D;AAC5D,gEAAgE;AAChE,iEAAiE;AACjE,wDAAwD;AACxD,2DAA2D;AAC3D,qEAAqE;AACrE,uEAAuE;AACvE,gCAAgC;AAChC,EAAE;AACF,kEAAkE;AAClE,6DAA6D;AAC7D,wEAAwE;AACxE,yDAAyD;AACzD,kBAAkB;AAElB,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAsBjC,MAAM,CAAC,MAAM,gBAAgB,GAAmD;IAC9E;QACE,GAAG,EAAE,gCAAgC;QACrC,KAAK,EAAE,gCAAg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ACzD,CAAC;IAED,IAAI,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACzB,QAAQ,CAAC,YAAY,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;YAC1C,gEAAgE;YAChE,IAAI,CAAC,KAAK,gCAAgC,EAAE,CAAC;gBAC3C,OAAO;oBACL,IAAI,EAAE,gCAAgC;oBACtC,MAAM,EAAE,SAAS;oBACjB,OAAO,EAAE,IAAI;oBACb,WAAW,EACT,4HAA4H;oBAC9H,MAAM,EAAE;wBACN,IAAI,EAAE,UAAU;wBAChB,SAAS,EAAE;4BACT;gCACE,IAAI,EAAE,KAAK;gCACX,OAAO,EAAE,+BAA+B;gCACxC,WAAW,EACT,sLAAsL;6BACzL;4BACD;gCACE,IAAI,EAAE,MAAM;gCACZ,OAAO,EAAE,+BAA+B;gCACxC,WAAW,EACT,mLAAmL;6BACtL;yBACF;qBACF;iBACF,CAAC;YACJ,CAAC;YACD,MAAM,IAAI,KAAK,CAAC,0BAA0B,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QACzD,CAAC,CAAC,CAAC;IACL,CAAC;IAED,MAAM,IAAI,GAAG,GAAG,MAAM,KAAK,SAAS,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;IACrE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;AAC5B,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ProfileChoice } from "./interactive.js";
|
|
2
|
+
import type { CustomSelection } from "./composer.js";
|
|
2
3
|
/**
|
|
3
4
|
* One required binary that must end up on PATH for a given profile's
|
|
4
5
|
* manifest to pass `harness doctor`. `binary` is the executable name we
|
|
@@ -7,12 +8,22 @@ import type { ProfileChoice } from "./interactive.js";
|
|
|
7
8
|
* we list them all so that a partial install still reads as "complete"
|
|
8
9
|
* for whichever binaries we depend on (e.g. understanding-gate ships
|
|
9
10
|
* three hook adapters; the manifest only wires two of them).
|
|
11
|
+
*
|
|
12
|
+
* `minVersion` is informational only today (rendered in the wizard's
|
|
13
|
+
* dependency table next to the package name) so operators see the
|
|
14
|
+
* floor a feature depends on. The wizard does NOT yet probe the
|
|
15
|
+
* installed bin's version, so a stale install proceeds silently;
|
|
16
|
+
* upgrade hint is on the operator. Adding actual enforcement is a
|
|
17
|
+
* separate task (mirrors the MCP `min_version` doctor probe pattern
|
|
18
|
+
* already wired in FULL_TEMPLATE for MCP entries).
|
|
10
19
|
*/
|
|
11
20
|
export interface ProfileDependency {
|
|
12
21
|
binary: string;
|
|
13
22
|
npmPackage: string;
|
|
14
23
|
/** Short label rendered in the wizard's dependency table. */
|
|
15
24
|
description: string;
|
|
25
|
+
/** Optional floor, displayed as `pkg@x.y.z+`. Informational only. */
|
|
26
|
+
minVersion?: string;
|
|
16
27
|
}
|
|
17
28
|
export declare const PROFILE_DEPENDENCIES: Record<Exclude<ProfileChoice, "custom">, ProfileDependency[]>;
|
|
18
29
|
/**
|
|
@@ -42,6 +53,20 @@ export interface CheckOptions {
|
|
|
42
53
|
* `npm i -g <pkg1> <pkg2>` call.
|
|
43
54
|
*/
|
|
44
55
|
export declare function checkDependencies(profile: Exclude<ProfileChoice, "custom">, opts?: CheckOptions): DependencyCheckResult;
|
|
56
|
+
/**
|
|
57
|
+
* List-based variant of `checkDependencies` for callers that compute a
|
|
58
|
+
* bespoke dep set (e.g. the Custom-profile composer in task 31d2fbb5).
|
|
59
|
+
* Same semantics: resolve each binary on PATH, return statuses +
|
|
60
|
+
* de-duped missing packages.
|
|
61
|
+
*/
|
|
62
|
+
export declare function checkDependencyList(deps: ProfileDependency[], opts?: CheckOptions): DependencyCheckResult;
|
|
63
|
+
/**
|
|
64
|
+
* Resolve the dependency list for a Custom-profile selection. Maps each
|
|
65
|
+
* checkbox key to its underlying binary requirement. Used by the
|
|
66
|
+
* interactive wizard's Custom branch so the dependency-check + install
|
|
67
|
+
* UX is identical to the named profiles.
|
|
68
|
+
*/
|
|
69
|
+
export declare function dependenciesForCustom(sel: CustomSelection): ProfileDependency[];
|
|
45
70
|
/**
|
|
46
71
|
* Render the dependency table the wizard shows to the operator. Pure
|
|
47
72
|
* function so tests can lock the surface text without spawning a
|
|
@@ -24,16 +24,24 @@ export const PROFILE_DEPENDENCIES = {
|
|
|
24
24
|
binary: "memory-router-user-prompt-submit",
|
|
25
25
|
npmPackage: "@lannguyensi/memory-router",
|
|
26
26
|
description: "memory router (UserPromptSubmit hook)",
|
|
27
|
+
// Mirrors the FULL_TEMPLATE memory.router min_version floor (the
|
|
28
|
+
// `--version` short-circuit harness doctor expects landed in 0.3.0).
|
|
29
|
+
minVersion: "0.3.0",
|
|
27
30
|
},
|
|
28
31
|
{
|
|
29
32
|
binary: "understanding-gate-claude-hook",
|
|
30
33
|
npmPackage: "@lannguyensi/understanding-gate",
|
|
31
34
|
description: "understanding gate (UserPromptSubmit injector)",
|
|
35
|
+
// 0.3.0 added parser-side bullet-to-section mapping so
|
|
36
|
+
// fast_confirm reports actually persist end-to-end (agent-grounding
|
|
37
|
+
// PR #78). Operators on 0.2.x silently miss the fix.
|
|
38
|
+
minVersion: "0.3.0",
|
|
32
39
|
},
|
|
33
40
|
{
|
|
34
41
|
binary: "understanding-gate-claude-stop",
|
|
35
42
|
npmPackage: "@lannguyensi/understanding-gate",
|
|
36
43
|
description: "understanding gate (Stop capture)",
|
|
44
|
+
minVersion: "0.3.0",
|
|
37
45
|
},
|
|
38
46
|
],
|
|
39
47
|
team: [
|
|
@@ -50,15 +58,18 @@ export const PROFILE_DEPENDENCIES = {
|
|
|
50
58
|
},
|
|
51
59
|
],
|
|
52
60
|
// Full inherits everything from Solo + Team, and adds the
|
|
53
|
-
// SessionStart preflight producer: the `git-preflight` hook shells
|
|
54
|
-
// to `agent-preflight` (`preflight` binary) to write
|
|
55
|
-
// to the ledger, which is what the
|
|
61
|
+
// SessionStart preflight producer: the `git-preflight` hook shells
|
|
62
|
+
// out to `agent-preflight` (`preflight` binary) to write
|
|
63
|
+
// `preflight:${REPO}` to the ledger, which is what the
|
|
64
|
+
// `preflight-before-*` policies match.
|
|
56
65
|
//
|
|
57
|
-
//
|
|
58
|
-
//
|
|
59
|
-
//
|
|
60
|
-
//
|
|
61
|
-
//
|
|
66
|
+
// codebase-oracle (`@lannguyensi/codebase-oracle`) is intentionally
|
|
67
|
+
// NOT in the Full chain. It is a useful standalone MCP for multi-repo
|
|
68
|
+
// semantic search, but harness itself does not require it and the
|
|
69
|
+
// setup cost (ORACLE_SCAN_ROOT + an embedding provider key + initial
|
|
70
|
+
// index run) is not worth pushing on every Full-profile operator.
|
|
71
|
+
// See FULL_TEMPLATE comment under `tools.mcp` for the manual wiring
|
|
72
|
+
// recipe (`harness add mcp codebase-oracle --command codebase-oracle,mcp`).
|
|
62
73
|
full: [
|
|
63
74
|
{
|
|
64
75
|
binary: "preflight",
|
|
@@ -116,10 +127,19 @@ function findOnPath(binary, pathEnv) {
|
|
|
116
127
|
* `npm i -g <pkg1> <pkg2>` call.
|
|
117
128
|
*/
|
|
118
129
|
export function checkDependencies(profile, opts = {}) {
|
|
130
|
+
return checkDependencyList(dependenciesForProfile(profile), opts);
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* List-based variant of `checkDependencies` for callers that compute a
|
|
134
|
+
* bespoke dep set (e.g. the Custom-profile composer in task 31d2fbb5).
|
|
135
|
+
* Same semantics: resolve each binary on PATH, return statuses +
|
|
136
|
+
* de-duped missing packages.
|
|
137
|
+
*/
|
|
138
|
+
export function checkDependencyList(deps, opts = {}) {
|
|
119
139
|
const pathEnv = opts.pathEnv ?? process.env.PATH ?? "";
|
|
120
140
|
const statuses = [];
|
|
121
141
|
const missingPackages = new Set();
|
|
122
|
-
for (const dep of
|
|
142
|
+
for (const dep of deps) {
|
|
123
143
|
const resolved = findOnPath(dep.binary, pathEnv);
|
|
124
144
|
if (resolved) {
|
|
125
145
|
statuses.push({ dep, installed: true, resolvedPath: resolved });
|
|
@@ -131,6 +151,70 @@ export function checkDependencies(profile, opts = {}) {
|
|
|
131
151
|
}
|
|
132
152
|
return { statuses, missingPackages: [...missingPackages] };
|
|
133
153
|
}
|
|
154
|
+
/**
|
|
155
|
+
* Resolve the dependency list for a Custom-profile selection. Maps each
|
|
156
|
+
* checkbox key to its underlying binary requirement. Used by the
|
|
157
|
+
* interactive wizard's Custom branch so the dependency-check + install
|
|
158
|
+
* UX is identical to the named profiles.
|
|
159
|
+
*/
|
|
160
|
+
export function dependenciesForCustom(sel) {
|
|
161
|
+
const chain = [];
|
|
162
|
+
const seen = new Set();
|
|
163
|
+
const push = (dep) => {
|
|
164
|
+
if (seen.has(dep.binary))
|
|
165
|
+
return;
|
|
166
|
+
seen.add(dep.binary);
|
|
167
|
+
chain.push(dep);
|
|
168
|
+
};
|
|
169
|
+
// Pack → understanding-gate adapters (mirrors PROFILE_DEPENDENCIES.solo).
|
|
170
|
+
if (sel.packs.includes("understanding-before-execution")) {
|
|
171
|
+
for (const dep of PROFILE_DEPENDENCIES.solo) {
|
|
172
|
+
if (dep.binary.startsWith("understanding-gate-"))
|
|
173
|
+
push(dep);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
// MCPs → their bridges / bins. codebase-oracle is treated as a
|
|
177
|
+
// first-class dep here even though FULL_TEMPLATE deliberately omits
|
|
178
|
+
// it (the doc-table reasoning is that its setup cost is too high for
|
|
179
|
+
// every Full operator). Custom is opt-in, so an operator who ticks
|
|
180
|
+
// codebase-oracle has accepted that cost; we still install the bin
|
|
181
|
+
// for them. The env-var requirement is surfaced as a composer warning.
|
|
182
|
+
const mcpToBinary = {
|
|
183
|
+
"agent-tasks": "agent-tasks-mcp-bridge",
|
|
184
|
+
"grounding-mcp": "grounding-mcp",
|
|
185
|
+
"memory-router": "memory-router-user-prompt-submit",
|
|
186
|
+
"codebase-oracle": "codebase-oracle",
|
|
187
|
+
};
|
|
188
|
+
const extraDeps = [
|
|
189
|
+
{
|
|
190
|
+
binary: "codebase-oracle",
|
|
191
|
+
npmPackage: "@lannguyensi/codebase-oracle",
|
|
192
|
+
description: "codebase-oracle MCP server",
|
|
193
|
+
},
|
|
194
|
+
];
|
|
195
|
+
for (const m of sel.mcps) {
|
|
196
|
+
const targetBin = mcpToBinary[m];
|
|
197
|
+
const dep = PROFILE_DEPENDENCIES.solo.find((d) => d.binary === targetBin) ??
|
|
198
|
+
PROFILE_DEPENDENCIES.team.find((d) => d.binary === targetBin) ??
|
|
199
|
+
extraDeps.find((d) => d.binary === targetBin);
|
|
200
|
+
if (dep)
|
|
201
|
+
push(dep);
|
|
202
|
+
}
|
|
203
|
+
// preflight-* policies need agent-preflight on PATH (the
|
|
204
|
+
// SessionStart hook FULL_TEMPLATE wires; mirrors PROFILE_DEPENDENCIES.full).
|
|
205
|
+
// Even though the Custom surface does not expose the SessionStart hook
|
|
206
|
+
// yet, operators wiring the preflight gates will still want the
|
|
207
|
+
// producer binary installed so a manual `harness session-start preflight`
|
|
208
|
+
// invocation can populate the ledger tag.
|
|
209
|
+
const wantsPreflight = sel.policies.some((p) => p.startsWith("preflight-"));
|
|
210
|
+
if (wantsPreflight) {
|
|
211
|
+
for (const dep of PROFILE_DEPENDENCIES.full) {
|
|
212
|
+
if (dep.binary === "preflight")
|
|
213
|
+
push(dep);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
return chain;
|
|
217
|
+
}
|
|
134
218
|
/**
|
|
135
219
|
* Render the dependency table the wizard shows to the operator. Pure
|
|
136
220
|
* function so tests can lock the surface text without spawning a
|
|
@@ -141,9 +225,15 @@ export function formatDependencyTable(profile, result) {
|
|
|
141
225
|
lines.push(`Profile "${profile}" depends on these binaries:`);
|
|
142
226
|
for (const status of result.statuses) {
|
|
143
227
|
const mark = status.installed ? "✓" : "✗";
|
|
228
|
+
// minVersion is informational only at this layer (the wizard does
|
|
229
|
+
// not yet probe the installed bin's version); show it next to the
|
|
230
|
+
// package name so operators see the floor a feature depends on.
|
|
231
|
+
const pkgLabel = status.dep.minVersion
|
|
232
|
+
? `${status.dep.npmPackage}@${status.dep.minVersion}+`
|
|
233
|
+
: status.dep.npmPackage;
|
|
144
234
|
const where = status.installed
|
|
145
235
|
? `(already installed)`
|
|
146
|
-
: `→ ${
|
|
236
|
+
: `→ ${pkgLabel}`;
|
|
147
237
|
lines.push(` ${mark} ${status.dep.binary.padEnd(36)} ${where}`);
|
|
148
238
|
}
|
|
149
239
|
if (result.missingPackages.length === 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dependencies.js","sourceRoot":"","sources":["../../../src/cli/init/dependencies.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,2BAA2B;AAC3B,EAAE;AACF,oEAAoE;AACpE,sEAAsE;AACtE,uEAAuE;AACvE,wEAAwE;AACxE,mEAAmE;AACnE,uEAAuE;AACvE,oEAAoE;AACpE,iEAAiE;AACjE,EAAE;AACF,wEAAwE;AACxE,uEAAuE;AACvE,kEAAkE;AAClE,iEAAiE;AACjE,mDAAmD;AAEnD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAC5D,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"dependencies.js","sourceRoot":"","sources":["../../../src/cli/init/dependencies.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,2BAA2B;AAC3B,EAAE;AACF,oEAAoE;AACpE,sEAAsE;AACtE,uEAAuE;AACvE,wEAAwE;AACxE,mEAAmE;AACnE,uEAAuE;AACvE,oEAAoE;AACpE,iEAAiE;AACjE,EAAE;AACF,wEAAwE;AACxE,uEAAuE;AACvE,kEAAkE;AAClE,iEAAiE;AACjE,mDAAmD;AAEnD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAA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