@teambit/ci 1.0.507 → 1.0.508
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.
- package/dist/ci.main.runtime.d.ts +3 -2
- package/dist/ci.main.runtime.js +5 -6
- package/dist/ci.main.runtime.js.map +1 -1
- package/dist/{preview-1787147173446.js → preview-1787160027560.js} +1 -1
- package/dist/sync/git-host-provider.d.ts +9 -0
- package/dist/sync/git-host-provider.js.map +1 -1
- package/dist/sync/github-client.d.ts +28 -0
- package/dist/sync/github-client.js +81 -3
- package/dist/sync/github-client.js.map +1 -1
- package/dist/sync/github-client.spec.js +249 -0
- package/dist/sync/github-client.spec.js.map +1 -1
- package/dist/sync/lane-sync-executor.d.ts +47 -3
- package/dist/sync/lane-sync-executor.js +191 -39
- package/dist/sync/lane-sync-executor.js.map +1 -1
- package/dist/sync/lane-sync-executor.spec.js +336 -0
- package/dist/sync/lane-sync-executor.spec.js.map +1 -1
- package/dist/sync/sync-planner.d.ts +12 -2
- package/dist/sync/sync-planner.js +17 -8
- package/dist/sync/sync-planner.js.map +1 -1
- package/dist/sync/sync-planner.spec.js +64 -0
- package/dist/sync/sync-planner.spec.js.map +1 -1
- package/dist/sync/sync-state.d.ts +34 -3
- package/dist/sync/sync-state.js +61 -3
- package/dist/sync/sync-state.js.map +1 -1
- package/dist/sync/sync-state.spec.js +54 -0
- package/dist/sync/sync-state.spec.js.map +1 -1
- package/package.json +15 -15
- package/sync/git-host-provider.ts +8 -0
- package/sync/github-client.spec.ts +160 -0
- package/sync/github-client.ts +90 -3
- package/sync/lane-sync-executor.spec.ts +291 -0
- package/sync/lane-sync-executor.ts +233 -50
- package/sync/sync-planner.spec.ts +41 -0
- package/sync/sync-planner.ts +31 -10
- package/sync/sync-state.spec.ts +48 -0
- package/sync/sync-state.ts +104 -4
|
@@ -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","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);\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,GAAAH,MAAA,CAAAE,qBAAA,CAAAL,CAAA,GAAAC,CAAA,KAAAK,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAN,CAAA,WAAAE,MAAA,CAAAK,wBAAA,CAAAR,CAAA,EAAAC,CAAA,EAAAQ,UAAA,OAAAP,CAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,CAAA,EAAAI,CAAA,YAAAJ,CAAA;AAAA,SAAAU,cAAAZ,CAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAY,SAAA,CAAAC,MAAA,EAAAb,CAAA,UAAAC,CAAA,WAAAW,SAAA,CAAAZ,CAAA,IAAAY,SAAA,CAAAZ,CAAA,QAAAA,CAAA,OAAAF,OAAA,CAAAI,MAAA,CAAAD,CAAA,OAAAa,OAAA,WAAAd,CAAA,IAAAe,eAAA,CAAAhB,CAAA,EAAAC,CAAA,EAAAC,CAAA,CAAAD,CAAA,SAAAE,MAAA,CAAAc,yBAAA,GAAAd,MAAA,CAAAe,gBAAA,CAAAlB,CAAA,EAAAG,MAAA,CAAAc,yBAAA,CAAAf,CAAA,KAAAH,OAAA,CAAAI,M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C,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","stateCommitBundlesSources","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 // Suspected work only — git cannot tell whether the bundled sources are inside the recorded snap,\n // so the executor probes with a read-only status check and settles without writing when clean.\n name: 'sources bundled into the state commit, otherwise converged -> export-branch (a probe)',\n input: { stateCommitBundlesSources: true, tipIsSyncCommit: false },\n type: 'export-branch',\n action: { type: 'export-branch' },\n },\n {\n name: 'bundled sources count as work when the lane also moved -> merge-diverged',\n input: { laneHead: 'L2', stateCommitBundlesSources: true, tipIsSyncCommit: false },\n type: 'merge-diverged',\n },\n {\n name: 'own-live with bundled sources -> KEEP the branch, naming the commits',\n input: { ...laneGone('own-live'), stateCommitBundlesSources: true, tipIsSyncCommit: false },\n type: 'close-pr',\n action: { type: 'close-pr', deleteBranch: false, keepReason: 'unmerged-commits' },\n },\n {\n // Our own ledger commits bundle sources too (import-lane writes the lane's files, merge-diverged\n // the merged tree) — already-exported content, not work. No probe can run against a deleted lane,\n // so the deletion path keeps consulting the tip marker, in the same direction it always has.\n name: 'own-live, bundled sources but the tip is OUR OWN ledger commit -> close-pr AND delete',\n input: { ...laneGone('own-live'), stateCommitBundlesSources: true, tipIsSyncCommit: true },\n type: 'close-pr',\n action: { type: 'close-pr', deleteBranch: true },\n },\n {\n // The convergence path is the opposite: a probe IS available there, and a tip that merely CLAIMS\n // to be ours (a squash body quoting the marker) must never suppress it — probe, don't trust.\n name: 'bundled sources with a tip claiming to be ours still probe -> export-branch',\n input: { stateCommitBundlesSources: true, tipIsSyncCommit: true },\n type: 'export-branch',\n },\n {\n // Adoption probes via `bit status`, so suspected bundled work routes there like dev commits do.\n name: 'existing branch, never synced, bundled sources -> adopt-branch (first contact)',\n input: { lastSyncedHead: undefined, ownership: 'inherited-or-none', stateCommitBundlesSources: true },\n type: 'adopt-branch',\n },\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);\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,GAAAH,MAAA,CAAAE,qBAAA,CAAAL,CAAA,GAAAC,CAAA,KAAAK,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAN,CAAA,WAAAE,MAAA,CAAAK,wBAAA,CAAAR,CAAA,EAAAC,CAAA,EAAAQ,UAAA,OAAAP,CAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,CAAA,EAAAI,CAAA,YAAAJ,CAAA;AAAA,SAAAU,cAAAZ,CAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAY,SAAA,CAAAC,MAAA,EAAAb,CAAA,UAAAC,CAAA,WAAAW,SAAA,CAAAZ,CAAA,IAAAY,SAAA,CAAAZ,CAAA,QAAAA,CAAA,OAAAF,OAAA,CAAAI,MAAA,CAAAD,CAAA,OAAAa,OAAA,WAAAd,CAAA,IAAAe,eAAA,CAAAhB,CAAA,EAAAC,CAAA,EAAAC,CAAA,CAAAD,CAAA,SAAAE,MAAA,CAAAc,yBAAA,GAAAd,MAAA,CAAAe,gBAAA,CAAAlB,CAAA,EAAAG,MAAA,CAAAc,yBAAA,CAAAf,CAAA,KAAAH,OAAA,CAAAI,MAAA,CAAAD,CAAA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AE,CAACG,OAAO,CAACf,MAAM,CAAC;IAC/E,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -55,9 +55,10 @@ export declare const CONFLICT_LABEL = "bit-sync-conflict";
|
|
|
55
55
|
export declare function hasSyncMarker(message: string): boolean;
|
|
56
56
|
/**
|
|
57
57
|
* Strict probe for "we wrote this commit": the marker alone on its own line. This is an input to branch
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
58
|
+
* DELETION only — the one decision no content probe can stand in for, because the lane it would compare
|
|
59
|
+
* against is gone. It must never decide convergence: a squash-merge's body quotes the squashed ledger
|
|
60
|
+
* messages verbatim, marker included, so a message can claim authorship the reconciler never had.
|
|
61
|
+
* `\r?` tolerates CRLF; a recognition failure errs toward keeping the branch.
|
|
61
62
|
*/
|
|
62
63
|
export declare function isSyncAuthoredMessage(message: string): boolean;
|
|
63
64
|
/**
|
|
@@ -98,6 +99,14 @@ export type BranchSyncState = {
|
|
|
98
99
|
bitmap?: BranchBitmapState;
|
|
99
100
|
/** Whether the branch carries commits on top of its bit state — work bit has not seen. */
|
|
100
101
|
hasDevCommits: boolean;
|
|
102
|
+
/**
|
|
103
|
+
* Whether the state commit also touched files besides `.bitmap`. SUSPECTED work only: those files
|
|
104
|
+
* may already be inside the snap the `.bitmap` records, which git cannot tell — the executor's
|
|
105
|
+
* read-only status probe is what distinguishes real work. True for ANY other path (`docs/`, CI
|
|
106
|
+
* config, this reconciler's own source-bundling ledger commits): a spurious `true` re-probes, which
|
|
107
|
+
* writes nothing, so it can repeat without consequence.
|
|
108
|
+
*/
|
|
109
|
+
stateCommitBundlesSources: boolean;
|
|
101
110
|
/** The branch tip's full commit message (subject + body), for the sync-marker loop-guard probe. */
|
|
102
111
|
tipMessage: string;
|
|
103
112
|
/**
|
|
@@ -106,6 +115,26 @@ export type BranchSyncState = {
|
|
|
106
115
|
*/
|
|
107
116
|
tipSha?: string;
|
|
108
117
|
};
|
|
118
|
+
/**
|
|
119
|
+
* The pure half of `hasUnsyncedWorkChanges` (ci.main.runtime.ts): whether a `bit status` result holds
|
|
120
|
+
* anything a snap/export would push. The unloadable categories count as work: `invalidComponents` AND
|
|
121
|
+
* `importPendingComponents` (`StatusMain` splits pending-import errors out of the invalid list) are
|
|
122
|
+
* both UNKNOWN — their sources may hold the branch's edits — and this answer gates a "converged,
|
|
123
|
+
* write nothing" exit, so not knowing must route to the snap (which fails loudly) rather than
|
|
124
|
+
* converge. Incoming-change categories (outdated, pending updates from main) deliberately do NOT
|
|
125
|
+
* count: they are the lane's or main's movement, which the planner routes, not branch work.
|
|
126
|
+
*/
|
|
127
|
+
export declare function statusReportsUnsyncedWork(status: {
|
|
128
|
+
newComponents: unknown[];
|
|
129
|
+
modifiedComponents: unknown[];
|
|
130
|
+
stagedComponents: unknown[];
|
|
131
|
+
locallySoftRemoved: unknown[];
|
|
132
|
+
pendingUpdateDependents: unknown[];
|
|
133
|
+
mergePendingComponents: unknown[];
|
|
134
|
+
componentsDuringMergeState: unknown[];
|
|
135
|
+
invalidComponents: unknown[];
|
|
136
|
+
importPendingComponents: unknown[];
|
|
137
|
+
}): boolean;
|
|
109
138
|
/**
|
|
110
139
|
* Whether a `rev-list --count` output reports commits. An unreadable count answers `true`: `false` is an
|
|
111
140
|
* input to branch retirement, so not knowing must withhold a deletion rather than license one. Empty
|
|
@@ -118,6 +147,8 @@ export declare function parseDevCommitCount(raw: string): boolean;
|
|
|
118
147
|
* change that arrived through a merge would otherwise be picked as this branch's own state commit.
|
|
119
148
|
*/
|
|
120
149
|
export declare function readBranchSyncState(branch: string, defaultBranch: string, defaultScope: string): Promise<BranchSyncState>;
|
|
150
|
+
/** The pure half of `commitTouchesBeyondBitmap`, split out so it is testable without a real git log. */
|
|
151
|
+
export declare function touchesBeyondBitmap(rawNames: string): boolean;
|
|
121
152
|
/**
|
|
122
153
|
* Whether `branch`'s committed `.bitmap` is byte-identical (by blob sha) to the one at its merge-base
|
|
123
154
|
* with the default branch — i.e. the branch never asserted a `.bitmap` change of its own, so whatever
|
package/dist/sync/sync-state.js
CHANGED
|
@@ -15,6 +15,8 @@ exports.oldestCommitIsNonSync = oldestCommitIsNonSync;
|
|
|
15
15
|
exports.parseBranchBitmap = parseBranchBitmap;
|
|
16
16
|
exports.parseDevCommitCount = parseDevCommitCount;
|
|
17
17
|
exports.readBranchSyncState = readBranchSyncState;
|
|
18
|
+
exports.statusReportsUnsyncedWork = statusReportsUnsyncedWork;
|
|
19
|
+
exports.touchesBeyondBitmap = touchesBeyondBitmap;
|
|
18
20
|
function _legacy() {
|
|
19
21
|
const data = require("@teambit/legacy.bit-map");
|
|
20
22
|
_legacy = function () {
|
|
@@ -125,9 +127,10 @@ function hasSyncMarker(message) {
|
|
|
125
127
|
|
|
126
128
|
/**
|
|
127
129
|
* Strict probe for "we wrote this commit": the marker alone on its own line. This is an input to branch
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
*
|
|
130
|
+
* DELETION only — the one decision no content probe can stand in for, because the lane it would compare
|
|
131
|
+
* against is gone. It must never decide convergence: a squash-merge's body quotes the squashed ledger
|
|
132
|
+
* messages verbatim, marker included, so a message can claim authorship the reconciler never had.
|
|
133
|
+
* `\r?` tolerates CRLF; a recognition failure errs toward keeping the branch.
|
|
131
134
|
*/
|
|
132
135
|
function isSyncAuthoredMessage(message) {
|
|
133
136
|
return new RegExp(`^${SYNC_COMMIT_MARKER.replace(/[[\]]/g, '\\$&')}\\r?$`, 'm').test(message);
|
|
@@ -170,6 +173,20 @@ const ADOPTION_TRAILER = exports.ADOPTION_TRAILER = 'Bit-Adopted';
|
|
|
170
173
|
function buildSyncCommitMessage(laneIdStr, laneHead, opts = {}) {
|
|
171
174
|
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');
|
|
172
175
|
}
|
|
176
|
+
/**
|
|
177
|
+
* The pure half of `hasUnsyncedWorkChanges` (ci.main.runtime.ts): whether a `bit status` result holds
|
|
178
|
+
* anything a snap/export would push. The unloadable categories count as work: `invalidComponents` AND
|
|
179
|
+
* `importPendingComponents` (`StatusMain` splits pending-import errors out of the invalid list) are
|
|
180
|
+
* both UNKNOWN — their sources may hold the branch's edits — and this answer gates a "converged,
|
|
181
|
+
* write nothing" exit, so not knowing must route to the snap (which fails loudly) rather than
|
|
182
|
+
* converge. Incoming-change categories (outdated, pending updates from main) deliberately do NOT
|
|
183
|
+
* count: they are the lane's or main's movement, which the planner routes, not branch work.
|
|
184
|
+
*/
|
|
185
|
+
function statusReportsUnsyncedWork(status) {
|
|
186
|
+
const divergence = [status.newComponents, status.modifiedComponents, status.stagedComponents, status.locallySoftRemoved, status.pendingUpdateDependents, status.mergePendingComponents, status.componentsDuringMergeState, status.invalidComponents, status.importPendingComponents];
|
|
187
|
+
return divergence.some(components => components.length > 0);
|
|
188
|
+
}
|
|
189
|
+
|
|
173
190
|
/**
|
|
174
191
|
* Whether a `rev-list --count` output reports commits. An unreadable count answers `true`: `false` is an
|
|
175
192
|
* input to branch retirement, so not knowing must withhold a deletion rather than license one. Empty
|
|
@@ -193,15 +210,56 @@ async function readBranchSyncState(branch, defaultBranch, defaultScope) {
|
|
|
193
210
|
const bitmap = parseBranchBitmap(await readFileAtRef(revision, _legacy2().BIT_MAP), defaultScope);
|
|
194
211
|
const range = stateCommit ? `${stateCommit}..${revision}` : `origin/${defaultBranch}..${revision}`;
|
|
195
212
|
const count = await _git().git.raw(['rev-list', range, '--count']);
|
|
213
|
+
|
|
214
|
+
// Source edits can HIDE AT OR BELOW the state commit — bundled into it (the conflict-halt comment's
|
|
215
|
+
// resolve-by-hand recipe), or in an earlier commit that a later `.bitmap`-only commit covers — and
|
|
216
|
+
// `hasDevCommits` starts counting only after it, so they were invisible. Git file names alone cannot
|
|
217
|
+
// tell whether those sources are already inside the snap the `.bitmap` records (a dev who snapped,
|
|
218
|
+
// exported, and committed everything at once) or were never snapped at all — so this is SUSPECTED
|
|
219
|
+
// work, computed over the whole range since the PREVIOUS state commit (the last point a `.bitmap`
|
|
220
|
+
// write could have accounted for sources) and reported separately for the planner to probe.
|
|
221
|
+
// Deliberately content-only, per this module's header: this reconciler's own ledger commits have the
|
|
222
|
+
// same shape (import-lane and merge-diverged bundle already-exported sources) and its probe is a
|
|
223
|
+
// read, so a spurious `true` costs one status check — while consulting the tip's MESSAGE here read a
|
|
224
|
+
// squash-merge (whose body quotes the squashed ledger messages, marker included) as machine-authored
|
|
225
|
+
// and silently dropped the bundled work.
|
|
226
|
+
const stateCommitBundlesSources = !parseDevCommitCount(count) && stateCommit !== undefined && stateCommit === tipSha && (await sourcesTouchedSincePreviousState(revision, defaultBranch));
|
|
196
227
|
return {
|
|
197
228
|
stateCommit,
|
|
198
229
|
bitmap,
|
|
199
230
|
hasDevCommits: parseDevCommitCount(count),
|
|
231
|
+
stateCommitBundlesSources,
|
|
200
232
|
tipMessage,
|
|
201
233
|
tipSha
|
|
202
234
|
};
|
|
203
235
|
}
|
|
204
236
|
|
|
237
|
+
/**
|
|
238
|
+
* Whether any file besides `.bitmap` changed between the PREVIOUS `.bitmap`-writing commit (or, on a
|
|
239
|
+
* branch with only one, its fork point off the default branch) and the tip. A tree diff over the
|
|
240
|
+
* whole range, not a per-commit walk: a source edit in one commit followed by a `.bitmap`-only commit
|
|
241
|
+
* would be invisible to a single-commit check, and a later revert legitimately cancels out.
|
|
242
|
+
* Unreadable answers `true`: this feeds `stateCommitBundlesSources`, where not knowing must plan the
|
|
243
|
+
* probe, never declare convergence.
|
|
244
|
+
*/
|
|
245
|
+
async function sourcesTouchedSincePreviousState(revision, defaultBranch) {
|
|
246
|
+
try {
|
|
247
|
+
const previousStateCommit = (await _git().git.raw(['log', revision, '--first-parent', '-n', '1', '--skip', '1', '--format=%H', '--', _legacy2().BIT_MAP])).trim();
|
|
248
|
+
const base = previousStateCommit || (await _git().git.raw(['merge-base', `origin/${defaultBranch}`, revision])).trim();
|
|
249
|
+
if (!base) return true;
|
|
250
|
+
const names = await _git().git.raw(['diff', '--name-only', `${base}..${revision}`]);
|
|
251
|
+
// Empty is legitimate here (a range whose edits cancel out), unlike a single state commit's diff.
|
|
252
|
+
return touchesBeyondBitmap(names);
|
|
253
|
+
} catch {
|
|
254
|
+
return true;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/** The pure half of `commitTouchesBeyondBitmap`, split out so it is testable without a real git log. */
|
|
259
|
+
function touchesBeyondBitmap(rawNames) {
|
|
260
|
+
return rawNames.split('\n').map(name => name.trim()).filter(Boolean).some(name => name !== _legacy2().BIT_MAP);
|
|
261
|
+
}
|
|
262
|
+
|
|
205
263
|
/**
|
|
206
264
|
* Whether `branch`'s committed `.bitmap` is byte-identical (by blob sha) to the one at its merge-base
|
|
207
265
|
* with the default branch — i.e. the branch never asserted a `.bitmap` change of its own, so whatever
|
|
@@ -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","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 {\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,O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AAI,GAAG,CAAC,MAAMV,UAAG,CAACV,GAAG,CAAC,CAAC,YAAY,EAAE,UAAUO,aAAa,EAAE,EAAE,UAAUD,MAAM,EAAE,CAAC,CAAC,EAAEhE,IAAI,CAAC,CAAC;IAClG,IAAI,CAAC8E,IAAI,EAAE,OAAO,KAAK;IACvB,MAAM,CAACC,UAAU,EAAEC,QAAQ,CAAC,GAAG,MAAMC,OAAO,CAACC,GAAG,CAAC,CAC/Cd,UAAG,CAACV,GAAG,CAAC,CAAC,WAAW,EAAE,UAAUM,MAAM,MAAMQ,kBAAO,EAAE,CAAC,CAAC,EACvDJ,UAAG,CAACV,GAAG,CAAC,CAAC,WAAW,EAAE,GAAGoB,IAAI,MAAMN,kBAAO,EAAE,CAAC,CAAC,CAC/C,CAAC;IACF,MAAMW,SAAS,GAAGJ,UAAU,CAAC/E,IAAI,CAAC,CAAC;IACnC,OAAOgD,OAAO,CAACmC,SAAS,CAAC,IAAIA,SAAS,KAAKH,QAAQ,CAAChF,IAAI,CAAC,CAAC;EAC5D,CAAC,CAAC,MAAM;IACN,OAAO,KAAK;EACd;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe0E,aAAaA,CAACR,QAAgB,EAAEkB,QAAgB,EAA+B;EAC5F,IAAI;IACF,OAAO,MAAMhB,UAAG,CAACV,GAAG,CAAC,CAAC,MAAM,EAAE,GAAGQ,QAAQ,MAAMkB,QAAQ,EAAE,CAAC,CAAC;EAC7D,CAAC,CAAC,MAAM;IACN,OAAOnF,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","statusReportsUnsyncedWork","status","divergence","newComponents","modifiedComponents","stagedComponents","locallySoftRemoved","pendingUpdateDependents","mergePendingComponents","componentsDuringMergeState","invalidComponents","importPendingComponents","some","length","parseDevCommitCount","raw","count","Number","parseInt","isNaN","readBranchSyncState","branch","defaultBranch","revision","tipSha","git","tipMessage","trimEnd","stateCommit","BIT_MAP","bitmap","readFileAtRef","range","stateCommitBundlesSources","sourcesTouchedSincePreviousState","hasDevCommits","previousStateCommit","base","names","touchesBeyondBitmap","rawNames","name","branchBitmapUnchangedSinceFork","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 only — the one decision no content probe can stand in for, because the lane it would compare\n * against is gone. It must never decide convergence: a squash-merge's body quotes the squashed ledger\n * messages verbatim, marker included, so a message can claim authorship the reconciler never had.\n * `\\r?` tolerates CRLF; a recognition failure errs toward keeping the branch.\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 /**\n * Whether the state commit also touched files besides `.bitmap`. SUSPECTED work only: those files\n * may already be inside the snap the `.bitmap` records, which git cannot tell — the executor's\n * read-only status probe is what distinguishes real work. True for ANY other path (`docs/`, CI\n * config, this reconciler's own source-bundling ledger commits): a spurious `true` re-probes, which\n * writes nothing, so it can repeat without consequence.\n */\n stateCommitBundlesSources: 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 * The pure half of `hasUnsyncedWorkChanges` (ci.main.runtime.ts): whether a `bit status` result holds\n * anything a snap/export would push. The unloadable categories count as work: `invalidComponents` AND\n * `importPendingComponents` (`StatusMain` splits pending-import errors out of the invalid list) are\n * both UNKNOWN — their sources may hold the branch's edits — and this answer gates a \"converged,\n * write nothing\" exit, so not knowing must route to the snap (which fails loudly) rather than\n * converge. Incoming-change categories (outdated, pending updates from main) deliberately do NOT\n * count: they are the lane's or main's movement, which the planner routes, not branch work.\n */\nexport function statusReportsUnsyncedWork(status: {\n newComponents: unknown[];\n modifiedComponents: unknown[];\n stagedComponents: unknown[];\n locallySoftRemoved: unknown[];\n pendingUpdateDependents: unknown[];\n mergePendingComponents: unknown[];\n componentsDuringMergeState: unknown[];\n invalidComponents: unknown[];\n importPendingComponents: unknown[];\n}): boolean {\n const divergence = [\n status.newComponents,\n status.modifiedComponents,\n status.stagedComponents,\n status.locallySoftRemoved,\n status.pendingUpdateDependents,\n status.mergePendingComponents,\n status.componentsDuringMergeState,\n status.invalidComponents,\n status.importPendingComponents,\n ];\n return divergence.some((components) => components.length > 0);\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 // Source edits can HIDE AT OR BELOW the state commit — bundled into it (the conflict-halt comment's\n // resolve-by-hand recipe), or in an earlier commit that a later `.bitmap`-only commit covers — and\n // `hasDevCommits` starts counting only after it, so they were invisible. Git file names alone cannot\n // tell whether those sources are already inside the snap the `.bitmap` records (a dev who snapped,\n // exported, and committed everything at once) or were never snapped at all — so this is SUSPECTED\n // work, computed over the whole range since the PREVIOUS state commit (the last point a `.bitmap`\n // write could have accounted for sources) and reported separately for the planner to probe.\n // Deliberately content-only, per this module's header: this reconciler's own ledger commits have the\n // same shape (import-lane and merge-diverged bundle already-exported sources) and its probe is a\n // read, so a spurious `true` costs one status check — while consulting the tip's MESSAGE here read a\n // squash-merge (whose body quotes the squashed ledger messages, marker included) as machine-authored\n // and silently dropped the bundled work.\n const stateCommitBundlesSources =\n !parseDevCommitCount(count) &&\n stateCommit !== undefined &&\n stateCommit === tipSha &&\n (await sourcesTouchedSincePreviousState(revision, defaultBranch));\n\n return {\n stateCommit,\n bitmap,\n hasDevCommits: parseDevCommitCount(count),\n stateCommitBundlesSources,\n tipMessage,\n tipSha,\n };\n}\n\n/**\n * Whether any file besides `.bitmap` changed between the PREVIOUS `.bitmap`-writing commit (or, on a\n * branch with only one, its fork point off the default branch) and the tip. A tree diff over the\n * whole range, not a per-commit walk: a source edit in one commit followed by a `.bitmap`-only commit\n * would be invisible to a single-commit check, and a later revert legitimately cancels out.\n * Unreadable answers `true`: this feeds `stateCommitBundlesSources`, where not knowing must plan the\n * probe, never declare convergence.\n */\nasync function sourcesTouchedSincePreviousState(revision: string, defaultBranch: string): Promise<boolean> {\n try {\n const previousStateCommit = (\n await git.raw(['log', revision, '--first-parent', '-n', '1', '--skip', '1', '--format=%H', '--', BIT_MAP])\n ).trim();\n const base = previousStateCommit || (await git.raw(['merge-base', `origin/${defaultBranch}`, revision])).trim();\n if (!base) return true;\n const names = await git.raw(['diff', '--name-only', `${base}..${revision}`]);\n // Empty is legitimate here (a range whose edits cancel out), unlike a single state commit's diff.\n return touchesBeyondBitmap(names);\n } catch {\n return true;\n }\n}\n\n/** The pure half of `commitTouchesBeyondBitmap`, split out so it is testable without a real git log. */\nexport function touchesBeyondBitmap(rawNames: string): boolean {\n return rawNames\n .split('\\n')\n .map((name) => name.trim())\n .filter(Boolean)\n .some((name) => name !== BIT_MAP);\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 {\n return await git.raw(['show', `${revision}:./${filePath}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EAAE,UAAUM,MAAM,MAAMQ,kBAAO,EAAE,CAAC,CAAC,EACvDJ,UAAG,CAACV,GAAG,CAAC,CAAC,WAAW,EAAE,GAAGsB,IAAI,MAAMR,kBAAO,EAAE,CAAC,CAAC,CAC/C,CAAC;IACF,MAAMkB,SAAS,GAAGJ,UAAU,CAACpG,IAAI,CAAC,CAAC;IACnC,OAAOgD,OAAO,CAACwD,SAAS,CAAC,IAAIA,SAAS,KAAKH,QAAQ,CAACrG,IAAI,CAAC,CAAC;EAC5D,CAAC,CAAC,MAAM;IACN,OAAO,KAAK;EACd;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAewF,aAAaA,CAACR,QAAgB,EAAEyB,QAAgB,EAA+B;EAC5F,IAAI;IACF,OAAO,MAAMvB,UAAG,CAACV,GAAG,CAAC,CAAC,MAAM,EAAE,GAAGQ,QAAQ,MAAMyB,QAAQ,EAAE,CAAC,CAAC;EAC7D,CAAC,CAAC,MAAM;IACN,OAAOxG,SAAS;EAClB;AACF","ignoreList":[]}
|
|
@@ -14,6 +14,11 @@ function _syncState() {
|
|
|
14
14
|
};
|
|
15
15
|
return data;
|
|
16
16
|
}
|
|
17
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
18
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
19
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
20
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
21
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
17
22
|
const DEFAULT_SCOPE = 'acme.shop';
|
|
18
23
|
const SNAP_1 = 'a'.repeat(40);
|
|
19
24
|
const SNAP_2 = 'b'.repeat(40);
|
|
@@ -216,6 +221,44 @@ describe('parseBranchBitmap', () => {
|
|
|
216
221
|
* retirement, so every unreadable shape must read as "there is unmerged work" and keep the branch.
|
|
217
222
|
*/
|
|
218
223
|
const DEV_COMMIT_COUNTS = [['a count of commits on top of the state commit', '3', true], ['the raw output shape, trailing newline and all', '3\n', true], ['a genuine zero — the only license to retire', '0', false], ["a genuine zero with git's trailing newline", '0\n', false], ['empty output, which simple-git resolves with on some non-zero exits', '', true], ['whitespace-only output', ' \n ', true], ['git writing an error where the count was expected', 'fatal: bad revision', true]];
|
|
224
|
+
describe('statusReportsUnsyncedWork', () => {
|
|
225
|
+
const empty = {
|
|
226
|
+
newComponents: [],
|
|
227
|
+
modifiedComponents: [],
|
|
228
|
+
stagedComponents: [],
|
|
229
|
+
locallySoftRemoved: [],
|
|
230
|
+
pendingUpdateDependents: [],
|
|
231
|
+
mergePendingComponents: [],
|
|
232
|
+
componentsDuringMergeState: [],
|
|
233
|
+
invalidComponents: [],
|
|
234
|
+
importPendingComponents: []
|
|
235
|
+
};
|
|
236
|
+
it('an all-empty status is converged', () => {
|
|
237
|
+
(0, _chai().expect)((0, _syncState().statusReportsUnsyncedWork)(empty)).to.equal(false);
|
|
238
|
+
});
|
|
239
|
+
it('a modified component is work', () => {
|
|
240
|
+
(0, _chai().expect)((0, _syncState().statusReportsUnsyncedWork)(_objectSpread(_objectSpread({}, empty), {}, {
|
|
241
|
+
modifiedComponents: ['comp1']
|
|
242
|
+
}))).to.equal(true);
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
// An unloadable component is UNKNOWN, not converged: its sources may hold the branch's work, and
|
|
246
|
+
// "not knowing" must route to the snap (which fails loudly), never to a silent converged answer.
|
|
247
|
+
it('an invalid (unloadable) component is work, not convergence', () => {
|
|
248
|
+
(0, _chai().expect)((0, _syncState().statusReportsUnsyncedWork)(_objectSpread(_objectSpread({}, empty), {}, {
|
|
249
|
+
invalidComponents: [{
|
|
250
|
+
id: 'comp1'
|
|
251
|
+
}]
|
|
252
|
+
}))).to.equal(true);
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
// StatusMain SPLITS pending-import errors out of invalidComponents — same unknown, different array.
|
|
256
|
+
it('a pending-import component is the same unknown, not convergence', () => {
|
|
257
|
+
(0, _chai().expect)((0, _syncState().statusReportsUnsyncedWork)(_objectSpread(_objectSpread({}, empty), {}, {
|
|
258
|
+
importPendingComponents: ['comp1']
|
|
259
|
+
}))).to.equal(true);
|
|
260
|
+
});
|
|
261
|
+
});
|
|
219
262
|
describe('parseDevCommitCount', () => {
|
|
220
263
|
DEV_COMMIT_COUNTS.forEach(([name, raw, hasDevCommits]) => {
|
|
221
264
|
it(`${hasDevCommits ? 'keeps the branch' : 'permits retirement'} for ${name}`, () => {
|
|
@@ -223,6 +266,17 @@ describe('parseDevCommitCount', () => {
|
|
|
223
266
|
});
|
|
224
267
|
});
|
|
225
268
|
});
|
|
269
|
+
describe('touchesBeyondBitmap', () => {
|
|
270
|
+
it('is false for an empty diff and for a .bitmap-only commit', () => {
|
|
271
|
+
(0, _chai().expect)((0, _syncState().touchesBeyondBitmap)('')).to.equal(false);
|
|
272
|
+
(0, _chai().expect)((0, _syncState().touchesBeyondBitmap)('\n')).to.equal(false);
|
|
273
|
+
(0, _chai().expect)((0, _syncState().touchesBeyondBitmap)('.bitmap\n')).to.equal(false);
|
|
274
|
+
});
|
|
275
|
+
it('is true when any source file rides in the same commit as the .bitmap write', () => {
|
|
276
|
+
(0, _chai().expect)((0, _syncState().touchesBeyondBitmap)('.bitmap\ncomp1/index.js\n')).to.equal(true);
|
|
277
|
+
(0, _chai().expect)((0, _syncState().touchesBeyondBitmap)('comp1/index.js\n')).to.equal(true);
|
|
278
|
+
});
|
|
279
|
+
});
|
|
226
280
|
describe('oldestCommitIsNonSync', () => {
|
|
227
281
|
it('is false for an empty range — no commits at all', () => {
|
|
228
282
|
(0, _chai().expect)((0, _syncState().oldestCommitIsNonSync)('')).to.equal(false);
|
|
@@ -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","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;IACvE,IAAAQ,cAAM,EAACN,SAAS,CAAC,CAACQ,EAAE,CAACE,OAAO,CAACE,+BAAkB,CAAC;IAChD,IAAAN,cAAM,EAAC,IAAAL,mC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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":[]}
|
|
1
|
+
{"version":3,"names":["_chai","data","require","_syncState","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","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","name","message","marker","authored","hasSyncMarker","isSyncAuthoredMessage","bitmapContent","lane","components","comp1","comp2","prefix","body","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","empty","newComponents","modifiedComponents","stagedComponents","locallySoftRemoved","pendingUpdateDependents","mergePendingComponents","componentsDuringMergeState","invalidComponents","importPendingComponents","statusReportsUnsyncedWork","raw","hasDevCommits","parseDevCommitCount","touchesBeyondBitmap","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 statusReportsUnsyncedWork,\n touchesBeyondBitmap,\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('statusReportsUnsyncedWork', () => {\n const empty = {\n newComponents: [],\n modifiedComponents: [],\n stagedComponents: [],\n locallySoftRemoved: [],\n pendingUpdateDependents: [],\n mergePendingComponents: [],\n componentsDuringMergeState: [],\n invalidComponents: [],\n importPendingComponents: [],\n };\n\n it('an all-empty status is converged', () => {\n expect(statusReportsUnsyncedWork(empty)).to.equal(false);\n });\n\n it('a modified component is work', () => {\n expect(statusReportsUnsyncedWork({ ...empty, modifiedComponents: ['comp1'] })).to.equal(true);\n });\n\n // An unloadable component is UNKNOWN, not converged: its sources may hold the branch's work, and\n // \"not knowing\" must route to the snap (which fails loudly), never to a silent converged answer.\n it('an invalid (unloadable) component is work, not convergence', () => {\n expect(statusReportsUnsyncedWork({ ...empty, invalidComponents: [{ id: 'comp1' }] })).to.equal(true);\n });\n\n // StatusMain SPLITS pending-import errors out of invalidComponents — same unknown, different array.\n it('a pending-import component is the same unknown, not convergence', () => {\n expect(statusReportsUnsyncedWork({ ...empty, importPendingComponents: ['comp1'] })).to.equal(true);\n });\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('touchesBeyondBitmap', () => {\n it('is false for an empty diff and for a .bitmap-only commit', () => {\n expect(touchesBeyondBitmap('')).to.equal(false);\n expect(touchesBeyondBitmap('\\n')).to.equal(false);\n expect(touchesBeyondBitmap('.bitmap\\n')).to.equal(false);\n });\n\n it('is true when any source file rides in the same commit as the .bitmap write', () => {\n expect(touchesBeyondBitmap('.bitmap\\ncomp1/index.js\\n')).to.equal(true);\n expect(touchesBeyondBitmap('comp1/index.js\\n')).to.equal(true);\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;AAcsB,SAAAG,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAJ,CAAA,OAAAG,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,CAAAL,CAAA,GAAAC,CAAA,KAAAK,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAN,CAAA,WAAAE,MAAA,CAAAK,wBAAA,CAAAR,CAAA,EAAAC,CAAA,EAAAQ,UAAA,OAAAP,CAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,CAAA,EAAAI,CAAA,YAAAJ,CAAA;AAAA,SAAAU,cAAAZ,CAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAY,SAAA,CAAAC,MAAA,EAAAb,CAAA,UAAAC,CAAA,WAAAW,SAAA,CAAAZ,CAAA,IAAAY,SAAA,CAAAZ,CAAA,QAAAA,CAAA,OAAAF,OAAA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