@teambit/ci 1.0.495 → 1.0.500

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.
@@ -1 +1 @@
1
- {"version":3,"names":["_chai","data","require","_syncPlanner","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","base","laneHead","branchExists","lastSyncedHead","hasDevCommits","tipIsSyncCommit","conflictLabelPresent","ownership","laneGone","undefined","table","name","input","type","reason","action","deleteBranch","keepReason","describe","it","result","planLaneSync","expect","to","equal","deep","contain"],"sources":["sync-planner.spec.ts"],"sourcesContent":["import { expect } from 'chai';\nimport type { LaneOwnershipEvidence, LaneSyncAction, LaneSyncInput } from './sync-planner';\nimport { planLaneSync } from './sync-planner';\n\nconst base: LaneSyncInput = {\n laneHead: 'L1',\n branchExists: true,\n lastSyncedHead: 'L1',\n hasDevCommits: false,\n tipIsSyncCommit: true,\n conflictLabelPresent: false,\n ownership: 'own-live',\n};\n\n/** the \"lane deleted remotely, branch still there\" shape — the only path that reads `ownership` */\nconst laneGone = (ownership: LaneOwnershipEvidence) => ({ laneHead: undefined, ownership });\n\n/**\n * The decision table. `action` (exact) is required on every row that decides a branch deletion: under\n * the defaults an ordinary developer branch reaches the planner in the same shape as a deleted lane's\n * branch, so `deleteBranch` and the keep reason are part of the contract, not incidental output.\n */\nconst table: Array<{\n name: string;\n input: Partial<LaneSyncInput>;\n type: LaneSyncAction['type'];\n action?: LaneSyncAction;\n reason?: string;\n}> = [\n { name: 'converged -> noop', input: {}, type: 'noop', reason: 'converged' },\n {\n name: 'conflict label present -> noop until resolved',\n input: { laneHead: 'L2', conflictLabelPresent: true },\n type: 'noop',\n },\n { name: 'lane gone + no branch -> noop', input: { laneHead: undefined, branchExists: false }, type: 'noop' },\n\n {\n name: \"own-live, no dev commits, OUR tip (the branch is exactly the lane's mirror) -> close-pr AND delete\",\n input: laneGone('own-live'),\n type: 'close-pr',\n action: { type: 'close-pr', deleteBranch: true },\n },\n {\n // A developer who commits their own `.bitmap` write looks own-live with nothing above the state\n // commit; the marker is what separates our mirror from their branch.\n name: 'own-live, no dev commits, a tip WE DID NOT WRITE -> close-pr but KEEP the branch',\n input: { ...laneGone('own-live'), tipIsSyncCommit: false },\n type: 'close-pr',\n action: { type: 'close-pr', deleteBranch: false, keepReason: 'tip-not-a-sync-commit' },\n },\n {\n name: 'own-live WITH dev commits (never-exported work above the state commit) -> KEEP the branch',\n input: { ...laneGone('own-live'), hasDevCommits: true },\n type: 'close-pr',\n action: { type: 'close-pr', deleteBranch: false, keepReason: 'unmerged-commits' },\n },\n {\n // \"tip-not-a-sync-commit\" would send the reader after the wrong thing when there is real work.\n name: 'own-live with dev commits AND a foreign tip -> keeps, naming the commits as the reason',\n input: { ...laneGone('own-live'), hasDevCommits: true, tipIsSyncCommit: false },\n type: 'close-pr',\n action: { type: 'close-pr', deleteBranch: false, keepReason: 'unmerged-commits' },\n },\n {\n name: 'own-merged (branch tip already in the default branch) -> close-pr AND delete',\n input: laneGone('own-merged'),\n type: 'close-pr',\n action: { type: 'close-pr', deleteBranch: true },\n },\n {\n // Reachability alone proves deleting loses nothing, so no marker conjunction applies here.\n name: 'own-merged deletes even with a foreign tip and dev commits',\n input: { ...laneGone('own-merged'), tipIsSyncCommit: false, hasDevCommits: true },\n type: 'close-pr',\n action: { type: 'close-pr', deleteBranch: true },\n },\n {\n name: 'own-superseded (PR merged, then more commits pushed) -> close-pr but KEEP the branch',\n input: laneGone('own-superseded'),\n type: 'close-pr',\n action: { type: 'close-pr', deleteBranch: false, keepReason: 'unmerged-commits' },\n },\n {\n name: 'inherited-or-none -> noop, and never close-pr',\n input: laneGone('inherited-or-none'),\n type: 'noop',\n reason: 'maps to no lane and has no sync history',\n },\n {\n name: 'inherited-or-none with the branch carrying its own dev commits -> still noop',\n input: { ...laneGone('inherited-or-none'), lastSyncedHead: undefined, hasDevCommits: true },\n type: 'noop',\n },\n\n // The adopt paths need no claim: nothing on them can delete a branch.\n {\n name: 'no branch yet -> import-lane',\n input: { branchExists: false, lastSyncedHead: undefined, ownership: 'inherited-or-none' },\n type: 'import-lane',\n },\n { name: 'lane moved, branch untouched -> import-lane', input: { laneHead: 'L2' }, type: 'import-lane' },\n { name: 'dev commits, lane unchanged -> export-branch', input: { hasDevCommits: true }, type: 'export-branch' },\n { name: 'both moved -> merge-diverged', input: { laneHead: 'L2', hasDevCommits: true }, type: 'merge-diverged' },\n {\n name: 'existing branch, never synced, no dev commits, lane EXISTS -> import-lane (adopt branch)',\n input: { lastSyncedHead: undefined, ownership: 'inherited-or-none' },\n type: 'import-lane',\n },\n {\n name: 'existing branch, never synced, has dev commits, lane EXISTS -> halt (ambiguous)',\n input: { lastSyncedHead: undefined, ownership: 'inherited-or-none', hasDevCommits: true },\n type: 'halt',\n },\n];\n\ndescribe('planLaneSync', () => {\n table.forEach(({ name, input, type, action, reason }) => {\n it(name, () => {\n const result = planLaneSync({ ...base, ...input });\n expect(result.type, name).to.equal(type);\n if (action) expect(result).to.deep.equal(action);\n if (reason) expect((result as { reason?: string }).reason).to.contain(reason);\n });\n });\n});\n"],"mappings":";;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,aAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,YAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA8C,SAAAG,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAJ,CAAA,OAAAG,MAAA,CAAAE,qBAAA,QAAAC,CAAA,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,CAAC;EAAES,IAAI,EAAE;AAAiB,CAAC,EAChH;EACEF,IAAI,EAAE,0FAA0F;EAChGC,KAAK,EAAE;IAAET,cAAc,EAAEM,SAAS;IAAEF,SAAS,EAAE;EAAoB,CAAC;EACpEM,IAAI,EAAE;AACR,CAAC,EACD;EACEF,IAAI,EAAE,iFAAiF;EACvFC,KAAK,EAAE;IAAET,cAAc,EAAEM,SAAS;IAAEF,SAAS,EAAE,mBAAmB;IAAEH,aAAa,EAAE;EAAK,CAAC;EACzFS,IAAI,EAAE;AACR,CAAC,CACF;AAEDK,QAAQ,CAAC,cAAc,EAAE,MAAM;EAC7BR,KAAK,CAAC3B,OAAO,CAAC,CAAC;IAAE4B,IAAI;IAAEC,KAAK;IAAEC,IAAI;IAAEE,MAAM;IAAED;EAAO,CAAC,KAAK;IACvDK,EAAE,CAACR,IAAI,EAAE,MAAM;MACb,MAAMS,MAAM,GAAG,IAAAC,2BAAY,EAAAzC,aAAA,CAAAA,aAAA,KAAMoB,IAAI,GAAKY,KAAK,CAAE,CAAC;MAClD,IAAAU,cAAM,EAACF,MAAM,CAACP,IAAI,EAAEF,IAAI,CAAC,CAACY,EAAE,CAACC,KAAK,CAACX,IAAI,CAAC;MACxC,IAAIE,MAAM,EAAE,IAAAO,cAAM,EAACF,MAAM,CAAC,CAACG,EAAE,CAACE,IAAI,CAACD,KAAK,CAACT,MAAM,CAAC;MAChD,IAAID,MAAM,EAAE,IAAAQ,cAAM,EAAEF,MAAM,CAAyBN,MAAM,CAAC,CAACS,EAAE,CAACG,OAAO,CAACZ,MAAM,CAAC;IAC/E,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_chai","data","require","_syncPlanner","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","base","laneHead","branchExists","lastSyncedHead","hasDevCommits","tipIsSyncCommit","conflictLabelPresent","ownership","laneGone","undefined","table","name","input","type","reason","action","deleteBranch","keepReason","hasIndependentHistory","branchNamesDifferentLane","describe","it","result","planLaneSync","expect","to","equal","deep","contain"],"sources":["sync-planner.spec.ts"],"sourcesContent":["import { expect } from 'chai';\nimport type { LaneOwnershipEvidence, LaneSyncAction, LaneSyncInput } from './sync-planner';\nimport { planLaneSync } from './sync-planner';\n\nconst base: LaneSyncInput = {\n laneHead: 'L1',\n branchExists: true,\n lastSyncedHead: 'L1',\n hasDevCommits: false,\n tipIsSyncCommit: true,\n conflictLabelPresent: false,\n ownership: 'own-live',\n};\n\n/** the \"lane deleted remotely, branch still there\" shape — the only path that reads `ownership` */\nconst laneGone = (ownership: LaneOwnershipEvidence) => ({ laneHead: undefined, ownership });\n\n/**\n * The decision table. `action` (exact) is required on every row that decides a branch deletion: under\n * the defaults an ordinary developer branch reaches the planner in the same shape as a deleted lane's\n * branch, so `deleteBranch` and the keep reason are part of the contract, not incidental output.\n */\nconst table: Array<{\n name: string;\n input: Partial<LaneSyncInput>;\n type: LaneSyncAction['type'];\n action?: LaneSyncAction;\n reason?: string;\n}> = [\n { name: 'converged -> noop', input: {}, type: 'noop', reason: 'converged' },\n {\n name: 'conflict label present -> noop until resolved',\n input: { laneHead: 'L2', conflictLabelPresent: true },\n type: 'noop',\n },\n { name: 'lane gone + no branch -> noop', input: { laneHead: undefined, branchExists: false }, type: 'noop' },\n\n {\n name: \"own-live, no dev commits, OUR tip (the branch is exactly the lane's mirror) -> close-pr AND delete\",\n input: laneGone('own-live'),\n type: 'close-pr',\n action: { type: 'close-pr', deleteBranch: true },\n },\n {\n // A developer who commits their own `.bitmap` write looks own-live with nothing above the state\n // commit; the marker is what separates our mirror from their branch.\n name: 'own-live, no dev commits, a tip WE DID NOT WRITE -> close-pr but KEEP the branch',\n input: { ...laneGone('own-live'), tipIsSyncCommit: false },\n type: 'close-pr',\n action: { type: 'close-pr', deleteBranch: false, keepReason: 'tip-not-a-sync-commit' },\n },\n {\n name: 'own-live WITH dev commits (never-exported work above the state commit) -> KEEP the branch',\n input: { ...laneGone('own-live'), hasDevCommits: true },\n type: 'close-pr',\n action: { type: 'close-pr', deleteBranch: false, keepReason: 'unmerged-commits' },\n },\n {\n // \"tip-not-a-sync-commit\" would send the reader after the wrong thing when there is real work.\n name: 'own-live with dev commits AND a foreign tip -> keeps, naming the commits as the reason',\n input: { ...laneGone('own-live'), hasDevCommits: true, tipIsSyncCommit: false },\n type: 'close-pr',\n action: { type: 'close-pr', deleteBranch: false, keepReason: 'unmerged-commits' },\n },\n {\n // Adoption proved content matched, never that the branch's pre-existing history is disposable.\n name: 'own-live, no dev commits, OUR tip, but it is the adoption ledger commit -> KEEP, never delete',\n input: { ...laneGone('own-live'), hasIndependentHistory: true },\n type: 'close-pr',\n action: { type: 'close-pr', deleteBranch: false, keepReason: 'adopted-branch' },\n },\n {\n name: 'own-merged (branch tip already in the default branch) -> close-pr AND delete',\n input: laneGone('own-merged'),\n type: 'close-pr',\n action: { type: 'close-pr', deleteBranch: true },\n },\n {\n // Reachability alone proves deleting loses nothing, so no marker conjunction applies here.\n name: 'own-merged deletes even with a foreign tip and dev commits',\n input: { ...laneGone('own-merged'), tipIsSyncCommit: false, hasDevCommits: true },\n type: 'close-pr',\n action: { type: 'close-pr', deleteBranch: true },\n },\n {\n name: 'own-merged deletes even when the tip is the adoption ledger commit — reachability is enough',\n input: { ...laneGone('own-merged'), hasIndependentHistory: true },\n type: 'close-pr',\n action: { type: 'close-pr', deleteBranch: true },\n },\n {\n name: 'own-superseded (PR merged, then more commits pushed) -> close-pr but KEEP the branch',\n input: laneGone('own-superseded'),\n type: 'close-pr',\n action: { type: 'close-pr', deleteBranch: false, keepReason: 'unmerged-commits' },\n },\n {\n name: 'inherited-or-none -> noop, and never close-pr',\n input: laneGone('inherited-or-none'),\n type: 'noop',\n reason: 'maps to no lane and has no sync history',\n },\n {\n name: 'inherited-or-none with the branch carrying its own dev commits -> still noop',\n input: { ...laneGone('inherited-or-none'), lastSyncedHead: undefined, hasDevCommits: true },\n type: 'noop',\n },\n\n // The adopt paths need no claim: nothing on them can delete a branch.\n {\n name: 'no branch yet -> import-lane',\n input: { branchExists: false, lastSyncedHead: undefined, ownership: 'inherited-or-none' },\n type: 'import-lane',\n },\n { name: 'lane moved, branch untouched -> import-lane', input: { laneHead: 'L2' }, type: 'import-lane' },\n { name: 'dev commits, lane unchanged -> export-branch', input: { hasDevCommits: true }, type: 'export-branch' },\n { name: 'both moved -> merge-diverged', input: { laneHead: 'L2', hasDevCommits: true }, type: 'merge-diverged' },\n {\n name: 'existing branch, never synced, no dev commits, lane EXISTS -> import-lane (adopt branch)',\n input: { lastSyncedHead: undefined, ownership: 'inherited-or-none' },\n type: 'import-lane',\n },\n {\n name: 'existing branch, never synced, has dev commits, lane EXISTS -> adopt-branch (first contact)',\n input: { lastSyncedHead: undefined, ownership: 'inherited-or-none', hasDevCommits: true },\n type: 'adopt-branch',\n },\n {\n name: 'existing branch, never synced, has dev commits, but .bitmap names a DIFFERENT lane -> halt',\n input: {\n lastSyncedHead: undefined,\n ownership: 'inherited-or-none',\n hasDevCommits: true,\n branchNamesDifferentLane: true,\n },\n type: 'halt',\n reason: 'names a different lane',\n },\n {\n // The executor resolves an inherited (merged) different-lane pointer to `false` — history, not a claim.\n name: 'existing branch, has dev commits, .bitmap names a MERGED-AND-INHERITED different lane -> adopt-branch',\n input: {\n lastSyncedHead: undefined,\n ownership: 'inherited-or-none',\n hasDevCommits: true,\n branchNamesDifferentLane: false,\n },\n type: 'adopt-branch',\n },\n];\n\ndescribe('planLaneSync', () => {\n table.forEach(({ name, input, type, action, reason }) => {\n it(name, () => {\n const result = planLaneSync({ ...base, ...input });\n expect(result.type, name).to.equal(type);\n if (action) expect(result).to.deep.equal(action);\n if (reason) expect((result as { reason?: string }).reason).to.contain(reason);\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ouched pair read as diverged after any unrelated release.
37
37
  */
38
38
  export declare function branchStateFingerprint(state: BranchBitmapState, laneComponentIds: string[]): string;
39
+ /**
40
+ * `snapPrCommit`'s return value when there was nothing to snap — its only signal either way. Lives in
41
+ * this leaf module so `ci.main.runtime.ts` and `lane-sync-executor.ts` share it without a cycle.
42
+ */
43
+ export declare const NO_CHANGES_TO_SNAP = "No changes detected, nothing to snap";
39
44
  export declare const LANE_HEAD_TRAILER = "Bit-Lane-Head";
40
45
  /**
41
46
  * Marks a commit as machine-generated. Duplicated in the `bit-git-sync` action repo's event router
@@ -55,11 +60,31 @@ export declare function hasSyncMarker(message: string): boolean;
55
60
  * `\r?` tolerates CRLF; a recognition failure errs toward keeping the branch / re-attempting the export.
56
61
  */
57
62
  export declare function isSyncAuthoredMessage(message: string): boolean;
63
+ /**
64
+ * Whether the OLDEST record of a `git log --reverse --format=%B%x1e` run is NOT bit-authored — i.e. a
65
+ * human created the branch before this reconciler touched it. Oldest only, not "any": ordinary lane
66
+ * branches carry real dev commits between ledger commits too, and "any" would misclassify them all.
67
+ */
68
+ export declare function oldestCommitIsNonSync(rawLog: string): boolean;
69
+ /**
70
+ * Strict probe for "this is one of our LEDGER commits": the sync marker on its own line AND the
71
+ * `Bit-Lane-Head` trailer — `buildSyncCommitMessage` always writes both. The deletion guard reads
72
+ * this instead of `isSyncAuthoredMessage` so a human commit merely quoting `[bit-sync]` still counts
73
+ * as independent history (a false "human" only ever keeps a branch).
74
+ */
75
+ export declare function isLedgerCommitMessage(message: string): boolean;
76
+ /**
77
+ * Marks `adopt-branch`'s ledger commit. Audit-only — the deletion guard reads the branch's ancestry
78
+ * instead, since a trailer marks only the one commit it is on and later ledger commits carry none.
79
+ */
80
+ export declare const ADOPTION_TRAILER = "Bit-Adopted";
58
81
  /**
59
82
  * The sync commit's message. Every part is an annotation (audit trail + loop-guard marker); nothing reads
60
83
  * it as state — messages are forgeable and rewritten on squash-merge. State comes from `.bitmap`.
61
84
  */
62
- export declare function buildSyncCommitMessage(laneIdStr: string, laneHead: string): string;
85
+ export declare function buildSyncCommitMessage(laneIdStr: string, laneHead: string, opts?: {
86
+ adopted?: boolean;
87
+ }): string;
63
88
  export type BranchSyncState = {
64
89
  /**
65
90
  * The newest first-parent commit that changed `.bitmap` — the reachability anchor for branch ownership
@@ -93,3 +118,10 @@ export declare function parseDevCommitCount(raw: string): boolean;
93
118
  * change that arrived through a merge would otherwise be picked as this branch's own state commit.
94
119
  */
95
120
  export declare function readBranchSyncState(branch: string, defaultBranch: string, defaultScope: string): Promise<BranchSyncState>;
121
+ /**
122
+ * Whether `branch`'s committed `.bitmap` is byte-identical (by blob sha) to the one at its merge-base
123
+ * with the default branch — i.e. the branch never asserted a `.bitmap` change of its own, so whatever
124
+ * pointer it carries is INHERITED. Compared at the fork point, not the default branch's current tip,
125
+ * which moves on and would false-block. False on any git error: unreadable must not license adoption.
126
+ */
127
+ export declare function branchBitmapUnchangedSinceFork(branch: string, defaultBranch: string): Promise<boolean>;
@@ -3,12 +3,15 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.SYNC_COMMIT_MARKER = exports.LANE_HEAD_TRAILER = exports.CONFLICT_LABEL = exports.ABSENT_ON_BRANCH = void 0;
6
+ exports.SYNC_COMMIT_MARKER = exports.NO_CHANGES_TO_SNAP = exports.LANE_HEAD_TRAILER = exports.CONFLICT_LABEL = exports.ADOPTION_TRAILER = exports.ABSENT_ON_BRANCH = void 0;
7
+ exports.branchBitmapUnchangedSinceFork = branchBitmapUnchangedSinceFork;
7
8
  exports.branchStateFingerprint = branchStateFingerprint;
8
9
  exports.buildSyncCommitMessage = buildSyncCommitMessage;
9
10
  exports.fingerprintIdVersions = fingerprintIdVersions;
10
11
  exports.hasSyncMarker = hasSyncMarker;
12
+ exports.isLedgerCommitMessage = isLedgerCommitMessage;
11
13
  exports.isSyncAuthoredMessage = isSyncAuthoredMessage;
14
+ exports.oldestCommitIsNonSync = oldestCommitIsNonSync;
12
15
  exports.parseBranchBitmap = parseBranchBitmap;
13
16
  exports.parseDevCommitCount = parseDevCommitCount;
14
17
  exports.readBranchSyncState = readBranchSyncState;
@@ -98,6 +101,12 @@ const ABSENT_ON_BRANCH = exports.ABSENT_ON_BRANCH = '<absent>';
98
101
  function branchStateFingerprint(state, laneComponentIds) {
99
102
  return fingerprintIdVersions(laneComponentIds.map(id => `${id}@${state.versions[id] ?? ABSENT_ON_BRANCH}`));
100
103
  }
104
+
105
+ /**
106
+ * `snapPrCommit`'s return value when there was nothing to snap — its only signal either way. Lives in
107
+ * this leaf module so `ci.main.runtime.ts` and `lane-sync-executor.ts` share it without a cycle.
108
+ */
109
+ const NO_CHANGES_TO_SNAP = exports.NO_CHANGES_TO_SNAP = 'No changes detected, nothing to snap';
101
110
  const LANE_HEAD_TRAILER = exports.LANE_HEAD_TRAILER = 'Bit-Lane-Head';
102
111
  /**
103
112
  * Marks a commit as machine-generated. Duplicated in the `bit-git-sync` action repo's event router
@@ -124,12 +133,42 @@ function isSyncAuthoredMessage(message) {
124
133
  return new RegExp(`^${SYNC_COMMIT_MARKER.replace(/[[\]]/g, '\\$&')}\\r?$`, 'm').test(message);
125
134
  }
126
135
 
136
+ /** The record separator `hasIndependentHistoryBelowStateCommit`'s `git log --format=%B%x1e` uses. */
137
+ const COMMIT_MESSAGE_RECORD_SEPARATOR = '\x1e';
138
+
139
+ /**
140
+ * Whether the OLDEST record of a `git log --reverse --format=%B%x1e` run is NOT bit-authored — i.e. a
141
+ * human created the branch before this reconciler touched it. Oldest only, not "any": ordinary lane
142
+ * branches carry real dev commits between ledger commits too, and "any" would misclassify them all.
143
+ */
144
+ function oldestCommitIsNonSync(rawLog) {
145
+ const messages = rawLog.split(COMMIT_MESSAGE_RECORD_SEPARATOR).map(entry => entry.trim()).filter(Boolean);
146
+ const oldest = messages[0];
147
+ return oldest !== undefined && !isLedgerCommitMessage(oldest);
148
+ }
149
+
150
+ /**
151
+ * Strict probe for "this is one of our LEDGER commits": the sync marker on its own line AND the
152
+ * `Bit-Lane-Head` trailer — `buildSyncCommitMessage` always writes both. The deletion guard reads
153
+ * this instead of `isSyncAuthoredMessage` so a human commit merely quoting `[bit-sync]` still counts
154
+ * as independent history (a false "human" only ever keeps a branch).
155
+ */
156
+ function isLedgerCommitMessage(message) {
157
+ return isSyncAuthoredMessage(message) && new RegExp(`^${LANE_HEAD_TRAILER}: `, 'm').test(message);
158
+ }
159
+
160
+ /**
161
+ * Marks `adopt-branch`'s ledger commit. Audit-only — the deletion guard reads the branch's ancestry
162
+ * instead, since a trailer marks only the one commit it is on and later ledger commits carry none.
163
+ */
164
+ const ADOPTION_TRAILER = exports.ADOPTION_TRAILER = 'Bit-Adopted';
165
+
127
166
  /**
128
167
  * The sync commit's message. Every part is an annotation (audit trail + loop-guard marker); nothing reads
129
168
  * it as state — messages are forgeable and rewritten on squash-merge. State comes from `.bitmap`.
130
169
  */
131
- function buildSyncCommitMessage(laneIdStr, laneHead) {
132
- return [`chore(bit-sync): sync lane ${laneIdStr} @ ${laneHead.slice(0, 9)}`, '', `${LANE_HEAD_TRAILER}: ${laneHead}`, SYNC_COMMIT_MARKER].join('\n');
170
+ function buildSyncCommitMessage(laneIdStr, laneHead, opts = {}) {
171
+ return [`chore(bit-sync): sync lane ${laneIdStr} @ ${laneHead.slice(0, 9)}`, '', `${LANE_HEAD_TRAILER}: ${laneHead}`, ...(opts.adopted ? [`${ADOPTION_TRAILER}: true`] : []), SYNC_COMMIT_MARKER].join('\n');
133
172
  }
134
173
  /**
135
174
  * Whether a `rev-list --count` output reports commits. An unreadable count answers `true`: `false` is an
@@ -163,6 +202,24 @@ async function readBranchSyncState(branch, defaultBranch, defaultScope) {
163
202
  };
164
203
  }
165
204
 
205
+ /**
206
+ * Whether `branch`'s committed `.bitmap` is byte-identical (by blob sha) to the one at its merge-base
207
+ * with the default branch — i.e. the branch never asserted a `.bitmap` change of its own, so whatever
208
+ * pointer it carries is INHERITED. Compared at the fork point, not the default branch's current tip,
209
+ * which moves on and would false-block. False on any git error: unreadable must not license adoption.
210
+ */
211
+ async function branchBitmapUnchangedSinceFork(branch, defaultBranch) {
212
+ try {
213
+ const base = (await _git().git.raw(['merge-base', `origin/${defaultBranch}`, `origin/${branch}`])).trim();
214
+ if (!base) return false;
215
+ const [branchBlob, baseBlob] = await Promise.all([_git().git.raw(['rev-parse', `origin/${branch}:./${_legacy2().BIT_MAP}`]), _git().git.raw(['rev-parse', `${base}:./${_legacy2().BIT_MAP}`])]);
216
+ const branchSha = branchBlob.trim();
217
+ return Boolean(branchSha) && branchSha === baseBlob.trim();
218
+ } catch {
219
+ return false;
220
+ }
221
+ }
222
+
166
223
  /**
167
224
  * A file's content at a git ref, or undefined when it isn't there. simple-git's `raw` can resolve with
168
225
  * empty output instead of rejecting on a missing path; `:./` keeps the path cwd-relative in case the
@@ -1 +1 @@
1
- {"version":3,"names":["_legacy","data","require","_legacy2","_toolboxCrypto","_git","parseBranchBitmap","content","defaultScope","trim","undefined","bitMap","BitMap","loadFromContentWithoutLoadingFiles","Buffer","from","versions","components","forEach","componentMap","version","id","toStringWithoutVersion","laneId","isLaneExported","laneIdStr","scope","toString","fingerprintIdVersions","idAtVersion","sha1","sort","join","ABSENT_ON_BRANCH","exports","branchStateFingerprint","state","laneComponentIds","map","LANE_HEAD_TRAILER","SYNC_COMMIT_MARKER","CONFLICT_LABEL","hasSyncMarker","message","includes","isSyncAuthoredMessage","RegExp","replace","test","buildSyncCommitMessage","laneHead","slice","parseDevCommitCount","raw","count","Number","parseInt","isNaN","readBranchSyncState","branch","defaultBranch","revision","tipSha","git","tipMessage","trimEnd","stateCommit","BIT_MAP","bitmap","readFileAtRef","range","hasDevCommits","filePath"],"sources":["sync-state.ts"],"sourcesContent":["import { BitMap } from '@teambit/legacy.bit-map';\nimport { BIT_MAP } from '@teambit/legacy.constants';\nimport { sha1 } from '@teambit/toolbox.crypto.sha1';\nimport { git } from '../git';\n\n/**\n * Sync state is derived from the `.bitmap` committed on a branch — the lane pointer (`_bit_lane`) and the\n * per-component versions — never from commit messages, which are forgeable and rewritten by squash/rebase.\n */\n\n/** What a branch's committed `.bitmap` says about the branch's bit state. */\nexport type BranchBitmapState = {\n /**\n * The scope-qualified lane id `.bitmap` points at (`<scope>/<name>`), or undefined when there is no\n * usable pointer — none at all (branch on main), or one bit marked not exported.\n */\n laneIdStr?: string;\n /** `<scope>/<name>` -> version (a snap hash, or a semver tag on main), exactly as `.bitmap` records it. */\n versions: Record<string, string>;\n};\n\n/**\n * Parse a `.bitmap` file's content — no workspace, no filesystem. Fail-safe: an unreadable file returns\n * undefined, and a pointer that parses but cannot attribute (unscoped id, `exported: false`) withholds\n * `laneIdStr`; either way no lane id licenses nothing, so a parse failure can never authorize a deletion.\n * An unexported pointer is ignored because its lane never existed on any remote and treating it as a\n * mirror would retire the branch.\n */\nexport function parseBranchBitmap(content: string | undefined, defaultScope: string): BranchBitmapState | undefined {\n if (!content || !content.trim()) return undefined;\n try {\n const bitMap = BitMap.loadFromContentWithoutLoadingFiles(Buffer.from(content, 'utf8'), '', '', defaultScope);\n const versions: Record<string, string> = {};\n bitMap.components.forEach((componentMap) => {\n const version = componentMap.id.version;\n // No version = never snapped/tagged; contributes nothing to the fingerprint.\n if (version) versions[componentMap.id.toStringWithoutVersion()] = version;\n });\n // An unscoped lane id cannot be attribution: every comparison target is scope-qualified.\n const laneId = bitMap.isLaneExported ? bitMap.laneId : undefined;\n const laneIdStr = laneId?.scope ? laneId.toString() : undefined;\n return { laneIdStr, versions };\n } catch {\n return undefined;\n }\n}\n\n/**\n * Fingerprint of `<component-id>@<version>` pairs: sorted (so listing/key order cannot perturb it), then\n * sha1'd (the value doubles as a single-token `Bit-Lane-Head` trailer).\n */\nexport function fingerprintIdVersions(idAtVersion: string[]): string {\n return sha1([...idAtVersion].sort().join('\\n'));\n}\n\n/**\n * Placeholder for a lane component the branch's `.bitmap` lacks. It must participate in the fingerprint,\n * or \"the lane grew a component\" would fingerprint identically to \"converged\".\n */\nexport const ABSENT_ON_BRANCH = '<absent>';\n\n/**\n * What the branch reflects, comparable to the lane's own fingerprint. Only the lane's components count:\n * the `.bitmap` also carries non-lane components at their main versions, and including those would make\n * an untouched pair read as diverged after any unrelated release.\n */\nexport function branchStateFingerprint(state: BranchBitmapState, laneComponentIds: string[]): string {\n return fingerprintIdVersions(laneComponentIds.map((id) => `${id}@${state.versions[id] ?? ABSENT_ON_BRANCH}`));\n}\n\nexport const LANE_HEAD_TRAILER = 'Bit-Lane-Head';\n/**\n * Marks a commit as machine-generated. Duplicated in the `bit-git-sync` action repo's event router\n * (the loop guard) — changing one copy without the other makes the reconciler re-trigger itself.\n */\nexport const SYNC_COMMIT_MARKER = '[bit-sync]';\nexport const CONFLICT_LABEL = 'bit-sync-conflict';\n\n/**\n * Permissive substring probe for \"looks machine-generated\" — the loop guard. Must NOT decide anything\n * irreversible; see `isSyncAuthoredMessage`.\n */\nexport function hasSyncMarker(message: string): boolean {\n return message.includes(SYNC_COMMIT_MARKER);\n}\n\n/**\n * Strict probe for \"we wrote this commit\": the marker alone on its own line. This is an input to branch\n * deletion and to the export-branch withhold (a branch whose tip is already our own commit settles\n * instead of re-exporting), so a developer merely quoting the marker must never count as authorship.\n * `\\r?` tolerates CRLF; a recognition failure errs toward keeping the branch / re-attempting the export.\n */\nexport function isSyncAuthoredMessage(message: string): boolean {\n return new RegExp(`^${SYNC_COMMIT_MARKER.replace(/[[\\]]/g, '\\\\$&')}\\\\r?$`, 'm').test(message);\n}\n\n/**\n * The sync commit's message. Every part is an annotation (audit trail + loop-guard marker); nothing reads\n * it as state — messages are forgeable and rewritten on squash-merge. State comes from `.bitmap`.\n */\nexport function buildSyncCommitMessage(laneIdStr: string, laneHead: string): string {\n return [\n `chore(bit-sync): sync lane ${laneIdStr} @ ${laneHead.slice(0, 9)}`,\n '',\n `${LANE_HEAD_TRAILER}: ${laneHead}`,\n SYNC_COMMIT_MARKER,\n ].join('\\n');\n}\n\nexport type BranchSyncState = {\n /**\n * The newest first-parent commit that changed `.bitmap` — the reachability anchor for branch ownership\n * and the baseline for `hasDevCommits`. Undefined when `.bitmap` was never written on the branch.\n */\n stateCommit?: string;\n /**\n * The branch tip's `.bitmap`, parsed; undefined when absent/unparseable (treated as \"not ours\").\n * Reading at the tip equals reading at `stateCommit` — nothing after it changed the file.\n */\n bitmap?: BranchBitmapState;\n /** Whether the branch carries commits on top of its bit state — work bit has not seen. */\n hasDevCommits: boolean;\n /** The branch tip's full commit message (subject + body), for the sync-marker loop-guard probe. */\n tipMessage: string;\n /**\n * The tip sha every field above was read from. The retirement path re-reads the branch and refuses to\n * delete anything else — the evidence licensed deleting THIS commit, not a later one.\n */\n tipSha?: string;\n};\n\n/**\n * Whether a `rev-list --count` output reports commits. An unreadable count answers `true`: `false` is an\n * input to branch retirement, so not knowing must withhold a deletion rather than license one. Empty\n * output is reachable — simple-git's `raw` resolves with it on some non-zero exits.\n */\nexport function parseDevCommitCount(raw: string): boolean {\n const count = Number.parseInt(raw.trim(), 10);\n return Number.isNaN(count) ? true : count > 0;\n}\n\n/**\n * Read a remote branch's sync state from its committed `.bitmap`. Assumes `git fetch origin` already ran.\n * `--first-parent` is a correctness requirement: `git log` orders across all parents, so a `.bitmap`\n * change that arrived through a merge would otherwise be picked as this branch's own state commit.\n */\nexport async function readBranchSyncState(\n branch: string,\n defaultBranch: string,\n defaultScope: string\n): Promise<BranchSyncState> {\n const revision = `origin/${branch}`;\n const tipSha = (await git.raw(['rev-parse', revision])).trim() || undefined;\n const tipMessage = (await git.raw(['log', revision, '-n', '1', '--format=%B'])).trimEnd();\n const stateCommit =\n (await git.raw(['log', revision, '--first-parent', '-n', '1', '--format=%H', '--', BIT_MAP])).trim() || undefined;\n\n const bitmap = parseBranchBitmap(await readFileAtRef(revision, BIT_MAP), defaultScope);\n\n const range = stateCommit ? `${stateCommit}..${revision}` : `origin/${defaultBranch}..${revision}`;\n const count = await git.raw(['rev-list', range, '--count']);\n\n return { stateCommit, bitmap, hasDevCommits: parseDevCommitCount(count), tipMessage, tipSha };\n}\n\n/**\n * A file's content at a git ref, or undefined when it isn't there. simple-git's `raw` can resolve with\n * empty output instead of rejecting on a missing path; `:./` keeps the path cwd-relative in case the\n * workspace is a subdirectory of the repo.\n */\nasync function readFileAtRef(revision: string, filePath: string): Promise<string | undefined> {\n try {\n return await git.raw(['show', `${revision}:./${filePath}`]);\n } catch {\n return undefined;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,SAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,eAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,cAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,KAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,IAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA;AACA;AACA;AACA;;AAEA;;AAWA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASK,iBAAiBA,CAACC,OAA2B,EAAEC,YAAoB,EAAiC;EAClH,IAAI,CAACD,OAAO,IAAI,CAACA,OAAO,CAACE,IAAI,CAAC,CAAC,EAAE,OAAOC,SAAS;EACjD,IAAI;IACF,MAAMC,MAAM,GAAGC,gBAAM,CAACC,kCAAkC,CAACC,MAAM,CAACC,IAAI,CAACR,OAAO,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAEC,YAAY,CAAC;IAC5G,MAAMQ,QAAgC,GAAG,CAAC,CAAC;IAC3CL,MAAM,CAACM,UAAU,CAACC,OAAO,C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,EAAEQ,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,aAAa,CAAC,CAAC,EAAEI,OAAO,CAAC,CAAC;EACzF,MAAMC,WAAW,GACf,CAAC,MAAMH,UAAG,CAACV,GAAG,CAAC,CAAC,KAAK,EAAEQ,QAAQ,EAAE,gBAAgB,EAAE,IAAI,EAAE,GAAG,EAAE,aAAa,EAAE,IAAI,EAAEM,kBAAO,CAAC,CAAC,EAAE1D,IAAI,CAAC,CAAC,IAAIC,SAAS;EAEnH,MAAM0D,MAAM,GAAG9D,iBAAiB,CAAC,MAAM+D,aAAa,CAACR,QAAQ,EAAEM,kBAAO,CAAC,EAAE3D,YAAY,CAAC;EAEtF,MAAM8D,KAAK,GAAGJ,WAAW,GAAG,GAAGA,WAAW,KAAKL,QAAQ,EAAE,GAAG,UAAUD,aAAa,KAAKC,QAAQ,EAAE;EAClG,MAAMP,KAAK,GAAG,MAAMS,UAAG,CAACV,GAAG,CAAC,CAAC,UAAU,EAAEiB,KAAK,EAAE,SAAS,CAAC,CAAC;EAE3D,OAAO;IAAEJ,WAAW;IAAEE,MAAM;IAAEG,aAAa,EAAEnB,mBAAmB,CAACE,KAAK,CAAC;IAAEU,UAAU;IAAEF;EAAO,CAAC;AAC/F;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAeO,aAAaA,CAACR,QAAgB,EAAEW,QAAgB,EAA+B;EAC5F,IAAI;IACF,OAAO,MAAMT,UAAG,CAACV,GAAG,CAAC,CAAC,MAAM,EAAE,GAAGQ,QAAQ,MAAMW,QAAQ,EAAE,CAAC,CAAC;EAC7D,CAAC,CAAC,MAAM;IACN,OAAO9D,SAAS;EAClB;AACF","ignoreList":[]}
1
+ {"version":3,"names":["_legacy","data","require","_legacy2","_toolboxCrypto","_git","parseBranchBitmap","content","defaultScope","trim","undefined","bitMap","BitMap","loadFromContentWithoutLoadingFiles","Buffer","from","versions","components","forEach","componentMap","version","id","toStringWithoutVersion","laneId","isLaneExported","laneIdStr","scope","toString","fingerprintIdVersions","idAtVersion","sha1","sort","join","ABSENT_ON_BRANCH","exports","branchStateFingerprint","state","laneComponentIds","map","NO_CHANGES_TO_SNAP","LANE_HEAD_TRAILER","SYNC_COMMIT_MARKER","CONFLICT_LABEL","hasSyncMarker","message","includes","isSyncAuthoredMessage","RegExp","replace","test","COMMIT_MESSAGE_RECORD_SEPARATOR","oldestCommitIsNonSync","rawLog","messages","split","entry","filter","Boolean","oldest","isLedgerCommitMessage","ADOPTION_TRAILER","buildSyncCommitMessage","laneHead","opts","slice","adopted","parseDevCommitCount","raw","count","Number","parseInt","isNaN","readBranchSyncState","branch","defaultBranch","revision","tipSha","git","tipMessage","trimEnd","stateCommit","BIT_MAP","bitmap","readFileAtRef","range","hasDevCommits","branchBitmapUnchangedSinceFork","base","branchBlob","baseBlob","Promise","all","branchSha","filePath"],"sources":["sync-state.ts"],"sourcesContent":["import { BitMap } from '@teambit/legacy.bit-map';\nimport { BIT_MAP } from '@teambit/legacy.constants';\nimport { sha1 } from '@teambit/toolbox.crypto.sha1';\nimport { git } from '../git';\n\n/**\n * Sync state is derived from the `.bitmap` committed on a branch — the lane pointer (`_bit_lane`) and the\n * per-component versions — never from commit messages, which are forgeable and rewritten by squash/rebase.\n */\n\n/** What a branch's committed `.bitmap` says about the branch's bit state. */\nexport type BranchBitmapState = {\n /**\n * The scope-qualified lane id `.bitmap` points at (`<scope>/<name>`), or undefined when there is no\n * usable pointer — none at all (branch on main), or one bit marked not exported.\n */\n laneIdStr?: string;\n /** `<scope>/<name>` -> version (a snap hash, or a semver tag on main), exactly as `.bitmap` records it. */\n versions: Record<string, string>;\n};\n\n/**\n * Parse a `.bitmap` file's content — no workspace, no filesystem. Fail-safe: an unreadable file returns\n * undefined, and a pointer that parses but cannot attribute (unscoped id, `exported: false`) withholds\n * `laneIdStr`; either way no lane id licenses nothing, so a parse failure can never authorize a deletion.\n * An unexported pointer is ignored because its lane never existed on any remote and treating it as a\n * mirror would retire the branch.\n */\nexport function parseBranchBitmap(content: string | undefined, defaultScope: string): BranchBitmapState | undefined {\n if (!content || !content.trim()) return undefined;\n try {\n const bitMap = BitMap.loadFromContentWithoutLoadingFiles(Buffer.from(content, 'utf8'), '', '', defaultScope);\n const versions: Record<string, string> = {};\n bitMap.components.forEach((componentMap) => {\n const version = componentMap.id.version;\n // No version = never snapped/tagged; contributes nothing to the fingerprint.\n if (version) versions[componentMap.id.toStringWithoutVersion()] = version;\n });\n // An unscoped lane id cannot be attribution: every comparison target is scope-qualified.\n const laneId = bitMap.isLaneExported ? bitMap.laneId : undefined;\n const laneIdStr = laneId?.scope ? laneId.toString() : undefined;\n return { laneIdStr, versions };\n } catch {\n return undefined;\n }\n}\n\n/**\n * Fingerprint of `<component-id>@<version>` pairs: sorted (so listing/key order cannot perturb it), then\n * sha1'd (the value doubles as a single-token `Bit-Lane-Head` trailer).\n */\nexport function fingerprintIdVersions(idAtVersion: string[]): string {\n return sha1([...idAtVersion].sort().join('\\n'));\n}\n\n/**\n * Placeholder for a lane component the branch's `.bitmap` lacks. It must participate in the fingerprint,\n * or \"the lane grew a component\" would fingerprint identically to \"converged\".\n */\nexport const ABSENT_ON_BRANCH = '<absent>';\n\n/**\n * What the branch reflects, comparable to the lane's own fingerprint. Only the lane's components count:\n * the `.bitmap` also carries non-lane components at their main versions, and including those would make\n * an untouched pair read as diverged after any unrelated release.\n */\nexport function branchStateFingerprint(state: BranchBitmapState, laneComponentIds: string[]): string {\n return fingerprintIdVersions(laneComponentIds.map((id) => `${id}@${state.versions[id] ?? ABSENT_ON_BRANCH}`));\n}\n\n/**\n * `snapPrCommit`'s return value when there was nothing to snap — its only signal either way. Lives in\n * this leaf module so `ci.main.runtime.ts` and `lane-sync-executor.ts` share it without a cycle.\n */\nexport const NO_CHANGES_TO_SNAP = 'No changes detected, nothing to snap';\n\nexport const LANE_HEAD_TRAILER = 'Bit-Lane-Head';\n/**\n * Marks a commit as machine-generated. Duplicated in the `bit-git-sync` action repo's event router\n * (the loop guard) — changing one copy without the other makes the reconciler re-trigger itself.\n */\nexport const SYNC_COMMIT_MARKER = '[bit-sync]';\nexport const CONFLICT_LABEL = 'bit-sync-conflict';\n\n/**\n * Permissive substring probe for \"looks machine-generated\" — the loop guard. Must NOT decide anything\n * irreversible; see `isSyncAuthoredMessage`.\n */\nexport function hasSyncMarker(message: string): boolean {\n return message.includes(SYNC_COMMIT_MARKER);\n}\n\n/**\n * Strict probe for \"we wrote this commit\": the marker alone on its own line. This is an input to branch\n * deletion and to the export-branch withhold (a branch whose tip is already our own commit settles\n * instead of re-exporting), so a developer merely quoting the marker must never count as authorship.\n * `\\r?` tolerates CRLF; a recognition failure errs toward keeping the branch / re-attempting the export.\n */\nexport function isSyncAuthoredMessage(message: string): boolean {\n return new RegExp(`^${SYNC_COMMIT_MARKER.replace(/[[\\]]/g, '\\\\$&')}\\\\r?$`, 'm').test(message);\n}\n\n/** The record separator `hasIndependentHistoryBelowStateCommit`'s `git log --format=%B%x1e` uses. */\nconst COMMIT_MESSAGE_RECORD_SEPARATOR = '\\x1e';\n\n/**\n * Whether the OLDEST record of a `git log --reverse --format=%B%x1e` run is NOT bit-authored — i.e. a\n * human created the branch before this reconciler touched it. Oldest only, not \"any\": ordinary lane\n * branches carry real dev commits between ledger commits too, and \"any\" would misclassify them all.\n */\nexport function oldestCommitIsNonSync(rawLog: string): boolean {\n const messages = rawLog\n .split(COMMIT_MESSAGE_RECORD_SEPARATOR)\n .map((entry) => entry.trim())\n .filter(Boolean);\n const oldest = messages[0];\n return oldest !== undefined && !isLedgerCommitMessage(oldest);\n}\n\n/**\n * Strict probe for \"this is one of our LEDGER commits\": the sync marker on its own line AND the\n * `Bit-Lane-Head` trailer — `buildSyncCommitMessage` always writes both. The deletion guard reads\n * this instead of `isSyncAuthoredMessage` so a human commit merely quoting `[bit-sync]` still counts\n * as independent history (a false \"human\" only ever keeps a branch).\n */\nexport function isLedgerCommitMessage(message: string): boolean {\n return isSyncAuthoredMessage(message) && new RegExp(`^${LANE_HEAD_TRAILER}: `, 'm').test(message);\n}\n\n/**\n * Marks `adopt-branch`'s ledger commit. Audit-only — the deletion guard reads the branch's ancestry\n * instead, since a trailer marks only the one commit it is on and later ledger commits carry none.\n */\nexport const ADOPTION_TRAILER = 'Bit-Adopted';\n\n/**\n * The sync commit's message. Every part is an annotation (audit trail + loop-guard marker); nothing reads\n * it as state — messages are forgeable and rewritten on squash-merge. State comes from `.bitmap`.\n */\nexport function buildSyncCommitMessage(laneIdStr: string, laneHead: string, opts: { adopted?: boolean } = {}): string {\n return [\n `chore(bit-sync): sync lane ${laneIdStr} @ ${laneHead.slice(0, 9)}`,\n '',\n `${LANE_HEAD_TRAILER}: ${laneHead}`,\n ...(opts.adopted ? [`${ADOPTION_TRAILER}: true`] : []),\n SYNC_COMMIT_MARKER,\n ].join('\\n');\n}\n\nexport type BranchSyncState = {\n /**\n * The newest first-parent commit that changed `.bitmap` — the reachability anchor for branch ownership\n * and the baseline for `hasDevCommits`. Undefined when `.bitmap` was never written on the branch.\n */\n stateCommit?: string;\n /**\n * The branch tip's `.bitmap`, parsed; undefined when absent/unparseable (treated as \"not ours\").\n * Reading at the tip equals reading at `stateCommit` — nothing after it changed the file.\n */\n bitmap?: BranchBitmapState;\n /** Whether the branch carries commits on top of its bit state — work bit has not seen. */\n hasDevCommits: boolean;\n /** The branch tip's full commit message (subject + body), for the sync-marker loop-guard probe. */\n tipMessage: string;\n /**\n * The tip sha every field above was read from. The retirement path re-reads the branch and refuses to\n * delete anything else — the evidence licensed deleting THIS commit, not a later one.\n */\n tipSha?: string;\n};\n\n/**\n * Whether a `rev-list --count` output reports commits. An unreadable count answers `true`: `false` is an\n * input to branch retirement, so not knowing must withhold a deletion rather than license one. Empty\n * output is reachable — simple-git's `raw` resolves with it on some non-zero exits.\n */\nexport function parseDevCommitCount(raw: string): boolean {\n const count = Number.parseInt(raw.trim(), 10);\n return Number.isNaN(count) ? true : count > 0;\n}\n\n/**\n * Read a remote branch's sync state from its committed `.bitmap`. Assumes `git fetch origin` already ran.\n * `--first-parent` is a correctness requirement: `git log` orders across all parents, so a `.bitmap`\n * change that arrived through a merge would otherwise be picked as this branch's own state commit.\n */\nexport async function readBranchSyncState(\n branch: string,\n defaultBranch: string,\n defaultScope: string\n): Promise<BranchSyncState> {\n const revision = `origin/${branch}`;\n const tipSha = (await git.raw(['rev-parse', revision])).trim() || undefined;\n const tipMessage = (await git.raw(['log', revision, '-n', '1', '--format=%B'])).trimEnd();\n const stateCommit =\n (await git.raw(['log', revision, '--first-parent', '-n', '1', '--format=%H', '--', BIT_MAP])).trim() || undefined;\n\n const bitmap = parseBranchBitmap(await readFileAtRef(revision, BIT_MAP), defaultScope);\n\n const range = stateCommit ? `${stateCommit}..${revision}` : `origin/${defaultBranch}..${revision}`;\n const count = await git.raw(['rev-list', range, '--count']);\n\n return { stateCommit, bitmap, hasDevCommits: parseDevCommitCount(count), tipMessage, tipSha };\n}\n\n/**\n * Whether `branch`'s committed `.bitmap` is byte-identical (by blob sha) to the one at its merge-base\n * with the default branch — i.e. the branch never asserted a `.bitmap` change of its own, so whatever\n * pointer it carries is INHERITED. Compared at the fork point, not the default branch's current tip,\n * which moves on and would false-block. False on any git error: unreadable must not license adoption.\n */\nexport async function branchBitmapUnchangedSinceFork(branch: string, defaultBranch: string): Promise<boolean> {\n try {\n const base = (await git.raw(['merge-base', `origin/${defaultBranch}`, `origin/${branch}`])).trim();\n if (!base) return false;\n const [branchBlob, baseBlob] = await Promise.all([\n git.raw(['rev-parse', `origin/${branch}:./${BIT_MAP}`]),\n git.raw(['rev-parse', `${base}:./${BIT_MAP}`]),\n ]);\n const branchSha = branchBlob.trim();\n return Boolean(branchSha) && branchSha === baseBlob.trim();\n } catch {\n return false;\n }\n}\n\n/**\n * A file's content at a git ref, or undefined when it isn't there. simple-git's `raw` can resolve with\n * empty output instead of rejecting on a missing path; `:./` keeps the path cwd-relative in case the\n * workspace is a subdirectory of the repo.\n */\nasync function readFileAtRef(revision: string, filePath: string): Promise<string | undefined> {\n try {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E,GAAGQ,QAAQ,MAAMkB,QAAQ,EAAE,CAAC,CAAC;EAC7D,CAAC,CAAC,MAAM;IACN,OAAOnF,SAAS;EAClB;AACF","ignoreList":[]}
@@ -223,6 +223,34 @@ describe('parseDevCommitCount', () => {
223
223
  });
224
224
  });
225
225
  });
226
+ describe('oldestCommitIsNonSync', () => {
227
+ it('is false for an empty range — no commits at all', () => {
228
+ (0, _chai().expect)((0, _syncState().oldestCommitIsNonSync)('')).to.equal(false);
229
+ });
230
+ it('is false when the oldest (first, with --reverse) record is bit-authored', () => {
231
+ // A normal bit-created branch: its own first ledger commit, then a later human dev commit and a
232
+ // second ledger commit from export-branch — non-sync work, but never the OLDEST record.
233
+ const log = [LANE_SYNC, 'feat: a later, normal dev commit\n', MAIN_SYNC].join('\x1e');
234
+ (0, _chai().expect)((0, _syncState().oldestCommitIsNonSync)(log)).to.equal(false);
235
+ });
236
+ it('is true when the oldest (first, with --reverse) record is a genuine, non-sync commit', () => {
237
+ // Adoption's exact shape: the branch's own first commit was a human's, before bit ever touched it.
238
+ const log = ['feat: a human created this branch before adoption\n', LANE_SYNC].join('\x1e');
239
+ (0, _chai().expect)((0, _syncState().oldestCommitIsNonSync)(log)).to.equal(true);
240
+ });
241
+ it('ignores a trailing separator with nothing after it', () => {
242
+ const log = `${LANE_SYNC}\x1e`;
243
+ (0, _chai().expect)((0, _syncState().oldestCommitIsNonSync)(log)).to.equal(false);
244
+ });
245
+
246
+ // A ledger commit needs the marker AND the Bit-Lane-Head trailer; a human message that merely
247
+ // quotes [bit-sync] on its own line must still read as independent history (a keep, never a delete).
248
+ it('is true when the oldest human commit quotes the [bit-sync] marker but has no ledger trailer', () => {
249
+ const spoof = 'feat: mention our tooling\n\n[bit-sync]\n';
250
+ const log = [spoof, LANE_SYNC].join('\x1e');
251
+ (0, _chai().expect)((0, _syncState().oldestCommitIsNonSync)(log)).to.equal(true);
252
+ });
253
+ });
226
254
  describe('fingerprintIdVersions', () => {
227
255
  it('is a single 40-hex token, and stable under reordering', () => {
228
256
  // A single token survives being written into a commit trailer; order-stability keeps neither
@@ -1 +1 @@
1
- {"version":3,"names":["_chai","data","require","_syncState","DEFAULT_SCOPE","SNAP_1","repeat","SNAP_2","LANE_SYNC","buildSyncCommitMessage","MAIN_SYNC","LANE_SNAP","describe","it","expect","split","to","equal","include","LANE_HEAD_TRAILER","SYNC_COMMIT_MARKER","MESSAGES","forEach","name","message","marker","authored","hasSyncMarker","isSyncAuthoredMessage","bitmapContent","lane","components","comp1","comp2","prefix","body","Object","entries","version","scope","mainFile","rootDir","_bit_lane","id","exported","JSON","stringify","bitmapWithRawLaneKey","laneKey","onLane","parseBranchBitmap","laneIdStr","versions","deep","state","POINTERS","undefined","not","UNREADABLE","content","defaultScope","DEV_COMMIT_COUNTS","raw","hasDevCommits","parseDevCommitCount","a","b","fingerprintIdVersions","match","laneIds","laneSide","branchStateFingerprint","laneMoved","grown","ABSENT_ON_BRANCH","withExtra","comp9"],"sources":["sync-state.spec.ts"],"sourcesContent":["import { expect } from 'chai';\nimport {\n ABSENT_ON_BRANCH,\n LANE_HEAD_TRAILER,\n SYNC_COMMIT_MARKER,\n branchStateFingerprint,\n buildSyncCommitMessage,\n fingerprintIdVersions,\n hasSyncMarker,\n isSyncAuthoredMessage,\n parseBranchBitmap,\n parseDevCommitCount,\n} from './sync-state';\n\nconst DEFAULT_SCOPE = 'acme.shop';\nconst SNAP_1 = 'a'.repeat(40);\nconst SNAP_2 = 'b'.repeat(40);\n\nconst LANE_SYNC = buildSyncCommitMessage('acme.shop/my-lane', 'a'.repeat(40));\nconst MAIN_SYNC = 'chore(bit-sync): sync git to latest main scope versions\\n\\n[bit-sync]';\n/** `executeMergeDiverged`'s snap message: a LANE message, whose marker is inline and never a tip. */\nconst LANE_SNAP = 'merge remote lane acme.shop/my-lane into my-lane [bit-sync]';\n\ndescribe('buildSyncCommitMessage', () => {\n it('names the lane scope-qualified in the subject and carries both annotations', () => {\n expect(LANE_SYNC.split('\\n', 1)[0]).to.equal(`chore(bit-sync): sync lane acme.shop/my-lane @ ${'a'.repeat(9)}`);\n expect(LANE_SYNC).to.include(`${LANE_HEAD_TRAILER}: ${'a'.repeat(40)}`);\n expect(LANE_SYNC).to.include(SYNC_COMMIT_MARKER);\n expect(buildSyncCommitMessage('other.scope/my-lane', 'b'.repeat(40))).to.include('sync lane other.scope/my-lane');\n });\n});\n\n/**\n * `hasSyncMarker` is the permissive loop guard; `isSyncAuthoredMessage` is an input to branch DELETION,\n * so a false positive there costs a developer's branch. Every row states both answers, and the rows\n * where they disagree are the laundering holes the strict probe exists to close.\n */\nconst MESSAGES: Array<[string, string, boolean, boolean]> = [\n // message, hasSyncMarker, isSyncAuthoredMessage\n ['what buildSyncCommitMessage produces', LANE_SYNC, true, true],\n ['the raw `git log %B` shape, trailing newline and all', `${LANE_SYNC}\\n`, true, true],\n ['the main-scope sync commit, whose marker is also its own line', MAIN_SYNC, true, true],\n ['CRLF line endings', `subject\\r\\n\\r\\n${SYNC_COMMIT_MARKER}\\r\\n`, true, true],\n ['a message that merely quotes the marker mid-line', 'revert the [bit-sync] bitmap churn', true, false],\n ['the marker quoted mid-line inside a body', 'fix: undo\\n\\nthis reverts a [bit-sync] commit\\n', true, false],\n ['the marker mentioned in a subject', 'chore: mention [bit-sync] here', true, false],\n ['the inline-marker lane snap message', LANE_SNAP, true, false],\n ['an ordinary commit', 'feat: something', false, false],\n ['the lane-head trailer on its own', `${LANE_HEAD_TRAILER}: ${'c'.repeat(40)}`, false, false],\n];\n\ndescribe('sync-commit recognition', () => {\n MESSAGES.forEach(([name, message, marker, authored]) => {\n it(`${authored ? 'accepts' : 'REJECTS'} ${name}`, () => {\n expect(hasSyncMarker(message), 'loop guard').to.equal(marker);\n expect(isSyncAuthoredMessage(message), 'deletion gate').to.equal(authored);\n });\n });\n});\n\n/** A `.bitmap` in the exact shape bit writes it (schema 17) — what `git show` hands the parser. */\nfunction bitmapContent({\n lane,\n components = { comp1: SNAP_1, comp2: SNAP_2 },\n prefix = '/**\\n * DO NOT EDIT THIS FILE\\n */\\n\\n',\n}: {\n lane?: { scope: string; name: string };\n components?: Record<string, string>;\n prefix?: string;\n} = {}): string {\n const body: Record<string, any> = {};\n Object.entries(components).forEach(([name, version]) => {\n body[name] = { name, scope: DEFAULT_SCOPE, version, mainFile: 'index.js', rootDir: name };\n });\n if (lane) body._bit_lane = { id: lane, exported: true };\n body['$schema-version'] = '17.0.0';\n return `${prefix}${JSON.stringify(body, null, 4)}`;\n}\n\n/** a `.bitmap` carrying whatever `_bit_lane` value the caller wants to see rejected */\nfunction bitmapWithRawLaneKey(laneKey: any): string {\n return JSON.stringify({\n comp1: { name: 'comp1', scope: DEFAULT_SCOPE, version: SNAP_1, mainFile: 'index.js', rootDir: 'comp1' },\n _bit_lane: laneKey,\n '$schema-version': '17.0.0',\n });\n}\n\nconst onLane = (name = 'my-lane', scope = DEFAULT_SCOPE) =>\n parseBranchBitmap(bitmapContent({ lane: { scope, name } }), DEFAULT_SCOPE) as NonNullable<\n ReturnType<typeof parseBranchBitmap>\n >;\n\ndescribe('parseBranchBitmap', () => {\n it('reads the lane pointer scope-qualified — the attribution the ownership rule is built on', () => {\n expect(onLane('my-lane', 'other.scope').laneIdStr).to.equal('other.scope/my-lane');\n });\n\n it('reads every component at the exact version the branch records', () => {\n expect(onLane().versions).to.deep.equal({\n [`${DEFAULT_SCOPE}/comp1`]: SNAP_1,\n [`${DEFAULT_SCOPE}/comp2`]: SNAP_2,\n });\n });\n\n it('survives the comment header bit prefixes every `.bitmap` with', () => {\n // `.bitmap` is JSON-with-comments; a throw here silently degrades every branch to \"not ours\".\n const state = parseBranchBitmap(\n bitmapContent({ lane: { scope: DEFAULT_SCOPE, name: 'my-lane' }, prefix: '/* generated, do not edit */\\n' }),\n DEFAULT_SCOPE\n );\n expect(state?.laneIdStr).to.equal(`${DEFAULT_SCOPE}/my-lane`);\n });\n\n /**\n * Only a pointer bit marked exported, carrying a scoped id, is attribution. Honouring anything else\n * would read \"lane removed\" for a lane that never existed remotely and retire a developer branch —\n * and a bare name could still trigger the branch-aliasing halt over a lane that does not exist.\n */\n const POINTERS: Array<[string, any, string | undefined]> = [\n ['bit marked it not exported', { id: { scope: DEFAULT_SCOPE, name: 'foo' }, exported: false }, undefined],\n ['`exported` is missing entirely', { id: { scope: DEFAULT_SCOPE, name: 'foo' } }, undefined],\n ['it is an empty object', {}, undefined],\n ['`id` is a string rather than a {scope, name}', { id: `${DEFAULT_SCOPE}/foo`, exported: true }, undefined],\n ['the lane id has no scope', { id: { scope: '', name: 'foo' }, exported: true }, undefined],\n // non-vacuity for the rows above: a well-formed pointer through the same helper DOES attribute\n [\n 'bit has marked the lane exported',\n { id: { scope: DEFAULT_SCOPE, name: 'foo' }, exported: true },\n `${DEFAULT_SCOPE}/foo`,\n ],\n ];\n\n POINTERS.forEach(([name, laneKey, laneIdStr]) => {\n it(`withholds attribution unless the pointer is usable: ${name}`, () => {\n const state = parseBranchBitmap(bitmapWithRawLaneKey(laneKey), DEFAULT_SCOPE);\n expect(state?.laneIdStr).to.equal(laneIdStr);\n });\n });\n\n it('reports no lane pointer at all for a `.bitmap` on main — every ordinary developer branch', () => {\n const state = parseBranchBitmap(bitmapContent(), DEFAULT_SCOPE);\n expect(state).to.not.equal(undefined);\n expect(state?.laneIdStr).to.equal(undefined);\n });\n\n /** Every way of not knowing must resolve to the answer that licenses nothing (no branch retired). */\n const UNREADABLE: Array<[string, string | undefined]> = [\n ['a `.bitmap` that is not valid JSON', '{ this is not json'],\n ['a file git could not produce at all', undefined],\n ['an empty file', ''],\n ['a whitespace-only file', ' \\n '],\n [\n 'an entry bit itself refuses — a scoped component with no version',\n JSON.stringify({\n comp1: { name: 'comp1', scope: DEFAULT_SCOPE, mainFile: 'index.js', rootDir: 'comp1' },\n '$schema-version': '17.0.0',\n }),\n ],\n [\n 'two components claiming the same rootDir',\n JSON.stringify({\n comp1: { name: 'comp1', scope: DEFAULT_SCOPE, version: SNAP_1, mainFile: 'index.js', rootDir: 'shared' },\n comp2: { name: 'comp2', scope: DEFAULT_SCOPE, version: SNAP_2, mainFile: 'index.js', rootDir: 'shared' },\n '$schema-version': '17.0.0',\n }),\n ],\n ];\n\n UNREADABLE.forEach(([name, content]) => {\n it(`degrades to undefined rather than guessing, for ${name}`, () => {\n expect(parseBranchBitmap(content, DEFAULT_SCOPE)).to.equal(undefined);\n });\n });\n\n it('falls back to the repository default scope for a component `.bitmap` does not scope', () => {\n // `latest` can never equal a snap hash, so such a pair reads as not-converged — the safe direction.\n const content = JSON.stringify({\n comp1: { name: 'comp1', scope: '', defaultScope: DEFAULT_SCOPE, mainFile: 'index.js', rootDir: 'comp1' },\n '$schema-version': '17.0.0',\n });\n expect(parseBranchBitmap(content, DEFAULT_SCOPE)?.versions).to.deep.equal({\n [`${DEFAULT_SCOPE}/comp1`]: 'latest',\n });\n });\n});\n\n/**\n * Only a count git actually printed may report \"no dev commits\" — that answer is an input to branch\n * retirement, so every unreadable shape must read as \"there is unmerged work\" and keep the branch.\n */\nconst DEV_COMMIT_COUNTS: Array<[string, string, boolean]> = [\n ['a count of commits on top of the state commit', '3', true],\n ['the raw output shape, trailing newline and all', '3\\n', true],\n ['a genuine zero — the only license to retire', '0', false],\n [\"a genuine zero with git's trailing newline\", '0\\n', false],\n ['empty output, which simple-git resolves with on some non-zero exits', '', true],\n ['whitespace-only output', ' \\n ', true],\n ['git writing an error where the count was expected', 'fatal: bad revision', true],\n];\n\ndescribe('parseDevCommitCount', () => {\n DEV_COMMIT_COUNTS.forEach(([name, raw, hasDevCommits]) => {\n it(`${hasDevCommits ? 'keeps the branch' : 'permits retirement'} for ${name}`, () => {\n expect(parseDevCommitCount(raw), JSON.stringify(raw)).to.equal(hasDevCommits);\n });\n });\n});\n\ndescribe('fingerprintIdVersions', () => {\n it('is a single 40-hex token, and stable under reordering', () => {\n // A single token survives being written into a commit trailer; order-stability keeps neither\n // listing order looking like a state change.\n const a = `${DEFAULT_SCOPE}/comp1@${SNAP_1}`;\n const b = `${DEFAULT_SCOPE}/comp2@${SNAP_2}`;\n expect(fingerprintIdVersions([a])).to.match(/^[0-9a-f]{40}$/);\n expect(fingerprintIdVersions([a, b])).to.equal(fingerprintIdVersions([b, a]));\n });\n});\n\ndescribe('branchStateFingerprint', () => {\n const laneIds = [`${DEFAULT_SCOPE}/comp1`, `${DEFAULT_SCOPE}/comp2`];\n\n it('equals the lane fingerprint when the branch records every lane component at the lane head', () => {\n // Computed the way `laneHeadFingerprint` computes it — the two sides must be comparable.\n const laneSide = fingerprintIdVersions([`${DEFAULT_SCOPE}/comp1@${SNAP_1}`, `${DEFAULT_SCOPE}/comp2@${SNAP_2}`]);\n expect(branchStateFingerprint(onLane(), laneIds)).to.equal(laneSide);\n });\n\n it('differs when the lane moved a component the branch has not caught up with', () => {\n const laneMoved = fingerprintIdVersions([\n `${DEFAULT_SCOPE}/comp1@${SNAP_1}`,\n `${DEFAULT_SCOPE}/comp2@${'c'.repeat(40)}`,\n ]);\n expect(branchStateFingerprint(onLane(), laneIds)).to.not.equal(laneMoved);\n });\n\n it('counts a lane component the branch does not have at all', () => {\n // Without the placeholder, \"the lane grew a component\" would fingerprint identically to \"converged\".\n const grown = [...laneIds, `${DEFAULT_SCOPE}/comp3`];\n expect(branchStateFingerprint(onLane(), grown)).to.not.equal(branchStateFingerprint(onLane(), laneIds));\n expect(branchStateFingerprint(onLane(), grown)).to.equal(\n fingerprintIdVersions([\n `${DEFAULT_SCOPE}/comp1@${SNAP_1}`,\n `${DEFAULT_SCOPE}/comp2@${SNAP_2}`,\n `${DEFAULT_SCOPE}/comp3@${ABSENT_ON_BRANCH}`,\n ])\n );\n });\n\n it('ignores components the branch has that are not on the lane', () => {\n // The `.bitmap` also carries non-lane components at their main versions; counting those would make\n // an untouched pair read as diverged after any unrelated release.\n const withExtra = parseBranchBitmap(\n bitmapContent({\n lane: { scope: DEFAULT_SCOPE, name: 'my-lane' },\n components: { comp1: SNAP_1, comp2: SNAP_2, comp9: '0.0.7' },\n }),\n DEFAULT_SCOPE\n ) as NonNullable<ReturnType<typeof parseBranchBitmap>>;\n expect(branchStateFingerprint(withExtra, laneIds)).to.equal(branchStateFingerprint(onLane(), laneIds));\n });\n});\n"],"mappings":";;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,WAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,UAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAaA,MAAMG,aAAa,GAAG,WAAW;AACjC,MAAMC,MAAM,GAAG,GAAG,CAACC,MAAM,CAAC,EAAE,CAAC;AAC7B,MAAMC,MAAM,GAAG,GAAG,CAACD,MAAM,CAAC,EAAE,CAAC;AAE7B,MAAME,SAAS,GAAG,IAAAC,mCAAsB,EAAC,mBAAmB,EAAE,GAAG,CAACH,MAAM,CAAC,EAAE,CAAC,CAAC;AAC7E,MAAMI,SAAS,GAAG,uEAAuE;AACzF;AACA,MAAMC,SAAS,GAAG,6DAA6D;AAE/EC,QAAQ,CAAC,wBAAwB,EAAE,MAAM;EACvCC,EAAE,CAAC,4EAA4E,EAAE,MAAM;IACrF,IAAAC,cAAM,EAACN,SAAS,CAACO,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAACC,EAAE,CAACC,KAAK,CAAC,kDAAkD,GAAG,CAACX,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;IAC/G,IAAAQ,cAAM,EAACN,SAAS,CAAC,CAACQ,EAAE,CAACE,OAAO,CAAC,GAAGC,8BAAiB,KAAK,GAAG,CAACb,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC;IACvE,IAAAQ,cAAM,EAACN,SAAS,CAAC,CAACQ,EAAE,CAACE,OAAO,CAACE,+BAAkB,CAAC;IAChD,IAAAN,cAAM,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AE,MAAM;IACrE;IACA;IACA,MAAM8D,SAAS,GAAG,IAAAzB,8BAAiB,EACjCrB,aAAa,CAAC;MACZC,IAAI,EAAE;QAAES,KAAK,EAAEnC,aAAa;QAAEmB,IAAI,EAAE;MAAU,CAAC;MAC/CQ,UAAU,EAAE;QAAEC,KAAK,EAAE3B,MAAM;QAAE4B,KAAK,EAAE1B,MAAM;QAAEqE,KAAK,EAAE;MAAQ;IAC7D,CAAC,CAAC,EACFxE,aACF,CAAsD;IACtD,IAAAU,cAAM,EAAC,IAAAyD,mCAAsB,EAACI,SAAS,EAAEN,OAAO,CAAC,CAAC,CAACrD,EAAE,CAACC,KAAK,CAAC,IAAAsD,mCAAsB,EAACtB,MAAM,CAAC,CAAC,EAAEoB,OAAO,CAAC,CAAC;EACxG,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_chai","data","require","_syncState","DEFAULT_SCOPE","SNAP_1","repeat","SNAP_2","LANE_SYNC","buildSyncCommitMessage","MAIN_SYNC","LANE_SNAP","describe","it","expect","split","to","equal","include","LANE_HEAD_TRAILER","SYNC_COMMIT_MARKER","MESSAGES","forEach","name","message","marker","authored","hasSyncMarker","isSyncAuthoredMessage","bitmapContent","lane","components","comp1","comp2","prefix","body","Object","entries","version","scope","mainFile","rootDir","_bit_lane","id","exported","JSON","stringify","bitmapWithRawLaneKey","laneKey","onLane","parseBranchBitmap","laneIdStr","versions","deep","state","POINTERS","undefined","not","UNREADABLE","content","defaultScope","DEV_COMMIT_COUNTS","raw","hasDevCommits","parseDevCommitCount","oldestCommitIsNonSync","log","join","spoof","a","b","fingerprintIdVersions","match","laneIds","laneSide","branchStateFingerprint","laneMoved","grown","ABSENT_ON_BRANCH","withExtra","comp9"],"sources":["sync-state.spec.ts"],"sourcesContent":["import { expect } from 'chai';\nimport {\n ABSENT_ON_BRANCH,\n LANE_HEAD_TRAILER,\n SYNC_COMMIT_MARKER,\n branchStateFingerprint,\n buildSyncCommitMessage,\n fingerprintIdVersions,\n oldestCommitIsNonSync,\n hasSyncMarker,\n isSyncAuthoredMessage,\n parseBranchBitmap,\n parseDevCommitCount,\n} from './sync-state';\n\nconst DEFAULT_SCOPE = 'acme.shop';\nconst SNAP_1 = 'a'.repeat(40);\nconst SNAP_2 = 'b'.repeat(40);\n\nconst LANE_SYNC = buildSyncCommitMessage('acme.shop/my-lane', 'a'.repeat(40));\nconst MAIN_SYNC = 'chore(bit-sync): sync git to latest main scope versions\\n\\n[bit-sync]';\n/** `executeMergeDiverged`'s snap message: a LANE message, whose marker is inline and never a tip. */\nconst LANE_SNAP = 'merge remote lane acme.shop/my-lane into my-lane [bit-sync]';\n\ndescribe('buildSyncCommitMessage', () => {\n it('names the lane scope-qualified in the subject and carries both annotations', () => {\n expect(LANE_SYNC.split('\\n', 1)[0]).to.equal(`chore(bit-sync): sync lane acme.shop/my-lane @ ${'a'.repeat(9)}`);\n expect(LANE_SYNC).to.include(`${LANE_HEAD_TRAILER}: ${'a'.repeat(40)}`);\n expect(LANE_SYNC).to.include(SYNC_COMMIT_MARKER);\n expect(buildSyncCommitMessage('other.scope/my-lane', 'b'.repeat(40))).to.include('sync lane other.scope/my-lane');\n });\n});\n\n/**\n * `hasSyncMarker` is the permissive loop guard; `isSyncAuthoredMessage` is an input to branch DELETION,\n * so a false positive there costs a developer's branch. Every row states both answers, and the rows\n * where they disagree are the laundering holes the strict probe exists to close.\n */\nconst MESSAGES: Array<[string, string, boolean, boolean]> = [\n // message, hasSyncMarker, isSyncAuthoredMessage\n ['what buildSyncCommitMessage produces', LANE_SYNC, true, true],\n ['the raw `git log %B` shape, trailing newline and all', `${LANE_SYNC}\\n`, true, true],\n ['the main-scope sync commit, whose marker is also its own line', MAIN_SYNC, true, true],\n ['CRLF line endings', `subject\\r\\n\\r\\n${SYNC_COMMIT_MARKER}\\r\\n`, true, true],\n ['a message that merely quotes the marker mid-line', 'revert the [bit-sync] bitmap churn', true, false],\n ['the marker quoted mid-line inside a body', 'fix: undo\\n\\nthis reverts a [bit-sync] commit\\n', true, false],\n ['the marker mentioned in a subject', 'chore: mention [bit-sync] here', true, false],\n ['the inline-marker lane snap message', LANE_SNAP, true, false],\n ['an ordinary commit', 'feat: something', false, false],\n ['the lane-head trailer on its own', `${LANE_HEAD_TRAILER}: ${'c'.repeat(40)}`, false, false],\n];\n\ndescribe('sync-commit recognition', () => {\n MESSAGES.forEach(([name, message, marker, authored]) => {\n it(`${authored ? 'accepts' : 'REJECTS'} ${name}`, () => {\n expect(hasSyncMarker(message), 'loop guard').to.equal(marker);\n expect(isSyncAuthoredMessage(message), 'deletion gate').to.equal(authored);\n });\n });\n});\n\n/** A `.bitmap` in the exact shape bit writes it (schema 17) — what `git show` hands the parser. */\nfunction bitmapContent({\n lane,\n components = { comp1: SNAP_1, comp2: SNAP_2 },\n prefix = '/**\\n * DO NOT EDIT THIS FILE\\n */\\n\\n',\n}: {\n lane?: { scope: string; name: string };\n components?: Record<string, string>;\n prefix?: string;\n} = {}): string {\n const body: Record<string, any> = {};\n Object.entries(components).forEach(([name, version]) => {\n body[name] = { name, scope: DEFAULT_SCOPE, version, mainFile: 'index.js', rootDir: name };\n });\n if (lane) body._bit_lane = { id: lane, exported: true };\n body['$schema-version'] = '17.0.0';\n return `${prefix}${JSON.stringify(body, null, 4)}`;\n}\n\n/** a `.bitmap` carrying whatever `_bit_lane` value the caller wants to see rejected */\nfunction bitmapWithRawLaneKey(laneKey: any): string {\n return JSON.stringify({\n comp1: { name: 'comp1', scope: DEFAULT_SCOPE, version: SNAP_1, mainFile: 'index.js', rootDir: 'comp1' },\n _bit_lane: laneKey,\n '$schema-version': '17.0.0',\n });\n}\n\nconst onLane = (name = 'my-lane', scope = DEFAULT_SCOPE) =>\n parseBranchBitmap(bitmapContent({ lane: { scope, name } }), DEFAULT_SCOPE) as NonNullable<\n ReturnType<typeof parseBranchBitmap>\n >;\n\ndescribe('parseBranchBitmap', () => {\n it('reads the lane pointer scope-qualified — the attribution the ownership rule is built on', () => {\n expect(onLane('my-lane', 'other.scope').laneIdStr).to.equal('other.scope/my-lane');\n });\n\n it('reads every component at the exact version the branch records', () => {\n expect(onLane().versions).to.deep.equal({\n [`${DEFAULT_SCOPE}/comp1`]: SNAP_1,\n [`${DEFAULT_SCOPE}/comp2`]: SNAP_2,\n });\n });\n\n it('survives the comment header bit prefixes every `.bitmap` with', () => {\n // `.bitmap` is JSON-with-comments; a throw here silently degrades every branch to \"not ours\".\n const state = parseBranchBitmap(\n bitmapContent({ lane: { scope: DEFAULT_SCOPE, name: 'my-lane' }, prefix: '/* generated, do not edit */\\n' }),\n DEFAULT_SCOPE\n );\n expect(state?.laneIdStr).to.equal(`${DEFAULT_SCOPE}/my-lane`);\n });\n\n /**\n * Only a pointer bit marked exported, carrying a scoped id, is attribution. Honouring anything else\n * would read \"lane removed\" for a lane that never existed remotely and retire a developer branch —\n * and a bare name could still trigger the branch-aliasing halt over a lane that does not exist.\n */\n const POINTERS: Array<[string, any, string | undefined]> = [\n ['bit marked it not exported', { id: { scope: DEFAULT_SCOPE, name: 'foo' }, exported: false }, undefined],\n ['`exported` is missing entirely', { id: { scope: DEFAULT_SCOPE, name: 'foo' } }, undefined],\n ['it is an empty object', {}, undefined],\n ['`id` is a string rather than a {scope, name}', { id: `${DEFAULT_SCOPE}/foo`, exported: true }, undefined],\n ['the lane id has no scope', { id: { scope: '', name: 'foo' }, exported: true }, undefined],\n // non-vacuity for the rows above: a well-formed pointer through the same helper DOES attribute\n [\n 'bit has marked the lane exported',\n { id: { scope: DEFAULT_SCOPE, name: 'foo' }, exported: true },\n `${DEFAULT_SCOPE}/foo`,\n ],\n ];\n\n POINTERS.forEach(([name, laneKey, laneIdStr]) => {\n it(`withholds attribution unless the pointer is usable: ${name}`, () => {\n const state = parseBranchBitmap(bitmapWithRawLaneKey(laneKey), DEFAULT_SCOPE);\n expect(state?.laneIdStr).to.equal(laneIdStr);\n });\n });\n\n it('reports no lane pointer at all for a `.bitmap` on main — every ordinary developer branch', () => {\n const state = parseBranchBitmap(bitmapContent(), DEFAULT_SCOPE);\n expect(state).to.not.equal(undefined);\n expect(state?.laneIdStr).to.equal(undefined);\n });\n\n /** Every way of not knowing must resolve to the answer that licenses nothing (no branch retired). */\n const UNREADABLE: Array<[string, string | undefined]> = [\n ['a `.bitmap` that is not valid JSON', '{ this is not json'],\n ['a file git could not produce at all', undefined],\n ['an empty file', ''],\n ['a whitespace-only file', ' \\n '],\n [\n 'an entry bit itself refuses — a scoped component with no version',\n JSON.stringify({\n comp1: { name: 'comp1', scope: DEFAULT_SCOPE, mainFile: 'index.js', rootDir: 'comp1' },\n '$schema-version': '17.0.0',\n }),\n ],\n [\n 'two components claiming the same rootDir',\n JSON.stringify({\n comp1: { name: 'comp1', scope: DEFAULT_SCOPE, version: SNAP_1, mainFile: 'index.js', rootDir: 'shared' },\n comp2: { name: 'comp2', scope: DEFAULT_SCOPE, version: SNAP_2, mainFile: 'index.js', rootDir: 'shared' },\n '$schema-version': '17.0.0',\n }),\n ],\n ];\n\n UNREADABLE.forEach(([name, content]) => {\n it(`degrades to undefined rather than guessing, for ${name}`, () => {\n expect(parseBranchBitmap(content, DEFAULT_SCOPE)).to.equal(undefined);\n });\n });\n\n it('falls back to the repository default scope for a component `.bitmap` does not scope', () => {\n // `latest` can never equal a snap hash, so such a pair reads as not-converged — the safe direction.\n const content = JSON.stringify({\n comp1: { name: 'comp1', scope: '', defaultScope: DEFAULT_SCOPE, mainFile: 'index.js', rootDir: 'comp1' },\n '$schema-version': '17.0.0',\n });\n expect(parseBranchBitmap(content, DEFAULT_SCOPE)?.versions).to.deep.equal({\n [`${DEFAULT_SCOPE}/comp1`]: 'latest',\n });\n });\n});\n\n/**\n * Only a count git actually printed may report \"no dev commits\" — that answer is an input to branch\n * retirement, so every unreadable shape must read as \"there is unmerged work\" and keep the branch.\n */\nconst DEV_COMMIT_COUNTS: Array<[string, string, boolean]> = [\n ['a count of commits on top of the state commit', '3', true],\n ['the raw output shape, trailing newline and all', '3\\n', true],\n ['a genuine zero — the only license to retire', '0', false],\n [\"a genuine zero with git's trailing newline\", '0\\n', false],\n ['empty output, which simple-git resolves with on some non-zero exits', '', true],\n ['whitespace-only output', ' \\n ', true],\n ['git writing an error where the count was expected', 'fatal: bad revision', true],\n];\n\ndescribe('parseDevCommitCount', () => {\n DEV_COMMIT_COUNTS.forEach(([name, raw, hasDevCommits]) => {\n it(`${hasDevCommits ? 'keeps the branch' : 'permits retirement'} for ${name}`, () => {\n expect(parseDevCommitCount(raw), JSON.stringify(raw)).to.equal(hasDevCommits);\n });\n });\n});\n\ndescribe('oldestCommitIsNonSync', () => {\n it('is false for an empty range — no commits at all', () => {\n expect(oldestCommitIsNonSync('')).to.equal(false);\n });\n\n it('is false when the oldest (first, with --reverse) record is bit-authored', () => {\n // A normal bit-created branch: its own first ledger commit, then a later human dev commit and a\n // second ledger commit from export-branch — non-sync work, but never the OLDEST record.\n const log = [LANE_SYNC, 'feat: a later, normal dev commit\\n', MAIN_SYNC].join('\\x1e');\n expect(oldestCommitIsNonSync(log)).to.equal(false);\n });\n\n it('is true when the oldest (first, with --reverse) record is a genuine, non-sync commit', () => {\n // Adoption's exact shape: the branch's own first commit was a human's, before bit ever touched it.\n const log = ['feat: a human created this branch before adoption\\n', LANE_SYNC].join('\\x1e');\n expect(oldestCommitIsNonSync(log)).to.equal(true);\n });\n\n it('ignores a trailing separator with nothing after it', () => {\n const log = `${LANE_SYNC}\\x1e`;\n expect(oldestCommitIsNonSync(log)).to.equal(false);\n });\n\n // A ledger commit needs the marker AND the Bit-Lane-Head trailer; a human message that merely\n // quotes [bit-sync] on its own line must still read as independent history (a keep, never a delete).\n it('is true when the oldest human commit quotes the [bit-sync] marker but has no ledger trailer', () => {\n const spoof = 'feat: mention our tooling\\n\\n[bit-sync]\\n';\n const log = [spoof, LANE_SYNC].join('\\x1e');\n expect(oldestCommitIsNonSync(log)).to.equal(true);\n });\n});\n\ndescribe('fingerprintIdVersions', () => {\n it('is a single 40-hex token, and stable under reordering', () => {\n // A single token survives being written into a commit trailer; order-stability keeps neither\n // listing order looking like a state change.\n const a = `${DEFAULT_SCOPE}/comp1@${SNAP_1}`;\n const b = `${DEFAULT_SCOPE}/comp2@${SNAP_2}`;\n expect(fingerprintIdVersions([a])).to.match(/^[0-9a-f]{40}$/);\n expect(fingerprintIdVersions([a, b])).to.equal(fingerprintIdVersions([b, a]));\n });\n});\n\ndescribe('branchStateFingerprint', () => {\n const laneIds = [`${DEFAULT_SCOPE}/comp1`, `${DEFAULT_SCOPE}/comp2`];\n\n it('equals the lane fingerprint when the branch records every lane component at the lane head', () => {\n // Computed the way `laneHeadFingerprint` computes it — the two sides must be comparable.\n const laneSide = fingerprintIdVersions([`${DEFAULT_SCOPE}/comp1@${SNAP_1}`, `${DEFAULT_SCOPE}/comp2@${SNAP_2}`]);\n expect(branchStateFingerprint(onLane(), laneIds)).to.equal(laneSide);\n });\n\n it('differs when the lane moved a component the branch has not caught up with', () => {\n const laneMoved = fingerprintIdVersions([\n `${DEFAULT_SCOPE}/comp1@${SNAP_1}`,\n `${DEFAULT_SCOPE}/comp2@${'c'.repeat(40)}`,\n ]);\n expect(branchStateFingerprint(onLane(), laneIds)).to.not.equal(laneMoved);\n });\n\n it('counts a lane component the branch does not have at all', () => {\n // Without the placeholder, \"the lane grew a component\" would fingerprint identically to \"converged\".\n const grown = [...laneIds, `${DEFAULT_SCOPE}/comp3`];\n expect(branchStateFingerprint(onLane(), grown)).to.not.equal(branchStateFingerprint(onLane(), laneIds));\n expect(branchStateFingerprint(onLane(), grown)).to.equal(\n fingerprintIdVersions([\n `${DEFAULT_SCOPE}/comp1@${SNAP_1}`,\n `${DEFAULT_SCOPE}/comp2@${SNAP_2}`,\n `${DEFAULT_SCOPE}/comp3@${ABSENT_ON_BRANCH}`,\n ])\n );\n });\n\n it('ignores components the branch has that are not on the lane', () => {\n // The `.bitmap` also carries non-lane components at their main versions; counting those would make\n // an untouched pair read as diverged after any unrelated release.\n const withExtra = parseBranchBitmap(\n bitmapContent({\n lane: { scope: DEFAULT_SCOPE, name: 'my-lane' },\n components: { comp1: SNAP_1, comp2: SNAP_2, comp9: '0.0.7' },\n }),\n DEFAULT_SCOPE\n ) as NonNullable<ReturnType<typeof parseBranchBitmap>>;\n expect(branchStateFingerprint(withExtra, laneIds)).to.equal(branchStateFingerprint(onLane(), laneIds));\n });\n});\n"],"mappings":";;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,WAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,UAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAcA,MAAMG,aAAa,GAAG,WAAW;AACjC,MAAMC,MAAM,GAAG,GAAG,CAACC,MAAM,CAAC,EAAE,CAAC;AAC7B,MAAMC,MAAM,GAAG,GAAG,CAACD,MAAM,CAAC,EAAE,CAAC;AAE7B,MAAME,SAAS,GAAG,IAAAC,mCAAsB,EAAC,mBAAmB,EAAE,GAAG,CAACH,MAAM,CAAC,EAAE,CAAC,CAAC;AAC7E,MAAMI,SAAS,GAAG,uEAAuE;AACzF;AACA,MAAMC,SAAS,GAAG,6DAA6D;AAE/EC,QAAQ,CAAC,wBAAwB,EAAE,MAAM;EACvCC,EAAE,CAAC,4EAA4E,EAAE,MAAM;IACrF,IAAAC,cAAM,EAACN,SAAS,CAACO,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAACC,EAAE,CAACC,KAAK,CAAC,kDAAkD,GAAG,CAACX,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;IAC/G,IAAAQ,cAAM,EAACN,SAAS,CAAC,CAACQ,EAAE,CAACE,OAAO,CAAC,GAAGC,8BAAiB,KAAK,GAAG,CAACb,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC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CACpB,GAAGnE,aAAa,UAAUC,MAAM,EAAE,EAClC,GAAGD,aAAa,UAAUG,MAAM,EAAE,EAClC,GAAGH,aAAa,UAAU0E,6BAAgB,EAAE,CAC7C,CACH,CAAC;EACH,CAAC,CAAC;EAEFjE,EAAE,CAAC,4DAA4D,EAAE,MAAM;IACrE;IACA;IACA,MAAMkE,SAAS,GAAG,IAAA7B,8BAAiB,EACjCrB,aAAa,CAAC;MACZC,IAAI,EAAE;QAAES,KAAK,EAAEnC,aAAa;QAAEmB,IAAI,EAAE;MAAU,CAAC;MAC/CQ,UAAU,EAAE;QAAEC,KAAK,EAAE3B,MAAM;QAAE4B,KAAK,EAAE1B,MAAM;QAAEyE,KAAK,EAAE;MAAQ;IAC7D,CAAC,CAAC,EACF5E,aACF,CAAsD;IACtD,IAAAU,cAAM,EAAC,IAAA6D,mCAAsB,EAACI,SAAS,EAAEN,OAAO,CAAC,CAAC,CAACzD,EAAE,CAACC,KAAK,CAAC,IAAA0D,mCAAsB,EAAC1B,MAAM,CAAC,CAAC,EAAEwB,OAAO,CAAC,CAAC;EACxG,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/ci",
3
- "version": "1.0.495",
3
+ "version": "1.0.500",
4
4
  "homepage": "https://bit.cloud/teambit/git/ci",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.git",
8
8
  "name": "ci",
9
- "version": "1.0.495"
9
+ "version": "1.0.500"
10
10
  },
11
11
  "dependencies": {
12
12
  "chalk": "4.1.2",
@@ -15,32 +15,32 @@
15
15
  "semver": "7.7.1",
16
16
  "simple-git": "^3.28.0",
17
17
  "@teambit/harmony": "0.4.12",
18
- "@teambit/cli": "0.0.1364",
19
- "@teambit/logger": "0.0.1457",
20
- "@teambit/workspace": "1.0.1099",
21
- "@teambit/builder": "1.0.1099",
22
- "@teambit/checkout": "1.0.1100",
18
+ "@teambit/cli": "0.0.1367",
19
+ "@teambit/logger": "0.0.1460",
23
20
  "@teambit/component-id": "1.2.4",
24
- "@teambit/component.modules.merge-helper": "0.0.88",
25
- "@teambit/component.snap-distance": "0.0.146",
26
- "@teambit/config-merger": "0.0.966",
27
- "@teambit/dependency-resolver": "1.0.1099",
28
- "@teambit/export": "1.0.1099",
21
+ "@teambit/component.modules.merge-helper": "0.0.91",
22
+ "@teambit/component.snap-distance": "0.0.149",
29
23
  "@teambit/harmony.modules.concurrency": "0.0.42",
30
- "@teambit/importer": "1.0.1099",
31
24
  "@teambit/lane-id": "0.0.312",
32
- "@teambit/lanes": "1.0.1120",
33
- "@teambit/legacy.consumer-component": "0.0.146",
34
- "@teambit/objects": "0.0.606",
35
- "@teambit/snapping": "1.0.1099",
36
- "@teambit/status": "1.0.1124",
25
+ "@teambit/legacy.consumer-component": "0.0.149",
37
26
  "@teambit/toolbox.promise.map-pool": "0.0.19",
38
27
  "@teambit/toolbox.string.random": "0.0.18",
39
28
  "@teambit/bit-error": "0.0.404",
40
29
  "@teambit/legacy.constants": "0.0.41",
41
- "@teambit/legacy.scope": "0.0.145",
42
- "@teambit/legacy.bit-map": "0.0.202",
43
- "@teambit/toolbox.crypto.sha1": "0.0.20"
30
+ "@teambit/legacy.scope": "0.0.148",
31
+ "@teambit/legacy.bit-map": "0.0.205",
32
+ "@teambit/toolbox.crypto.sha1": "0.0.20",
33
+ "@teambit/workspace": "1.0.1105",
34
+ "@teambit/builder": "1.0.1105",
35
+ "@teambit/checkout": "1.0.1106",
36
+ "@teambit/config-merger": "0.0.972",
37
+ "@teambit/dependency-resolver": "1.0.1105",
38
+ "@teambit/export": "1.0.1105",
39
+ "@teambit/importer": "1.0.1105",
40
+ "@teambit/lanes": "1.0.1126",
41
+ "@teambit/objects": "0.0.612",
42
+ "@teambit/snapping": "1.0.1105",
43
+ "@teambit/status": "1.0.1130"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@types/lodash": "4.14.165",