|
10 | 10 | - ✅ **DONE**: Array element extraction - tasks receive individual array elements |
11 | 11 | - ✅ **DONE**: Output aggregation - inline implementation aggregates map task outputs for dependents |
12 | 12 | - ✅ **DONE**: DSL support for `.map()` for defining map steps with compile-time duplicate detection |
13 | | -- ⏳ **TODO**: Fix orphaned messages on run failure |
| 13 | +- ✅ **DONE**: Fix orphaned messages on run failure |
14 | 14 | - ⏳ **TODO**: Performance optimization with step_states.output column |
15 | 15 |
|
16 | 16 | ### Chores |
|
106 | 106 | - Updated DSL README with .map() documentation |
107 | 107 | - Created detailed changeset |
108 | 108 |
|
| 109 | +- [x] **PR #219: Fix Orphaned Messages on Run Failure** - `09-18-fix-orphaned-messages-on-fail` ✅ COMPLETED |
| 110 | + |
| 111 | + - Archives all queued messages when run fails (prevents orphaned messages) |
| 112 | + - Handles type constraint violations gracefully without exceptions |
| 113 | + - Added guards to prevent any mutations on failed runs: |
| 114 | + - complete_task returns unchanged |
| 115 | + - start_ready_steps exits early |
| 116 | + - cascade_complete_taskless_steps returns 0 |
| 117 | + - Added performance index for efficient message archiving |
| 118 | + - Tests unstashed and passing (archive_sibling_map_tasks, archive_messages_on_type_constraint_failure) |
| 119 | + - Updated core README with failure handling mentions |
| 120 | + - **Critical fix: prevents queue performance degradation in production** |
| 121 | + |
109 | 122 | #### ❌ Remaining Work (Priority Order) |
110 | 123 |
|
111 | | -- [ ] **Priority 1: Fix Orphaned Messages on Run Failure** 🚨 CRITICAL |
| 124 | +- [ ] **Integration Tests** |
112 | 125 |
|
113 | | - - Archive all pending messages when run fails |
114 | | - - Handle map sibling tasks specially |
115 | | - - Fix type constraint violations to fail immediately without retries |
116 | | - - See detailed plan: [PLAN_orphaned_messages.md](./PLAN_orphaned_messages.md) |
117 | | - - **Critical for production: prevents queue performance degradation** |
118 | | - - Tests already written (stashed) that document the problem |
| 126 | + - End-to-end workflows with real array data |
| 127 | + - Basic happy path coverage |
| 128 | + - This should be minimal and added to the Edge Worker integration test suite for now |
119 | 129 |
|
120 | | -- [ ] **Priority 2: Performance Optimization - step_states.output Column** |
| 130 | +- [ ] **Performance Optimization - step_states.output Column** |
121 | 131 |
|
122 | 132 | - Migrate from inline aggregation to storing outputs in step_states |
123 | 133 | - See detailed plan: [PLAN_step_output.md](./PLAN_step_output.md) |
|
132 | 142 | - Update all aggregation tests (~17 files) |
133 | 143 | - **Note**: This is an optimization that should be done after core functionality is stable |
134 | 144 |
|
135 | | -- [ ] **Priority 3: Integration Tests** |
136 | | - |
137 | | - - End-to-end workflows with real array data |
138 | | - - Basic happy path coverage |
139 | | - - This should be minimal and added to the Edge Worker integration test suite for now |
140 | | - |
141 | | -- [ ] **Priority 4: Update core README** |
142 | | - |
143 | | - - `pkgs/core/README.md` |
144 | | - |
145 | | - - Add new section describing the step types |
146 | | - - Describe single step briefly, focus on describing map step type and how it differs |
147 | | - - Make sure to mention that maps are constrained to have exactly one dependency |
148 | | - - Show multiple cases of inputs -> task creation |
149 | | - - Explain edge cases (empty array propagation, invalid array input) |
150 | | - - Explain root map vs dependent map and how it gets handled and what restrictions those apply on the Flow input |
151 | | - - Explain cascade completion of taskless steps and its limitations |
| 145 | +- [ ] **Update `pkgs/core/README.md`** |
152 | 146 |
|
153 | | -- [ ] **Priority 5: Add docs page** |
| 147 | + - Add new section describing the step types |
| 148 | + - Describe single step briefly, focus on describing map step type and how it differs |
| 149 | + - Make sure to mention that maps are constrained to have exactly one dependency |
| 150 | + - Show multiple cases of inputs -> task creation |
| 151 | + - Explain edge cases (empty array propagation, invalid array input) |
| 152 | + - Explain root map vs dependent map and how it gets handled and what restrictions those apply on the Flow input |
| 153 | + - Explain cascade completion of taskless steps and its limitations |
154 | 154 |
|
155 | | - - **Add basic docs page** |
| 155 | +- [ ] **Add docs page** |
156 | 156 |
|
157 | | - - put it into `pkgs/website/src/content/docs/concepts/array-and-map-steps.mdx` |
158 | | - - describe the DSL and how the map works and why we need it |
159 | | - - show example usage of root map |
160 | | - - show example usage of dependent map |
161 | | - - focus mostly on how to use it, instead of how it works under the hood |
162 | | - - link to the README's for more details |
| 157 | + - put it into `pkgs/website/src/content/docs/concepts/array-and-map-steps.mdx` |
| 158 | + - describe the DSL and how the map works and why we need it |
| 159 | + - show example usage of root map |
| 160 | + - show example usage of dependent map |
| 161 | + - focus mostly on how to use it, instead of how it works under the hood |
| 162 | + - link to the README's for more details |
163 | 163 |
|
164 | | -- [ ] **Priority 6: Migration Consolidation** (Do this last before merge!) |
| 164 | +- [ ] **Migration Consolidation** |
165 | 165 |
|
166 | 166 | - Remove all temporary/incremental migrations from feature branches |
167 | 167 | - Generate a single consolidated migration for the entire map infrastructure |
168 | 168 | - Ensure clean migration path from current production schema |
169 | 169 | - If NULL improvement is done, include it in the consolidated migration |
170 | 170 |
|
171 | | -- [ ] **Priority 7: Graphite Stack Merge** |
| 171 | +- [ ] **Graphite Stack Merge** |
172 | 172 |
|
173 | 173 | - Configure Graphite merge queue for the complete PR stack |
174 | 174 | - Ensure all PRs in sequence can be merged together |
|
0 commit comments