patchrelay 0.36.4 → 0.36.5

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "service": "patchrelay",
3
- "version": "0.36.4",
4
- "commit": "1202c3df2bcb",
5
- "builtAt": "2026-04-09T07:03:52.765Z"
3
+ "version": "0.36.5",
4
+ "commit": "1f30d4407cf6",
5
+ "builtAt": "2026-04-09T08:27:55.606Z"
6
6
  }
@@ -134,6 +134,34 @@ function appendTaskObjective(lines, issue) {
134
134
  }
135
135
  lines.push("");
136
136
  }
137
+ function extractIssueSection(description, heading) {
138
+ if (!description)
139
+ return undefined;
140
+ const escaped = heading.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
141
+ const pattern = new RegExp(`^## ${escaped}\\s*$([\\s\\S]*?)(?=^##\\s+|$)`, "im");
142
+ const match = description.match(pattern);
143
+ const body = match?.[1]?.trim();
144
+ return body && body.length > 0 ? body : undefined;
145
+ }
146
+ function appendScopeDiscipline(lines, issue) {
147
+ const description = issue.description?.trim();
148
+ const scope = extractIssueSection(description, "Scope");
149
+ const acceptance = extractIssueSection(description, "Acceptance criteria")
150
+ ?? extractIssueSection(description, "Success criteria");
151
+ const relevantCode = extractIssueSection(description, "Relevant code");
152
+ lines.push("## Scope Discipline", "");
153
+ lines.push("Stay inside the delegated task.", "Finish the issue completely enough to satisfy its stated scope and acceptance criteria, but do not widen it into unrelated product polish or follow-up cleanup.", "Only broaden to adjacent routes, copy, or supporting surfaces when the issue text or repository guidance explicitly says they are the same user flow.", "If you notice a worthwhile broader inconsistency that is not required to make this task correct, mention it in your summary as follow-up context instead of expanding the implementation.", "");
154
+ if (scope) {
155
+ lines.push("### In Scope", "", scope, "");
156
+ }
157
+ if (acceptance) {
158
+ lines.push("### Acceptance / Done", "", acceptance, "");
159
+ }
160
+ if (relevantCode) {
161
+ lines.push("### Relevant Code", "", relevantCode, "");
162
+ }
163
+ lines.push("### Likely Review Invariants", "", "- Check the surfaces explicitly named in the task before stopping.", "- If repository guidance says certain changed surfaces are one flow, verify that shared flow, but do not treat unrelated surrounding cleanup as part of this task.", "- A review repair should fix the concrete concern on the current head, not silently expand the Linear issue into a broader rewrite.", "");
164
+ }
137
165
  function appendLinearContext(lines, context) {
138
166
  const promptContext = typeof context?.promptContext === "string" ? context.promptContext.trim() : "";
139
167
  const latestPrompt = typeof context?.promptBody === "string" ? context.promptBody.trim() : "";
@@ -404,6 +432,7 @@ function appendRequestedChangesInstructions(lines, runType, context) {
404
432
  export function buildInitialRunPrompt(issue, runType, repoPath, context) {
405
433
  const lines = buildPromptHeader(issue);
406
434
  appendTaskObjective(lines, issue);
435
+ appendScopeDiscipline(lines, issue);
407
436
  appendLinearContext(lines, context);
408
437
  // Add run-type-specific context for reactive runs
409
438
  switch (runType) {
@@ -440,6 +469,8 @@ export function buildInitialRunPrompt(issue, runType, repoPath, context) {
440
469
  export function buildFollowUpRunPrompt(issue, runType, repoPath, context) {
441
470
  const lines = buildPromptHeader(issue);
442
471
  appendFollowUpPromptPrelude(lines, issue, runType, context);
472
+ appendTaskObjective(lines, issue);
473
+ appendScopeDiscipline(lines, issue);
443
474
  // Add run-type-specific context for reactive runs
444
475
  switch (runType) {
445
476
  case "ci_repair": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "patchrelay",
3
- "version": "0.36.4",
3
+ "version": "0.36.5",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "repository": {