-
Notifications
You must be signed in to change notification settings - Fork 4.1k
fix archive scenario drift for #1246 #1252
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
Open
zhangsan582
wants to merge
3
commits into
Fission-AI:main
Choose a base branch
from
zhangsan582:feature_0623_2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+126
−1
Open
Changes from 2 commits
Commits
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
20 changes: 20 additions & 0 deletions
20
openspec/changes/fix-archive-modified-scenario-drift-1246/design.md
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,20 @@ | ||
| # Design | ||
|
|
||
| ## Decision | ||
|
|
||
| Use an archive-time conflict gate instead of scenario-level auto-merge. | ||
|
|
||
| ## Rationale | ||
|
|
||
| `MODIFIED` currently means a complete requirement block replacement. Automatically merging scenario lists would change that contract and make deliberate scenario removal ambiguous. A conservative guard preserves the existing replacement model while preventing the specific data-loss failure from Issue #1246. | ||
|
|
||
| ## Approach | ||
|
|
||
| - Parse `#### Scenario:` headings from the current canonical requirement block and from the incoming modified block. | ||
| - During `MODIFIED` application, compare scenario headings by trimmed, case-sensitive name. | ||
| - If any current scenario heading is absent from the incoming block, throw a clear error before any spec write happens. | ||
| - Continue to prepare all spec updates before writing, preserving existing all-or-nothing behavior. | ||
|
|
||
| ## Trade-offs | ||
|
|
||
| This does not solve all stale-base drift cases. It specifically blocks the high-impact scenario deletion case described in Issue #1246. A later base-fingerprint design can extend drift detection for broader body text or requirement removal changes. |
16 changes: 16 additions & 0 deletions
16
openspec/changes/fix-archive-modified-scenario-drift-1246/proposal.md
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,16 @@ | ||
| # Fix archive modified scenario drift | ||
|
|
||
| ## Why | ||
|
|
||
| Issue #1246 reports that two active changes can both modify the same requirement from the same original base. Archiving the first change updates the canonical spec, but archiving the second change then replaces the whole requirement block and silently removes scenarios added by the first change. | ||
|
|
||
| ## What Changes | ||
|
|
||
| - Add a conservative archive-time guard for `MODIFIED` requirement blocks. | ||
| - When the current canonical requirement contains scenario headings that the incoming modified block does not contain, abort instead of replacing the block. | ||
| - Keep existing whole-requirement replacement behavior when the incoming modified block includes all current scenarios. | ||
| - Add a regression test that archives two changes modifying the same requirement sequentially and verifies the second archive does not delete the first change's scenario. | ||
|
|
||
| ## Impact | ||
|
|
||
| This prevents silent spec data loss without changing the delta file format. Users must refresh/rebase a stale `MODIFIED` requirement block before archiving if the canonical spec has gained scenarios since the change was authored. |
7 changes: 7 additions & 0 deletions
7
openspec/changes/fix-archive-modified-scenario-drift-1246/tasks.md
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,7 @@ | ||
| ## Tasks | ||
|
|
||
| - [x] Analyze Issue #1246 and archive delta application behavior. | ||
| - [x] Add archive-time scenario drift guard for modified requirements. | ||
| - [x] Add regression coverage for sequential archives modifying the same requirement. | ||
| - [x] Run targeted and project validation. | ||
| - [ ] Commit only source and test changes. | ||
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
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.
Uh oh!
There was an error while loading. Please reload this page.