patchrelay 0.41.7 → 0.42.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/dist/build-info.json +3 -3
- package/dist/hook-runner.js +18 -1
- package/dist/prompting/patchrelay.js +16 -0
- package/package.json +1 -1
package/dist/build-info.json
CHANGED
package/dist/hook-runner.js
CHANGED
|
@@ -8,7 +8,7 @@ export async function runProjectHook(repoPath, hookName, options) {
|
|
|
8
8
|
}
|
|
9
9
|
const result = await execCommand(hookPath, [], {
|
|
10
10
|
cwd: options.cwd,
|
|
11
|
-
env: { ...
|
|
11
|
+
env: { ...sanitizedParentEnv(), ...(options.env ?? {}) },
|
|
12
12
|
timeoutMs: options.timeoutMs ?? 120_000,
|
|
13
13
|
});
|
|
14
14
|
return {
|
|
@@ -18,6 +18,23 @@ export async function runProjectHook(repoPath, hookName, options) {
|
|
|
18
18
|
stderr: result.stderr,
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
|
+
// Patchrelay runs as a service with NODE_ENV=production, which makes `npm ci`
|
|
22
|
+
// in a project hook silently omit devDependencies. The subject project's install
|
|
23
|
+
// surface is a separate concern from patchrelay's own runtime, so scrub the
|
|
24
|
+
// variables that would leak patchrelay's production posture into the hook.
|
|
25
|
+
const STRIPPED_PARENT_ENV_VARS = [
|
|
26
|
+
"NODE_ENV",
|
|
27
|
+
"NPM_CONFIG_PRODUCTION",
|
|
28
|
+
"NPM_CONFIG_OMIT",
|
|
29
|
+
"NPM_CONFIG_INCLUDE",
|
|
30
|
+
];
|
|
31
|
+
function sanitizedParentEnv() {
|
|
32
|
+
const env = { ...process.env };
|
|
33
|
+
for (const key of STRIPPED_PARENT_ENV_VARS) {
|
|
34
|
+
delete env[key];
|
|
35
|
+
}
|
|
36
|
+
return env;
|
|
37
|
+
}
|
|
21
38
|
export function buildHookEnv(issueKey, branchName, stage, worktreePath) {
|
|
22
39
|
return {
|
|
23
40
|
PATCHRELAY_ISSUE_KEY: issueKey,
|
|
@@ -356,6 +356,22 @@ function buildPublicationContract(runType) {
|
|
|
356
356
|
"If the worktree already contains relevant changes for this issue, verify them and publish them.",
|
|
357
357
|
"If you changed files for this issue, commit them, push the issue branch, and open or update the PR before stopping.",
|
|
358
358
|
"Do not stop with only local commits or uncommitted changes.",
|
|
359
|
+
"",
|
|
360
|
+
"## PR Body Contract",
|
|
361
|
+
"",
|
|
362
|
+
"When you open or update a PR, shape the body so a strict reviewer can decide in one pass.",
|
|
363
|
+
"",
|
|
364
|
+
"Title: imperative, ≤72 chars. Do not prefix with the issue key — the branch carries it.",
|
|
365
|
+
"",
|
|
366
|
+
"Body sections, in this order. Omit any that do not apply but keep the order:",
|
|
367
|
+
"",
|
|
368
|
+
" ## Why — 1-3 sentences on the problem and motivation.",
|
|
369
|
+
" ## What — ≤5 bullets naming the files or surfaces that change.",
|
|
370
|
+
" ## Tradeoffs — one explicit tradeoff taken, or the single word \"None\".",
|
|
371
|
+
" ## Risks — 1-3 things a strict reviewer would ask about. For each, either fix it before committing or explain why it is acceptable. This section is load-bearing; a strict reviewer reads it first.",
|
|
372
|
+
"",
|
|
373
|
+
"Do not restate the diff in prose. Quote the ambiguous fragment directly if the reader needs to see it.",
|
|
374
|
+
"Do not add a \"Verification\" or \"I ran these commands\" section; CI owns pass/fail and posts check runs the reviewer already sees.",
|
|
359
375
|
].join("\n");
|
|
360
376
|
}
|
|
361
377
|
return [
|