@ibgib/vcs-gib 0.0.30 → 0.0.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (216) hide show
  1. package/dist/AUTO-GENERATED-version.d.mts +1 -1
  2. package/dist/AUTO-GENERATED-version.mjs +1 -1
  3. package/dist/bootstrap/node-bootstrap.d.mts.map +1 -1
  4. package/dist/bootstrap/node-bootstrap.mjs +7 -21
  5. package/dist/bootstrap/node-bootstrap.mjs.map +1 -1
  6. package/dist/cli/commands/{add-cmd.d.mts → cli-add-cmd.d.mts} +3 -4
  7. package/dist/cli/commands/cli-add-cmd.d.mts.map +1 -0
  8. package/dist/cli/commands/cli-add-cmd.mjs +45 -0
  9. package/dist/cli/commands/cli-add-cmd.mjs.map +1 -0
  10. package/dist/cli/commands/{branch-cmd.d.mts → cli-branch-cmd.d.mts} +9 -9
  11. package/dist/cli/commands/cli-branch-cmd.d.mts.map +1 -0
  12. package/dist/cli/commands/cli-branch-cmd.mjs +59 -0
  13. package/dist/cli/commands/cli-branch-cmd.mjs.map +1 -0
  14. package/dist/cli/commands/cli-checkout-cmd.d.mts +20 -0
  15. package/dist/cli/commands/cli-checkout-cmd.d.mts.map +1 -0
  16. package/dist/cli/commands/cli-checkout-cmd.mjs +50 -0
  17. package/dist/cli/commands/cli-checkout-cmd.mjs.map +1 -0
  18. package/dist/cli/commands/cli-commit-cmd.d.mts +23 -0
  19. package/dist/cli/commands/cli-commit-cmd.d.mts.map +1 -0
  20. package/dist/cli/commands/cli-commit-cmd.mjs +52 -0
  21. package/dist/cli/commands/cli-commit-cmd.mjs.map +1 -0
  22. package/dist/cli/commands/{generate-comment-cmd.d.mts → cli-generate-comment-cmd.d.mts} +1 -1
  23. package/dist/cli/commands/cli-generate-comment-cmd.d.mts.map +1 -0
  24. package/dist/cli/commands/{generate-comment-cmd.mjs → cli-generate-comment-cmd.mjs} +11 -6
  25. package/dist/cli/commands/cli-generate-comment-cmd.mjs.map +1 -0
  26. package/dist/cli/commands/{init-cmd.d.mts → cli-init-cmd.d.mts} +3 -3
  27. package/dist/cli/commands/cli-init-cmd.d.mts.map +1 -0
  28. package/dist/cli/commands/cli-init-cmd.mjs +47 -0
  29. package/dist/cli/commands/cli-init-cmd.mjs.map +1 -0
  30. package/dist/cli/commands/{log-cmd.d.mts → cli-log-cmd.d.mts} +3 -4
  31. package/dist/cli/commands/cli-log-cmd.d.mts.map +1 -0
  32. package/dist/cli/commands/cli-log-cmd.mjs +90 -0
  33. package/dist/cli/commands/cli-log-cmd.mjs.map +1 -0
  34. package/dist/cli/commands/cli-merge-cmd.d.mts +22 -0
  35. package/dist/cli/commands/cli-merge-cmd.d.mts.map +1 -0
  36. package/dist/cli/commands/cli-merge-cmd.mjs +66 -0
  37. package/dist/cli/commands/cli-merge-cmd.mjs.map +1 -0
  38. package/dist/cli/commands/{reset-cmd.d.mts → cli-reset-cmd.d.mts} +2 -2
  39. package/dist/cli/commands/cli-reset-cmd.d.mts.map +1 -0
  40. package/dist/cli/commands/cli-reset-cmd.mjs +63 -0
  41. package/dist/cli/commands/cli-reset-cmd.mjs.map +1 -0
  42. package/dist/cli/commands/cli-restore-cmd.d.mts +23 -0
  43. package/dist/cli/commands/cli-restore-cmd.d.mts.map +1 -0
  44. package/dist/cli/commands/cli-restore-cmd.mjs +55 -0
  45. package/dist/cli/commands/cli-restore-cmd.mjs.map +1 -0
  46. package/dist/cli/commands/{status-cmd.d.mts → cli-status-cmd.d.mts} +3 -3
  47. package/dist/cli/commands/cli-status-cmd.d.mts.map +1 -0
  48. package/dist/cli/commands/cli-status-cmd.mjs +96 -0
  49. package/dist/cli/commands/cli-status-cmd.mjs.map +1 -0
  50. package/dist/cli/vcs-cli-main.d.mts.map +1 -1
  51. package/dist/cli/vcs-cli-main.mjs +18 -15
  52. package/dist/cli/vcs-cli-main.mjs.map +1 -1
  53. package/dist/cli/vcs-projection-helper.d.mts +23 -0
  54. package/dist/cli/vcs-projection-helper.d.mts.map +1 -0
  55. package/dist/cli/vcs-projection-helper.mjs +91 -0
  56. package/dist/cli/vcs-projection-helper.mjs.map +1 -0
  57. package/dist/cli/vcs-repo-helper.d.mts +19 -0
  58. package/dist/cli/vcs-repo-helper.d.mts.map +1 -0
  59. package/dist/cli/vcs-repo-helper.mjs +74 -0
  60. package/dist/cli/vcs-repo-helper.mjs.map +1 -0
  61. package/dist/test/test-helpers.d.mts +11 -2
  62. package/dist/test/test-helpers.d.mts.map +1 -1
  63. package/dist/test/test-helpers.mjs +35 -0
  64. package/dist/test/test-helpers.mjs.map +1 -1
  65. package/package.json +6 -6
  66. package/src/AUTO-GENERATED-version.mts +1 -1
  67. package/src/bootstrap/node-bootstrap.mts +7 -21
  68. package/src/bootstrap/node-bootstrap.respec.mts +2 -2
  69. package/src/cli/cli-arg-parser.respec.mts +2 -2
  70. package/src/cli/cli-e2e.respec.mts +12 -12
  71. package/src/cli/commands/branch-checkout-cmd.respec.mts +426 -412
  72. package/src/cli/commands/cli-add-cmd.mts +65 -0
  73. package/src/cli/commands/cli-branch-cmd.mts +87 -0
  74. package/src/cli/commands/cli-checkout-cmd.mts +72 -0
  75. package/src/cli/commands/cli-commit-cmd.mts +77 -0
  76. package/src/cli/commands/{generate-comment-cmd.mts → cli-generate-comment-cmd.mts} +12 -6
  77. package/src/cli/commands/cli-init-cmd.mts +78 -0
  78. package/src/cli/commands/cli-log-cmd.mts +126 -0
  79. package/src/cli/commands/cli-merge-cmd.mts +99 -0
  80. package/src/cli/commands/cli-reset-cmd.mts +94 -0
  81. package/src/cli/commands/cli-restore-cmd.mts +87 -0
  82. package/src/cli/commands/cli-status-cmd.mts +131 -0
  83. package/src/cli/commands/commit-log-cmd.respec.mts +85 -28
  84. package/src/cli/commands/init-cmd.respec.mts +3 -3
  85. package/src/cli/commands/reset-restore-cmd.respec.mts +9 -9
  86. package/src/cli/commands/status-add-cmd.respec.mts +21 -17
  87. package/src/cli/vcs-cli-main.mts +18 -15
  88. package/src/cli/vcs-projection-helper.mts +112 -0
  89. package/src/cli/vcs-repo-helper.mts +99 -0
  90. package/src/engine/branch/branch-space.respec.mts +23 -21
  91. package/src/engine/merge/b2tfs-sync-comments.respec.mts +11 -11
  92. package/src/test/test-helpers.mts +50 -2
  93. package/src/vcs-gib.respec.mts +25 -16
  94. package/tsconfig.test.tsbuildinfo +1 -1
  95. package/tsconfig.tsbuildinfo +1 -1
  96. package/vcs-gib_test_output.md +58 -0
  97. package/dist/cli/commands/add-cmd.d.mts.map +0 -1
  98. package/dist/cli/commands/add-cmd.mjs +0 -346
  99. package/dist/cli/commands/add-cmd.mjs.map +0 -1
  100. package/dist/cli/commands/branch-cmd.d.mts.map +0 -1
  101. package/dist/cli/commands/branch-cmd.mjs +0 -238
  102. package/dist/cli/commands/branch-cmd.mjs.map +0 -1
  103. package/dist/cli/commands/checkout-cmd.d.mts +0 -21
  104. package/dist/cli/commands/checkout-cmd.d.mts.map +0 -1
  105. package/dist/cli/commands/checkout-cmd.mjs +0 -174
  106. package/dist/cli/commands/checkout-cmd.mjs.map +0 -1
  107. package/dist/cli/commands/commit-cmd.d.mts +0 -24
  108. package/dist/cli/commands/commit-cmd.d.mts.map +0 -1
  109. package/dist/cli/commands/commit-cmd.mjs +0 -449
  110. package/dist/cli/commands/commit-cmd.mjs.map +0 -1
  111. package/dist/cli/commands/generate-comment-cmd.d.mts.map +0 -1
  112. package/dist/cli/commands/generate-comment-cmd.mjs.map +0 -1
  113. package/dist/cli/commands/init-cmd.d.mts.map +0 -1
  114. package/dist/cli/commands/init-cmd.mjs +0 -119
  115. package/dist/cli/commands/init-cmd.mjs.map +0 -1
  116. package/dist/cli/commands/log-cmd.d.mts.map +0 -1
  117. package/dist/cli/commands/log-cmd.mjs +0 -349
  118. package/dist/cli/commands/log-cmd.mjs.map +0 -1
  119. package/dist/cli/commands/merge-cmd.d.mts +0 -36
  120. package/dist/cli/commands/merge-cmd.d.mts.map +0 -1
  121. package/dist/cli/commands/merge-cmd.mjs +0 -292
  122. package/dist/cli/commands/merge-cmd.mjs.map +0 -1
  123. package/dist/cli/commands/reset-cmd.d.mts.map +0 -1
  124. package/dist/cli/commands/reset-cmd.mjs +0 -93
  125. package/dist/cli/commands/reset-cmd.mjs.map +0 -1
  126. package/dist/cli/commands/restore-cmd.d.mts +0 -22
  127. package/dist/cli/commands/restore-cmd.d.mts.map +0 -1
  128. package/dist/cli/commands/restore-cmd.mjs +0 -115
  129. package/dist/cli/commands/restore-cmd.mjs.map +0 -1
  130. package/dist/cli/commands/status-cmd.d.mts.map +0 -1
  131. package/dist/cli/commands/status-cmd.mjs +0 -132
  132. package/dist/cli/commands/status-cmd.mjs.map +0 -1
  133. package/dist/engine/branch/branch-graph-helper.d.mts +0 -28
  134. package/dist/engine/branch/branch-graph-helper.d.mts.map +0 -1
  135. package/dist/engine/branch/branch-graph-helper.mjs +0 -81
  136. package/dist/engine/branch/branch-graph-helper.mjs.map +0 -1
  137. package/dist/engine/branch/branch-helper.d.mts +0 -40
  138. package/dist/engine/branch/branch-helper.d.mts.map +0 -1
  139. package/dist/engine/branch/branch-helper.mjs +0 -78
  140. package/dist/engine/branch/branch-helper.mjs.map +0 -1
  141. package/dist/engine/branch/branch-space-helper.d.mts +0 -23
  142. package/dist/engine/branch/branch-space-helper.d.mts.map +0 -1
  143. package/dist/engine/branch/branch-space-helper.mjs +0 -78
  144. package/dist/engine/branch/branch-space-helper.mjs.map +0 -1
  145. package/dist/engine/branch/branch-types.d.mts +0 -26
  146. package/dist/engine/branch/branch-types.d.mts.map +0 -1
  147. package/dist/engine/branch/branch-types.mjs +0 -7
  148. package/dist/engine/branch/branch-types.mjs.map +0 -1
  149. package/dist/engine/diff/line-diff-helper.d.mts +0 -76
  150. package/dist/engine/diff/line-diff-helper.d.mts.map +0 -1
  151. package/dist/engine/diff/line-diff-helper.mjs +0 -144
  152. package/dist/engine/diff/line-diff-helper.mjs.map +0 -1
  153. package/dist/engine/filter/glob-helper.d.mts +0 -51
  154. package/dist/engine/filter/glob-helper.d.mts.map +0 -1
  155. package/dist/engine/filter/glob-helper.mjs +0 -132
  156. package/dist/engine/filter/glob-helper.mjs.map +0 -1
  157. package/dist/engine/index/index-helper.d.mts +0 -113
  158. package/dist/engine/index/index-helper.d.mts.map +0 -1
  159. package/dist/engine/index/index-helper.mjs +0 -533
  160. package/dist/engine/index/index-helper.mjs.map +0 -1
  161. package/dist/engine/index/index-types.d.mts +0 -63
  162. package/dist/engine/index/index-types.d.mts.map +0 -1
  163. package/dist/engine/index/index-types.mjs +0 -7
  164. package/dist/engine/index/index-types.mjs.map +0 -1
  165. package/dist/engine/item/item-atom-helper.d.mts +0 -20
  166. package/dist/engine/item/item-atom-helper.d.mts.map +0 -1
  167. package/dist/engine/item/item-atom-helper.mjs +0 -30
  168. package/dist/engine/item/item-atom-helper.mjs.map +0 -1
  169. package/dist/engine/item/item-helper.d.mts +0 -94
  170. package/dist/engine/item/item-helper.d.mts.map +0 -1
  171. package/dist/engine/item/item-helper.mjs +0 -424
  172. package/dist/engine/item/item-helper.mjs.map +0 -1
  173. package/dist/engine/item/item-types.d.mts +0 -128
  174. package/dist/engine/item/item-types.d.mts.map +0 -1
  175. package/dist/engine/item/item-types.mjs +0 -16
  176. package/dist/engine/item/item-types.mjs.map +0 -1
  177. package/dist/engine/merge/b2tfs-3way-graft-strategy.d.mts +0 -74
  178. package/dist/engine/merge/b2tfs-3way-graft-strategy.d.mts.map +0 -1
  179. package/dist/engine/merge/b2tfs-3way-graft-strategy.mjs +0 -570
  180. package/dist/engine/merge/b2tfs-3way-graft-strategy.mjs.map +0 -1
  181. package/dist/engine/merge/b2tfs-3way-graft-types.d.mts +0 -34
  182. package/dist/engine/merge/b2tfs-3way-graft-types.d.mts.map +0 -1
  183. package/dist/engine/merge/b2tfs-3way-graft-types.mjs +0 -2
  184. package/dist/engine/merge/b2tfs-3way-graft-types.mjs.map +0 -1
  185. package/dist/engine/status/status-helper.d.mts +0 -90
  186. package/dist/engine/status/status-helper.d.mts.map +0 -1
  187. package/dist/engine/status/status-helper.mjs +0 -286
  188. package/dist/engine/status/status-helper.mjs.map +0 -1
  189. package/src/cli/commands/add-cmd.mts +0 -435
  190. package/src/cli/commands/branch-cmd.mts +0 -311
  191. package/src/cli/commands/checkout-cmd.mts +0 -227
  192. package/src/cli/commands/commit-cmd.mts +0 -557
  193. package/src/cli/commands/init-cmd.mts +0 -152
  194. package/src/cli/commands/log-cmd.mts +0 -449
  195. package/src/cli/commands/merge-cmd.mts +0 -363
  196. package/src/cli/commands/reset-cmd.mts +0 -128
  197. package/src/cli/commands/restore-cmd.mts +0 -155
  198. package/src/cli/commands/status-cmd.mts +0 -168
  199. package/src/engine/branch/branch-graph-helper.mts +0 -117
  200. package/src/engine/branch/branch-helper.mts +0 -112
  201. package/src/engine/branch/branch-space-helper.mts +0 -110
  202. package/src/engine/branch/branch-types.mts +0 -29
  203. package/src/engine/diff/line-diff-helper.mts +0 -210
  204. package/src/engine/diff/line-diff-helper.respec.mts +0 -84
  205. package/src/engine/filter/glob-helper.mts +0 -165
  206. package/src/engine/filter/glob-helper.respec.mts +0 -94
  207. package/src/engine/index/index-helper.mts +0 -705
  208. package/src/engine/index/index-types.mts +0 -66
  209. package/src/engine/item/item-atom-helper.mts +0 -30
  210. package/src/engine/item/item-helper.mts +0 -544
  211. package/src/engine/item/item-types.mts +0 -137
  212. package/src/engine/item/item.respec.mts +0 -92
  213. package/src/engine/merge/b2tfs-3way-graft-strategy.mts +0 -630
  214. package/src/engine/merge/b2tfs-3way-graft-strategy.respec.mts +0 -346
  215. package/src/engine/merge/b2tfs-3way-graft-types.mts +0 -34
  216. package/src/engine/status/status-helper.mts +0 -383
@@ -10,17 +10,17 @@ import { extractErrorMsg } from '@ibgib/helper-gib/dist/helpers/utils-helper.mjs
10
10
 
11
11
  import { parseVcsArgs } from './cli-arg-parser.mjs';
12
12
  import { VCS_SUBCOMMANDS } from './cli-constants.mjs';
13
- import { executeInitCmd } from './commands/init-cmd.mjs';
14
- import { executeStatusCmd } from './commands/status-cmd.mjs';
15
- import { executeAddCmd } from './commands/add-cmd.mjs';
16
- import { executeCommitCmd } from './commands/commit-cmd.mjs';
17
- import { executeLogCmd } from './commands/log-cmd.mjs';
18
- import { executeBranchCmd } from './commands/branch-cmd.mjs';
19
- import { executeCheckoutCmd } from './commands/checkout-cmd.mjs';
20
- import { executeMergeCmd } from './commands/merge-cmd.mjs';
21
- import { executeResetCmd } from './commands/reset-cmd.mjs';
22
- import { executeRestoreCmd } from './commands/restore-cmd.mjs';
23
- import { executeGenerateCommentCmd } from './commands/generate-comment-cmd.mjs';
13
+ import { executeInitCmd } from './commands/cli-init-cmd.mjs';
14
+ import { executeStatusCmd } from './commands/cli-status-cmd.mjs';
15
+ import { executeAddCmd } from './commands/cli-add-cmd.mjs';
16
+ import { executeCommitCmd } from './commands/cli-commit-cmd.mjs';
17
+ import { executeLogCmd } from './commands/cli-log-cmd.mjs';
18
+ import { executeBranchCmd } from './commands/cli-branch-cmd.mjs';
19
+ import { executeCheckoutCmd } from './commands/cli-checkout-cmd.mjs';
20
+ import { executeMergeCmd } from './commands/cli-merge-cmd.mjs';
21
+ import { executeResetCmd } from './commands/cli-reset-cmd.mjs';
22
+ import { executeRestoreCmd } from './commands/cli-restore-cmd.mjs';
23
+ import { executeGenerateCommentCmd } from './commands/cli-generate-comment-cmd.mjs';
24
24
  import { AUTO_GENERATED_VERSION } from '../AUTO-GENERATED-version.mjs';
25
25
  import { GLOBAL_LOG_A_LOT } from '../vcs-gib-constants.mjs';
26
26
 
@@ -76,7 +76,7 @@ export async function main({
76
76
  const lc = `${lcFile}[${main.name}]`;
77
77
  try {
78
78
  if (logalot) {
79
- console.log(`${lc} starting... (I: 4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e)`);
79
+ console.log(`${lc} starting... (I: genuuid)`);
80
80
  }
81
81
 
82
82
  const parsed = parseVcsArgs(argv);
@@ -140,7 +140,10 @@ export async function main({
140
140
  }
141
141
  case VCS_SUBCOMMANDS.CHECKOUT: {
142
142
  const branchName = parsed.positionals[0] || parsed.flags.branchName;
143
- await executeCheckoutCmd({ branchName });
143
+ await executeCheckoutCmd({
144
+ branchName,
145
+ force: parsed.flags.force,
146
+ });
144
147
  break;
145
148
  }
146
149
  case VCS_SUBCOMMANDS.MERGE: {
@@ -180,11 +183,11 @@ export async function main({
180
183
 
181
184
  return 0;
182
185
  } catch (error) {
183
- console.error(`Error: ${extractErrorMsg(error)} (E: 8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3d)`);
186
+ console.error(`Error: ${extractErrorMsg(error)} (E: genuuid)`);
184
187
  return 1;
185
188
  } finally {
186
189
  if (logalot) {
187
- console.log(`${lc} complete. (I: 9f0a1b2c3d4e5f6a7b8c9d0e1f2a3b4c)`);
190
+ console.log(`${lc} complete. (I: genuuid)`);
188
191
  }
189
192
  }
190
193
  }
@@ -0,0 +1,112 @@
1
+ /**
2
+ * @module vcs-projection-helper
3
+ *
4
+ * CLI-specific filesystem projection helpers for reading and writing `.vcsgib/vcs_index_projection.json`.
5
+ * Strictly housed in `apps/vcs-gib` CLI layer to maintain pure isolation from `core-gib`.
6
+ */
7
+
8
+ import path from 'node:path';
9
+ import fs from 'node:fs/promises';
10
+
11
+ import { extractErrorMsg } from '@ibgib/helper-gib/dist/helpers/utils-helper.mjs';
12
+ import { getIbGibAddr } from '@ibgib/ts-gib/dist/helper.mjs';
13
+ import { IbGibSpaceAny } from '@ibgib/core-gib/dist/witness/space/space-base-v1.mjs';
14
+ import { getIbGibsFromCache_fallbackToSpaces } from '@ibgib/core-gib/dist/common/other/ibgib-helper.mjs';
15
+ import { B2tFSIndexIbGib_V1 } from '@ibgib/core-gib/dist/vcs/index/index-types.mjs';
16
+ import { GLOBAL_LOG_A_LOT } from '../vcs-gib-constants.mjs';
17
+
18
+ const lcFile = `[vcs-projection-helper]`;
19
+ const logalot = GLOBAL_LOG_A_LOT;
20
+
21
+ /**
22
+ * Retrieves authoritative B2tFSIndexIbGib_V1 from space by reading the `.vcsgib/vcs_index_projection.json` pointer on disk.
23
+ */
24
+ export async function readVcsIndexProjectionFromDisk({
25
+ vcsPath,
26
+ space,
27
+ }: {
28
+ vcsPath: string;
29
+ space: IbGibSpaceAny;
30
+ }): Promise<B2tFSIndexIbGib_V1 | undefined> {
31
+ const lc = `${lcFile}[${readVcsIndexProjectionFromDisk.name}]`;
32
+ try {
33
+ if (logalot) {
34
+ console.log(`${lc} starting... (I: genuuid)`);
35
+ }
36
+
37
+ if (!vcsPath) {
38
+ return undefined;
39
+ }
40
+
41
+ const projPath = path.join(vcsPath, 'vcs_index_projection.json');
42
+ let indexAddr: string | undefined;
43
+ try {
44
+ const raw = await fs.readFile(projPath, 'utf8');
45
+ const parsed = JSON.parse(raw);
46
+ indexAddr = parsed.indexAddr;
47
+ } catch {
48
+ return undefined;
49
+ }
50
+
51
+ if (!indexAddr) {
52
+ return undefined;
53
+ }
54
+
55
+ const ibgibs = await getIbGibsFromCache_fallbackToSpaces({
56
+ addrs: [indexAddr],
57
+ space,
58
+ });
59
+
60
+ const indexIbGib = ibgibs?.at(0) as B2tFSIndexIbGib_V1;
61
+ return indexIbGib;
62
+ } catch (error) {
63
+ console.error(`${lc} ${extractErrorMsg(error)} (E: genuuid)`);
64
+ throw error;
65
+ } finally {
66
+ if (logalot) {
67
+ console.log(`${lc} complete. (I: genuuid)`);
68
+ }
69
+ }
70
+ }
71
+
72
+ /**
73
+ * Writes read-only JSON projection cache of repository index to disk.
74
+ */
75
+ export async function writeVcsIndexProjectionToDisk({
76
+ vcsPath,
77
+ indexIbGib,
78
+ }: {
79
+ vcsPath: string;
80
+ indexIbGib: B2tFSIndexIbGib_V1;
81
+ }): Promise<void> {
82
+ const lc = `${lcFile}[${writeVcsIndexProjectionToDisk.name}]`;
83
+ try {
84
+ if (logalot) {
85
+ console.log(`${lc} starting... (I: 06da189dd09843652865d2c82e415826)`);
86
+ }
87
+
88
+ await fs.mkdir(vcsPath, { recursive: true });
89
+
90
+ const indexAddr = getIbGibAddr({ ibGib: indexIbGib });
91
+ const projectionObj = {
92
+ _isReadOnlyProjection: true,
93
+ _comment: 'STRICTLY READ-ONLY PROJECTION GENERATED FROM B2TFSINDEXIBGIB_V1 IN LOCALSPACE',
94
+ indexAddr,
95
+ spaceId: indexIbGib.data?.mySpaceId,
96
+ activeBranchName: indexIbGib.data?.activeBranchName || 'main',
97
+ stagedCount: (indexIbGib.data?.staged_item || []).length,
98
+ stagedPaths: indexIbGib.data?.stagedPaths || {},
99
+ updatedAt: new Date().toISOString(),
100
+ };
101
+
102
+ const projFile = path.join(vcsPath, 'vcs_index_projection.json');
103
+ await fs.writeFile(projFile, JSON.stringify(projectionObj, null, 2), 'utf8');
104
+ } catch (error) {
105
+ console.error(`${lc} ${extractErrorMsg(error)} (E: genuuid)`);
106
+ throw error;
107
+ } finally {
108
+ if (logalot) {
109
+ console.log(`${lc} complete. (I: genuuid)`);
110
+ }
111
+ }
112
+ }
@@ -0,0 +1,99 @@
1
+ /**
2
+ * @module vcs-repo-helper
3
+ *
4
+ * Helper to bootstrap Node environment and open a VcsRepository session.
5
+ */
6
+
7
+ import path from 'node:path';
8
+ import fs from 'node:fs/promises';
9
+
10
+ import { extractErrorMsg } from '@ibgib/helper-gib/dist/helpers/utils-helper.mjs';
11
+ import { VcsRepository } from '@ibgib/core-gib/dist/vcs/vcs-repository.mjs';
12
+ import { resolveContextualBranchName } from '@ibgib/core-gib/dist/vcs/branch/branch-helper.mjs';
13
+ import { getB2tFSIndexIbGib } from '@ibgib/core-gib/dist/vcs/index/index-helper.mjs';
14
+ import { getOrCreateBranchSpace } from '@ibgib/core-gib/dist/vcs/branch/branch-helper.mjs';
15
+ import { getOrCreateWorkspaceProjectionSpace } from '@ibgib/node-gib/dist/vcs/workspace-space-helper.mjs';
16
+
17
+ import { GLOBAL_LOG_A_LOT } from '../vcs-gib-constants.mjs';
18
+ import { bootstrapVcsMetaspace } from '../bootstrap/node-bootstrap.mjs';
19
+ import { B2TFS_BRANCH_DEFAULT_NAME } from '@ibgib/core-gib/dist/vcs/branch/branch-constants.mjs';
20
+
21
+ const logalot = GLOBAL_LOG_A_LOT;
22
+
23
+ export interface OpenVcsRepositoryOpts {
24
+ targetDir?: string;
25
+ vcsFolderName?: string;
26
+ branchName?: string;
27
+ }
28
+
29
+ export interface OpenVcsRepositoryResult {
30
+ repo: VcsRepository;
31
+ repoRoot: string;
32
+ vcsPath: string;
33
+ activeWorktreeDir: string;
34
+ }
35
+
36
+ export async function openVcsRepository({
37
+ targetDir = process.cwd(),
38
+ vcsFolderName = '.vcsgib',
39
+ branchName,
40
+ }: OpenVcsRepositoryOpts = {}): Promise<OpenVcsRepositoryResult> {
41
+ const lc = `[${openVcsRepository.name}]`;
42
+ try {
43
+ if (logalot) { console.log(`${lc} starting... (I: 4a621eb5576a3064f85177c6de80a826)`); }
44
+
45
+ const absTargetDir = path.resolve(targetDir);
46
+
47
+ // 1. Locate repository root and bootstrap Node localSpace
48
+ const { metaspace, localSpace, vcsPath, repoRoot } = await bootstrapVcsMetaspace({
49
+ repoPath: absTargetDir,
50
+ vcsFolderName,
51
+ });
52
+
53
+ // 2. Fetch authoritative in-band index from localSpace
54
+ const indexIbGib = await getB2tFSIndexIbGib({ space: localSpace, metaspace });
55
+ if (!indexIbGib) {
56
+ throw new Error(`Not an ibgib repository (index not found in ${vcsPath})`);
57
+ }
58
+
59
+ // 3. Determine active branch and worktree directory
60
+ const activeBranchName = branchName || resolveContextualBranchName({
61
+ targetDir: absTargetDir,
62
+ repoRoot,
63
+ indexIbGib,
64
+ });
65
+
66
+ const activeWorktreeDir = activeBranchName === B2TFS_BRANCH_DEFAULT_NAME
67
+ ? repoRoot
68
+ : path.join(repoRoot, 'b', activeBranchName);
69
+
70
+ // 4. Resolve branch space & create Node workspace projection space
71
+ const { space: activeSpace } = await getOrCreateBranchSpace({
72
+ metaspace,
73
+ branchName: activeBranchName,
74
+ });
75
+
76
+ const { space: workspaceSpace } = await getOrCreateWorkspaceProjectionSpace({
77
+ metaspace,
78
+ workspaceRoot: activeWorktreeDir,
79
+ vcsFolderName,
80
+ backingSpace: activeSpace,
81
+ });
82
+
83
+ // 5. Construct domain facade
84
+ const repo = new VcsRepository({
85
+ metaspace,
86
+ localSpace,
87
+ workspaceSpace,
88
+ repoRoot,
89
+ vcsFolderName,
90
+ });
91
+
92
+ return { repo, repoRoot, activeWorktreeDir, vcsPath };
93
+ } catch (error) {
94
+ console.error(`${lc} ${extractErrorMsg(error)}`);
95
+ throw error;
96
+ } finally {
97
+ if (logalot) { console.log(`${lc} complete.`); }
98
+ }
99
+ }
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @module branch-space.respec.node
3
- *
3
+ *
4
4
  * Unit tests for branch space helper, space-qualified address formatting/parsing,
5
5
  * and graph population into branch spaces.
6
6
  */
@@ -8,44 +8,49 @@
8
8
  import path from 'node:path';
9
9
  import fs from 'node:fs/promises';
10
10
 
11
- import {
12
- respecfully, ifWe, iReckon
13
- } from '@ibgib/helper-gib/dist/respec-gib/respec-gib.mjs';
11
+ import { respecfully, ifWe, iReckon } from '@ibgib/helper-gib/dist/respec-gib/respec-gib.mjs';
12
+
14
13
  import { ROOT } from '@ibgib/ts-gib/dist/V1/constants.mjs';
15
14
  import { Factory_V1 } from '@ibgib/ts-gib/dist/V1/factory.mjs';
16
15
  import { getIbGibAddr } from '@ibgib/ts-gib/dist/helper.mjs';
17
16
  import { getFromSpace, persistTransformResult } from '@ibgib/core-gib/dist/witness/space/space-helper.mjs';
17
+ import { getB2tFSItemIb } from '@ibgib/core-gib/dist/vcs/item/item-atom-helper.mjs';
18
+ import { populateBranchSpaceFromGraph } from '@ibgib/core-gib/dist/vcs/branch/branch-graph-helper.mjs';
19
+ import { B2tFSItemIbGib_V1 } from '@ibgib/core-gib/dist/vcs/item/item-types.mjs';
20
+ import { getOrCreateBranchSpace } from '@ibgib/core-gib/dist/vcs/branch/branch-helper.mjs';
21
+ import { getSpaceQualifiedIbGibAddr, parseSpaceQualifiedIbGibAddr, isSpaceQualifiedAddr } from '@ibgib/core-gib/dist/common/other/ibgib-helper.mjs';
18
22
 
19
23
  import { bootstrapVcsMetaspace } from '../../bootstrap/node-bootstrap.mjs';
20
- import { getB2tFSItemIb } from '../item/item-atom-helper.mjs';
21
- import { getOrCreateBranchSpace } from './branch-space-helper.mjs';
22
- import { populateBranchSpaceFromGraph } from './branch-graph-helper.mjs';
23
- import { getSpaceQualifiedIbGibAddr, parseSpaceQualifiedIbGibAddr } from '../index/index-helper.mjs';
24
- import { B2tFSItemIbGib_V1 } from '../item/item-types.mjs';
25
24
 
26
- const lc = `[apps/vcs-gib/src/engine/branch/branch-space.respec.node.mts]`;
25
+ const lc = `[apps/vcs-gib/src/engine/branch/branch-space.respec.mts]`;
27
26
 
28
27
  await respecfully(lc, `Branch Space & Graph Helper Respecs`, async () => {
29
28
 
30
29
  await respecfully(lc, `Space-Qualified Address Parsing & Formatting`, async () => {
31
30
  await ifWe(lc, `formats space-qualified address using options object`, async () => {
32
- const sq = getSpaceQualifiedIbGibAddr({ spaceId: 'sp_alpha', ibGibAddr: 'item_a^gib123' });
33
- iReckon(lc, sq).willEqual('v:1^spaceId:sp_alpha^item_a^gib123');
31
+ const sq = getSpaceQualifiedIbGibAddr({ spaceId: 'sp_alpha', ibGibAddr: 'item_a^gib' });
32
+ iReckon(lc, sq).willEqual('v:1^spaceId:sp_alpha^item_a^gib');
34
33
  });
35
34
 
36
35
  await ifWe(lc, `parses space-qualified address using options object`, async () => {
37
- const parsed = parseSpaceQualifiedIbGibAddr({ spaceQualifiedAddr: 'v:1^spaceId:sp_alpha^item_a^gib123' });
36
+ const parsed = parseSpaceQualifiedIbGibAddr({ sqAddr: 'v:1^spaceId:sp_alpha^item_a^gib' });
38
37
  iReckon(lc, parsed).isGonnaBeTruthy();
39
38
  iReckon(lc, parsed!.version).willEqual(1);
40
39
  iReckon(lc, parsed!.spaceId).willEqual('sp_alpha');
41
- iReckon(lc, parsed!.ibGibAddr).willEqual('item_a^gib123');
40
+ iReckon(lc, parsed!.ibGibAddr).willEqual('item_a^gib');
42
41
  iReckon(lc, parsed!.ib).willEqual('item_a');
43
- iReckon(lc, parsed!.gib).willEqual('gib123');
42
+ iReckon(lc, parsed!.gib).willEqual('gib');
44
43
  });
45
44
 
46
- await ifWe(lc, `returns null for invalid space-qualified address string`, async () => {
47
- const parsed = parseSpaceQualifiedIbGibAddr({ spaceQualifiedAddr: 'invalid_address_string' });
48
- iReckon(lc, parsed).isGonnaBeFalsy();
45
+ await ifWe(lc, `throws for invalid space-qualified address string`, async () => {
46
+ let threw = false;
47
+ try {
48
+ parseSpaceQualifiedIbGibAddr({ sqAddr: 'invalid_address_string' });
49
+ } catch {
50
+ threw = true;
51
+ }
52
+ iReckon(lc, threw).isGonnaBeTrue();
53
+ iReckon(lc, isSpaceQualifiedAddr('invalid_address_string')).isGonnaBeFalse();
49
54
  });
50
55
  });
51
56
 
@@ -62,7 +67,6 @@ await respecfully(lc, `Branch Space & Graph Helper Respecs`, async () => {
62
67
  const branchName = 'feature_alpha';
63
68
  const result1 = await getOrCreateBranchSpace({
64
69
  metaspace,
65
- vcsPath,
66
70
  branchName,
67
71
  });
68
72
 
@@ -72,7 +76,6 @@ await respecfully(lc, `Branch Space & Graph Helper Respecs`, async () => {
72
76
 
73
77
  const result2 = await getOrCreateBranchSpace({
74
78
  metaspace,
75
- vcsPath,
76
79
  branchName,
77
80
  });
78
81
 
@@ -132,7 +135,6 @@ await respecfully(lc, `Branch Space & Graph Helper Respecs`, async () => {
132
135
  // Create target branch space
133
136
  const { space: targetBranchSpace } = await getOrCreateBranchSpace({
134
137
  metaspace,
135
- vcsPath,
136
138
  branchName: 'main',
137
139
  });
138
140
 
@@ -25,14 +25,14 @@ import { createCommentIbGib } from '@ibgib/core-gib/dist/common/comment/comment-
25
25
  import { getBinIb } from '@ibgib/core-gib/dist/common/other/ibgib-helper.mjs';
26
26
  import { BinIbGib_V1 } from '@ibgib/core-gib/dist/common/bin/bin-types.mjs';
27
27
  import { putInSpace, persistTransformResult, registerNewIbGib, getFromSpace, getLatestAddrs } from '@ibgib/core-gib/dist/witness/space/space-helper.mjs';
28
+ import { createB2tFSItemIbGib, evolveB2tFSItemIbGib } from '@ibgib/core-gib/dist/vcs/item/item-helper.mjs';
29
+ import { B2tFSItemIbGib_V1, BINARY_REL8N_NAME } from '@ibgib/core-gib/dist/vcs/item/item-types.mjs';
30
+ import { B2tFS3WayGraftStrategy } from '@ibgib/core-gib/dist/vcs/merge/b2tfs-3way-graft-strategy.mjs';
31
+ import { getOrCreateBranchSpace } from '@ibgib/core-gib/dist/vcs/branch/branch-helper.mjs';
28
32
 
29
33
  import { bootstrapVcsMetaspace } from '../../bootstrap/node-bootstrap.mjs';
30
- import { getOrCreateBranchSpace } from '../branch/branch-space-helper.mjs';
31
- import { createB2tFSItemIbGib, evolveB2tFSItemIbGib } from '../item/item-helper.mjs';
32
- import { B2tFSItemIbGib_V1, BINARY_REL8N_NAME } from '../item/item-types.mjs';
33
- import { B2tFS3WayGraftStrategy } from './b2tfs-3way-graft-strategy.mjs';
34
34
 
35
- const lc = `[apps/vcs-gib/src/engine/merge/b2tfs-sync-comments.respec.node.mts]`;
35
+ const lc = `[apps/vcs-gib/src/engine/merge/b2tfs-sync-comments.respec.mts]`;
36
36
  const graftStrategySvc = GraftStrategyService.instance;
37
37
 
38
38
  async function createFileWithBinAndComment({
@@ -149,8 +149,8 @@ await respecfully(lc, `B2tFS Item & Comment Sync Graph Integrity`, async () => {
149
149
  repoPath: testDir,
150
150
  vcsFolderName,
151
151
  });
152
- const { space: spaceA } = await getOrCreateBranchSpace({ metaspace, vcsPath, branchName: 'branch_a' });
153
- const { space: spaceB } = await getOrCreateBranchSpace({ metaspace, vcsPath, branchName: 'branch_b' });
152
+ const { space: spaceA } = await getOrCreateBranchSpace({ metaspace, branchName: 'branch_a' });
153
+ const { space: spaceB } = await getOrCreateBranchSpace({ metaspace, branchName: 'branch_b' });
154
154
 
155
155
  // 1. Create file item with comment in Space A
156
156
  const { fileItem } = await createFileWithBinAndComment({
@@ -208,8 +208,8 @@ await respecfully(lc, `B2tFS Item & Comment Sync Graph Integrity`, async () => {
208
208
  repoPath: testDir,
209
209
  vcsFolderName,
210
210
  });
211
- const { space: spaceA } = await getOrCreateBranchSpace({ metaspace, vcsPath, branchName: 'branch_a' });
212
- const { space: spaceB } = await getOrCreateBranchSpace({ metaspace, vcsPath, branchName: 'branch_b' });
211
+ const { space: spaceA } = await getOrCreateBranchSpace({ metaspace, branchName: 'branch_a' });
212
+ const { space: spaceB } = await getOrCreateBranchSpace({ metaspace, branchName: 'branch_b' });
213
213
 
214
214
  // 1. Create file with comment 1 in Space A
215
215
  const { fileItem: fileItemA1 } = await createFileWithBinAndComment({
@@ -299,8 +299,8 @@ await respecfully(lc, `B2tFS Item & Comment Sync Graph Integrity`, async () => {
299
299
  repoPath: testDir,
300
300
  vcsFolderName,
301
301
  });
302
- const { space: spaceA } = await getOrCreateBranchSpace({ metaspace, vcsPath, branchName: 'branch_a' });
303
- const { space: spaceB } = await getOrCreateBranchSpace({ metaspace, vcsPath, branchName: 'branch_b' });
302
+ const { space: spaceA } = await getOrCreateBranchSpace({ metaspace, branchName: 'branch_a' });
303
+ const { space: spaceB } = await getOrCreateBranchSpace({ metaspace, branchName: 'branch_b' });
304
304
 
305
305
  // 1. Initial base file in Space A
306
306
  const { fileItem: lcaFile } = await createFileWithBinAndComment({
@@ -20,8 +20,9 @@ import { IbGibAddr } from '@ibgib/ts-gib/dist/types.mjs';
20
20
  import { getLatestAddrs } from '@ibgib/core-gib/dist/witness/space/space-helper.mjs';
21
21
  import { IbGibSpaceAny } from '@ibgib/core-gib/dist/witness/space/space-base-v1.mjs';
22
22
 
23
- import { B2tFSBranchIbGib_V1 } from '../engine/branch/branch-types.mjs';
24
- import { B2tFSItemIbGib_V1 } from '../engine/item/item-types.mjs';
23
+ import { B2tFSBranchIbGib_V1 } from '@ibgib/core-gib/dist/vcs/branch/branch-types.mjs';
24
+ import { B2tFSItemIbGib_V1, B2TFS_CHILD_ITEM_REL8N_NAME } from '@ibgib/core-gib/dist/vcs/item/item-types.mjs';
25
+ import { getIbGibFromSpace } from '@ibgib/core-gib/dist/common/other/ibgib-helper.mjs';
25
26
 
26
27
 
27
28
  // ─────────────────────────────────────────────────────────────────────────────
@@ -166,3 +167,50 @@ export function logAddr(label: string, addr: IbGibAddr | undefined): void {
166
167
  export function logAddrs(label: string, addrs: IbGibAddr[] | undefined): void {
167
168
  console.log(`[ADDRS][${label}]: ${shortAddrs(addrs)}`);
168
169
  }
170
+
171
+ /**
172
+ * Recursively logs the b2tfs item hierarchy from a rootItemAddr within a space.
173
+ */
174
+ export async function logTreeHierarchy({
175
+ label,
176
+ rootItemAddr,
177
+ space,
178
+ metaspace,
179
+ }: {
180
+ label: string;
181
+ rootItemAddr?: string;
182
+ space: any;
183
+ metaspace?: any;
184
+ }): Promise<void> {
185
+ const lc = `[TRACE_B2TFS][${label}]`;
186
+ const spaceName = space?.data?.name || space?.data?.spaceSubPath || space?.ib || 'unknown';
187
+ console.log(`${lc} === Hierarchy for root: ${shortAddr(rootItemAddr)} in space: ${spaceName} ===`);
188
+ if (!rootItemAddr) {
189
+ console.log(`${lc} rootItemAddr is falsy`);
190
+ return;
191
+ }
192
+
193
+ async function walk(addr: string, depth: number, currentPath: string): Promise<void> {
194
+ const indent = ' '.repeat(depth);
195
+ const item = await getIbGibFromSpace({ addr, space, metaspace }) as B2tFSItemIbGib_V1;
196
+ if (!item) {
197
+ console.log(`${lc}${indent} ❌ MISSING item at ${shortAddr(addr)} (path: ${currentPath})`);
198
+ return;
199
+ }
200
+ const name = item.data?.name || '(root)';
201
+ const fsType = item.data?.fsType || 'unknown';
202
+ const comments = item.rel8ns?.comment || [];
203
+ const children = item.rel8ns?.[B2TFS_CHILD_ITEM_REL8N_NAME] || [];
204
+ console.log(`${lc}${indent} 📁 ${name} (${fsType}) addr: ${shortAddr(addr)} comments: ${comments.length} children: ${children.length}`);
205
+ for (const cAddr of comments) {
206
+ const comment = await getIbGibFromSpace({ addr: cAddr, space, metaspace });
207
+ console.log(`${lc}${indent} 💬 comment: "${(comment?.data as any)?.text?.slice(0, 50)}"`);
208
+ }
209
+ for (const childAddr of children) {
210
+ await walk(childAddr, depth + 1, currentPath ? `${currentPath}/${name}` : name);
211
+ }
212
+ }
213
+
214
+ await walk(rootItemAddr, 1, '');
215
+ }
216
+
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @module vcs-gib.respec.node
3
- *
3
+ *
4
4
  * Full Engine Cycle Integration Tests for @ibgib/vcs-gib.
5
5
  * Tests Metaspace bootstrap, canonical ib atoms, item creation, branch spaces, and index tracking.
6
6
  */
@@ -8,19 +8,20 @@
8
8
  import path from 'node:path';
9
9
  import fs from 'node:fs/promises';
10
10
 
11
- import {
12
- respecfully, ifWe, iReckon
13
- } from '@ibgib/helper-gib/dist/respec-gib/respec-gib.mjs';
11
+ import { respecfully, ifWe, iReckon } from '@ibgib/helper-gib/dist/respec-gib/respec-gib.mjs';
14
12
  import { ROOT } from '@ibgib/ts-gib/dist/V1/constants.mjs';
15
13
  import { Factory_V1 } from '@ibgib/ts-gib/dist/V1/factory.mjs';
14
+ import { getIbGibAddr } from '@ibgib/ts-gib/dist/helper.mjs';
15
+ import { getB2tFSItemIb } from '@ibgib/core-gib/dist/vcs/item/item-atom-helper.mjs';
16
+ import { createB2tFSBranchIbGib, getB2tFSBranchSpaceName } from '@ibgib/core-gib/dist/vcs/branch/branch-helper.mjs';
17
+ import { createB2tFSIndexIbGib, } from '@ibgib/core-gib/dist/vcs/index/index-helper.mjs';
18
+ import { B2tFSItemIbGib_V1 } from '@ibgib/core-gib/dist/vcs/item/item-types.mjs';
19
+ import { getSpaceQualifiedIbGibAddr, parseSpaceQualifiedIbGibAddr } from '@ibgib/core-gib/dist/common/other/ibgib-helper.mjs';
20
+ import { getSpaceIdFromIb } from '@ibgib/core-gib/dist/witness/space/metaspace/metaspace-innerspace/metaspace-innerspace-helper.mjs';
16
21
 
17
22
  import { bootstrapVcsMetaspace } from './bootstrap/node-bootstrap.mjs';
18
- import { getB2tFSItemIb } from './engine/item/item-atom-helper.mjs';
19
- import { createB2tFSBranchIbGib, getB2tFSBranchSpaceName } from './engine/branch/branch-helper.mjs';
20
- import { createB2tFSIndexIbGib, getSpaceQualifiedIbGibAddr, parseSpaceQualifiedIbGibAddr } from './engine/index/index-helper.mjs';
21
- import { B2tFSItemIbGib_V1 } from './engine/item/item-types.mjs';
22
23
 
23
- const lc = `[apps/vcs-gib/src/vcs-gib.respec.node.mts]`;
24
+ const lc = `[apps/vcs-gib/src/vcs-gib.respec.mts]`;
24
25
 
25
26
  await respecfully(lc, `vcs-gib Full Engine Cycle`, async () => {
26
27
 
@@ -33,12 +34,12 @@ await respecfully(lc, `vcs-gib Full Engine Cycle`, async () => {
33
34
 
34
35
  await respecfully(lc, `Space-Qualified Addresses`, async () => {
35
36
  await ifWe(lc, `formats and parses space-qualified addresses`, async () => {
36
- const sq = getSpaceQualifiedIbGibAddr('space_a', 'item^gib123');
37
- iReckon(lc, sq).willEqual('v:1^spaceId:space_a^item^gib123');
37
+ const sqAddr = getSpaceQualifiedIbGibAddr({ spaceId: 'space_a', ibGibAddr: 'item^gib' });
38
+ iReckon(lc, sqAddr).willEqual('v:1^spaceId:space_a^item^gib');
38
39
 
39
- const parsed = parseSpaceQualifiedIbGibAddr(sq);
40
+ const parsed = parseSpaceQualifiedIbGibAddr({ sqAddr });
40
41
  iReckon(lc, parsed?.spaceId).willEqual('space_a');
41
- iReckon(lc, parsed?.ibGibAddr).willEqual('item^gib123');
42
+ iReckon(lc, parsed?.ibGibAddr).willEqual('item^gib');
42
43
  });
43
44
  });
44
45
 
@@ -77,15 +78,23 @@ await respecfully(lc, `vcs-gib Full Engine Cycle`, async () => {
77
78
  metaspace,
78
79
  });
79
80
  iReckon(lc, branchIbGib.data?.name).willEqual('main');
81
+ const branchAddr = getIbGibAddr({ ibGib: branchIbGib });
82
+
83
+ const localSpaceId = getSpaceIdFromIb(localSpace.ib);
84
+ const sqBranchAddr = getSpaceQualifiedIbGibAddr({
85
+ ibGibAddr: branchAddr,
86
+ spaceId: localSpaceId,
87
+ });
80
88
 
81
89
  // Create Index IbGib
82
90
  const indexIbGib = await createB2tFSIndexIbGib({
83
- spaceId: 'local_space_uuid',
84
- activeSpaceId: 'local_space_uuid',
91
+ activeSpaceId: localSpaceId,
85
92
  space: localSpace,
93
+ activeBranchName: branchName,
94
+ sqBranchAddr,
86
95
  metaspace,
87
96
  });
88
- iReckon(lc, indexIbGib.data?.mySpaceId).willEqual('local_space_uuid');
97
+ iReckon(lc, indexIbGib.data?.mySpaceId).willEqual(localSpaceId);
89
98
  iReckon(lc, indexIbGib.data?.staged_item).willEqual([]);
90
99
  iReckon(lc, indexIbGib.rel8ns?.staged_item).isGonnaBeFalsy();
91
100
  } finally {