aw-spec-cli 0.1.10 → 0.1.11
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/assets/.appweaver/ORCH-DIALECT.md +17 -5
- package/assets/.appweaver/orchestrator/README.md +1 -1
- package/assets/.appweaver/orchestrator/adapters/claude_agent_sdk.py +2 -2
- package/assets/.appweaver/orchestrator/adapters/google_antigravity.py +28 -6
- package/assets/.appweaver/orchestrator/modules/delta-spec.orch.yaml +13 -1
- package/assets/.appweaver/orchestrator/orchestrator.py +126 -39
- package/assets/.appweaver/orchestrator/workflows/aw-spec-adopt.orch.yaml +5 -0
- package/assets/.appweaver/orchestrator/workflows/aw-spec-characterize.orch.yaml +1 -0
- package/assets/.appweaver/orchestrator/workflows/aw-spec-onboard.orch.yaml +1 -0
- package/assets/.appweaver/orchestrator/workflows/aw-spec-specify.orch.yaml +888 -141
- package/assets/.appweaver/scripts/bash/aw-spec-actions.sh +826 -16
- package/assets/.appweaver/scripts/powershell/aw-spec-actions.ps1 +780 -12
- package/assets/.appweaver/stack-profiles/java-spring.json +3 -3
- package/assets/.appweaver/templates/spec-template.md +73 -62
- package/assets/.appweaver/templates/story-template.md +107 -0
- package/assets/guardrails/technology/java-spring/ai-rules.md +505 -0
- package/assets/guardrails/technology/java-spring/api-versioning.md +782 -0
- package/assets/guardrails/technology/java-spring/authorization.md +618 -0
- package/assets/guardrails/technology/java-spring/clean-architecture.md +960 -0
- package/assets/guardrails/technology/java-spring/coding-standards.md +821 -0
- package/assets/guardrails/technology/java-spring/dependency-policy.md +91 -0
- package/assets/guardrails/technology/java-spring/domain-driven-design.md +467 -0
- package/assets/guardrails/technology/java-spring/domain_abstraction.md +424 -0
- package/assets/guardrails/technology/java-spring/folder-structure.md +1537 -0
- package/assets/guardrails/technology/java-spring/global_exception_handler.md +247 -0
- package/assets/guardrails/technology/java-spring/logging.md +215 -0
- package/assets/guardrails/technology/java-spring/modular-monolith.md +77 -0
- package/assets/guardrails/technology/java-spring/persistence.md +316 -0
- package/assets/guardrails/technology/java-spring/problem_details.md +98 -0
- package/assets/guardrails/technology/java-spring/result_mapping.md +48 -0
- package/assets/guardrails/technology/java-spring/technology-constitution.md +168 -0
- package/assets/guardrails/technology/java-spring/testing.md +601 -0
- package/assets/guardrails/technology/java-spring/zero-trust.md +210 -0
- package/dist/index.js +0 -0
- package/dist/utils/config.d.ts +22 -0
- package/dist/utils/config.d.ts.map +1 -0
- package/dist/utils/config.js +76 -0
- package/dist/utils/config.js.map +1 -0
- package/dist/utils/copy-assets.d.ts.map +1 -1
- package/dist/utils/copy-assets.js +4 -11
- package/dist/utils/copy-assets.js.map +1 -1
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +11 -7
- package/dist/utils/paths.js.map +1 -1
- package/package.json +2 -1
- package/assets/guardrails/technology/java-spring/README.md +0 -62
- package/dist/commands/update.d.ts +0 -3
- package/dist/commands/update.d.ts.map +0 -1
- package/dist/commands/update.js +0 -142
- package/dist/commands/update.js.map +0 -1
- package/dist/utils/manifest.d.ts +0 -31
- package/dist/utils/manifest.d.ts.map +0 -1
- package/dist/utils/manifest.js +0 -91
- package/dist/utils/manifest.js.map +0 -1
- package/dist/utils/update-engine.d.ts +0 -52
- package/dist/utils/update-engine.d.ts.map +0 -1
- package/dist/utils/update-engine.js +0 -203
- package/dist/utils/update-engine.js.map +0 -1
|
@@ -0,0 +1,424 @@
|
|
|
1
|
+
# Domain Abstraction Component Specification
|
|
2
|
+
|
|
3
|
+
> Pure technology/domain capability. This document defines the reusable domain abstractions
|
|
4
|
+
> and their required behavior.
|
|
5
|
+
>
|
|
6
|
+
> These abstractions are optional capabilities. Applications and domain models MUST adopt
|
|
7
|
+
> them only when the corresponding requirement exists.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## 1. Purpose
|
|
12
|
+
|
|
13
|
+
Define a reusable Domain Abstraction capability that provides common domain-level abstractions required by applications.
|
|
14
|
+
|
|
15
|
+
The component standardizes foundational domain concepts while keeping domain models independent of infrastructure and framework concerns.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## 2. Applicability
|
|
20
|
+
|
|
21
|
+
This component MAY be adopted when the application requires the corresponding domain abstractions.
|
|
22
|
+
|
|
23
|
+
The abstractions are reusable domain capabilities and MAY be adopted selectively by domain models.
|
|
24
|
+
|
|
25
|
+
Applications MUST NOT require every domain entity to implement every abstraction.
|
|
26
|
+
|
|
27
|
+
For example, an entity does not automatically become:
|
|
28
|
+
|
|
29
|
+
- auditable;
|
|
30
|
+
- soft-deletable;
|
|
31
|
+
- tenant-aware;
|
|
32
|
+
- a named entity;
|
|
33
|
+
- an aggregate root.
|
|
34
|
+
|
|
35
|
+
Abstractions MUST NOT be added merely for consistency or because they are available.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## 3. Entity Abstraction
|
|
40
|
+
|
|
41
|
+
The component MUST provide an Entity abstraction parameterized by the identifier type.
|
|
42
|
+
|
|
43
|
+
The Entity abstraction MUST represent an entity through its identity.
|
|
44
|
+
|
|
45
|
+
The public Entity contract MUST expose retrieval of the identifier.
|
|
46
|
+
|
|
47
|
+
The public Entity contract MUST NOT expose unrestricted identifier mutation.
|
|
48
|
+
|
|
49
|
+
Entity identity MUST be treated as stable domain identity.
|
|
50
|
+
|
|
51
|
+
Internal identifier initialization or mutation MUST be isolated from the general public contract.
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## 4. Entity Base Implementation and Equality
|
|
56
|
+
|
|
57
|
+
The component MUST provide a reusable base entity implementation that:
|
|
58
|
+
|
|
59
|
+
- stores the identifier;
|
|
60
|
+
- exposes the identifier through the Entity contract;
|
|
61
|
+
- allows controlled internal identifier initialization;
|
|
62
|
+
- provides identity-based equality and hash-code behavior.
|
|
63
|
+
|
|
64
|
+
Entity equality MUST be based on entity identity rather than all entity attributes.
|
|
65
|
+
|
|
66
|
+
The implementation MUST:
|
|
67
|
+
|
|
68
|
+
- treat the same object instance as equal;
|
|
69
|
+
- compare entities based on identifier when identifiers are available;
|
|
70
|
+
- avoid considering mutable domain attributes as identity;
|
|
71
|
+
- treat entities without a valid identifier as not equal to another entity solely because both identifiers are absent;
|
|
72
|
+
- maintain consistent equality and hash-code behavior for subclasses or proxy-like implementations without requiring framework-specific dependencies.
|
|
73
|
+
|
|
74
|
+
Attribute-based equality MUST NOT be used for entities.
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## 5. Aggregate Root
|
|
79
|
+
|
|
80
|
+
The component MUST provide an Aggregate Root abstraction representing the entry point for modifying an aggregate and maintaining its business invariants.
|
|
81
|
+
|
|
82
|
+
The reusable base implementation MUST:
|
|
83
|
+
|
|
84
|
+
- be an Entity;
|
|
85
|
+
- implement the Aggregate Root abstraction;
|
|
86
|
+
- support domain-event registration;
|
|
87
|
+
- reject null domain events;
|
|
88
|
+
- expose registered domain events through a read-only or unmodifiable view;
|
|
89
|
+
- report whether domain events exist;
|
|
90
|
+
- allow registered domain events to be cleared after handling or dispatch.
|
|
91
|
+
|
|
92
|
+
The aggregate root MUST remain the domain boundary for the aggregate.
|
|
93
|
+
|
|
94
|
+
External callers MUST NOT be able to directly mutate the internal domain-event collection.
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## 6. Domain Events
|
|
99
|
+
|
|
100
|
+
The component MUST provide a base abstraction for domain events representing significant business occurrences that have already happened.
|
|
101
|
+
|
|
102
|
+
Each domain event MUST contain its occurrence timestamp.
|
|
103
|
+
|
|
104
|
+
The occurrence timestamp MUST be immutable after event creation.
|
|
105
|
+
|
|
106
|
+
Domain events MUST support both:
|
|
107
|
+
|
|
108
|
+
- automatic timestamp creation;
|
|
109
|
+
- explicit timestamp creation where required by tests or controlled event construction.
|
|
110
|
+
|
|
111
|
+
The component MUST provide a capability for identifying objects that contain domain events.
|
|
112
|
+
|
|
113
|
+
This capability MUST support:
|
|
114
|
+
|
|
115
|
+
- retrieving events;
|
|
116
|
+
- checking whether events exist;
|
|
117
|
+
- clearing events.
|
|
118
|
+
|
|
119
|
+
The internal event collection MUST NOT be directly mutable by external callers.
|
|
120
|
+
|
|
121
|
+
### Responsibility Boundary
|
|
122
|
+
|
|
123
|
+
The Domain Abstraction component is responsible only for representing and collecting domain events.
|
|
124
|
+
|
|
125
|
+
It MUST NOT:
|
|
126
|
+
|
|
127
|
+
- publish events to a message broker;
|
|
128
|
+
- send events over HTTP;
|
|
129
|
+
- persist events;
|
|
130
|
+
- implement an outbox;
|
|
131
|
+
- dispatch events to external systems.
|
|
132
|
+
|
|
133
|
+
Event publication and delivery are outside the responsibility of this component.
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## 7. Named Entity
|
|
138
|
+
|
|
139
|
+
The component MUST provide an abstraction for entities that have a name attribute.
|
|
140
|
+
|
|
141
|
+
The abstraction MUST support:
|
|
142
|
+
|
|
143
|
+
- name retrieval;
|
|
144
|
+
- controlled name modification.
|
|
145
|
+
|
|
146
|
+
Named entity identity MUST continue to be determined by the entity identifier.
|
|
147
|
+
|
|
148
|
+
The name MUST NOT become part of entity identity or equality.
|
|
149
|
+
|
|
150
|
+
### Typed Named Entity
|
|
151
|
+
|
|
152
|
+
The component MUST provide an abstraction combining:
|
|
153
|
+
|
|
154
|
+
- Named Entity behavior;
|
|
155
|
+
- Entity identity behavior.
|
|
156
|
+
|
|
157
|
+
The generic identifier type MUST be preserved.
|
|
158
|
+
|
|
159
|
+
### Named Entity Base
|
|
160
|
+
|
|
161
|
+
The component MUST provide a reusable base implementation that:
|
|
162
|
+
|
|
163
|
+
- inherits entity identity behavior;
|
|
164
|
+
- provides the name property;
|
|
165
|
+
- exposes name retrieval;
|
|
166
|
+
- supports controlled name modification;
|
|
167
|
+
- retains identity-based equality.
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
## 8. Auditable Entity
|
|
172
|
+
|
|
173
|
+
The component MUST provide an Auditable Entity abstraction supporting:
|
|
174
|
+
|
|
175
|
+
- creation timestamp;
|
|
176
|
+
- creator identity;
|
|
177
|
+
- modification timestamp;
|
|
178
|
+
- modifier identity.
|
|
179
|
+
|
|
180
|
+
Creation information represents historical facts and SHOULD remain immutable after creation.
|
|
181
|
+
|
|
182
|
+
The mechanism used to populate audit information is outside the responsibility of this component.
|
|
183
|
+
|
|
184
|
+
Modification fields MAY change when the entity is modified during its lifecycle.
|
|
185
|
+
|
|
186
|
+
The component MUST NOT introduce a separate auditing framework or infrastructure.
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## 9. Soft Deletable
|
|
191
|
+
|
|
192
|
+
The component MUST provide a Soft Deletable abstraction representing logical deletion.
|
|
193
|
+
|
|
194
|
+
The abstraction MUST support:
|
|
195
|
+
|
|
196
|
+
- deleted state;
|
|
197
|
+
- deletion timestamp;
|
|
198
|
+
- deletion actor.
|
|
199
|
+
|
|
200
|
+
The standard soft-delete operation MUST represent a complete deletion state by simultaneously:
|
|
201
|
+
|
|
202
|
+
- marking the entity as deleted;
|
|
203
|
+
- recording the deletion UTC timestamp;
|
|
204
|
+
- recording the responsible deletion actor.
|
|
205
|
+
|
|
206
|
+
The standard operation MUST NOT allow an incomplete deletion state.
|
|
207
|
+
|
|
208
|
+
The component MUST NOT implement:
|
|
209
|
+
|
|
210
|
+
- persistence filtering;
|
|
211
|
+
- repository filtering;
|
|
212
|
+
- database-specific soft-delete behavior.
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## 10. Tenant Entity
|
|
217
|
+
|
|
218
|
+
The component MUST provide a Tenant Entity abstraction for entities associated with a tenant.
|
|
219
|
+
|
|
220
|
+
The abstraction MUST support:
|
|
221
|
+
|
|
222
|
+
- tenant identifier retrieval;
|
|
223
|
+
- controlled tenant identifier modification.
|
|
224
|
+
|
|
225
|
+
The component MUST NOT implement:
|
|
226
|
+
|
|
227
|
+
- tenant resolution;
|
|
228
|
+
- authentication;
|
|
229
|
+
- authorization;
|
|
230
|
+
- tenant isolation;
|
|
231
|
+
- persistence filtering.
|
|
232
|
+
|
|
233
|
+
Tenant enforcement is outside the responsibility of this component.
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
## 11. Named ID Value Object and Factory
|
|
238
|
+
|
|
239
|
+
### Named ID Value Object
|
|
240
|
+
|
|
241
|
+
The component MUST provide a value abstraction combining:
|
|
242
|
+
|
|
243
|
+
- an identifier;
|
|
244
|
+
- a name.
|
|
245
|
+
|
|
246
|
+
The value representation MUST preserve the behavior of representing the name together with the identifier.
|
|
247
|
+
|
|
248
|
+
The Named ID MUST NOT become an Entity.
|
|
249
|
+
|
|
250
|
+
Equality MUST remain strictly value-based.
|
|
251
|
+
|
|
252
|
+
### Named ID Factory
|
|
253
|
+
|
|
254
|
+
The component MUST provide a factory utility for creating Named ID values from entities.
|
|
255
|
+
|
|
256
|
+
The factory MUST:
|
|
257
|
+
|
|
258
|
+
- support creation from an Entity and a Named Entity;
|
|
259
|
+
- support creation from an Entity implementing Named Entity;
|
|
260
|
+
- reject null required inputs;
|
|
261
|
+
- reject the operation when the required Named Entity behavior is not provided;
|
|
262
|
+
- avoid silently creating an incomplete Named ID;
|
|
263
|
+
- remain a creation utility only.
|
|
264
|
+
|
|
265
|
+
The factory MUST NOT introduce persistence or infrastructure behavior.
|
|
266
|
+
|
|
267
|
+
---
|
|
268
|
+
|
|
269
|
+
## 12. Framework Independence
|
|
270
|
+
|
|
271
|
+
The Domain Abstraction component MUST remain independent of application infrastructure and external technology concerns.
|
|
272
|
+
|
|
273
|
+
The component MUST NOT require dependencies on:
|
|
274
|
+
|
|
275
|
+
- Spring;
|
|
276
|
+
- Spring Data;
|
|
277
|
+
- JPA;
|
|
278
|
+
- Hibernate;
|
|
279
|
+
- HTTP;
|
|
280
|
+
- REST;
|
|
281
|
+
- servlet APIs;
|
|
282
|
+
- database infrastructure;
|
|
283
|
+
- messaging infrastructure;
|
|
284
|
+
- web frameworks;
|
|
285
|
+
- infrastructure security mechanisms.
|
|
286
|
+
|
|
287
|
+
The component SHOULD rely only on standard Java capabilities required to implement its defined contracts.
|
|
288
|
+
|
|
289
|
+
Dependency versions MUST be managed by the consuming application's approved dependency management.
|
|
290
|
+
|
|
291
|
+
The component SHOULD NOT require environment-specific configuration.
|
|
292
|
+
|
|
293
|
+
Core behavior MUST be deterministic and defined by its contracts.
|
|
294
|
+
|
|
295
|
+
---
|
|
296
|
+
|
|
297
|
+
## 13. Thread Safety
|
|
298
|
+
|
|
299
|
+
Aggregate root instances and their internal domain-event collections are not required to be thread-safe.
|
|
300
|
+
|
|
301
|
+
They are intended to be used within an appropriate application operation and transaction lifecycle.
|
|
302
|
+
|
|
303
|
+
The component MUST NOT introduce generic synchronization or concurrent collections solely for defensive purposes.
|
|
304
|
+
|
|
305
|
+
Applications requiring concurrent access MUST establish an appropriate concurrency strategy outside the component.
|
|
306
|
+
|
|
307
|
+
---
|
|
308
|
+
|
|
309
|
+
## 14. Security and Sensitive Data
|
|
310
|
+
|
|
311
|
+
The component MUST NOT implement infrastructure security mechanisms.
|
|
312
|
+
|
|
313
|
+
The following values are domain data within this component:
|
|
314
|
+
|
|
315
|
+
- tenant identifiers;
|
|
316
|
+
- audit identities;
|
|
317
|
+
- entity identifiers;
|
|
318
|
+
- domain event data.
|
|
319
|
+
|
|
320
|
+
The component MUST NOT:
|
|
321
|
+
|
|
322
|
+
- authenticate users;
|
|
323
|
+
- authorize operations;
|
|
324
|
+
- resolve user identities;
|
|
325
|
+
- resolve tenants;
|
|
326
|
+
- enforce tenant isolation;
|
|
327
|
+
- implement access-control policies.
|
|
328
|
+
|
|
329
|
+
---
|
|
330
|
+
|
|
331
|
+
## 15. Prohibited Behavior
|
|
332
|
+
|
|
333
|
+
The component MUST NOT:
|
|
334
|
+
|
|
335
|
+
- introduce Spring dependencies;
|
|
336
|
+
- introduce JPA or Hibernate dependencies;
|
|
337
|
+
- implement persistence behavior;
|
|
338
|
+
- implement repository behavior;
|
|
339
|
+
- publish or transport domain events;
|
|
340
|
+
- implement event brokers;
|
|
341
|
+
- implement an outbox;
|
|
342
|
+
- implement tenant resolution;
|
|
343
|
+
- implement authorization;
|
|
344
|
+
- implement authentication;
|
|
345
|
+
- implement global exception handling;
|
|
346
|
+
- implement HTTP Problem Details;
|
|
347
|
+
- implement API Result Mapping;
|
|
348
|
+
- implement application-level logging;
|
|
349
|
+
- expose unrestricted entity identifier mutation;
|
|
350
|
+
- expose mutable access to an aggregate's internal domain-event collection;
|
|
351
|
+
- use entity attributes as the basis for entity identity equality;
|
|
352
|
+
- introduce custom abstractions that are not required by the defined component contract.
|
|
353
|
+
|
|
354
|
+
---
|
|
355
|
+
|
|
356
|
+
## 16. Implementation Boundary
|
|
357
|
+
|
|
358
|
+
This document defines the required behavior and contracts of the Domain Abstraction component.
|
|
359
|
+
|
|
360
|
+
Exact implementation details MAY be selected by the implementation as long as the defined behavior is preserved.
|
|
361
|
+
|
|
362
|
+
Unless explicitly required by this specification, this document does not mandate:
|
|
363
|
+
|
|
364
|
+
- exact package names;
|
|
365
|
+
- exact Java class names;
|
|
366
|
+
- visibility modifiers;
|
|
367
|
+
- constructor signatures;
|
|
368
|
+
- collection implementations;
|
|
369
|
+
- record versus class choices;
|
|
370
|
+
- internal helper methods.
|
|
371
|
+
|
|
372
|
+
The implementation MUST preserve the following behavioral contracts:
|
|
373
|
+
|
|
374
|
+
- entity identity semantics;
|
|
375
|
+
- controlled identifier mutation;
|
|
376
|
+
- entity equality and hash-code semantics;
|
|
377
|
+
- aggregate-root domain-event lifecycle;
|
|
378
|
+
- read-only domain-event exposure;
|
|
379
|
+
- immutable domain-event occurrence timestamps;
|
|
380
|
+
- named-entity behavior;
|
|
381
|
+
- auditing semantics;
|
|
382
|
+
- complete soft-delete behavior;
|
|
383
|
+
- UTC deletion timestamp behavior;
|
|
384
|
+
- tenant identifier behavior;
|
|
385
|
+
- Named ID value-based equality;
|
|
386
|
+
- Named ID factory rejection behavior.
|
|
387
|
+
|
|
388
|
+
---
|
|
389
|
+
|
|
390
|
+
## 17. Acceptance Criteria
|
|
391
|
+
|
|
392
|
+
- [ ] Entity identity is exposed without unrestricted identifier mutation.
|
|
393
|
+
|
|
394
|
+
- [ ] Entity equality and hash-code behavior follow the defined identity semantics.
|
|
395
|
+
|
|
396
|
+
- [ ] Aggregate roots support controlled domain-event registration and lifecycle.
|
|
397
|
+
|
|
398
|
+
- [ ] Domain events reject null values.
|
|
399
|
+
|
|
400
|
+
- [ ] Domain events are exposed without allowing external mutation.
|
|
401
|
+
|
|
402
|
+
- [ ] Domain events contain immutable occurrence timestamps.
|
|
403
|
+
|
|
404
|
+
- [ ] Named entities preserve identity-based equality.
|
|
405
|
+
|
|
406
|
+
- [ ] Auditable entities provide the required audit information.
|
|
407
|
+
|
|
408
|
+
- [ ] Creation audit information can remain immutable after creation.
|
|
409
|
+
|
|
410
|
+
- [ ] Modification audit information can change during the entity lifecycle.
|
|
411
|
+
|
|
412
|
+
- [ ] Soft deletion represents deleted state, deletion timestamp, and deletion actor as one complete operation.
|
|
413
|
+
|
|
414
|
+
- [ ] Soft-delete timestamps use UTC.
|
|
415
|
+
|
|
416
|
+
- [ ] Tenant entities provide tenant association without implementing tenant resolution or enforcement.
|
|
417
|
+
|
|
418
|
+
- [ ] Named ID follows value-based equality.
|
|
419
|
+
|
|
420
|
+
- [ ] Named ID factory rejects invalid or incomplete inputs.
|
|
421
|
+
|
|
422
|
+
- [ ] The component has no dependency on Spring, JPA, Hibernate, HTTP, or other infrastructure frameworks.
|
|
423
|
+
|
|
424
|
+
- [ ] The implementation preserves all behavioral contracts defined by this specification.
|