-
Notifications
You must be signed in to change notification settings - Fork 1.3k
feat: make apply instructions schema-aware #444
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 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
ae5a694
feat: make apply instructions schema-aware
TabishB 58b7cc5
Merge branch 'main' into TabishB/sacramento
TabishB c959ba1
fix: improve apply instructions robustness and consistency
TabishB 4b8f013
test: add fallback behavior tests for schemas without apply block
TabishB 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
36 changes: 18 additions & 18 deletions
36
openspec/changes/make-apply-instructions-schema-aware/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 |
|---|---|---|
| @@ -1,35 +1,35 @@ | ||
| ## Prerequisites | ||
|
|
||
| - [ ] 0.1 Implement `add-per-change-schema-metadata` first (to auto-detect schema) | ||
| - [x] 0.1 Implement `add-per-change-schema-metadata` first (to auto-detect schema) | ||
|
|
||
| ## 1. Schema Format | ||
|
|
||
| - [ ] 1.1 Add `ApplyPhaseSchema` Zod schema to `src/core/artifact-graph/types.ts` | ||
| - [ ] 1.2 Update `SchemaYamlSchema` to include optional `apply` field | ||
| - [ ] 1.3 Export `ApplyPhase` type | ||
| - [x] 1.1 Add `ApplyPhaseSchema` Zod schema to `src/core/artifact-graph/types.ts` | ||
| - [x] 1.2 Update `SchemaYamlSchema` to include optional `apply` field | ||
| - [x] 1.3 Export `ApplyPhase` type | ||
|
|
||
| ## 2. Update Existing Schemas | ||
|
|
||
| - [ ] 2.1 Add `apply` block to `schemas/spec-driven/schema.yaml` | ||
| - [ ] 2.2 Add `apply` block to `schemas/tdd/schema.yaml` | ||
| - [x] 2.1 Add `apply` block to `schemas/spec-driven/schema.yaml` | ||
| - [x] 2.2 Add `apply` block to `schemas/tdd/schema.yaml` | ||
|
|
||
| ## 3. Refactor generateApplyInstructions | ||
|
|
||
| - [ ] 3.1 Load schema via `resolveSchema(schemaName)` | ||
| - [ ] 3.2 Read `apply.requires` to determine required artifacts | ||
| - [ ] 3.3 Check artifact existence dynamically (not hardcoded paths) | ||
| - [ ] 3.4 Use `apply.tracks` for progress tracking (or skip if null) | ||
| - [ ] 3.5 Use `apply.instruction` for the instruction text | ||
| - [ ] 3.6 Build `contextFiles` from all existing artifacts in schema | ||
| - [x] 3.1 Load schema via `resolveSchema(schemaName)` | ||
| - [x] 3.2 Read `apply.requires` to determine required artifacts | ||
| - [x] 3.3 Check artifact existence dynamically (not hardcoded paths) | ||
| - [x] 3.4 Use `apply.tracks` for progress tracking (or skip if null) | ||
| - [x] 3.5 Use `apply.instruction` for the instruction text | ||
| - [x] 3.6 Build `contextFiles` from all existing artifacts in schema | ||
|
|
||
| ## 4. Handle Fallback | ||
|
|
||
| - [ ] 4.1 If schema has no `apply` block, require all artifacts to exist | ||
| - [ ] 4.2 Default instruction: "All artifacts complete. Proceed with implementation." | ||
| - [x] 4.1 If schema has no `apply` block, require all artifacts to exist | ||
| - [x] 4.2 Default instruction: "All artifacts complete. Proceed with implementation." | ||
|
|
||
| ## 5. Tests | ||
|
|
||
| - [ ] 5.1 Test apply instructions with spec-driven schema | ||
| - [ ] 5.2 Test apply instructions with tdd schema | ||
| - [ ] 5.3 Test fallback when schema has no apply block | ||
| - [ ] 5.4 Test blocked state when required artifacts missing | ||
| - [x] 5.1 Test apply instructions with spec-driven schema | ||
| - [x] 5.2 Test apply instructions with tdd schema | ||
| - [x] 5.3 Test fallback when schema has no apply block | ||
| - [x] 5.4 Test blocked state when required artifacts missing |
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
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.
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.