-
Notifications
You must be signed in to change notification settings - Fork 4.6k
fix(apply): surface deferred scope instead of silently simplifying tasks #1530
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
917dc78
fix(apply): surface deferred scope instead of silently simplifying tasks
clay-good c6dc256
fix(apply): anchor deferred-scope guidance to spec scope, not effort
clay-good 844953d
fix(apply): name the "accept exceptions" pattern in deferred-scope gu…
clay-good dd6297e
test(apply): assert the deferred-scope guidance requires pausing
clay-good 4d224a1
Merge branch 'main' into claude/openspec-backlog-triage-b9df58
clay-good File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@fission-ai/openspec": patch | ||
| --- | ||
|
|
||
| Apply workflow now tells agents to surface unexpected scope instead of hiding it. When a task needs work beyond what the spec describes, the `/opsx:apply` skill and command guidance direct the agent to pause and report the added scope rather than silently narrowing, deferring, or simplifying away specified behavior, and to mark a task complete only when its specified behavior is fully implemented. Fixes #1529. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| import { describe, it, expect } from 'vitest'; | ||
| import { | ||
| getApplyInstructions, | ||
| getApplyChangeSkillTemplate, | ||
| getOpsxApplyCommandTemplate, | ||
| } from '../../../src/core/templates/workflows/apply-change.js'; | ||
|
|
||
| // #1529: agents were silently simplifying or deferring work mid-apply and | ||
| // marking tasks done anyway. The apply instructions must tell the agent to | ||
| // surface unexpected scope instead of absorbing it, on both surfaces. | ||
| describe('apply instructions surface deferred scope (#1529)', () => { | ||
| const instructions = getApplyInstructions(); | ||
|
|
||
| it('tells the agent to surface added scope rather than defer or simplify', () => { | ||
| expect(instructions).toContain('surface the added scope'); | ||
| expect(instructions).toContain('beyond what the spec describes'); | ||
| expect(instructions).toMatch(/never silently narrow, defer/); | ||
| }); | ||
|
|
||
| it('requires pausing, not just reporting and continuing', () => { | ||
| // The agent must hand control back, not surface the scope and press on. | ||
| expect(instructions).toContain('surface the added scope and pause'); | ||
| }); | ||
|
|
||
| it('forbids marking a task complete when it is only partially done', () => { | ||
| expect(instructions).toMatch( | ||
| /Only mark a task .* when its specified behavior is fully implemented/ | ||
| ); | ||
| }); | ||
|
|
||
| it('carries the same guidance on both the skill and command surfaces', () => { | ||
| const needle = 'surface the added scope'; | ||
| expect(getApplyChangeSkillTemplate().instructions).toContain(needle); | ||
| expect(getOpsxApplyCommandTemplate().content).toContain(needle); | ||
| }); | ||
| }); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Assert the pause requirement explicitly.
The test checks that the instructions surface added scope and prohibit silent simplification or deferment. It does not check that the agent pauses. The test could pass if the workflow reports the added scope and then continues without waiting for guidance.
Add
surface the added scope and pauseto the single-surface assertion and use the same phrase for both rendered surfaces. The production requirement is insrc/core/templates/workflows/apply-change.ts, Lines 181-182.Proposed assertion update
This follows the PR objective that unexpected scope must pause the workflow.
Also applies to: 23-26
🤖 Prompt for AI Agents