Commit ee83353
feat(config): add project-level configuration via openspec/config.yaml (Fission-AI#499)
* feat(config): add project-level configuration via openspec/config.yaml
Adds openspec/config.yaml support for project-level customization without
forking schemas. Teams can now:
- Set a default schema (used when --schema flag not provided)
- Inject project context into all artifact instructions
- Add per-artifact rules (e.g., proposal rules, specs rules)
Key changes:
- New `src/core/project-config.ts` with Zod schema and resilient parsing
- New `src/core/config-prompts.ts` for interactive config creation
- Updated schema resolution order: CLI → change metadata → config → default
- Updated instruction generation to inject <context> and <rules> XML sections
- Integrated config creation prompts into `artifact-experimental-setup`
Schema resolution precedence:
1. --schema CLI flag (explicit override)
2. .openspec.yaml in change directory (change-specific)
3. openspec/config.yaml schema field (project default)
4. "spec-driven" (hardcoded fallback)
* test(config): add e2e tests and performance benchmarks for project config
- Add project config integration tests in artifact-workflow.test.ts:
- Test new change uses schema from config
- Test CLI schema overrides config schema
- Test context and rules injection in instructions
- Test backwards compatibility without config file
- Test immediate reflection of config changes
- Add performance benchmark tests in project-config.test.ts:
- Typical config (1KB): <20ms target
- Large config (50KB): <50ms target
- Repeated reads consistency check
- Missing config fast-path test
- Add project configuration documentation in experimental-workflow.md:
- Config fields reference (schema, context, rules)
- Schema precedence explanation
- Artifact IDs by schema
- Troubleshooting guide
- Mark all tasks complete in tasks.md
* refactor(config): remove benchmark tests, document decision in source
Remove performance benchmark tests from project-config.test.ts and
document the results directly in the source code instead. Benchmarks
showed config reads are fast enough (~0.5ms typical) that caching
is unnecessary.
* fix(config): resolve three issues in project config feature
- Remove nested <template> tags: generateInstructions() no longer wraps
template content since printInstructionsText() already handles XML
structure
- Fix schema message accuracy: newChangeCommand() now uses the resolved
schema returned from createChange() instead of hardcoded fallback
- Add TTY check: artifact-experimental-setup skips interactive prompts
in non-TTY environments (CI, automation) to prevent hangs1 parent 1f10736 commit ee83353
File tree
21 files changed
+4021
-22
lines changed- docs
- openspec/changes
- project-config
- specs
- config-loading
- context-injection
- rules-injection
- schema-resolution
- project-local-schemas
- src
- commands
- core
- artifact-graph
- utils
- test
- commands
- core
- artifact-graph
- utils
21 files changed
+4021
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
81 | 173 | | |
82 | 174 | | |
83 | 175 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
0 commit comments