Commit 4d4fe3c
feat(runtime): implement SeedLoaderService with reference resolution, dependency ordering, and multi-pass loading
- ISeedLoaderService contract in packages/spec/src/contracts/
- SeedLoaderService runtime in packages/runtime/src/seed-loader.ts
- Dependency graph builder from object metadata (lookup/master_detail)
- Topological sort (Kahn's algorithm) for insert ordering
- Reference resolution via externalId with DB fallback
- Multi-pass loading for circular dependencies
- Dry-run validation mode
- Upsert/insert/update/ignore/replace mode support
- UUID/ObjectId detection to skip resolution
- Actionable error reporting
- Updated app-plugin.ts to use SeedLoaderService with fallback
- 36 runtime tests + 3 contract tests, all passing
- Full suite: 121 runtime tests passing
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>1 parent d6efa2a commit 4d4fe3c
7 files changed
Lines changed: 2076 additions & 14 deletions
File tree
- packages
- runtime/src
- spec/src/contracts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
127 | 128 | | |
128 | 129 | | |
129 | 130 | | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
134 | 175 | | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
144 | 181 | | |
145 | 182 | | |
| 183 | + | |
146 | 184 | | |
147 | | - | |
148 | 185 | | |
149 | 186 | | |
150 | 187 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
0 commit comments