interaqt 0.3.0 → 0.4.0

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 (58) hide show
  1. package/agent/.claude/agents/code-generation-handler.md +2 -0
  2. package/agent/.claude/agents/computation-generation-handler.md +2 -3
  3. package/agent/.claude/agents/implement-design-handler.md +4 -13
  4. package/agent/.claude/agents/requirements-analysis-handler.md +88 -16
  5. package/agent/agentspace/knowledge/generator/api-reference.md +3815 -0
  6. package/agent/agentspace/knowledge/generator/basic-interaction-generation.md +377 -0
  7. package/agent/agentspace/knowledge/generator/computation-analysis.md +309 -0
  8. package/agent/agentspace/knowledge/generator/computation-implementation.md +983 -0
  9. package/agent/agentspace/knowledge/generator/data-analysis.md +484 -0
  10. package/agent/agentspace/knowledge/generator/entity-relation-generation.md +395 -0
  11. package/agent/agentspace/knowledge/generator/permission-implementation.md +460 -0
  12. package/agent/agentspace/knowledge/generator/permission-test-implementation.md +870 -0
  13. package/agent/agentspace/knowledge/generator/test-implementation.md +674 -0
  14. package/agent/agentspace/knowledge/usage/00-mindset-shift.md +322 -0
  15. package/agent/agentspace/knowledge/usage/01-core-concepts.md +131 -0
  16. package/agent/agentspace/knowledge/usage/02-define-entities-properties.md +407 -0
  17. package/agent/agentspace/knowledge/usage/03-entity-relations.md +599 -0
  18. package/agent/agentspace/knowledge/usage/04-reactive-computations.md +2186 -0
  19. package/agent/agentspace/knowledge/usage/05-interactions.md +1411 -0
  20. package/agent/agentspace/knowledge/usage/06-attributive-permissions.md +10 -0
  21. package/agent/agentspace/knowledge/usage/07-payload-parameters.md +593 -0
  22. package/agent/agentspace/knowledge/usage/08-activities.md +863 -0
  23. package/agent/agentspace/knowledge/usage/09-filtered-entities.md +784 -0
  24. package/agent/agentspace/knowledge/usage/10-async-computations.md +734 -0
  25. package/agent/agentspace/knowledge/usage/11-global-dictionaries.md +942 -0
  26. package/agent/agentspace/knowledge/usage/12-data-querying.md +1033 -0
  27. package/agent/agentspace/knowledge/usage/13-testing.md +1201 -0
  28. package/agent/agentspace/knowledge/usage/14-api-reference.md +1606 -0
  29. package/agent/agentspace/knowledge/usage/15-entity-crud-patterns.md +1122 -0
  30. package/agent/agentspace/knowledge/usage/16-frontend-page-design-guide.md +485 -0
  31. package/agent/agentspace/knowledge/usage/17-performance-optimization.md +283 -0
  32. package/agent/agentspace/knowledge/usage/18-api-exports-reference.md +176 -0
  33. package/agent/agentspace/knowledge/usage/19-common-anti-patterns.md +563 -0
  34. package/agent/agentspace/knowledge/usage/README.md +148 -0
  35. package/dist/index.js +2977 -2976
  36. package/dist/index.js.map +1 -1
  37. package/dist/runtime/ComputationSourceMap.d.ts +11 -21
  38. package/dist/runtime/ComputationSourceMap.d.ts.map +1 -1
  39. package/dist/runtime/Controller.d.ts +2 -2
  40. package/dist/runtime/MonoSystem.d.ts.map +1 -1
  41. package/dist/runtime/Scheduler.d.ts +6 -6
  42. package/dist/runtime/Scheduler.d.ts.map +1 -1
  43. package/dist/runtime/System.d.ts +5 -0
  44. package/dist/runtime/System.d.ts.map +1 -1
  45. package/dist/runtime/computations/Computation.d.ts +4 -9
  46. package/dist/runtime/computations/Computation.d.ts.map +1 -1
  47. package/dist/runtime/computations/StateMachine.d.ts +4 -7
  48. package/dist/runtime/computations/StateMachine.d.ts.map +1 -1
  49. package/dist/runtime/computations/Transform.d.ts +7 -1
  50. package/dist/runtime/computations/Transform.d.ts.map +1 -1
  51. package/dist/runtime/computations/TransitionFinder.d.ts +2 -2
  52. package/dist/runtime/computations/TransitionFinder.d.ts.map +1 -1
  53. package/dist/shared/StateTransfer.d.ts +15 -5
  54. package/dist/shared/StateTransfer.d.ts.map +1 -1
  55. package/dist/shared/Transform.d.ts +17 -3
  56. package/dist/shared/Transform.d.ts.map +1 -1
  57. package/package.json +1 -1
  58. package/agent/.claude/agents/requirements-analysis-handler-bak.md +0 -530
@@ -279,6 +279,8 @@ This task has its own dedicated sub-agent that handles the progressive implement
279
279
 
280
280
  **🛑 STOP GATE: DO NOT proceed to Task 3.1.4.4 until ALL computations in `docs/computation-implementation-plan.json` are marked as complete with passing tests.**
281
281
 
282
+ ** CRETICA:L use the specialized sub-agent `computation-generation-handler` until ALL computations in `docs/computation-implementation-plan.json` are marked as complete with passing tests.**
283
+
282
284
  **✅ END Task 3.1.4.3: Update `docs/STATUS.json`:**
283
285
  ```json
284
286
  {
@@ -59,6 +59,7 @@ color: blue
59
59
  - You should modify the PARENT entity's computation, not the current entity
60
60
  - Example: For `_parent:[User]`, modify the `User` entity's computation that creates Posts
61
61
  - This typically occurs when a child entity needs to be created by a parent's Transform computation
62
+ - **📍 Finding the parent entity**: You can find the parent entity name in the current item's `lifecycle.creation.parent` field
62
63
  - **How to create child entities**: Use the relation's source/target property name in the parent's Transform return value
63
64
  - Example: If `OrderItemRelation` has `sourceProperty: 'items'`, then in Order's Transform:
64
65
  ```typescript
@@ -79,9 +80,7 @@ color: blue
79
80
  - **🔴 SPECIAL CASE 2: `_owner` notation**
80
81
  - If the computation decision is `_owner`, this means:
81
82
  - The property's value is fully controlled by its owner entity/relation's computation
82
- - You should modify the OWNER entity/relation's creation or derivation logic, not add a separate property computation
83
- - For `controlType: "creation-only"`: Add the property assignment logic in the entity/relation's creation Transform or StateMachine
84
- - For `controlType: "derived-with-parent"`: The property is part of the parent's derivation computation
83
+ - You should modify the OWNER entity/relation's creation or derivation logic, not add a separate property computation. Add the property assignment logic in the entity/relation's creation Transform
85
84
  - Example: For a `createdAt` property with `_owner`, add timestamp assignment in the entity's Transform that creates it
86
85
  - Add computation code using assignment pattern at end of file:
87
86
  ```typescript
@@ -37,20 +37,11 @@ You are a honest software expert with the following capabilities:
37
37
  }
38
38
  ```
39
39
 
40
- **🔴 CRITICAL FOUNDATION:**
41
- **📖 MUST READ FIRST: `requirements/detailed-requirements.json`**
42
- - **Read the COMPLETE detailed requirements document thoroughly before starting data analysis**
43
- - **This document is the ROOT SOURCE for all data analysis**
44
- - **ALL data entities, properties, and relationships mentioned in the detailed requirements MUST be analyzed**
45
- - **No data element from the requirements should be overlooked**
46
-
47
40
 
48
41
  **Process:**
49
- 1. **FIRST**: Thoroughly read `requirements/detailed-requirements.json` to understand ALL data requirements
50
- 2. **EXTRACT**: Identify every entity, property, and relationship mentioned in the requirements
51
- 3. **ANALYZE**: Follow the systematic approach in `data-analysis.md` for each identified data element
52
- 4. **DOCUMENT**: Use the Analysis Documentation Template from `data-analysis.md` to create your `docs/data-design.json`
53
- 5. **VERIFY**: Cross-check that ALL data from the detailed requirements has been included in your analysis
42
+ 1. **ANALYZE**: Follow the systematic approach in `agentspace/knowledge/generator/data-analysis.md` for each identified data element
43
+ 2. **DOCUMENT**: Use the Analysis Documentation Template from `agentspace/knowledge/generator/data-analysis.md` to create your `docs/data-design.json`
44
+ 3. **VERIFY**: Cross-check that ALL data from the detailed requirements has been included in your analysis
54
45
 
55
46
  **✅ END Task 2.1: Update `docs/STATUS.json`:**
56
47
  ```json
@@ -150,7 +141,7 @@ You are a honest software expert with the following capabilities:
150
141
  - `docs/interaction-design.md` (from Task 2.2)
151
142
  3. **ANALYZE**: For EVERY entity and EVERY property, follow the step-by-step analysis process
152
143
  4. **DOCUMENT**: Create `docs/computation-analysis.json` documenting your analysis for each entity/property
153
- 5. **REFERENCE**: Use `computation-implementation.md` as a reference for syntax and examples
144
+ 5. **REFERENCE**: Use `./agentspace/knowledge/generator/computation-implementation.md` as a reference for syntax and examples
154
145
 
155
146
  **Key Steps from computation-analysis.md:**
156
147
  - [ ] Create analysis document at `docs/computation-analysis.json`
@@ -72,6 +72,11 @@ Constraints expressed on roles, interactions, and data in requirements.
72
72
 
73
73
  ### Analyze User Input
74
74
 
75
+ **🌐 Language Processing:**
76
+ - Translate user input to English if provided in other languages
77
+ - Use English consistently throughout all subsequent analysis and outputs
78
+ - Preserve original meaning and context during translation
79
+
75
80
  User input may contain:
76
81
  - Vague or incomplete goals
77
82
  - Specific requirements mixed with goals
@@ -169,6 +174,39 @@ git commit -m "feat: Task 1.1 - Complete goal analysis and refinement"
169
174
 
170
175
  We focus on data-centric requirements. Human software usage delegates unsuitable tasks (storage, computation) to support better decision-making. Since decisions require information, we start with **READ requirements** as the root.
171
176
 
177
+ ### ⚠️ CRITICAL: Reactive Framework Principles
178
+
179
+ **DO NOT create "automatic system" requirements.** Our framework is reactive - avoid designing autonomous system behaviors.
180
+
181
+ **Transform "non-data-reactive" requirements into:**
182
+
183
+ 1. **Reactive Data Requirements**:
184
+ - ❌ WRONG: "System automatically counts total books"
185
+ - ✅ CORRECT: "There is a `totalBookCount` data that represents the statistical result of total books"
186
+
187
+ 2. **Interaction Constraint Conditions**:
188
+ - ❌ WRONG: "System automatically detects uniqueness"
189
+ - ✅ CORRECT: "Can only create unique XXX" (as constraint condition)
190
+
191
+ 3. **Data Constraints on Write Operations**:
192
+ - ❌ WRONG: "System automatically creates uniform record when employee is created"
193
+ - ✅ CORRECT: "When creating employee, automatically create uniform record" (as data constraint)
194
+
195
+ 4. **Data Replacement Operations**:
196
+ - ❌ WRONG: "Replace old data with new data"
197
+ - ✅ CORRECT: "Create new data + Delete old data" (as two separate operations)
198
+
199
+ **For unavoidable side-effect requirements** (e.g., "automatically send notification"):
200
+ - Design the requirement but explicitly mark as **"Currently Not Supported"**
201
+ - Document: "This requirement involves automatic side-effects which are not supported by the current reactive framework"
202
+
203
+ **Examples of Proper Transformation:**
204
+ - "Auto-calculate late fees" → "Late fee amount is computed based on overdue days and daily rate"
205
+ - "Auto-send reminders" → "Reminder needed status is computed based on due date" + "Send reminder interaction"
206
+ - "Auto-validate ISBN" → "Can only create books with valid ISBN format" (constraint)
207
+ - "Auto-update inventory" → "Available count is computed based on total copies minus borrowed copies"
208
+ - "Replace employee profile" → "Create new employee profile" + "Delete old employee profile" (two interactions)
209
+
172
210
  ### Step 1: Create Read Requirements from Goals
173
211
 
174
212
  Read requirements express:
@@ -255,6 +293,20 @@ Create `requirements/requirements-analysis.json`:
255
293
  },
256
294
  "business_constraints": ["[Business rule 1]"],
257
295
  "data_constraints": ["[Data constraint 1]"]
296
+ },
297
+ {
298
+ "id": "R103",
299
+ "type": "delete",
300
+ "title": "[Requirement name]",
301
+ "parent": "R001",
302
+ "role": "[Role]",
303
+ "data": {
304
+ "type": "entity|relation",
305
+ "description": "[Data to delete]"
306
+ },
307
+ "deletion_type": "hard",
308
+ "deletion_rules": ["[Rule 1: e.g., Cannot delete if has active references]", "[Rule 2]"],
309
+ "business_constraints": ["[Business rule 1]"]
258
310
  }
259
311
  ],
260
312
  "from_R101": [
@@ -334,6 +386,11 @@ For each entity property:
334
386
  - **Computation Method**: For aggregated or computed values
335
387
  - **Data Dependencies**: For computed values, list dependencies
336
388
 
389
+ **Hard Deletion Property**:
390
+ - If delete requirements in Task 1.2 specify `"deletion_type": "hard"`
391
+ - Add **HardDeletionProperty** to the entity/relation
392
+ - Document deletion rules from requirements as property metadata
393
+
337
394
  ### Step 3: Relation Identification and Analysis
338
395
 
339
396
  **Relations are the ONLY way to connect entities** - they replace traditional foreign key patterns.
@@ -426,9 +483,17 @@ Create `requirements/data-concepts.json`:
426
483
  "description": "Total copies minus borrowed copies",
427
484
  "dependencies": ["BookCopy", "BorrowRecord"]
428
485
  }
486
+ },
487
+ {
488
+ "name": "_hardDeletion",
489
+ "type": "HardDeletionProperty",
490
+ "required": false,
491
+ "computed": false,
492
+ "deletion_rules": ["Cannot delete if has active borrow records", "Only administrators can delete"],
493
+ "source_requirement": "R103"
429
494
  }
430
495
  ],
431
- "referenced_in": ["R001", "R101", "R201"],
496
+ "referenced_in": ["R001", "R101", "R103", "R201"],
432
497
  "note": "No authorId or publisherId - use BookAuthorRelation and BookPublisherRelation instead"
433
498
  },
434
499
  {
@@ -481,9 +546,17 @@ Create `requirements/data-concepts.json`:
481
546
  "name": "dueDate",
482
547
  "type": "date",
483
548
  "required": true
549
+ },
550
+ {
551
+ "name": "_hardDeletion",
552
+ "type": "HardDeletionProperty",
553
+ "required": false,
554
+ "computed": false,
555
+ "deletion_rules": ["Auto-delete when book is returned"],
556
+ "source_requirement": "R103"
484
557
  }
485
558
  ],
486
- "lifecycle": "Created on borrow, updated on return",
559
+ "lifecycle": "Created on borrow, updated on return, deleted on return or book deletion",
487
560
  "referenced_in": ["R102", "R103"]
488
561
  },
489
562
  {
@@ -541,6 +614,7 @@ git commit -m "feat: Task 1.3 - Complete data concept extraction"
541
614
  - Interactions fulfill requirements
542
615
  - All data in interactions must reference concepts from Task 1.3
543
616
  - **CRITICAL**: Inherit all data constraints from requirements
617
+ - **Interaction IDs must be semantic names** (e.g., "BorrowBook", "ViewAvailableBooks") not generic codes (e.g., "I001", "I002")
544
618
 
545
619
  ### Interaction Specification Format
546
620
 
@@ -569,8 +643,7 @@ Create `requirements/interactions-design.json`:
569
643
  },
570
644
  "interactions": [
571
645
  {
572
- "id": "I001",
573
- "name": "BorrowBook",
646
+ "id": "BorrowBook",
574
647
  "fulfills_requirements": ["R101"],
575
648
  "type": "create",
576
649
  "specification": {
@@ -611,8 +684,7 @@ Create `requirements/interactions-design.json`:
611
684
  ]
612
685
  },
613
686
  {
614
- "id": "I002",
615
- "name": "ViewAvailableBooks",
687
+ "id": "ViewAvailableBooks",
616
688
  "fulfills_requirements": ["R001"],
617
689
  "type": "read",
618
690
  "specification": {
@@ -650,20 +722,20 @@ Create `requirements/interactions-design.json`:
650
722
  ],
651
723
  "interaction_matrix": {
652
724
  "by_requirement": {
653
- "R001": ["I002"],
654
- "R101": ["I001"],
655
- "R102": ["I003"],
656
- "R201": ["I004"]
725
+ "R001": ["ViewAvailableBooks"],
726
+ "R101": ["BorrowBook"],
727
+ "R102": ["ReturnBook"],
728
+ "R201": ["ValidateReaderStatus"]
657
729
  },
658
730
  "by_role": {
659
- "Reader": ["I001", "I002"],
660
- "Librarian": ["I003", "I004", "I005"],
661
- "Administrator": ["I006", "I007"]
731
+ "Reader": ["BorrowBook", "ViewAvailableBooks"],
732
+ "Librarian": ["ReturnBook", "ValidateReaderStatus", "ManageBookInventory"],
733
+ "Administrator": ["CreateBook", "ManageReaderAccounts"]
662
734
  },
663
735
  "by_data_entity": {
664
- "Book": ["I001", "I002", "I003"],
665
- "Reader": ["I001", "I004"],
666
- "BorrowRecord": ["I001", "I003", "I005"]
736
+ "Book": ["BorrowBook", "ViewAvailableBooks", "CreateBook"],
737
+ "Reader": ["BorrowBook", "ValidateReaderStatus"],
738
+ "BorrowRecord": ["BorrowBook", "ReturnBook", "ManageBookInventory"]
667
739
  }
668
740
  },
669
741
  "coverage_analysis": {