Concept Flow - path.resolve for absolute paths
Start with empty path
Read next path segment
Is segment absolute?
Yes→Reset path to this segment
| No
Append segment to current path
More segments?
Yes→Repeat
No
Normalize path (resolve .. and .)
Return absolute path
path.resolve reads each path segment from left to right, resets if an absolute path is found, appends relative segments, then normalizes and returns the absolute path.