Repository navigation
Commit f3ba965
refactor: simplify the cycle guard's path resolution and the dry-run write sites
Post-review simplification pass. No behaviour change; all five constraints the
review pass established are intact and still proven by their tests.
`DirectorySource.RealPath` drops the `File.ResolveLinkTarget` fallback and the
manual rooted/relative branch. Both were dead code, verified rather than assumed:
`Directory.ResolveLinkTarget(path, returnFinalTarget: true).FullName` already
returns a fully-qualified, symlink-resolved absolute path for a relative one-hop
target, a relative chain, an absolute target and a `.` self-link — checked with
the process CWD set to `/`, which is exactly where a relative target resolved
against the wrong base would have shown itself. Since `Collect` only ever calls
`RealPath` on a path it has already confirmed is a directory, `File.`- and
`Directory.ResolveLinkTarget` could never disagree either. Thirteen lines become
two; the component-by-component LOOP is untouched, which is the part that
carries the correctness (resolving only the final segment misses a cycle reached
through a symlinked ancestor).
Also fixes a doc-comment bug introduced by the previous commit: the new
`PathComparer` block was inserted between `Expand()`'s existing `<summary>` and
`Expand()` itself, so two adjacent `///` blocks merged into one and XML-doc
tooling attached the pair to `PathComparer`, orphaning `Expand()`'s own summary.
`init.ts` factors the four-times-repeated `if (!dryRun) { mkdir; writeFile }` into
`writeUnlessDryRun`, and the three past/future tense ternaries into
`verbed(dryRun, pastParticiple)` — each call site now states only its own past
participle rather than spelling out both tenses of a whole sentence. This
normalises one message from active "would wire" to passive "would be wired", to
match the two that already read that way; the non-dry-run wording is unchanged,
which is what the tests pin.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 514f707 commit f3ba965
2 files changed
Lines changed: 43 additions & 47 deletions
File tree
- server
- csharp/MetaObjects/Loader
- typescript/packages/cli/src/commands
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | 61 | | |
67 | 62 | | |
68 | 63 | | |
| |||
81 | 76 | | |
82 | 77 | | |
83 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| |||
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
207 | 205 | | |
208 | 206 | | |
209 | 207 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
221 | 238 | | |
222 | 239 | | |
223 | 240 | | |
| |||
255 | 272 | | |
256 | 273 | | |
257 | 274 | | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
| 275 | + | |
263 | 276 | | |
264 | 277 | | |
265 | 278 | | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
| 279 | + | |
271 | 280 | | |
272 | 281 | | |
273 | 282 | | |
274 | 283 | | |
275 | 284 | | |
276 | | - | |
277 | | - | |
278 | | - | |
| 285 | + | |
279 | 286 | | |
280 | 287 | | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
286 | 292 | | |
287 | 293 | | |
288 | 294 | | |
| |||
301 | 307 | | |
302 | 308 | | |
303 | 309 | | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
| 310 | + | |
| 311 | + | |
310 | 312 | | |
311 | 313 | | |
312 | 314 | | |
313 | 315 | | |
314 | 316 | | |
315 | 317 | | |
316 | 318 | | |
317 | | - | |
| 319 | + | |
| 320 | + | |
318 | 321 | | |
319 | 322 | | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
| 323 | + | |
326 | 324 | | |
327 | 325 | | |
328 | 326 | | |
| |||
0 commit comments