artifact-contracts 0.33.3 → 0.33.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -154,6 +154,46 @@ documentation:
154
154
  # expands to: ["docs/**/*.md", "packages/*/README.md"]
155
155
  ```
156
156
 
157
+ ### Trace Link Rules
158
+
159
+ The optional `trace` section declares traceability links between artifacts — how one artifact connects to or derives from another.
160
+
161
+ ```yaml
162
+ trace:
163
+ links:
164
+ - id: contract-to-generated
165
+ from: cli-contract-definition
166
+ to: generated-cli
167
+ resolver: codegen
168
+ description: "CLI contract generates TypeScript scaffolding"
169
+ - id: source-to-tests
170
+ from: core-library
171
+ to: test-suite
172
+ resolver: naming
173
+ ```
174
+
175
+ | Field | Required | Description |
176
+ |-------|----------|-------------|
177
+ | `id` | Yes | Unique link identifier (kebab-case) |
178
+ | `from` | Yes | Source artifact ID (must exist in `artifacts`) |
179
+ | `to` | Yes | Target artifact ID (must exist in `artifacts`) |
180
+ | `resolver` | Yes | Link resolution strategy |
181
+ | `description` | No | Human-readable explanation |
182
+
183
+ **Resolver types:**
184
+
185
+ | Resolver | Use case |
186
+ |----------|----------|
187
+ | `operationId` | ID-based matching (e.g., CLI contract operationId → generated handler) |
188
+ | `ast` | Import/call resolution via AST analysis |
189
+ | `naming` | Naming convention (e.g., `foo.ts` → `foo.test.ts`) |
190
+ | `codegen` | Codegen pipeline (e.g., DSL YAML → generated TypeScript) |
191
+
192
+ Validation rules:
193
+ - `from` and `to` must reference existing artifact IDs
194
+ - Link `id` values must be unique
195
+ - Self-links (`from === to`) are rejected
196
+
157
197
  ## Commands
158
198
 
159
199
  ### Deterministic Commands