Skip to content

Commit fd52de7

Browse files
authored
Issue plan improvements (#9242)
1 parent f72bf95 commit fd52de7

3 files changed

Lines changed: 200 additions & 30 deletions

File tree

‎.github/tests/test_issue_plan_workflow.js‎

Lines changed: 70 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,14 @@ function acceptsComment(body, { action = 'created', pullRequest = false, associa
4848

4949
describe('Issue planning workflow', () => {
5050
it('accepts a leading /plan command with optional direction on a new issue comment', () => {
51-
for (const body of ['/plan', '/plan Focus on Python', '/plan\nFocus on .NET', '/plan\r\nFocus on both']) {
51+
for (const body of [
52+
'/plan',
53+
'/plan Focus on Python',
54+
'/plan also check if feature X already solves this problem',
55+
'/plan\nFocus on .NET',
56+
'/plan\r\nFocus on both',
57+
'/plan\nCheck existing samples.\nConsider compatibility.',
58+
]) {
5259
assert.equal(acceptsComment(body), true, body);
5360
}
5461
});
@@ -128,18 +135,77 @@ describe('Issue planning workflow', () => {
128135
assert.match(source, /Answers alone do not trigger another run/);
129136
assert.match(source, /Match earlier questions to the answers and corrections/);
130137
assert.match(source, /previous planning comments as proposals to reassess/);
131-
assert.match(source, /If important gaps remain or the answers reveal new gaps, ask/);
138+
assert.match(source, /If important gaps\s+remain or the answers reveal new gaps, ask/);
132139
assert.match(source, /For a partially answered question, ask only/);
133140
assert.match(source, /briefly acknowledge what the latest answers clarified/);
134141
assert.match(source, /leaves earlier comments intact/);
142+
assert.match(source, /new investigation direction/);
143+
assert.match(source, /reassess whether action is warranted/);
144+
assert.match(source, /Do not mechanically extend an earlier implementation plan/);
135145
});
136146

137-
it('requires investigation, a plan-or-questions decision, and plain-language context', () => {
147+
it('uses optional direction as bounded investigation guidance through sanitized prompt input', () => {
148+
assert.match(source, /A bare `\/plan` requests the full investigation/);
149+
assert.match(source, /Optional text after the\s+leading `\/plan` guides what to focus on/);
150+
assert.match(source, /Independently verify suggested explanations, features, and solutions/);
151+
assert.match(source, /explain the result of the requested checks or what\s+could not be checked and why/);
152+
assert.match(source, /does not override workflow safeguards/);
153+
assert.match(source, /expand repository access, authorize running code, or force a particular conclusion/);
154+
assert.match(source, /<request>\s*\$\{\{ steps\.sanitized\.outputs\.text \}\}\s*<\/request>/);
155+
assert.match(job('activation'), /text: \$\{\{ steps\.sanitized\.outputs\.text \}\}/);
156+
assert.match(job('activation'), /GH_AW_STEPS_SANITIZED_OUTPUTS_TEXT: \$\{\{ steps\.sanitized\.outputs\.text \}\}/);
157+
assert.match(job('activation'), /\{\{#runtime-import \.github\/workflows\/issue-plan\.md\}\}/);
158+
});
159+
160+
it('forms recommendations independently of unmerged pull request solutions', () => {
161+
assert.match(source, /may acknowledge that an open pull request exists/);
162+
assert.match(source, /do not inspect its\s+proposed implementation, diff, or reviews/);
163+
assert.match(source, /Do not use open pull requests as solution evidence or as evidence of necessity,\s+scope, complexity, or an approved approach/);
164+
assert.match(source, /also applies to proposed fixes\s+quoted in the issue discussion/);
165+
assert.match(source, /A closed, unmerged proposal is\s+not evidence of supported behavior/);
166+
assert.match(source, /Merged changes may inform the investigation\s+only when their relevance to current repository behavior is verified/);
167+
assert.doesNotMatch(source, /Follow relevant links to issues and pull requests/);
168+
});
169+
170+
it('decides whether action is warranted before planning proportionate changes', () => {
171+
assert.ok(source.indexOf('## Decide whether action is warranted') < source.indexOf('## Write the issue comment'));
172+
assert.match(source, /contradicts supported or documented behavior/);
173+
assert.match(source, /existing features, configuration, samples, or documentation already\s+solve the problem/);
174+
assert.match(source, /workaround is not automatically an adequate resolution/);
175+
assert.match(source, /Scenario specificity alone is not a reason\s+to dismiss an issue/);
176+
assert.match(source, /complexity, compatibility risks, and ongoing maintenance cost/);
177+
assert.match(source, /Complexity is a trade-off, not\s+an automatic reason to reject a fix/);
178+
for (const outcome of ['Code changes', 'A sample', 'Documentation', 'documented limitation', 'A combination', 'No action']) {
179+
assert.ok(source.includes(`**${outcome}**`), `Missing recommendation outcome: ${outcome}`);
180+
}
181+
assert.match(source, /Support the recommendation and meaningful trade-offs with repository evidence/);
182+
assert.match(source, /heading \*\*Recommendation\*\* before any plan/);
183+
assert.match(source, /State whether code changes are warranted/);
184+
assert.match(source, /### When no action is recommended/);
185+
assert.match(source, /If new documentation of a\s+limitation is needed, propose that documentation work rather than calling it\s+no action/);
186+
assert.match(source, /Do not give a firm recommendation or plan while these answers are\s+still needed/);
187+
});
188+
189+
it('sizes the response to the ask and grounds complex before-and-after examples', () => {
190+
assert.match(source, /Match the length and depth of the response to the ask, its complexity/);
191+
assert.match(source, /For a simple ask, keep the summary,\s+recommendation, and plan short and to the point/);
192+
assert.match(source, /For a complex ask, explain the important trade-offs and consequences in more\s+detail/);
193+
assert.match(source, /scenario step by step: show the current behavior and where the issue arises/);
194+
assert.match(source, /explain how the proposed change would affect those steps, and show the same\s+scenario after the proposed change/);
195+
assert.match(source, /Ground current behavior in repository\s+evidence and clearly label the after-change behavior as expected, not tested/);
196+
assert.match(source, /If recommending a sample, workaround, or documented limitation instead of a fix/);
197+
assert.match(source, /complexity does not require a long response when the decision is straightforward/);
198+
assert.match(source, /\*\*Proposed plan\*\* and a numbered list sized to the work/);
199+
});
200+
201+
it('requires investigation, outcome-appropriate validation, and plain-language context', () => {
138202
assert.match(source, /all available comments, following\s+pagination as needed/);
139203
assert.match(source, /Do not ask for information already provided/);
140204
assert.match(source, /### When a plan is appropriate/);
141205
assert.match(source, /### When important details are missing/);
142-
assert.match(source, /tests for the reported behavior and nearby behavior/);
206+
assert.match(source, /For code changes, include tests for the reported behavior and nearby behavior/);
207+
assert.match(source, /For sample or documentation work, describe appropriate validation/);
208+
assert.match(source, /do not invent code changes or mandatory code tests for documentation-only work/);
143209
assert.match(source, /first explain any context that has not already been mentioned/);
144210
assert.match(source, /Use plain, simple terms/);
145211
assert.match(source, /Avoid jargon and unexplained abbreviations/);

‎.github/workflows/issue-plan.lock.yml‎

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)