/** * @module commit-cmd * * Isomorphic execution engine for `vcs commit`. * Assembles staged items into B2tFSItemIbGib_V1 Merkle tree, ingests companion comments, * advances B2tFSBranchIbGib_V1 pointer, and clears staged galaxy state. */ import { extractErrorMsg, getUUID, hash, replaceStringInArray } from '@ibgib/helper-gib/dist/helpers/utils-helper.mjs'; import { joinPaths } from '@ibgib/helper-gib/dist/helpers/path-helper.mjs'; import { getIbGibAddr, getIbAndGib } from '@ibgib/ts-gib/dist/helper.mjs'; import { getGibInfo } from '@ibgib/ts-gib/dist/V1/transforms/transform-helper.mjs'; import { mut8 } from '@ibgib/ts-gib/dist/V1/transforms/mut8.mjs'; import { rel8 } from '@ibgib/ts-gib/dist/V1/transforms/rel8.mjs'; import { Rel8nReplacement } from '@ibgib/ts-gib/dist/types.mjs'; import { GLOBAL_LOG_A_LOT } from '../../../core-constants.mjs'; import { persistTransformResult, registerNewIbGib } from '../../../witness/space/space-helper.mjs'; import { createCommentIbGib } from '../../../common/comment/comment-helper.mjs'; import { CommentIbGib_V1 } from '../../../common/comment/comment-types.mjs'; import { CMD_MODIFIER_WORKSPACE_SCAN } from '../../../witness/space/workspace-projection-space/workspace-projection-space-constants.mjs'; import { WorkspaceScanResultData } from '../../../witness/space/workspace-projection-space/workspace-projection-space-types.mjs'; import { B2tFSItemIbGib_V1, B2TFS_CHILD_ITEM_REL8N_NAME, B2tFSType } from '../item/item-types.mjs'; import { createB2tFSItemIbGib, evolveB2tFSItemIbGib, getBranchAndRootItemInfosAndIbGibsAndSpaceFromGalaxyIbGib, getProjectedItemFilename, } from '../item/item-helpers.mjs'; import { isPackageGalaxyIbGib } from '../../package-galaxy/package-timeline-helpers.mjs'; import { B2tFSBranchIbGib_V1 } from '../branch/branch-types.mjs'; import { B2TFS_BRANCH_DEFAULT_NAME } from '../branch/branch-constants.mjs'; import { resolveContextualBranchName } from '../branch/branch-helpers.mjs'; import { updateB2tFSGalaxyIbGib, } from '../b2tfs-galaxy/b2tfs-galaxy-helpers.mjs'; import { VcsCommitOpts, VcsCommitResult } from './command-types.mjs'; import { getIbGibFromSpace, getIbGibsFromSpace, getSpaceQualifiedIbGibAddr } from '../../../common/other/ibgib-helper.mjs'; import { getSpaceIdFromIb } from '../../../witness/space/metaspace/metaspace-innerspace/metaspace-innerspace-helper.mjs'; import { IbGibSpaceAny } from '../../../witness/space/space-base-v1.mjs'; import { B2tFSGalaxyData_V1, B2tFSStagedItemRecord } from '../b2tfs-galaxy/b2tfs-galaxy-types.mjs'; import { createBranchSnapshotIbGib } from '../snapshot/snapshot-helpers.mjs'; const lcFile = `[commit-cmd]`; const logalot = GLOBAL_LOG_A_LOT; interface TreeNode { name: string; fsType: B2tFSType; itemAddr?: string; children: Map; } export async function executeVcsCommit({ metaspace, localSpace, branchName: explicitBranchName, activeBranchSpace: givenActiveBranchSpace, branchSpace: givenBranchSpace, workspaceSpace, galaxyIbGib, message, author = 'vcs-user', b2tfsGalaxyRoot = '', targetDir = b2tfsGalaxyRoot, vcsFolderName = '.vcsgib', keepEmptyFolders = false, primaryIdentityTjpAddr, deviceDelegate, cosmosInfo, galaxyInfo, originSnapshotInfos, }: VcsCommitOpts): Promise { const lc = `${lcFile}[${executeVcsCommit.name}]`; try { if (logalot) { console.log(`${lc} starting... (I: b8615dc6ad884198a85729aa3900d726)`); } if (!b2tfsGalaxyRoot) { throw new Error(`b2tfsGalaxyRoot required for executeVcsCommit (E: f490281b6a184e92a83850cb39480826)`); } const activeBranchName = explicitBranchName || resolveContextualBranchName({ targetDir: targetDir || b2tfsGalaxyRoot, b2tfsGalaxyRoot, galaxyIbGib, }); if (!activeBranchName) { throw new Error(`(UNEXPECTED) activeBranchName falsy? (E: 61e786846d989a15ad6c9b68068c0a26)`); } const stagedPaths = galaxyIbGib.data.stagedPaths || {}; const stagedKeys = Object.keys(stagedPaths); if (stagedKeys.length === 0) { throw new Error(`Nothing to commit (no staged items found in galaxy) (E: b1b825a7a47f020c6978d64a70f12c26)`); } // Fetch branch info, branch ibgib, and latest root item ibgib const { branchInfo: activeBranchInfo, branchIbGib: activeBranchIbGib, branchSpace: resolvedBranchSpace, rootItemAddr_latest: existingRootItemAddr, rootItemIbGib_latest: existingRootItem, } = await getBranchAndRootItemInfosAndIbGibsAndSpaceFromGalaxyIbGib({ galaxyIbGib, branchName: activeBranchName, metaspace, }); const activeBranchSpace = givenBranchSpace || givenActiveBranchSpace || resolvedBranchSpace; if (!activeBranchSpace) { throw new Error(`(UNEXPECTED) branchSpace falsy for branch "${activeBranchName}" (E: 5d2f9eee12e924ad5f9035c3518734ff)`); } // 1. Ingest companion comments from workspace space if available // todo: refactor workspace scan to its own helper function, then this code should pull pendingComments from that refactored function. let pendingComments: Array<{ commentRelPath: string; targetRelPath: string; targetType: 'file' | 'folder'; content: string }> = []; if (workspaceSpace) { const scanRes = await workspaceSpace.witness({ data: { cmd: 'get', cmdModifiers: [CMD_MODIFIER_WORKSPACE_SCAN], }, }); const scanData = (scanRes?.data as any)?.scanResult as WorkspaceScanResultData; if (scanData?.pendingComments) { pendingComments = scanData.pendingComments; } } // Build item comments map: targetRelPath -> array of commentAddrs const itemCommentsMap = new Map(); const filesToUnlink: string[] = []; for (const pendingComment of pendingComments) { const commentRes = await createCommentIbGib({ text: pendingComment.content, saveInSpace: true, space: activeBranchSpace, }); const commentIbGib = commentRes.newIbGib as CommentIbGib_V1; const commentAddr = getIbGibAddr({ ibGib: commentIbGib }); await metaspace.registerNewIbGib({ ibGib: commentIbGib, space: activeBranchSpace }); const list = itemCommentsMap.get(pendingComment.targetRelPath) || []; list.push(commentAddr); itemCommentsMap.set(pendingComment.targetRelPath, list); filesToUnlink.push(pendingComment.commentRelPath); } const ingestedCommentCount = pendingComments.length; if ((!message || message.trim().length === 0) && ingestedCommentCount === 0) { throw new Error(`Commit message is required (-m "message" or companion comment files) (E: fb4714c7171820cdc491ff48aa89a626)`); } // 2. Assemble new root folder tree let { newRootItem, newRootAddr, committedPaths, deletedPaths } = await commitCmd_buildFolderTree({ existingRootItem, stagedPaths, itemCommentsMap, activeBranchSpace, metaspace, keepEmptyFolders, }); // 3. If top-level commit message is provided, attach CommentIbGib to root item let commentAddr: string | undefined; if (message && message.trim().length > 0) { const commentRes = await createCommentIbGib({ text: message.trim(), saveInSpace: true, space: activeBranchSpace, }); const commentIbGib = commentRes.newIbGib as CommentIbGib_V1; commentAddr = getIbGibAddr({ ibGib: commentIbGib }); await metaspace.registerNewIbGib({ ibGib: commentIbGib, space: activeBranchSpace }); const existingComments = newRootItem.rel8ns?.comment || []; const evolveRootRes = await evolveB2tFSItemIbGib({ existingItem: newRootItem, rel8nsToUpdate: { comment: [...existingComments, commentAddr], }, }); await persistTransformResult({ resTransform: evolveRootRes, space: activeBranchSpace }); await metaspace.registerNewIbGib({ ibGib: evolveRootRes.newIbGib, space: activeBranchSpace }); newRootItem = evolveRootRes.newIbGib as B2tFSItemIbGib_V1; newRootAddr = getIbGibAddr({ ibGib: newRootItem }); if (logalot) { console.log(`[DIAG-COMMIT] branch: '${activeBranchName}', message: "${message}", commentAddr: ${commentAddr}, rootItem comments: ${JSON.stringify(newRootItem.rel8ns?.comment || [])}`); } } else { if (logalot) { console.log(`${lc} no commit msg? do we require a commit msg? (I: 71203833c29513061814948650bd8226)`); } } // 3.5 Generate immutable Snapshot Stone let snapshotIbGib: any; let snapshotAddr: string | undefined; let evolvedAuthorDelegateKeystone: any; if (deviceDelegate && primaryIdentityTjpAddr) { const snapRes = await createBranchSnapshotIbGib({ branchIbGib: activeBranchIbGib, rootItem: newRootItem, commitMessageAddr: commentAddr, cosmosInfo: cosmosInfo || { name: (galaxyIbGib.data as any)?.cosmosName, }, galaxyInfo: galaxyInfo || { name: galaxyIbGib.data?.name, addr: getIbGibAddr({ ibGib: galaxyIbGib }), tjpAddr: galaxyIbGib.rel8ns?.tjp?.[0], }, originSnapshotInfos, primaryIdentityTjpAddr, deviceDelegate, space: activeBranchSpace, controlSpace: localSpace, metaspace, }); snapshotIbGib = snapRes.snapshotIbGib; snapshotAddr = snapRes.snapshotAddr; evolvedAuthorDelegateKeystone = snapRes.evolvedAuthorDelegateKeystone; } // 4. Advance B2tFSBranchIbGib_V1 node inside activeBranchSpace // IMPORTANT: Use mut8+rel8, NOT firstGen. firstGen creates a new TJP (new timeline root). // We must stay on the same timeline so getLatestAddrs resolves through the original metastones. // Pass 1: mut8 data fields const existingSnapshots = activeBranchIbGib.data?.['@snapshot'] || []; const branchDataToUpdate: any = { committedAt: new Date().toISOString(), committedPaths, ...(snapshotAddr ? { '@snapshot': [...existingSnapshots, snapshotAddr] } : {}), }; if (deletedPaths && deletedPaths.length > 0) { branchDataToUpdate.deletedPaths = deletedPaths; } const branchMut8Res = await mut8({ src: activeBranchIbGib, dataToAddOrPatch: branchDataToUpdate, dna: true, nCounter: true, }); let newBranchIbGib = branchMut8Res.newIbGib as B2tFSBranchIbGib_V1; await persistTransformResult({ resTransform: branchMut8Res, space: activeBranchSpace }); // Pass 2: rel8 new root item and optional commit comment const branchRel8nsToReplace: { [rel8nName: string]: Rel8nReplacement[]; } = { 'b2tfs_item': [{ oldAddr: existingRootItemAddr, newAddr: newRootAddr, }], }; const branchRel8nsToAdd = !!commentAddr ? { 'comment': [commentAddr] } : undefined; const resRel8_newRootAndComment = await rel8({ src: newBranchIbGib, rel8nsToAddByAddr: branchRel8nsToAdd, rel8nsToReplaceByAddr: branchRel8nsToReplace, dna: true, nCounter: true, }); newBranchIbGib = resRel8_newRootAndComment.newIbGib as B2tFSBranchIbGib_V1; const newBranchAddr = getIbGibAddr({ ibGib: newBranchIbGib }); await persistTransformResult({ resTransform: resRel8_newRootAndComment, space: activeBranchSpace }); await registerNewIbGib({ ibGib: newBranchIbGib, space: activeBranchSpace }); await metaspace.registerNewIbGib({ ibGib: newBranchIbGib, space: activeBranchSpace }); const newBranchSqAddr = getSpaceQualifiedIbGibAddr({ spaceId: getSpaceIdFromIb(activeBranchSpace.ib), ibGibAddr: newBranchAddr, }); // 5. Update B2tFSGalaxyIbGib_V1 in localSpace const isTrunkBranch = activeBranchName.toLowerCase() === (galaxyIbGib.data.policy?.defaultBranch || B2TFS_BRANCH_DEFAULT_NAME).toLowerCase(); const dataToUpdate: Partial = { stagedPaths: {}, staged_item: [], }; if (isTrunkBranch) { dataToUpdate.trunkBranchSqAddr = newBranchSqAddr; dataToUpdate['$@branch'] = [newBranchSqAddr]; } const updatedGalaxy = await updateB2tFSGalaxyIbGib({ space: localSpace, metaspace, galaxyIbGib, dataToUpdate, }); // 6. Delete ingested companion comment files (and superseded package version files) from workspace space if (isPackageGalaxyIbGib(galaxyIbGib) && deletedPaths && deletedPaths.length > 0) { for (const delPath of deletedPaths) { if (!filesToUnlink.includes(delPath)) { filesToUnlink.push(delPath); } } } if (workspaceSpace && filesToUnlink.length > 0) { for (const fileToUnlink of filesToUnlink) { try { await workspaceSpace.witness({ data: { cmd: 'delete', relPath: fileToUnlink, ibGibAddrs: [fileToUnlink], }, }); } catch { // Suppress unlink error } } } return { branchName: activeBranchName, commitAddr: newBranchAddr, commentAddr, rootItemAddr: newRootAddr, committedPaths, deletedPaths, ingestedCommentsCount: ingestedCommentCount, updatedGalaxy, branchIbGib: newBranchIbGib, snapshotIbGib, snapshotAddr, evolvedAuthorDelegateKeystone, }; } catch (error) { debugger; // error in core commit console.error(`${lc} ${extractErrorMsg(error)} (E: 7afb5867182883e4f8433198d4197f26)`); throw error; } finally { if (logalot) { console.log(`${lc} complete. (I: 8d7c6286dec864a1a3b6349880e09626)`); } } } async function commitCmd_buildFolderTree({ existingRootItem, stagedPaths, itemCommentsMap, activeBranchSpace, metaspace, keepEmptyFolders = false, }: { existingRootItem: B2tFSItemIbGib_V1; stagedPaths: { [relPath: string]: B2tFSStagedItemRecord }; itemCommentsMap: Map; activeBranchSpace: any; metaspace: any; keepEmptyFolders?: boolean; }): Promise<{ newRootItem: B2tFSItemIbGib_V1; newRootAddr: string; committedPaths: string[]; deletedPaths: string[] }> { const lc = `[${commitCmd_buildFolderTree.name}]`; try { if (logalot) { console.log(`${lc} starting... (I: dfcd220de3b81323c8e1bf4ff9615926)`); } const existingItemsMap = new Map(); await commitCmd_walkBranchGraph({ item: existingRootItem, space: activeBranchSpace, metaspace, currentRelPath: '', outMap: existingItemsMap, }); if (!existingRootItem.data.name) { throw new Error(`(UNEXPECTED) existingRootItem.data.name falsy? (E: 8af4e81f199479b12861c861f2482826)`); } const rootNode: TreeNode = { name: existingRootItem.data.name, fsType: 'folder', itemAddr: getIbGibAddr({ ibGib: existingRootItem }), children: new Map(), }; // Populate existing committed items into tree for (const [relPath, info] of existingItemsMap.entries()) { const segments = relPath.split('/').filter(Boolean); let curr = rootNode; for (let i = 0; i < segments.length; i++) { const seg = segments[i]; const isLast = i === segments.length - 1; if (!curr.children.has(seg)) { curr.children.set(seg, { name: seg, fsType: isLast ? info.fsType : 'folder', itemAddr: isLast ? getIbGibAddr({ ibGib: info.item }) : undefined, children: new Map(), }); } curr = curr.children.get(seg)!; } } // Merge staged items into tree const committedPaths: string[] = []; const deletedPaths: string[] = []; for (const [relPath, stagedRec] of Object.entries(stagedPaths)) { committedPaths.push(relPath); const segments = relPath.split('/').filter(Boolean); let curr = rootNode; if (stagedRec.isDeleted) { deletedPaths.push(relPath); for (let i = 0; i < segments.length - 1; i++) { const seg = segments[i]; curr = curr.children.get(seg)!; if (!curr) { break; } } if (curr) { const leafName = segments[segments.length - 1]; curr.children.delete(leafName); } } else { for (let i = 0; i < segments.length; i++) { const seg = segments[i]; const isLast = i === segments.length - 1; if (!curr.children.has(seg)) { curr.children.set(seg, { name: seg, fsType: isLast ? stagedRec.fsType : 'folder', itemAddr: isLast ? stagedRec.itemAddr : undefined, children: new Map(), }); } const next = curr.children.get(seg)!; if (isLast) { next.itemAddr = stagedRec.itemAddr; next.fsType = stagedRec.fsType; } curr = next; } } } const resMerkle = await commitCmd_buildMerkleFolder({ node: rootNode, isRoot: true, itemCommentsMap, activeBranchSpace, metaspace, keepEmptyFolders, }); if (!resMerkle) { throw new Error(`(UNEXPECTED) root Merkle folder returned null (E: e36a5b28d09e4f25b29c9e81f7281026)`); } const newRootItem = resMerkle.item; const newRootAddr = getIbGibAddr({ ibGib: newRootItem }); return { newRootItem, newRootAddr, committedPaths, deletedPaths }; } catch (error) { console.error(`${lc} ${extractErrorMsg(error)}`); throw error; } finally { if (logalot) { console.log(`${lc} complete.`); } } } function getChildItemTjpKey(addr: string): string { const { ib, gib } = getIbAndGib({ ibGibAddr: addr }); const tjpGib = getGibInfo({ gib }).tjpGib || gib; return `${ib}^${tjpGib}`; } async function commitCmd_buildMerkleFolder({ node, parentRelPath, isRoot = false, itemCommentsMap, activeBranchSpace, metaspace, keepEmptyFolders = false, }: { node: TreeNode; parentRelPath?: string; isRoot?: boolean; itemCommentsMap: Map; activeBranchSpace: any; metaspace: any; keepEmptyFolders?: boolean; }): Promise<{ item: B2tFSItemIbGib_V1; itemAddr: string } | null> { const currentRelPath = isRoot ? '' : (parentRelPath ? joinPaths(parentRelPath, node.name) : node.name); const childAddrs: string[] = []; for (const [childName, childNode] of node.children.entries()) { if (childNode.fsType === 'folder') { if (!keepEmptyFolders && childNode.children.size === 0) { // Prune empty folder without recursing continue; } const res = await commitCmd_buildMerkleFolder({ node: childNode, parentRelPath: currentRelPath, isRoot: false, itemCommentsMap, activeBranchSpace, metaspace, keepEmptyFolders, }); if (res) { childAddrs.push(res.itemAddr); } } else { let fileItemAddr = childNode.itemAddr; const fileRelPath = currentRelPath ? joinPaths(currentRelPath, childName) : childName; const commentsToAttach = itemCommentsMap.get(fileRelPath) || []; if (commentsToAttach.length > 0 && fileItemAddr) { const existingFileItem = await getIbGibFromSpace({ addr: fileItemAddr, space: activeBranchSpace, metaspace, }); if (!existingFileItem) { throw new Error(`could not get fileItemAddr (${fileItemAddr}) from activeBranchSpace (${activeBranchSpace.ib}) (E: 316865814791f792f7814d04c6af7826)`); } const evolveFileRes = await evolveB2tFSItemIbGib({ existingItem: existingFileItem, rel8nsToUpdate: { comment: [...commentsToAttach], }, }); await persistTransformResult({ resTransform: evolveFileRes, space: activeBranchSpace }); await metaspace.registerNewIbGib({ ibGib: evolveFileRes.newIbGib, space: activeBranchSpace }); fileItemAddr = getIbGibAddr({ ibGib: evolveFileRes.newIbGib }); } if (fileItemAddr) { childAddrs.push(fileItemAddr); } } } // Prune empty non-root folder if keepEmptyFolders is false if (!isRoot && !keepEmptyFolders && childAddrs.length === 0) { return null; } const folderCommentsToAttach = itemCommentsMap.get(currentRelPath) || []; let folderItem: B2tFSItemIbGib_V1; if (node.itemAddr) { const existingFolderItem = await getIbGibFromSpace({ addr: node.itemAddr, space: activeBranchSpace, }); if (!existingFolderItem) { throw new Error(`could not get node.itemAddr (${node.itemAddr}) from activeBranchSpace (${activeBranchSpace.ib}) (E: a1d53d1d920878c718cd4349b204e926)`); } const oldChildAddrs = existingFolderItem.rel8ns?.[B2TFS_CHILD_ITEM_REL8N_NAME] || []; const oldChildByTjp = new Map(); for (const addr of oldChildAddrs) { const tjp = getChildItemTjpKey(addr); oldChildByTjp.set(tjp, addr); } const activeChildByTjp = new Map(); for (const addr of childAddrs) { const tjp = getChildItemTjpKey(addr); activeChildByTjp.set(tjp, addr); } const childrenToRemove: string[] = []; const childrenToAdd: string[] = []; // Check old children: if missing or evolved in active, remove old addr for (const [tjp, oldAddr] of oldChildByTjp.entries()) { const activeAddr = activeChildByTjp.get(tjp); if (!activeAddr || activeAddr !== oldAddr) { childrenToRemove.push(oldAddr); } } // Check active children: if new or evolved from old, add new addr for (const [tjp, activeAddr] of activeChildByTjp.entries()) { const oldAddr = oldChildByTjp.get(tjp); if (!oldAddr || oldAddr !== activeAddr) { childrenToAdd.push(activeAddr); } } const existingComments = existingFolderItem.rel8ns?.comment || []; const hasNewFolderComments = folderCommentsToAttach && folderCommentsToAttach.length > 0; // If no changes to children or comments, reuse existing folder item unchanged if (childrenToRemove.length === 0 && childrenToAdd.length === 0 && !hasNewFolderComments) { return { item: existingFolderItem, itemAddr: node.itemAddr }; } const evolveFolderRes = await evolveB2tFSItemIbGib({ existingItem: existingFolderItem, rel8nsToUpdate: { ...(childrenToAdd.length > 0 ? { [B2TFS_CHILD_ITEM_REL8N_NAME]: childrenToAdd } : {}), ...(hasNewFolderComments ? { comment: [...existingComments, ...folderCommentsToAttach] } : {}), }, rel8nsToRemove: childrenToRemove.length > 0 ? { [B2TFS_CHILD_ITEM_REL8N_NAME]: childrenToRemove, } : undefined, }); await persistTransformResult({ resTransform: evolveFolderRes, space: activeBranchSpace }); await metaspace.registerNewIbGib({ ibGib: evolveFolderRes.newIbGib, space: activeBranchSpace }); folderItem = evolveFolderRes.newIbGib as B2tFSItemIbGib_V1; } else { const folderNameHash = await hash({ s: node.name }); const createFolderRes = await createB2tFSItemIbGib({ fsType: 'folder', name: node.name, data: { nameHash: folderNameHash, diffTransactionId: await getUUID(), }, rel8ns: { [B2TFS_CHILD_ITEM_REL8N_NAME]: childAddrs, ...(folderCommentsToAttach.length > 0 ? { comment: folderCommentsToAttach } : {}), }, }); await persistTransformResult({ resTransform: createFolderRes, space: activeBranchSpace }); await metaspace.registerNewIbGib({ ibGib: createFolderRes.newIbGib, space: activeBranchSpace }); folderItem = createFolderRes.newIbGib as B2tFSItemIbGib_V1; } const folderItemAddr = getIbGibAddr({ ibGib: folderItem }); return { item: folderItem, itemAddr: folderItemAddr }; } async function commitCmd_walkBranchGraph({ item, space, metaspace, currentRelPath, outMap, }: { item: B2tFSItemIbGib_V1; space: IbGibSpaceAny; metaspace?: any; currentRelPath: string; outMap: Map; }): Promise { if (!item || !item.data) { return; } const { fsType } = item.data; if (currentRelPath) { outMap.set(currentRelPath, { relPath: currentRelPath, fsType, item }); } if (fsType === 'folder') { const childAddrs = item.rel8ns?.[B2TFS_CHILD_ITEM_REL8N_NAME] || []; const childIbGibs = await getIbGibsFromSpace({ addrs: childAddrs, space, }); for (const childItem of childIbGibs) { const childName = getProjectedItemFilename(childItem) || childItem.data.name; const childRelPath = currentRelPath ? joinPaths(currentRelPath, childName) : childName; await commitCmd_walkBranchGraph({ item: childItem, space, metaspace, currentRelPath: childRelPath, outMap, }); } } }