@teambit/ci 1.0.507 → 1.0.512
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-1787168213927.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","_laneSyncExecutor","_syncConfig","stubExecutor","warnings","executor","LaneSyncExecutor","lanes","ci","logger","console","consoleWarning","msg","push","error","gitHost","undefined","cfg","resolveSyncConfig","defaultScope","comp","id","head","toStringWithoutVersion","scope","split","describe","a","b","it","fingerprint","laneHeadFingerprint","expect","to","match","equal","moved","not","DEFAULT_SCOPE","ours","theirs","foreignLaneComponents","deep","namespaced","description","crossScopeDescription","include","ids","Array","from","length","_","index","LANE_HEAD","body","componentCount","laneSyncPrBody","laneIdStr","laneUrl","branch","laneHead","components","repeat","rendered","be","below","FOREIGN","summary","crossScopeSkipSummary","refusal","crossScopeRefusal","reason","crossScopeMidFlightHaltReason","branchMirrorsOtherLaneReason","note","branchMirrorsOtherLaneNote","throwingExecutor","gitHostCalls","noopLogger","debug","getDefaultBranchName","Error","name","findPrByBranch","number","htmlUrl","labels","addLabel","comment","fetched","syncLane","hostScope","dryRun","LANE_NAME","haltCommentBody","laneId","line","dryRunSummaryLine","type","forEach","contain","deleteBranch","EVIDENCE_SHA","MOVED_SHA","retirer","currentTip","pushError","pushes","currentBranchTip","pushBranchDeletion","sha","closePr","executeClosePr","laneName","defaultBranch","expectedTipSha","join","executorWithInheritance","inherited","branchInheritsBitmapFromDefault","mirroredLane","differentLaneStillClaims","executorWithAncestryResult","result","calls","hasIndependentHistoryBelowStateCommit","stateCommit","compute","ownership","computeHasIndependentHistory","BASE_SHA","REJECTION","classifier","baseSha","e","classifyPushRejection","classify","unrelated","lastNonSyncCommitMessage","checkoutFromRemote","restoreWorkspace","snapAndExportOntoLane","status","recordLaneHeadOnBranch","executeExportBranch","target","deps","hasUnsyncedWorkChanges","materializeLane","executeAdoptBranch","racedLedgerPushSummary","isProtectedBranch"],"sources":["lane-sync-executor.spec.ts"],"sourcesContent":["import { expect } from 'chai';\nimport {\n branchMirrorsOtherLaneNote,\n branchMirrorsOtherLaneReason,\n crossScopeDescription,\n crossScopeMidFlightHaltReason,\n crossScopeRefusal,\n crossScopeSkipSummary,\n dryRunSummaryLine,\n foreignLaneComponents,\n haltCommentBody,\n isProtectedBranch,\n laneHeadFingerprint,\n LaneSyncExecutor,\n laneSyncPrBody,\n racedLedgerPushSummary,\n} from './lane-sync-executor';\nimport type { LaneOwnershipEvidence } from './sync-planner';\nimport { resolveSyncConfig } from './sync-config';\n\n/**\n * One stub executor for every seam-based test: real executor code over stubbed deps, no repository.\n * `warnings` collects `consoleWarning` lines for tests that assert on them.\n */\nfunction stubExecutor(): { executor: LaneSyncExecutor; warnings: string[] } {\n const warnings: string[] = [];\n const executor = new LaneSyncExecutor({\n lanes: {} as any,\n ci: {} as any,\n logger: { console: () => {}, consoleWarning: (msg: string) => warnings.push(msg), error: () => {} } as any,\n gitHost: undefined,\n cfg: resolveSyncConfig({}),\n defaultScope: 'acme.shop',\n });\n return { executor, warnings };\n}\n\ntype LaneComponents = Parameters<typeof laneHeadFingerprint>[0];\n\n/** A stand-in for `LaneData`'s component entry; the helpers only read the id string, scope and head. */\nfunction comp(id: string, head: string): LaneComponents[number] {\n return {\n id: { toStringWithoutVersion: () => id, scope: id.split('/', 1)[0] },\n head,\n } as unknown as LaneComponents[number];\n}\n\ndescribe('laneHeadFingerprint', () => {\n const a = comp('acme.shop/comp1', 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1');\n const b = comp('acme.shop/comp2', 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb2');\n\n it('is a single 40-hex token, so it survives being written into a commit trailer as an annotation', () => {\n const fingerprint = laneHeadFingerprint([a, b]);\n expect(fingerprint).to.match(/^[0-9a-f]{40}$/);\n });\n\n it('is stable under reordering: the remote listing order must not look like the lane moved', () => {\n expect(laneHeadFingerprint([a, b])).to.equal(laneHeadFingerprint([b, a]));\n });\n\n it('changes when a component head changes', () => {\n const moved = comp('acme.shop/comp2', 'cccccccccccccccccccccccccccccccccccccc33');\n expect(laneHeadFingerprint([a, moved])).to.not.equal(laneHeadFingerprint([a, b]));\n });\n\n it('changes when a component is added or removed', () => {\n expect(laneHeadFingerprint([a])).to.not.equal(laneHeadFingerprint([a, b]));\n expect(laneHeadFingerprint([])).to.not.equal(laneHeadFingerprint([a]));\n });\n\n it('does not depend on the lane object, only on its content', () => {\n expect(laneHeadFingerprint([a, b])).to.equal(laneHeadFingerprint([comp('acme.shop/comp1', a.head), b]));\n });\n});\n\ndescribe('foreignLaneComponents', () => {\n const DEFAULT_SCOPE = 'acme.shop';\n const ours = comp('acme.shop/comp1', 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1');\n const theirs = comp('other.scope/comp2', 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb2');\n\n it('is empty for a lane whose components are all in the repository scope', () => {\n expect(foreignLaneComponents([ours], DEFAULT_SCOPE)).to.deep.equal([]);\n expect(foreignLaneComponents([], DEFAULT_SCOPE)).to.deep.equal([]);\n });\n\n it('names every component outside the repository scope', () => {\n expect(foreignLaneComponents([ours, theirs], DEFAULT_SCOPE)).to.deep.equal(['other.scope/comp2']);\n });\n\n it('compares the scope, not the id prefix: a namespaced component of our scope is ours', () => {\n // `acme.shop/ui/button` must not read as scope `acme.shop/ui`.\n const namespaced = comp('acme.shop/ui/button', 'ccccccccccccccccccccccccccccccccccccc333');\n expect(foreignLaneComponents([namespaced], DEFAULT_SCOPE)).to.deep.equal([]);\n });\n\n it('treats a lane hosted elsewhere but filled with our components as ours (hosting != content)', () => {\n expect(foreignLaneComponents([ours], DEFAULT_SCOPE)).to.deep.equal([]);\n });\n});\n\ndescribe('crossScopeDescription', () => {\n const DEFAULT_SCOPE = 'acme.shop';\n\n it('names the foreign scopes and this repository scope', () => {\n const description = crossScopeDescription(['other.scope/comp2', 'third.scope/comp3'], DEFAULT_SCOPE);\n expect(description).to.include('components from scope(s) other.scope, third.scope');\n expect(description).to.include(`(this repo maps scope ${DEFAULT_SCOPE})`);\n expect(description).to.include('foreign components: other.scope/comp2, third.scope/comp3');\n });\n\n it('lists at most five foreign components and summarizes the rest', () => {\n const ids = Array.from({ length: 8 }, (_, index) => `other.scope/comp${index}`);\n const description = crossScopeDescription(ids, DEFAULT_SCOPE);\n expect(description).to.include('other.scope/comp4');\n expect(description).to.not.include('other.scope/comp5');\n expect(description).to.include('…and 3 more');\n });\n\n it('does not append a count when everything is listed', () => {\n expect(crossScopeDescription(['other.scope/comp1'], DEFAULT_SCOPE)).to.not.include('more');\n });\n});\n\n// GitHub rejects a PR whose body exceeds 65,536 characters, whole-request; a lane has no size limit.\ndescribe('laneSyncPrBody', () => {\n const LANE_HEAD = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1';\n\n function body(componentCount: number) {\n return laneSyncPrBody({\n laneIdStr: 'acme.shop/my-lane',\n laneUrl: 'https://bit.cloud/acme/shop/~lane/my-lane',\n branch: 'my-lane',\n laneHead: LANE_HEAD,\n components: Array.from({ length: componentCount }, (_, index) =>\n comp(`acme.shop/namespace/component-with-a-realistic-name-${index}`, `${'0'.repeat(39)}${index % 10}`)\n ),\n });\n }\n\n it('lists at most twenty components and summarizes the rest, keeping the exact total', () => {\n const rendered = body(100);\n expect(rendered).to.include('component-with-a-realistic-name-19');\n expect(rendered).to.not.include('component-with-a-realistic-name-20');\n expect(rendered).to.include('and 80 more');\n expect(rendered).to.include('Components on the lane (100):');\n expect(rendered).to.include(`lane head: \\`${LANE_HEAD}\\``);\n });\n\n it('stays far inside a git host body limit for a lane of any size', () => {\n expect(body(100).length).to.be.below(60000);\n expect(body(5000).length).to.be.below(60000);\n });\n\n it('lists a small lane in full, with no summary line', () => {\n const rendered = body(3);\n expect(rendered).to.include('component-with-a-realistic-name-2');\n expect(rendered).to.not.include('more');\n expect(rendered).to.include('Components on the lane (3):');\n });\n\n it('says so explicitly when the lane has no components', () => {\n expect(body(0)).to.include('_none_');\n });\n});\n\ndescribe('cross-scope outcome messages', () => {\n const DEFAULT_SCOPE = 'acme.shop';\n const FOREIGN = ['other.scope/comp2'];\n\n it('an enumerated lane is SKIPPED, in the vocabulary of a healthy run', () => {\n const summary = crossScopeSkipSummary('my-lane', FOREIGN, DEFAULT_SCOPE);\n expect(summary).to.match(/^my-lane -> skipped \\(cross-scope lane: /);\n expect(summary).to.include('no branch created');\n // A HALTED/REFUSED marker in this line would flip the exit code of a healthy repository.\n expect(summary).to.not.include('HALTED');\n expect(summary).to.not.include('REFUSED');\n });\n\n it('an explicitly requested lane is REFUSED, with the reason and the \"nothing was written\" promise', () => {\n const refusal = crossScopeRefusal(FOREIGN, DEFAULT_SCOPE);\n expect(refusal).to.include('cross-scope lane: components from scope(s) other.scope');\n expect(refusal).to.include(\"not supported yet — see the docs' Cross-scope lanes section\");\n expect(refusal).to.include('No branch was created and nothing was written');\n });\n\n it('the refusal does not claim it created no branch when a branch already exists', () => {\n const refusal = crossScopeRefusal(FOREIGN, DEFAULT_SCOPE, 'my-lane');\n expect(refusal).to.include('Nothing was written; the existing branch my-lane was left untouched');\n expect(refusal).to.not.include('No branch was created');\n });\n\n it('a lane that became cross-scope mid-flight names the branch it can no longer converge with', () => {\n const reason = crossScopeMidFlightHaltReason('my-lane', FOREIGN, DEFAULT_SCOPE);\n expect(reason).to.include('lane became cross-scope after it was mirrored onto my-lane');\n expect(reason).to.include('can no longer be reconciled automatically');\n });\n});\n\ndescribe('branchMirrorsOtherLaneReason', () => {\n it('names the branch, the lane that owns it, and the lane that was refused', () => {\n const reason = branchMirrorsOtherLaneReason('release', 'other.scope/release', 'acme.shop/release');\n expect(reason).to.include('branch release mirrors lane other.scope/release');\n expect(reason).to.include('refusing to plan for acme.shop/release');\n expect(reason).to.include(\"overwrite the other lane's mirror\");\n });\n\n it('the PR comment tells the branch owner their lane is fine, and not to run the usual steps', () => {\n const note = branchMirrorsOtherLaneNote('other.scope/release', 'acme.shop/release');\n expect(note).to.include('belongs to lane `other.scope/release`');\n expect(note).to.include('nothing is wrong with it');\n expect(note).to.include('acme.shop/release');\n expect(note).to.match(/Do NOT run the usual \"bit lane import\" resolution steps/);\n expect(note).to.include('rename one of the two lanes');\n expect(note).to.include('`branches`');\n });\n});\n\n// The executor is real; `getDefaultBranchName` throwing is the seam — the first dependency\n// `reconcileLane` awaits after the fetch, so the throw reaches the outer catch with no git/network work.\ndescribe('syncLane outer catch under --dry-run', () => {\n function throwingExecutor(gitHostCalls: string[]): LaneSyncExecutor {\n const noopLogger = { console: () => {}, consoleWarning: () => {}, error: () => {}, debug: () => {} };\n const executor = new LaneSyncExecutor({\n lanes: {} as any,\n ci: {\n getDefaultBranchName: async () => {\n throw new Error('boom');\n },\n } as any,\n logger: noopLogger as any,\n gitHost: {\n name: 'stub',\n findPrByBranch: async () => {\n gitHostCalls.push('findPrByBranch');\n return { number: 7, htmlUrl: 'https://example.test/pr/7', labels: [] };\n },\n addLabel: async () => {\n gitHostCalls.push('addLabel');\n },\n comment: async () => {\n gitHostCalls.push('comment');\n },\n } as any,\n cfg: resolveSyncConfig({}),\n defaultScope: 'acme.shop',\n });\n // Mark the fetch done so the spec never touches a repository or the network.\n (executor as any).fetched = true;\n return executor;\n }\n\n it('reports the halt without reading, labelling or commenting on the PR', async () => {\n const gitHostCalls: string[] = [];\n const summary = await throwingExecutor(gitHostCalls).syncLane(\n { hostScope: 'acme.shop', name: 'my-lane' },\n { dryRun: true }\n );\n expect(summary).to.equal('HALTED my-lane -> unexpected error: boom');\n expect(gitHostCalls).to.deep.equal([]);\n });\n\n it('is non-vacuous: without --dry-run the same failure does read, label and comment the PR', async () => {\n const gitHostCalls: string[] = [];\n const summary = await throwingExecutor(gitHostCalls).syncLane({ hostScope: 'acme.shop', name: 'my-lane' });\n expect(summary).to.equal('HALTED my-lane -> unexpected error: boom');\n expect(gitHostCalls).to.deep.equal(['findPrByBranch', 'addLabel', 'comment']);\n });\n\n // '-hostile' is a legal bit lane name (the charset allows a leading '-') that can never be a branch.\n it('a lane whose name cannot map to a branch halts report-only instead of throwing', async () => {\n const gitHostCalls: string[] = [];\n const summary = await throwingExecutor(gitHostCalls).syncLane({ hostScope: 'acme.shop', name: '-hostile' });\n expect(summary).to.match(/^HALTED -hostile -> unexpected error: .*not a valid git branch name/);\n expect(gitHostCalls).to.deep.equal([]);\n });\n});\n\n// bit's lane-name charset admits `$`, `-`, `_` and `!`, so an unquoted runbook shell-expands when pasted.\ndescribe('haltCommentBody', () => {\n const LANE_NAME = 'fix-$home-and-!bang';\n\n it('single-quotes every value it interpolates into a command', () => {\n const body = haltCommentBody({\n reason: 'merge conflicts in: acme.shop/comp1',\n branch: LANE_NAME,\n laneId: `acme.shop/${LANE_NAME}`,\n });\n expect(body).to.include(`git fetch origin && git checkout '${LANE_NAME}'`);\n expect(body).to.include(`bit lane import 'acme.shop/${LANE_NAME}'`);\n expect(body).to.include(`git push origin '${LANE_NAME}'`);\n // the reason is prose, not a command, and the runbook still reads as one\n expect(body).to.include('merge conflicts in: acme.shop/comp1');\n expect(body).to.include('Remove the `bit-sync-conflict` label to resume syncing.');\n });\n\n // A configured `branches` override only has to be a valid git ref, and git accepts a quote in one.\n it('escapes a value that itself contains a quote, rather than ending the quoting early', () => {\n const body = haltCommentBody({ reason: 'x', branch: \"it's-a-branch\", laneId: 'acme.shop/lane' });\n expect(body).to.include(`git checkout 'it'\\\\''s-a-branch'`);\n });\n\n it('leaves an overriding note alone: it carries no commands to quote', () => {\n const body = haltCommentBody({ reason: 'x', branch: LANE_NAME, laneId: 'acme.shop/lane', note: 'nothing to do' });\n expect(body).to.include('nothing to do');\n expect(body).to.not.include('git checkout');\n });\n});\n\n// `summarizeSync` decides the exit code by scanning for the prefix and nothing else, so a prefix-less\n// line makes a dry run report success on a plan the real run would have halted on.\ndescribe('dryRunSummaryLine', () => {\n it('carries the HALTED prefix and the reason for a planned halt, so the run exits non-zero', () => {\n const line = dryRunSummaryLine('my-lane', { type: 'halt', reason: 'cannot tell which side is newer' });\n expect(line).to.equal('HALTED my-lane -> cannot tell which side is newer');\n });\n\n it('leaves every other planned action unprefixed — those runs are healthy', () => {\n (['import-lane', 'export-branch', 'merge-diverged'] as const).forEach((type) => {\n const line = dryRunSummaryLine('my-lane', { type });\n expect(line, type).to.equal(`my-lane -> ${type}`);\n expect(line, type).to.not.contain('HALTED');\n expect(line, type).to.not.contain('REFUSED');\n });\n expect(dryRunSummaryLine('my-lane', { type: 'noop', reason: 'converged' })).to.equal('my-lane -> noop');\n expect(dryRunSummaryLine('my-lane', { type: 'close-pr', deleteBranch: true })).to.equal('my-lane -> close-pr');\n });\n});\n\n// The deletion decision is computed from refs fetched once per run; on an `--all` run the branch can\n// advance while earlier lanes are reconciled. Both seams are stubbed, so no repository is touched.\ndescribe('close-pr re-verifies the tip before retiring a branch', () => {\n const EVIDENCE_SHA = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1';\n const MOVED_SHA = 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb2';\n\n function retirer(currentTip: string | undefined, pushError?: Error) {\n const { executor, warnings } = stubExecutor();\n const pushes: string[][] = [];\n (executor as any).currentBranchTip = async () => currentTip;\n (executor as any).pushBranchDeletion = async (branch: string, sha: string) => {\n pushes.push([branch, sha]);\n if (pushError) throw pushError;\n };\n const closePr = () =>\n (executor as any).executeClosePr({\n laneName: 'my-lane',\n laneIdStr: 'acme.shop/my-lane',\n branch: 'my-lane',\n defaultBranch: 'main',\n deleteBranch: true,\n expectedTipSha: EVIDENCE_SHA,\n }) as Promise<string>;\n return { closePr, warnings, pushes };\n }\n\n it('deletes at the evidence sha while the branch is still there', async () => {\n const { closePr, pushes } = retirer(EVIDENCE_SHA);\n expect(await closePr()).to.equal('my-lane -> close-pr (no open PR, branch my-lane deleted)');\n expect(pushes).to.deep.equal([['my-lane', EVIDENCE_SHA]]);\n });\n\n it('KEEPS the branch when the tip moved during the run, pushing nothing at all', async () => {\n const { closePr, warnings, pushes } = retirer(MOVED_SHA);\n const summary = await closePr();\n expect(summary).to.contain('branch my-lane kept: its tip advanced after the ownership evidence was read');\n expect(pushes).to.deep.equal([]);\n expect(warnings.join('\\n')).to.contain(`its tip is now ${MOVED_SHA} rather than the ${EVIDENCE_SHA}`);\n });\n\n it('keeps the branch when the tip cannot be re-read at all, rather than trusting the stale answer', async () => {\n const { closePr, pushes } = retirer(undefined);\n expect(await closePr()).to.contain('branch my-lane kept: its tip advanced');\n expect(pushes).to.deep.equal([]);\n });\n\n // The re-read and the push are not atomic; the server gets the last word, and it is not a crash.\n it('reports a lease refusal as the same kept outcome', async () => {\n const { closePr, warnings } = retirer(\n EVIDENCE_SHA,\n new Error('! [rejected] (delete) -> my-lane (stale info)\\nerror: failed to push some refs')\n );\n expect(await closePr()).to.contain('branch my-lane kept: its tip advanced');\n expect(warnings.join('\\n')).to.contain('the remote refused the lease');\n });\n\n it('an unrelated push failure still reads as \"left in place\", not as a race', async () => {\n const { closePr } = retirer(EVIDENCE_SHA, new Error('remote: GH006: Protected branch update failed'));\n expect(await closePr()).to.equal('my-lane -> close-pr (no open PR, branch my-lane left in place)');\n });\n});\n\ndescribe('differentLaneStillClaims uses .bitmap blob equality, not commit reachability', () => {\n function executorWithInheritance(inherited: boolean) {\n const executor = new LaneSyncExecutor({\n lanes: {} as any,\n ci: {} as any,\n logger: { console: () => {}, consoleWarning: () => {}, error: () => {} } as any,\n gitHost: undefined,\n cfg: resolveSyncConfig({}),\n defaultScope: 'acme.shop',\n });\n (executor as any).branchInheritsBitmapFromDefault = async () => inherited;\n return (mirroredLane: string | undefined, laneIdStr: string) =>\n (executor as any).differentLaneStillClaims(mirroredLane, laneIdStr, 'my-branch', 'main') as Promise<boolean>;\n }\n\n it('does not claim when there is no mirrored lane pointer at all — never even checks the blob', async () => {\n const differentLaneStillClaims = executorWithInheritance(true);\n expect(await differentLaneStillClaims(undefined, 'acme.shop/my-lane')).to.equal(false);\n });\n\n it(\"does not claim for this lane's own pointer — never even checks the blob\", async () => {\n const differentLaneStillClaims = executorWithInheritance(true);\n expect(await differentLaneStillClaims('acme.shop/my-lane', 'acme.shop/my-lane')).to.equal(false);\n });\n\n it(\"does not claim when the different-lane .bitmap is byte-identical to the default branch's — inherited\", async () => {\n const differentLaneStillClaims = executorWithInheritance(true);\n expect(await differentLaneStillClaims('acme.shop/other-lane', 'acme.shop/my-lane')).to.equal(false);\n });\n\n it(\"STILL claims when the different-lane .bitmap has diverged from the default branch's — halt, not adopt\", async () => {\n const differentLaneStillClaims = executorWithInheritance(false);\n expect(await differentLaneStillClaims('acme.shop/other-lane', 'acme.shop/my-lane')).to.equal(true);\n });\n});\n\ndescribe('computeHasIndependentHistory gates the ancestry check to own-live claims with a state commit', () => {\n function executorWithAncestryResult(result: boolean) {\n const calls: Array<[string, string]> = [];\n const executor = new LaneSyncExecutor({\n lanes: {} as any,\n ci: {} as any,\n logger: { console: () => {}, consoleWarning: () => {}, error: () => {} } as any,\n gitHost: undefined,\n cfg: resolveSyncConfig({}),\n defaultScope: 'acme.shop',\n });\n (executor as any).hasIndependentHistoryBelowStateCommit = async (stateCommit: string, defaultBranch: string) => {\n calls.push([stateCommit, defaultBranch]);\n return result;\n };\n const compute = (ownership: LaneOwnershipEvidence, stateCommit: string | undefined, defaultBranch: string) =>\n (executor as any).computeHasIndependentHistory(ownership, stateCommit, defaultBranch) as Promise<boolean>;\n return { compute, calls };\n }\n\n it('skips the ancestry check entirely for a reachable claim (own-merged)', async () => {\n const { compute, calls } = executorWithAncestryResult(true);\n expect(await compute('own-merged', 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1', 'main')).to.equal(false);\n expect(calls).to.deep.equal([]);\n });\n\n it('skips the ancestry check entirely for own-superseded too', async () => {\n const { compute, calls } = executorWithAncestryResult(true);\n expect(await compute('own-superseded', 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1', 'main')).to.equal(false);\n expect(calls).to.deep.equal([]);\n });\n\n it('skips the check when there is no state commit to inspect, even for an own-live claim', async () => {\n const { compute, calls } = executorWithAncestryResult(true);\n expect(await compute('own-live', undefined, 'main')).to.equal(false);\n expect(calls).to.deep.equal([]);\n });\n\n it('defers to the ancestry check for an own-live claim with a state commit', async () => {\n const { compute, calls } = executorWithAncestryResult(true);\n expect(await compute('own-live', 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1', 'main')).to.equal(true);\n expect(calls).to.deep.equal([['aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1', 'main']]);\n });\n});\n\ndescribe('classifyPushRejection confirms a race before calling it one', () => {\n const BASE_SHA = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1';\n const MOVED_SHA = 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb2';\n const REJECTION = new Error('! [rejected] HEAD -> feature (fetch first)\\nerror: failed to push some refs');\n\n function classifier(currentTip: string | undefined) {\n const { executor } = stubExecutor();\n (executor as any).currentBranchTip = async () => currentTip;\n return (baseSha: string | undefined, e: Error) =>\n (executor as any).classifyPushRejection('my-branch', baseSha, e) as Promise<'confirmed-race' | 'not-a-race'>;\n }\n\n it('confirms the race when the branch actually moved off the base we pushed against', async () => {\n const classify = classifier(MOVED_SHA);\n expect(await classify(BASE_SHA, REJECTION)).to.equal('confirmed-race');\n });\n\n it('confirms the race for a brand-new branch that now exists on the remote', async () => {\n const classify = classifier(MOVED_SHA);\n expect(await classify(undefined, REJECTION)).to.equal('confirmed-race');\n });\n\n // Message-text matching alone is not proof: a persistent, unrelated rejection could repeat the same\n // wording forever. Without this re-fetch-and-compare, that would go permanently green.\n it('answers not-a-race when the branch did NOT move — the wording matched but nothing raced', async () => {\n const classify = classifier(BASE_SHA);\n expect(await classify(BASE_SHA, REJECTION)).to.equal('not-a-race');\n });\n\n it('answers not-a-race when a brand-new branch still does not exist on the remote', async () => {\n const classify = classifier(undefined);\n expect(await classify(undefined, REJECTION)).to.equal('not-a-race');\n });\n\n // The polarity bug this guards: `currentTip === undefined` here means the re-fetch FAILED (network\n // blip, auth hiccup) — unknown, not evidence the branch moved. `undefined !== baseSha` reads as\n // truthy if compared naively, which would misreport an unanswerable check as a confirmed race and\n // paper over a real, persistent failure. Withhold like every other unknown-answer path in this file.\n it('answers not-a-race when the re-fetch itself fails, even though a base sha is known', async () => {\n const classify = classifier(undefined);\n expect(await classify(BASE_SHA, REJECTION)).to.equal('not-a-race');\n });\n\n it('answers not-a-race for a rejection whose wording is not a non-fast-forward race at all', async () => {\n const classify = classifier(MOVED_SHA);\n const unrelated = new Error('remote: GH006: Protected branch update failed');\n expect(await classify(BASE_SHA, unrelated)).to.equal('not-a-race');\n });\n});\n\n// The live incident's actual shape: the snap/export onto the lane already succeeded — the lane truly\n// moved — and only the branch's OWN ledger-commit push (recordLaneHeadOnBranch) lost the race. Nothing\n// exercised `racedLedgerPushSummary` before this; a wording regression there would have gone unnoticed.\ndescribe('executeExportBranch reports the ledger-race wording when only the ledger push races', () => {\n it('surfaces \"lane updated; branch ledger commit lost the push race\" without halting', async () => {\n const { executor } = stubExecutor();\n (executor as any).lastNonSyncCommitMessage = async () => 'feat: some change';\n (executor as any).checkoutFromRemote = async () => {};\n (executor as any).restoreWorkspace = async () => {};\n // The export half already succeeded; only the ledger commit that follows raced.\n (executor as any).snapAndExportOntoLane = async () => ({ status: 'exported' });\n (executor as any).recordLaneHeadOnBranch = async () => ({ status: 'raced' });\n\n const summary = await (executor as any).executeExportBranch({\n target: { hostScope: 'acme.shop', name: 'my-lane' },\n laneIdStr: 'acme.shop/my-lane',\n branch: 'my-lane',\n defaultBranch: 'main',\n });\n\n expect(summary).to.equal(\n 'my-lane -> raced (lane updated; branch ledger commit lost the push race — next run re-plans)'\n );\n expect(summary).to.not.include('HALTED');\n });\n});\n\n// Adoption never snaps or exports, so its raced line must NOT claim the lane was updated — the lane\n// is untouched and only the branch's pointer commit lost the race.\ndescribe('executeAdoptBranch reports a lane-untouched race when its ledger push races', () => {\n it('surfaces \"lane untouched; adoption ledger commit lost the push race\" without halting', async () => {\n const { executor } = stubExecutor();\n (executor as any).deps.ci = { hasUnsyncedWorkChanges: async () => false };\n (executor as any).checkoutFromRemote = async () => {};\n (executor as any).restoreWorkspace = async () => {};\n (executor as any).materializeLane = async () => undefined;\n (executor as any).recordLaneHeadOnBranch = async () => ({ status: 'raced' });\n\n const summary = await (executor as any).executeAdoptBranch({\n target: { hostScope: 'acme.shop', name: 'my-lane' },\n laneIdStr: 'acme.shop/my-lane',\n branch: 'my-lane',\n defaultBranch: 'main',\n });\n\n expect(summary).to.equal(\n 'my-lane -> raced (lane untouched; adoption ledger commit lost the push race — next run re-plans)'\n );\n expect(summary).to.not.include('lane updated');\n expect(summary).to.not.include('HALTED');\n });\n});\n\n// A destructive auto-resolution (onConflict git-wins/lane-wins) that already exported must not vanish\n// from the summary just because the ledger push raced.\ndescribe('racedLedgerPushSummary keeps the conflict-policy clause', () => {\n it('carries the merge path’s policyClause through the raced ledger line', () => {\n expect(racedLedgerPushSummary('my-lane', 'conflicts auto-resolved: git-wins on 3 file(s); ')).to.equal(\n 'my-lane -> raced (conflicts auto-resolved: git-wins on 3 file(s); lane updated; branch ledger commit ' +\n 'lost the push race — next run re-plans)'\n );\n });\n});\n\ndescribe('isProtectedBranch', () => {\n it('refuses the default branch and the main sync branch', () => {\n expect(isProtectedBranch('develop', 'develop', 'bit-sync/main')).to.equal(true);\n expect(isProtectedBranch('bit-sync/main', 'develop', 'bit-sync/main')).to.equal(true);\n });\n\n it('permits an ordinary lane branch', () => {\n expect(isProtectedBranch('my-lane', 'develop', 'bit-sync/main')).to.equal(false);\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,kBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,iBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAiBA,SAAAG,YAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,WAAA,YAAAA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c,CAAC;IAC9C,IAAAd,cAAM,EAACmC,OAAO,CAAC,CAAClC,EAAE,CAACI,GAAG,CAACS,OAAO,CAAC,QAAQ,CAAC;EAC1C,CAAC,CAAC;AACJ,CAAC,CAAC;;AAEF;AACA;AACApB,QAAQ,CAAC,yDAAyD,EAAE,MAAM;EACxEG,EAAE,CAAC,qEAAqE,EAAE,MAAM;IAC9E,IAAAG,cAAM,EAAC,IAAAsH,0CAAsB,EAAC,SAAS,EAAE,kDAAkD,CAAC,CAAC,CAACrH,EAAE,CAACE,KAAK,CACpG,uGAAuG,GACrG,yCACJ,CAAC;EACH,CAAC,CAAC;AACJ,CAAC,CAAC;AAEFT,QAAQ,CAAC,mBAAmB,EAAE,MAAM;EAClCG,EAAE,CAAC,qDAAqD,EAAE,MAAM;IAC9D,IAAAG,cAAM,EAAC,IAAAuH,qCAAiB,EAAC,SAAS,EAAE,SAAS,EAAE,eAAe,CAAC,CAAC,CAACtH,EAAE,CAACE,KAAK,CAAC,IAAI,CAAC;IAC/E,IAAAH,cAAM,EAAC,IAAAuH,qCAAiB,EAAC,eAAe,EAAE,SAAS,EAAE,eAAe,CAAC,CAAC,CAACtH,EAAE,CAACE,KAAK,CAAC,IAAI,CAAC;EACvF,CAAC,CAAC;EAEFN,EAAE,CAAC,iCAAiC,EAAE,MAAM;IAC1C,IAAAG,cAAM,EAAC,IAAAuH,qCAAiB,EAAC,SAAS,EAAE,SAAS,EAAE,eAAe,CAAC,CAAC,CAACtH,EAAE,CAACE,KAAK,CAAC,KAAK,CAAC;EAClF,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_chai","data","require","_laneSyncExecutor","_syncConfig","stubExecutor","warnings","executor","LaneSyncExecutor","lanes","ci","logger","console","consoleWarning","msg","push","error","gitHost","undefined","cfg","resolveSyncConfig","defaultScope","comp","id","head","toStringWithoutVersion","scope","split","describe","a","b","it","fingerprint","laneHeadFingerprint","expect","to","match","equal","moved","not","DEFAULT_SCOPE","ours","theirs","foreignLaneComponents","deep","namespaced","description","crossScopeDescription","include","ids","Array","from","length","_","index","LANE_HEAD","body","componentCount","laneSyncPrBody","laneIdStr","laneUrl","branch","laneHead","components","repeat","rendered","be","below","FOREIGN","summary","crossScopeSkipSummary","refusal","crossScopeRefusal","reason","crossScopeMidFlightHaltReason","branchMirrorsOtherLaneReason","note","branchMirrorsOtherLaneNote","throwingExecutor","gitHostCalls","noopLogger","debug","getDefaultBranchName","Error","name","findPrByBranch","number","htmlUrl","labels","addLabel","comment","fetched","syncLane","hostScope","dryRun","LANE_NAME","haltCommentBody","laneId","line","dryRunSummaryLine","type","forEach","contain","deleteBranch","EVIDENCE_SHA","MOVED_SHA","retirer","currentTip","pushError","pushes","currentBranchTip","pushBranchDeletion","sha","closePr","executeClosePr","laneName","defaultBranch","expectedTipSha","join","executorWithInheritance","inherited","branchInheritsBitmapFromDefault","mirroredLane","differentLaneStillClaims","executorWithAncestryResult","result","calls","hasIndependentHistoryBelowStateCommit","stateCommit","compute","ownership","computeHasIndependentHistory","BASE_SHA","REJECTION","classifier","baseSha","e","classifyPushRejection","classify","unrelated","lastNonSyncCommitMessage","checkoutFromRemote","restoreWorkspace","materializeLane","deps","hasUnsyncedWorkChanges","snapAndExportOntoLane","status","recordLaneHeadOnBranch","executeExportBranch","target","stubExport","currentLaneComponents","plannedLaneComponents","touched","getRemoteLane","run","preExportLane","L1","L2","stubMerge","snapStatus","summaryCalls","mergeLaneIntoBranchWorkingTree","conflicts","conflictedFileCount","remoteLane","postRunSummaryComment","args","executeMergeDiverged","have","lengthOf","executeAdoptBranch","racedLedgerPushSummary","isProtectedBranch","lane","updateDependents","laneSummaryComponents","map","c","before","after","changed","changedLaneComponents","stable","runSummaryCommentBody","branchTipSha","RUN_SUMMARY_MARKER","BEFORE","AFTER","executorWith","call","preComponents","postComponents","upserts","upsertComment","_n","_m","prNumber","marker"],"sources":["lane-sync-executor.spec.ts"],"sourcesContent":["import { expect } from 'chai';\nimport {\n branchMirrorsOtherLaneNote,\n branchMirrorsOtherLaneReason,\n changedLaneComponents,\n laneSummaryComponents,\n crossScopeDescription,\n crossScopeMidFlightHaltReason,\n crossScopeRefusal,\n crossScopeSkipSummary,\n dryRunSummaryLine,\n foreignLaneComponents,\n haltCommentBody,\n isProtectedBranch,\n laneHeadFingerprint,\n LaneSyncExecutor,\n laneSyncPrBody,\n racedLedgerPushSummary,\n RUN_SUMMARY_MARKER,\n runSummaryCommentBody,\n} from './lane-sync-executor';\nimport type { LaneOwnershipEvidence } from './sync-planner';\nimport { resolveSyncConfig } from './sync-config';\n\n/**\n * One stub executor for every seam-based test: real executor code over stubbed deps, no repository.\n * `warnings` collects `consoleWarning` lines for tests that assert on them.\n */\nfunction stubExecutor(): { executor: LaneSyncExecutor; warnings: string[] } {\n const warnings: string[] = [];\n const executor = new LaneSyncExecutor({\n lanes: {} as any,\n ci: {} as any,\n logger: { console: () => {}, consoleWarning: (msg: string) => warnings.push(msg), error: () => {} } as any,\n gitHost: undefined,\n cfg: resolveSyncConfig({}),\n defaultScope: 'acme.shop',\n });\n return { executor, warnings };\n}\n\ntype LaneComponents = Parameters<typeof laneHeadFingerprint>[0];\n\n/** A stand-in for `LaneData`'s component entry; the helpers only read the id string, scope and head. */\nfunction comp(id: string, head: string): LaneComponents[number] {\n return {\n id: { toStringWithoutVersion: () => id, scope: id.split('/', 1)[0] },\n head,\n } as unknown as LaneComponents[number];\n}\n\ndescribe('laneHeadFingerprint', () => {\n const a = comp('acme.shop/comp1', 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1');\n const b = comp('acme.shop/comp2', 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb2');\n\n it('is a single 40-hex token, so it survives being written into a commit trailer as an annotation', () => {\n const fingerprint = laneHeadFingerprint([a, b]);\n expect(fingerprint).to.match(/^[0-9a-f]{40}$/);\n });\n\n it('is stable under reordering: the remote listing order must not look like the lane moved', () => {\n expect(laneHeadFingerprint([a, b])).to.equal(laneHeadFingerprint([b, a]));\n });\n\n it('changes when a component head changes', () => {\n const moved = comp('acme.shop/comp2', 'cccccccccccccccccccccccccccccccccccccc33');\n expect(laneHeadFingerprint([a, moved])).to.not.equal(laneHeadFingerprint([a, b]));\n });\n\n it('changes when a component is added or removed', () => {\n expect(laneHeadFingerprint([a])).to.not.equal(laneHeadFingerprint([a, b]));\n expect(laneHeadFingerprint([])).to.not.equal(laneHeadFingerprint([a]));\n });\n\n it('does not depend on the lane object, only on its content', () => {\n expect(laneHeadFingerprint([a, b])).to.equal(laneHeadFingerprint([comp('acme.shop/comp1', a.head), b]));\n });\n});\n\ndescribe('foreignLaneComponents', () => {\n const DEFAULT_SCOPE = 'acme.shop';\n const ours = comp('acme.shop/comp1', 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1');\n const theirs = comp('other.scope/comp2', 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb2');\n\n it('is empty for a lane whose components are all in the repository scope', () => {\n expect(foreignLaneComponents([ours], DEFAULT_SCOPE)).to.deep.equal([]);\n expect(foreignLaneComponents([], DEFAULT_SCOPE)).to.deep.equal([]);\n });\n\n it('names every component outside the repository scope', () => {\n expect(foreignLaneComponents([ours, theirs], DEFAULT_SCOPE)).to.deep.equal(['other.scope/comp2']);\n });\n\n it('compares the scope, not the id prefix: a namespaced component of our scope is ours', () => {\n // `acme.shop/ui/button` must not read as scope `acme.shop/ui`.\n const namespaced = comp('acme.shop/ui/button', 'ccccccccccccccccccccccccccccccccccccc333');\n expect(foreignLaneComponents([namespaced], DEFAULT_SCOPE)).to.deep.equal([]);\n });\n\n it('treats a lane hosted elsewhere but filled with our components as ours (hosting != content)', () => {\n expect(foreignLaneComponents([ours], DEFAULT_SCOPE)).to.deep.equal([]);\n });\n});\n\ndescribe('crossScopeDescription', () => {\n const DEFAULT_SCOPE = 'acme.shop';\n\n it('names the foreign scopes and this repository scope', () => {\n const description = crossScopeDescription(['other.scope/comp2', 'third.scope/comp3'], DEFAULT_SCOPE);\n expect(description).to.include('components from scope(s) other.scope, third.scope');\n expect(description).to.include(`(this repo maps scope ${DEFAULT_SCOPE})`);\n expect(description).to.include('foreign components: other.scope/comp2, third.scope/comp3');\n });\n\n it('lists at most five foreign components and summarizes the rest', () => {\n const ids = Array.from({ length: 8 }, (_, index) => `other.scope/comp${index}`);\n const description = crossScopeDescription(ids, DEFAULT_SCOPE);\n expect(description).to.include('other.scope/comp4');\n expect(description).to.not.include('other.scope/comp5');\n expect(description).to.include('…and 3 more');\n });\n\n it('does not append a count when everything is listed', () => {\n expect(crossScopeDescription(['other.scope/comp1'], DEFAULT_SCOPE)).to.not.include('more');\n });\n});\n\n// GitHub rejects a PR whose body exceeds 65,536 characters, whole-request; a lane has no size limit.\ndescribe('laneSyncPrBody', () => {\n const LANE_HEAD = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1';\n\n function body(componentCount: number) {\n return laneSyncPrBody({\n laneIdStr: 'acme.shop/my-lane',\n laneUrl: 'https://bit.cloud/acme/shop/~lane/my-lane',\n branch: 'my-lane',\n laneHead: LANE_HEAD,\n components: Array.from({ length: componentCount }, (_, index) =>\n comp(`acme.shop/namespace/component-with-a-realistic-name-${index}`, `${'0'.repeat(39)}${index % 10}`)\n ),\n });\n }\n\n it('lists at most twenty components and summarizes the rest, keeping the exact total', () => {\n const rendered = body(100);\n expect(rendered).to.include('component-with-a-realistic-name-19');\n expect(rendered).to.not.include('component-with-a-realistic-name-20');\n expect(rendered).to.include('and 80 more');\n expect(rendered).to.include('Components on the lane (100):');\n expect(rendered).to.include(`lane head: \\`${LANE_HEAD}\\``);\n });\n\n it('stays far inside a git host body limit for a lane of any size', () => {\n expect(body(100).length).to.be.below(60000);\n expect(body(5000).length).to.be.below(60000);\n });\n\n it('lists a small lane in full, with no summary line', () => {\n const rendered = body(3);\n expect(rendered).to.include('component-with-a-realistic-name-2');\n expect(rendered).to.not.include('more');\n expect(rendered).to.include('Components on the lane (3):');\n });\n\n it('says so explicitly when the lane has no components', () => {\n expect(body(0)).to.include('_none_');\n });\n});\n\ndescribe('cross-scope outcome messages', () => {\n const DEFAULT_SCOPE = 'acme.shop';\n const FOREIGN = ['other.scope/comp2'];\n\n it('an enumerated lane is SKIPPED, in the vocabulary of a healthy run', () => {\n const summary = crossScopeSkipSummary('my-lane', FOREIGN, DEFAULT_SCOPE);\n expect(summary).to.match(/^my-lane -> skipped \\(cross-scope lane: /);\n expect(summary).to.include('no branch created');\n // A HALTED/REFUSED marker in this line would flip the exit code of a healthy repository.\n expect(summary).to.not.include('HALTED');\n expect(summary).to.not.include('REFUSED');\n });\n\n it('an explicitly requested lane is REFUSED, with the reason and the \"nothing was written\" promise', () => {\n const refusal = crossScopeRefusal(FOREIGN, DEFAULT_SCOPE);\n expect(refusal).to.include('cross-scope lane: components from scope(s) other.scope');\n expect(refusal).to.include(\"not supported yet — see the docs' Cross-scope lanes section\");\n expect(refusal).to.include('No branch was created and nothing was written');\n });\n\n it('the refusal does not claim it created no branch when a branch already exists', () => {\n const refusal = crossScopeRefusal(FOREIGN, DEFAULT_SCOPE, 'my-lane');\n expect(refusal).to.include('Nothing was written; the existing branch my-lane was left untouched');\n expect(refusal).to.not.include('No branch was created');\n });\n\n it('a lane that became cross-scope mid-flight names the branch it can no longer converge with', () => {\n const reason = crossScopeMidFlightHaltReason('my-lane', FOREIGN, DEFAULT_SCOPE);\n expect(reason).to.include('lane became cross-scope after it was mirrored onto my-lane');\n expect(reason).to.include('can no longer be reconciled automatically');\n });\n});\n\ndescribe('branchMirrorsOtherLaneReason', () => {\n it('names the branch, the lane that owns it, and the lane that was refused', () => {\n const reason = branchMirrorsOtherLaneReason('release', 'other.scope/release', 'acme.shop/release');\n expect(reason).to.include('branch release mirrors lane other.scope/release');\n expect(reason).to.include('refusing to plan for acme.shop/release');\n expect(reason).to.include(\"overwrite the other lane's mirror\");\n });\n\n it('the PR comment tells the branch owner their lane is fine, and not to run the usual steps', () => {\n const note = branchMirrorsOtherLaneNote('other.scope/release', 'acme.shop/release');\n expect(note).to.include('belongs to lane `other.scope/release`');\n expect(note).to.include('nothing is wrong with it');\n expect(note).to.include('acme.shop/release');\n expect(note).to.match(/Do NOT run the usual \"bit lane import\" resolution steps/);\n expect(note).to.include('rename one of the two lanes');\n expect(note).to.include('`branches`');\n });\n});\n\n// The executor is real; `getDefaultBranchName` throwing is the seam — the first dependency\n// `reconcileLane` awaits after the fetch, so the throw reaches the outer catch with no git/network work.\ndescribe('syncLane outer catch under --dry-run', () => {\n function throwingExecutor(gitHostCalls: string[]): LaneSyncExecutor {\n const noopLogger = { console: () => {}, consoleWarning: () => {}, error: () => {}, debug: () => {} };\n const executor = new LaneSyncExecutor({\n lanes: {} as any,\n ci: {\n getDefaultBranchName: async () => {\n throw new Error('boom');\n },\n } as any,\n logger: noopLogger as any,\n gitHost: {\n name: 'stub',\n findPrByBranch: async () => {\n gitHostCalls.push('findPrByBranch');\n return { number: 7, htmlUrl: 'https://example.test/pr/7', labels: [] };\n },\n addLabel: async () => {\n gitHostCalls.push('addLabel');\n },\n comment: async () => {\n gitHostCalls.push('comment');\n },\n } as any,\n cfg: resolveSyncConfig({}),\n defaultScope: 'acme.shop',\n });\n // Mark the fetch done so the spec never touches a repository or the network.\n (executor as any).fetched = true;\n return executor;\n }\n\n it('reports the halt without reading, labelling or commenting on the PR', async () => {\n const gitHostCalls: string[] = [];\n const summary = await throwingExecutor(gitHostCalls).syncLane(\n { hostScope: 'acme.shop', name: 'my-lane' },\n { dryRun: true }\n );\n expect(summary).to.equal('HALTED my-lane -> unexpected error: boom');\n expect(gitHostCalls).to.deep.equal([]);\n });\n\n it('is non-vacuous: without --dry-run the same failure does read, label and comment the PR', async () => {\n const gitHostCalls: string[] = [];\n const summary = await throwingExecutor(gitHostCalls).syncLane({ hostScope: 'acme.shop', name: 'my-lane' });\n expect(summary).to.equal('HALTED my-lane -> unexpected error: boom');\n expect(gitHostCalls).to.deep.equal(['findPrByBranch', 'addLabel', 'comment']);\n });\n\n // '-hostile' is a legal bit lane name (the charset allows a leading '-') that can never be a branch.\n it('a lane whose name cannot map to a branch halts report-only instead of throwing', async () => {\n const gitHostCalls: string[] = [];\n const summary = await throwingExecutor(gitHostCalls).syncLane({ hostScope: 'acme.shop', name: '-hostile' });\n expect(summary).to.match(/^HALTED -hostile -> unexpected error: .*not a valid git branch name/);\n expect(gitHostCalls).to.deep.equal([]);\n });\n});\n\n// bit's lane-name charset admits `$`, `-`, `_` and `!`, so an unquoted runbook shell-expands when pasted.\ndescribe('haltCommentBody', () => {\n const LANE_NAME = 'fix-$home-and-!bang';\n\n it('single-quotes every value it interpolates into a command', () => {\n const body = haltCommentBody({\n reason: 'merge conflicts in: acme.shop/comp1',\n branch: LANE_NAME,\n laneId: `acme.shop/${LANE_NAME}`,\n });\n expect(body).to.include(`git fetch origin && git checkout '${LANE_NAME}'`);\n expect(body).to.include(`bit lane import 'acme.shop/${LANE_NAME}'`);\n expect(body).to.include(`git push origin '${LANE_NAME}'`);\n // the reason is prose, not a command, and the runbook still reads as one\n expect(body).to.include('merge conflicts in: acme.shop/comp1');\n expect(body).to.include('Remove the `bit-sync-conflict` label to resume syncing.');\n });\n\n // A configured `branches` override only has to be a valid git ref, and git accepts a quote in one.\n it('escapes a value that itself contains a quote, rather than ending the quoting early', () => {\n const body = haltCommentBody({ reason: 'x', branch: \"it's-a-branch\", laneId: 'acme.shop/lane' });\n expect(body).to.include(`git checkout 'it'\\\\''s-a-branch'`);\n });\n\n it('leaves an overriding note alone: it carries no commands to quote', () => {\n const body = haltCommentBody({ reason: 'x', branch: LANE_NAME, laneId: 'acme.shop/lane', note: 'nothing to do' });\n expect(body).to.include('nothing to do');\n expect(body).to.not.include('git checkout');\n });\n});\n\n// `summarizeSync` decides the exit code by scanning for the prefix and nothing else, so a prefix-less\n// line makes a dry run report success on a plan the real run would have halted on.\ndescribe('dryRunSummaryLine', () => {\n it('carries the HALTED prefix and the reason for a planned halt, so the run exits non-zero', () => {\n const line = dryRunSummaryLine('my-lane', { type: 'halt', reason: 'cannot tell which side is newer' });\n expect(line).to.equal('HALTED my-lane -> cannot tell which side is newer');\n });\n\n it('leaves every other planned action unprefixed — those runs are healthy', () => {\n (['import-lane', 'export-branch', 'merge-diverged'] as const).forEach((type) => {\n const line = dryRunSummaryLine('my-lane', { type });\n expect(line, type).to.equal(`my-lane -> ${type}`);\n expect(line, type).to.not.contain('HALTED');\n expect(line, type).to.not.contain('REFUSED');\n });\n expect(dryRunSummaryLine('my-lane', { type: 'noop', reason: 'converged' })).to.equal('my-lane -> noop');\n expect(dryRunSummaryLine('my-lane', { type: 'close-pr', deleteBranch: true })).to.equal('my-lane -> close-pr');\n });\n});\n\n// The deletion decision is computed from refs fetched once per run; on an `--all` run the branch can\n// advance while earlier lanes are reconciled. Both seams are stubbed, so no repository is touched.\ndescribe('close-pr re-verifies the tip before retiring a branch', () => {\n const EVIDENCE_SHA = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1';\n const MOVED_SHA = 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb2';\n\n function retirer(currentTip: string | undefined, pushError?: Error) {\n const { executor, warnings } = stubExecutor();\n const pushes: string[][] = [];\n (executor as any).currentBranchTip = async () => currentTip;\n (executor as any).pushBranchDeletion = async (branch: string, sha: string) => {\n pushes.push([branch, sha]);\n if (pushError) throw pushError;\n };\n const closePr = () =>\n (executor as any).executeClosePr({\n laneName: 'my-lane',\n laneIdStr: 'acme.shop/my-lane',\n branch: 'my-lane',\n defaultBranch: 'main',\n deleteBranch: true,\n expectedTipSha: EVIDENCE_SHA,\n }) as Promise<string>;\n return { closePr, warnings, pushes };\n }\n\n it('deletes at the evidence sha while the branch is still there', async () => {\n const { closePr, pushes } = retirer(EVIDENCE_SHA);\n expect(await closePr()).to.equal('my-lane -> close-pr (no open PR, branch my-lane deleted)');\n expect(pushes).to.deep.equal([['my-lane', EVIDENCE_SHA]]);\n });\n\n it('KEEPS the branch when the tip moved during the run, pushing nothing at all', async () => {\n const { closePr, warnings, pushes } = retirer(MOVED_SHA);\n const summary = await closePr();\n expect(summary).to.contain('branch my-lane kept: its tip advanced after the ownership evidence was read');\n expect(pushes).to.deep.equal([]);\n expect(warnings.join('\\n')).to.contain(`its tip is now ${MOVED_SHA} rather than the ${EVIDENCE_SHA}`);\n });\n\n it('keeps the branch when the tip cannot be re-read at all, rather than trusting the stale answer', async () => {\n const { closePr, pushes } = retirer(undefined);\n expect(await closePr()).to.contain('branch my-lane kept: its tip advanced');\n expect(pushes).to.deep.equal([]);\n });\n\n // The re-read and the push are not atomic; the server gets the last word, and it is not a crash.\n it('reports a lease refusal as the same kept outcome', async () => {\n const { closePr, warnings } = retirer(\n EVIDENCE_SHA,\n new Error('! [rejected] (delete) -> my-lane (stale info)\\nerror: failed to push some refs')\n );\n expect(await closePr()).to.contain('branch my-lane kept: its tip advanced');\n expect(warnings.join('\\n')).to.contain('the remote refused the lease');\n });\n\n it('an unrelated push failure still reads as \"left in place\", not as a race', async () => {\n const { closePr } = retirer(EVIDENCE_SHA, new Error('remote: GH006: Protected branch update failed'));\n expect(await closePr()).to.equal('my-lane -> close-pr (no open PR, branch my-lane left in place)');\n });\n});\n\ndescribe('differentLaneStillClaims uses .bitmap blob equality, not commit reachability', () => {\n function executorWithInheritance(inherited: boolean) {\n const executor = new LaneSyncExecutor({\n lanes: {} as any,\n ci: {} as any,\n logger: { console: () => {}, consoleWarning: () => {}, error: () => {} } as any,\n gitHost: undefined,\n cfg: resolveSyncConfig({}),\n defaultScope: 'acme.shop',\n });\n (executor as any).branchInheritsBitmapFromDefault = async () => inherited;\n return (mirroredLane: string | undefined, laneIdStr: string) =>\n (executor as any).differentLaneStillClaims(mirroredLane, laneIdStr, 'my-branch', 'main') as Promise<boolean>;\n }\n\n it('does not claim when there is no mirrored lane pointer at all — never even checks the blob', async () => {\n const differentLaneStillClaims = executorWithInheritance(true);\n expect(await differentLaneStillClaims(undefined, 'acme.shop/my-lane')).to.equal(false);\n });\n\n it(\"does not claim for this lane's own pointer — never even checks the blob\", async () => {\n const differentLaneStillClaims = executorWithInheritance(true);\n expect(await differentLaneStillClaims('acme.shop/my-lane', 'acme.shop/my-lane')).to.equal(false);\n });\n\n it(\"does not claim when the different-lane .bitmap is byte-identical to the default branch's — inherited\", async () => {\n const differentLaneStillClaims = executorWithInheritance(true);\n expect(await differentLaneStillClaims('acme.shop/other-lane', 'acme.shop/my-lane')).to.equal(false);\n });\n\n it(\"STILL claims when the different-lane .bitmap has diverged from the default branch's — halt, not adopt\", async () => {\n const differentLaneStillClaims = executorWithInheritance(false);\n expect(await differentLaneStillClaims('acme.shop/other-lane', 'acme.shop/my-lane')).to.equal(true);\n });\n});\n\ndescribe('computeHasIndependentHistory gates the ancestry check to own-live claims with a state commit', () => {\n function executorWithAncestryResult(result: boolean) {\n const calls: Array<[string, string]> = [];\n const executor = new LaneSyncExecutor({\n lanes: {} as any,\n ci: {} as any,\n logger: { console: () => {}, consoleWarning: () => {}, error: () => {} } as any,\n gitHost: undefined,\n cfg: resolveSyncConfig({}),\n defaultScope: 'acme.shop',\n });\n (executor as any).hasIndependentHistoryBelowStateCommit = async (stateCommit: string, defaultBranch: string) => {\n calls.push([stateCommit, defaultBranch]);\n return result;\n };\n const compute = (ownership: LaneOwnershipEvidence, stateCommit: string | undefined, defaultBranch: string) =>\n (executor as any).computeHasIndependentHistory(ownership, stateCommit, defaultBranch) as Promise<boolean>;\n return { compute, calls };\n }\n\n it('skips the ancestry check entirely for a reachable claim (own-merged)', async () => {\n const { compute, calls } = executorWithAncestryResult(true);\n expect(await compute('own-merged', 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1', 'main')).to.equal(false);\n expect(calls).to.deep.equal([]);\n });\n\n it('skips the ancestry check entirely for own-superseded too', async () => {\n const { compute, calls } = executorWithAncestryResult(true);\n expect(await compute('own-superseded', 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1', 'main')).to.equal(false);\n expect(calls).to.deep.equal([]);\n });\n\n it('skips the check when there is no state commit to inspect, even for an own-live claim', async () => {\n const { compute, calls } = executorWithAncestryResult(true);\n expect(await compute('own-live', undefined, 'main')).to.equal(false);\n expect(calls).to.deep.equal([]);\n });\n\n it('defers to the ancestry check for an own-live claim with a state commit', async () => {\n const { compute, calls } = executorWithAncestryResult(true);\n expect(await compute('own-live', 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1', 'main')).to.equal(true);\n expect(calls).to.deep.equal([['aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1', 'main']]);\n });\n});\n\ndescribe('classifyPushRejection confirms a race before calling it one', () => {\n const BASE_SHA = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1';\n const MOVED_SHA = 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb2';\n const REJECTION = new Error('! [rejected] HEAD -> feature (fetch first)\\nerror: failed to push some refs');\n\n function classifier(currentTip: string | undefined) {\n const { executor } = stubExecutor();\n (executor as any).currentBranchTip = async () => currentTip;\n return (baseSha: string | undefined, e: Error) =>\n (executor as any).classifyPushRejection('my-branch', baseSha, e) as Promise<'confirmed-race' | 'not-a-race'>;\n }\n\n it('confirms the race when the branch actually moved off the base we pushed against', async () => {\n const classify = classifier(MOVED_SHA);\n expect(await classify(BASE_SHA, REJECTION)).to.equal('confirmed-race');\n });\n\n it('confirms the race for a brand-new branch that now exists on the remote', async () => {\n const classify = classifier(MOVED_SHA);\n expect(await classify(undefined, REJECTION)).to.equal('confirmed-race');\n });\n\n // Message-text matching alone is not proof: a persistent, unrelated rejection could repeat the same\n // wording forever. Without this re-fetch-and-compare, that would go permanently green.\n it('answers not-a-race when the branch did NOT move — the wording matched but nothing raced', async () => {\n const classify = classifier(BASE_SHA);\n expect(await classify(BASE_SHA, REJECTION)).to.equal('not-a-race');\n });\n\n it('answers not-a-race when a brand-new branch still does not exist on the remote', async () => {\n const classify = classifier(undefined);\n expect(await classify(undefined, REJECTION)).to.equal('not-a-race');\n });\n\n // The polarity bug this guards: `currentTip === undefined` here means the re-fetch FAILED (network\n // blip, auth hiccup) — unknown, not evidence the branch moved. `undefined !== baseSha` reads as\n // truthy if compared naively, which would misreport an unanswerable check as a confirmed race and\n // paper over a real, persistent failure. Withhold like every other unknown-answer path in this file.\n it('answers not-a-race when the re-fetch itself fails, even though a base sha is known', async () => {\n const classify = classifier(undefined);\n expect(await classify(BASE_SHA, REJECTION)).to.equal('not-a-race');\n });\n\n it('answers not-a-race for a rejection whose wording is not a non-fast-forward race at all', async () => {\n const classify = classifier(MOVED_SHA);\n const unrelated = new Error('remote: GH006: Protected branch update failed');\n expect(await classify(BASE_SHA, unrelated)).to.equal('not-a-race');\n });\n});\n\n// The live incident's actual shape: the snap/export onto the lane already succeeded — the lane truly\n// moved — and only the branch's OWN ledger-commit push (recordLaneHeadOnBranch) lost the race. Nothing\n// exercised `racedLedgerPushSummary` before this; a wording regression there would have gone unnoticed.\ndescribe('executeExportBranch reports the ledger-race wording when only the ledger push races', () => {\n it('surfaces \"lane updated; branch ledger commit lost the push race\" without halting', async () => {\n const { executor } = stubExecutor();\n (executor as any).lastNonSyncCommitMessage = async () => 'feat: some change';\n (executor as any).checkoutFromRemote = async () => {};\n (executor as any).restoreWorkspace = async () => {};\n (executor as any).materializeLane = async () => undefined;\n (executor as any).deps.ci = { hasUnsyncedWorkChanges: async () => true };\n // The export half already succeeded; only the ledger commit that follows raced.\n (executor as any).snapAndExportOntoLane = async () => ({ status: 'exported' });\n (executor as any).recordLaneHeadOnBranch = async () => ({ status: 'raced' });\n\n const summary = await (executor as any).executeExportBranch({\n target: { hostScope: 'acme.shop', name: 'my-lane' },\n laneIdStr: 'acme.shop/my-lane',\n branch: 'my-lane',\n defaultBranch: 'main',\n });\n\n expect(summary).to.equal(\n 'my-lane -> raced (lane updated; branch ledger commit lost the push race — next run re-plans)'\n );\n expect(summary).to.not.include('HALTED');\n });\n});\n\n// The probe's \"clean\" answer means converged only against the lane the PLAN read. A lane that moved\n// in between must re-plan — comparing the branch's files with the newer lane would misread the\n// lane's own advance as branch work and export a revert over a concurrent developer's export.\ndescribe('executeExportBranch bails when the lane moved since planning', () => {\n function stubExport(currentLaneComponents: LaneComponents, plannedLaneComponents: LaneComponents) {\n const { executor } = stubExecutor();\n const touched: string[] = [];\n (executor as any).checkoutFromRemote = async () => {};\n (executor as any).restoreWorkspace = async () => {};\n (executor as any).materializeLane = async () => undefined;\n (executor as any).lastNonSyncCommitMessage = async () => 'feat: some change';\n (executor as any).getRemoteLane = async () => ({ components: currentLaneComponents });\n (executor as any).deps.ci = {\n hasUnsyncedWorkChanges: async () => {\n touched.push('status');\n return false;\n },\n };\n (executor as any).snapAndExportOntoLane = async () => {\n touched.push('snap');\n return { status: 'exported' };\n };\n const run = () =>\n (executor as any).executeExportBranch({\n target: { hostScope: 'acme.shop', name: 'my-lane' },\n laneIdStr: 'acme.shop/my-lane',\n branch: 'my-lane',\n defaultBranch: 'main',\n preExportLane: { components: plannedLaneComponents },\n }) as Promise<string>;\n return { run, touched };\n }\n\n const L1 = [comp('acme.shop/comp1', 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1')];\n const L2 = [comp('acme.shop/comp1', 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb2')];\n\n it('a moved lane returns a re-plan noop before the status read or any snap', async () => {\n const { run, touched } = stubExport(L2, L1);\n const summary = await run();\n expect(summary).to.include('my-lane -> noop');\n expect(summary).to.include('moved');\n expect(touched).to.deep.equal([]);\n });\n\n it('an unmoved lane proceeds to the probe', async () => {\n const { run, touched } = stubExport(L1, L1);\n const summary = await run();\n expect(summary).to.include('my-lane -> noop (converged)');\n expect(touched).to.deep.equal(['status']);\n });\n});\n\n// The merge path snaps whatever the merge produced — which can be nothing new, now routinely: a\n// source-bundling tip plus a moved lane plans merge-diverged, and a branch with nothing of its own\n// merges clean and leaves the snap a noop. The summary must say so, and the run-summary comment\n// belongs only to runs that actually exported.\ndescribe('executeMergeDiverged distinguishes an exporting merge from a nothing-new merge', () => {\n function stubMerge(snapStatus: 'noop' | 'exported', currentLaneComponents: LaneComponents = []) {\n const { executor } = stubExecutor();\n const summaryCalls: any[] = [];\n (executor as any).checkoutFromRemote = async () => {};\n (executor as any).restoreWorkspace = async () => {};\n (executor as any).getRemoteLane = async () => ({ components: currentLaneComponents });\n (executor as any).mergeLaneIntoBranchWorkingTree = async () => ({ conflicts: [], conflictedFileCount: 0 });\n (executor as any).snapAndExportOntoLane = async () => ({ status: snapStatus });\n (executor as any).recordLaneHeadOnBranch = async () => ({\n status: 'ok',\n laneHead: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1',\n remoteLane: { components: [] },\n });\n (executor as any).postRunSummaryComment = async (args: any) => summaryCalls.push(args);\n const run = () =>\n (executor as any).executeMergeDiverged({\n target: { hostScope: 'acme.shop', name: 'my-lane' },\n laneIdStr: 'acme.shop/my-lane',\n branch: 'my-lane',\n defaultBranch: 'main',\n preExportLane: { components: [] },\n }) as Promise<string>;\n return { run, summaryCalls };\n }\n\n it('a nothing-new merge says so, and posts no run summary', async () => {\n const { run, summaryCalls } = stubMerge('noop');\n const summary = await run();\n expect(summary).to.include('my-lane -> merge-diverged');\n expect(summary).to.include('nothing new to export');\n expect(summary).to.not.include('then exported');\n expect(summaryCalls).to.have.lengthOf(0);\n });\n\n it('an exporting merge keeps the exported wording and posts the run summary', async () => {\n const { run, summaryCalls } = stubMerge('exported');\n const summary = await run();\n expect(summary).to.include('then exported');\n expect(summaryCalls).to.have.lengthOf(1);\n expect(summaryCalls[0].laneHead).to.equal('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1');\n });\n\n // Same freshness rule as the export probe: the plan's inputs must still describe the world.\n it('a lane that moved since planning bails to a re-plan before merging anything', async () => {\n const moved = [comp('acme.shop/comp1', 'ccccccccccccccccccccccccccccccccccccccc3')];\n const { run, summaryCalls } = stubMerge('exported', moved);\n const summary = await run();\n expect(summary).to.include('my-lane -> noop');\n expect(summary).to.include('moved');\n expect(summaryCalls).to.have.lengthOf(0);\n });\n});\n\n// Adoption never snaps or exports, so its raced line must NOT claim the lane was updated — the lane\n// is untouched and only the branch's pointer commit lost the race.\ndescribe('executeAdoptBranch reports a lane-untouched race when its ledger push races', () => {\n it('surfaces \"lane untouched; adoption ledger commit lost the push race\" without halting', async () => {\n const { executor } = stubExecutor();\n (executor as any).deps.ci = { hasUnsyncedWorkChanges: async () => false };\n (executor as any).checkoutFromRemote = async () => {};\n (executor as any).restoreWorkspace = async () => {};\n (executor as any).materializeLane = async () => undefined;\n (executor as any).recordLaneHeadOnBranch = async () => ({ status: 'raced' });\n\n const summary = await (executor as any).executeAdoptBranch({\n target: { hostScope: 'acme.shop', name: 'my-lane' },\n laneIdStr: 'acme.shop/my-lane',\n branch: 'my-lane',\n defaultBranch: 'main',\n });\n\n expect(summary).to.equal(\n 'my-lane -> raced (lane untouched; adoption ledger commit lost the push race — next run re-plans)'\n );\n expect(summary).to.not.include('lane updated');\n expect(summary).to.not.include('HALTED');\n });\n});\n\n// A destructive auto-resolution (onConflict git-wins/lane-wins) that already exported must not vanish\n// from the summary just because the ledger push raced.\ndescribe('racedLedgerPushSummary keeps the conflict-policy clause', () => {\n it('carries the merge path’s policyClause through the raced ledger line', () => {\n expect(racedLedgerPushSummary('my-lane', 'conflicts auto-resolved: git-wins on 3 file(s); ')).to.equal(\n 'my-lane -> raced (conflicts auto-resolved: git-wins on 3 file(s); lane updated; branch ledger commit ' +\n 'lost the push race — next run re-plans)'\n );\n });\n});\n\ndescribe('isProtectedBranch', () => {\n it('refuses the default branch and the main sync branch', () => {\n expect(isProtectedBranch('develop', 'develop', 'bit-sync/main')).to.equal(true);\n expect(isProtectedBranch('bit-sync/main', 'develop', 'bit-sync/main')).to.equal(true);\n });\n\n it('permits an ordinary lane branch', () => {\n expect(isProtectedBranch('my-lane', 'develop', 'bit-sync/main')).to.equal(false);\n });\n});\n\ndescribe('laneSummaryComponents', () => {\n it('includes hidden updateDependents — a cascade export must not read as \"nothing changed\"', () => {\n const lane = {\n components: [comp('acme.shop/comp1', 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1')],\n updateDependents: [comp('acme.shop/dep1', 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb2')],\n } as any;\n expect(laneSummaryComponents(lane).map((c) => c.id.toStringWithoutVersion())).to.deep.equal([\n 'acme.shop/comp1',\n 'acme.shop/dep1',\n ]);\n });\n\n it('an absent lane lists nothing', () => {\n expect(laneSummaryComponents(undefined)).to.deep.equal([]);\n });\n});\n\ndescribe('changedLaneComponents', () => {\n it('includes a component new to the lane, and one whose head moved', () => {\n const before = [comp('acme.shop/comp1', 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1')];\n const after = [\n comp('acme.shop/comp1', 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb2'),\n comp('acme.shop/comp2', 'ccccccccccccccccccccccccccccccccccccccc3'),\n ];\n const changed = changedLaneComponents(before, after);\n expect(changed.map((c) => c.id.toStringWithoutVersion())).to.deep.equal(['acme.shop/comp1', 'acme.shop/comp2']);\n });\n\n it('excludes a component whose head did not move', () => {\n const stable = comp('acme.shop/comp1', 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1');\n expect(changedLaneComponents([stable], [stable])).to.deep.equal([]);\n });\n\n it('treats an undefined \"before\" (never seen this lane) as everything being new', () => {\n const after = [comp('acme.shop/comp1', 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1')];\n expect(changedLaneComponents(undefined, after)).to.deep.equal(after);\n });\n});\n\ndescribe('runSummaryCommentBody', () => {\n it('carries the marker, the changed components, and the branch/lane anchors', () => {\n const body = runSummaryCommentBody({\n laneIdStr: 'acme.shop/my-lane',\n laneUrl: 'https://bit.cloud/acme/shop/~lane/my-lane',\n branch: 'my-lane',\n branchTipSha: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1',\n laneHead: 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb2',\n changed: [comp('acme.shop/comp1', 'ccccccccccccccccccccccccccccccccccccccc3')],\n });\n expect(body).to.include(RUN_SUMMARY_MARKER);\n expect(body).to.include('acme.shop/comp1` @ `ccccccccc');\n expect(body).to.include('branch: `my-lane` @ `aaaaaaaaa`');\n // the lane anchor is a LINK — the reader lands on the lane, not on a name to copy-paste\n expect(body).to.include('lane: [`acme.shop/my-lane`](https://bit.cloud/acme/shop/~lane/my-lane) @ `bbbbbbbbb`');\n });\n\n it('says plainly that nothing changed, rather than an empty list', () => {\n const body = runSummaryCommentBody({\n laneIdStr: 'acme.shop/my-lane',\n laneUrl: 'https://bit.cloud/acme/shop/~lane/my-lane',\n branch: 'my-lane',\n branchTipSha: undefined,\n laneHead: 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb2',\n changed: [],\n });\n expect(body).to.include('none — nothing on the lane changed this run');\n expect(body).to.not.include('@ `undefined');\n });\n});\n\n// The comment is a pure surface effect: it must never gate the run's own outcome, and must degrade\n// silently through every \"nothing to comment on\" state a real host, PR or branch can be in.\ndescribe('postRunSummaryComment', () => {\n const BEFORE = [comp('acme.shop/comp1', 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1')];\n const AFTER = [comp('acme.shop/comp1', 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb2')];\n\n function executorWith(gitHost: any, warnings: string[] = []) {\n const executor = new LaneSyncExecutor({\n lanes: {} as any,\n ci: {} as any,\n logger: { console: () => {}, consoleWarning: (msg: string) => warnings.push(msg), error: () => {} } as any,\n gitHost,\n cfg: resolveSyncConfig({}),\n defaultScope: 'acme.shop',\n });\n (executor as any).currentBranchTip = async () => 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1';\n return executor;\n }\n\n const call = (executor: LaneSyncExecutor) =>\n (executor as any).postRunSummaryComment({\n target: { hostScope: 'acme.shop', name: 'my-lane' },\n laneIdStr: 'acme.shop/my-lane',\n branch: 'my-lane',\n laneHead: 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb2',\n branchTipSha: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1',\n preComponents: BEFORE,\n postComponents: AFTER,\n }) as Promise<void>;\n\n // The anchor is the ledger sha THIS run pushed — passed in, never refetched: a concurrent developer\n // push must not be presented as the synced tip, and no remote read exists to fail the path.\n it('anchors the body on the given pushed sha without any branch refetch', async () => {\n const upserts: string[] = [];\n const gitHost = {\n findPrByBranch: async () => ({ number: 7, htmlUrl: 'https://example.test/pr/7', labels: [] }),\n upsertComment: async (_n: number, _m: string, body: string) => upserts.push(body),\n };\n const executor = executorWith(gitHost);\n (executor as any).currentBranchTip = async () => {\n throw new Error('must not be called');\n };\n await call(executor);\n expect(upserts).to.have.lengthOf(1);\n expect(upserts[0]).to.include('branch: `my-lane` @ `aaaaaaaaa`');\n });\n\n it('upserts the marked comment on the open PR when the host supports it', async () => {\n const calls: any[] = [];\n const gitHost = {\n findPrByBranch: async () => ({ number: 7, htmlUrl: 'https://example.test/pr/7', labels: [] }),\n upsertComment: async (prNumber: number, marker: string, body: string) => {\n calls.push({ prNumber, marker, body });\n },\n };\n await call(executorWith(gitHost));\n expect(calls).to.have.lengthOf(1);\n expect(calls[0].prNumber).to.equal(7);\n expect(calls[0].marker).to.equal(RUN_SUMMARY_MARKER);\n expect(calls[0].body).to.include('acme.shop/comp1` @ `bbbbbbbbb');\n });\n\n it('is a no-op with no configured git host', async () => {\n await call(executorWith(undefined)); // would throw on any host call; nothing to assert but \"did not throw\"\n });\n\n it('is a no-op when the host does not implement upsertComment', async () => {\n const calls: any[] = [];\n const gitHost = {\n findPrByBranch: async () => {\n calls.push('findPrByBranch');\n return { number: 7, htmlUrl: 'https://example.test/pr/7', labels: [] };\n },\n };\n await call(executorWith(gitHost));\n // upsertComment is feature-tested BEFORE the PR lookup — an unsupported host must not even look up the PR.\n expect(calls).to.deep.equal([]);\n });\n\n it('is a no-op when the branch has no open PR yet', async () => {\n const calls: any[] = [];\n const gitHost = {\n findPrByBranch: async () => undefined,\n upsertComment: async () => {\n calls.push('upsertComment');\n },\n };\n await call(executorWith(gitHost));\n expect(calls).to.deep.equal([]);\n });\n\n it('warns and does not throw when the comment API call fails', async () => {\n const warnings: string[] = [];\n const gitHost = {\n findPrByBranch: async () => ({ number: 7, htmlUrl: 'https://example.test/pr/7', labels: [] }),\n upsertComment: async () => {\n throw new Error('rate limited');\n },\n };\n await call(executorWith(gitHost, warnings));\n expect(warnings.join('\\n')).to.contain('Could not post the run-summary comment');\n expect(warnings.join('\\n')).to.contain('rate limited');\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,kBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,iBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAqBA,SAAAG,YAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,WAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA;AACA;AACA;AACA;AACA,SAASI,YAAYA,CAAA,EAAuD;EAC1E,MAAMC,QAAkB,GAAG,EAAE;EAC7B,MAAMC,QAAQ,GAAG,KAAIC,oCAAgB,EAAC;IACpCC,KAAK,EAAE,CAAC,CAAQ;IAChBC,EAAE,EAAE,CAAC,CAAQ;IACbC,MAAM,EAAE;MAAE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CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -22,10 +22,20 @@ export type LaneSyncInput = {
|
|
|
22
22
|
lastSyncedHead?: string;
|
|
23
23
|
/** whether the branch carries commits on top of the commit that last wrote its `.bitmap` */
|
|
24
24
|
hasDevCommits: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Whether the state commit also touched non-`.bitmap` files — SUSPECTED work git cannot confirm (the
|
|
27
|
+
* files may already be inside the recorded snap). Content-only, so this reconciler's own
|
|
28
|
+
* source-bundling ledger commits read `true` too. Plans the probing `export-branch` when everything
|
|
29
|
+
* else reads converged; treated like dev commits everywhere a wrong "no work" answer could lose
|
|
30
|
+
* something (deletion, divergence, first contact).
|
|
31
|
+
*/
|
|
32
|
+
stateCommitBundlesSources?: boolean;
|
|
25
33
|
/**
|
|
26
34
|
* Whether the reconciler itself wrote the tip commit. The one exception to "markers are annotations":
|
|
27
|
-
* consulted only on the branch-deletion path
|
|
28
|
-
*
|
|
35
|
+
* consulted only on the branch-deletion path — to withhold a deletion, and to discount bundled
|
|
36
|
+
* sources our own ledger commit carries (no probe can run against a deleted lane). It must never
|
|
37
|
+
* decide convergence: a squash body quoting the marker forges it. Must be computed with
|
|
38
|
+
* `isSyncAuthoredMessage`, not the loop guard's substring match.
|
|
29
39
|
*/
|
|
30
40
|
tipIsSyncCommit: boolean;
|
|
31
41
|
/**
|
|
@@ -34,8 +34,16 @@ function planLaneSync(input) {
|
|
|
34
34
|
const {
|
|
35
35
|
tipIsSyncCommit,
|
|
36
36
|
hasIndependentHistory,
|
|
37
|
-
branchNamesDifferentLane
|
|
37
|
+
branchNamesDifferentLane,
|
|
38
|
+
stateCommitBundlesSources
|
|
38
39
|
} = input;
|
|
40
|
+
// Suspected-or-real work: everywhere a wrong "no work" answer could lose something, bundled sources
|
|
41
|
+
// count like dev commits — the executor's read-only probe is what tells them apart.
|
|
42
|
+
const mayCarryWork = hasDevCommits || Boolean(stateCommitBundlesSources);
|
|
43
|
+
// The deletion path cannot probe (the lane is gone), so there — and only there — the tip marker
|
|
44
|
+
// discounts the sources our own ledger commits bundle (import-lane writes the lane's files,
|
|
45
|
+
// merge-diverged the merged tree). Same message dependence, same direction, as it always had.
|
|
46
|
+
const mayCarryWorkForDeletion = hasDevCommits || Boolean(stateCommitBundlesSources) && !tipIsSyncCommit;
|
|
39
47
|
if (conflictLabelPresent) {
|
|
40
48
|
return {
|
|
41
49
|
type: 'noop',
|
|
@@ -49,11 +57,11 @@ function planLaneSync(input) {
|
|
|
49
57
|
};
|
|
50
58
|
switch (ownership) {
|
|
51
59
|
case 'own-live':
|
|
52
|
-
// Each check is a separate reason to withhold a delete:
|
|
53
|
-
//
|
|
60
|
+
// Each check is a separate reason to withhold a delete: real or suspected work exists nowhere
|
|
61
|
+
// else; a non-sync tip may be a developer's own `.bitmap` write; an adopted branch's
|
|
54
62
|
// pre-existing history was never proven disposable. A false keep is harmless, a false delete
|
|
55
63
|
// destroys the only copy.
|
|
56
|
-
if (
|
|
64
|
+
if (mayCarryWorkForDeletion) {
|
|
57
65
|
return {
|
|
58
66
|
type: 'close-pr',
|
|
59
67
|
deleteBranch: false,
|
|
@@ -103,14 +111,15 @@ function planLaneSync(input) {
|
|
|
103
111
|
type: 'import-lane'
|
|
104
112
|
};
|
|
105
113
|
if (!lastSyncedHead) {
|
|
106
|
-
if (
|
|
114
|
+
if (mayCarryWork) {
|
|
107
115
|
if (branchNamesDifferentLane) {
|
|
108
116
|
return {
|
|
109
117
|
type: 'halt',
|
|
110
118
|
reason: 'branch has commits but its .bitmap names a different lane; cannot tell which side is newer'
|
|
111
119
|
};
|
|
112
120
|
}
|
|
113
|
-
// The lane exists but the pair has no sync history: first contact, not a conflict
|
|
121
|
+
// The lane exists but the pair has no sync history: first contact, not a conflict — and
|
|
122
|
+
// adoption already probes via `bit status`, so bundled sources are safe to route here too.
|
|
114
123
|
return {
|
|
115
124
|
type: 'adopt-branch'
|
|
116
125
|
};
|
|
@@ -120,13 +129,13 @@ function planLaneSync(input) {
|
|
|
120
129
|
};
|
|
121
130
|
}
|
|
122
131
|
const laneMoved = laneHead !== lastSyncedHead;
|
|
123
|
-
if (laneMoved &&
|
|
132
|
+
if (laneMoved && mayCarryWork) return {
|
|
124
133
|
type: 'merge-diverged'
|
|
125
134
|
};
|
|
126
135
|
if (laneMoved) return {
|
|
127
136
|
type: 'import-lane'
|
|
128
137
|
};
|
|
129
|
-
if (
|
|
138
|
+
if (mayCarryWork) return {
|
|
130
139
|
type: 'export-branch'
|
|
131
140
|
};
|
|
132
141
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["planLaneSync","input","laneHead","branchExists","lastSyncedHead","hasDevCommits","conflictLabelPresent","ownership","tipIsSyncCommit","hasIndependentHistory","branchNamesDifferentLane","type","reason","deleteBranch","keepReason","laneMoved"],"sources":["sync-planner.ts"],"sourcesContent":["/**\n * How much of a claim this lane/branch pair has on `origin/<branch>` — the only thing that licenses\n * retiring it, because `close-pr` deletes the branch. Under the default config every branch name maps\n * to a same-named lane, and branches cut after a merged sync PR inherit its `.bitmap`, so \"looks\n * bit-managed\" is not enough. Evidence = attribution (the branch's `.bitmap` lane pointer) plus\n * reachability of the state commit / tip from the default branch:\n *\n * - `own-live` — names this lane; state commit not in the default branch (real, unmerged lane branch).\n * - `own-merged` — names this lane; branch tip already in the default branch (deleting loses nothing).\n * - `own-superseded` — state commit merged but tip not: close the PR, KEEP the branch.\n * - `inherited-or-none` — no pointer, another lane's, or unreadable: not ours, touch nothing.\n */\nexport type LaneOwnershipEvidence = 'own-live' | 'own-merged' | 'own-superseded' | 'inherited-or-none';\n\nexport type LaneSyncInput = {\n /** fingerprint of the lane's component heads on bit.cloud; undefined when the lane is gone */\n laneHead?: string;\n branchExists: boolean;\n /**\n * The lane-component fingerprint as the branch's committed `.bitmap` records it; undefined when the\n * branch holds no state for this lane. Equality with `laneHead` is the definition of converged.\n */\n lastSyncedHead?: string;\n /** whether the branch carries commits on top of the commit that last wrote its `.bitmap` */\n hasDevCommits: boolean;\n /**\n * Whether the reconciler itself wrote the tip commit. The one exception to \"markers are annotations\":\n * consulted only on the branch-deletion path, and only ever to WITHHOLD a deletion. Must be computed\n * with `isSyncAuthoredMessage`, not the loop guard's substring match.\n */\n tipIsSyncCommit: boolean;\n /**\n * The branch had real (non-bit) commits before this reconciler touched it — it was adopted, not\n * manufactured. Can only withhold a delete, never authorize one.\n */\n hasIndependentHistory?: boolean;\n conflictLabelPresent: boolean;\n /** The branch's committed `.bitmap` names a DIFFERENT lane — another lane's claim, never adopted. */\n branchNamesDifferentLane?: boolean;\n /** @see LaneOwnershipEvidence — consulted only on the \"lane is gone\" path. */\n ownership: LaneOwnershipEvidence;\n};\n\n/**\n * Why a `close-pr` is keeping the branch rather than deleting it. `tip-advanced-during-run` is the one\n * the planner never emits: it is discovered when the executor re-reads the branch just before deleting.\n */\nexport type BranchKeepReason =\n | 'unmerged-commits'\n | 'tip-not-a-sync-commit'\n | 'tip-advanced-during-run'\n | 'adopted-branch';\n\nexport type LaneSyncAction =\n | { type: 'noop'; reason: string }\n | { type: 'import-lane' }\n | { type: 'export-branch' }\n | { type: 'merge-diverged' }\n | { type: 'adopt-branch' }\n // Two variants rather than an optional `keepReason` so the type enforces that a keep always says why.\n | { type: 'close-pr'; deleteBranch: true }\n | { type: 'close-pr'; deleteBranch: false; keepReason: BranchKeepReason }\n | { type: 'halt'; reason: string };\n\nexport function planLaneSync(input: LaneSyncInput): LaneSyncAction {\n const { laneHead, branchExists, lastSyncedHead, hasDevCommits, conflictLabelPresent, ownership } = input;\n const { tipIsSyncCommit, hasIndependentHistory, branchNamesDifferentLane } = input;\n if (conflictLabelPresent) {\n return { type: 'noop', reason: 'PR is labeled bit-sync-conflict; resolve and remove the label to resume' };\n }\n if (!laneHead) {\n if (!branchExists) return { type: 'noop', reason: 'lane and branch both absent' };\n switch (ownership) {\n case 'own-live':\n // Each check is a separate reason to withhold a delete: dev commits are work that exists\n // nowhere else; a non-sync tip may be a developer's own `.bitmap` write; an adopted branch's\n // pre-existing history was never proven disposable. A false keep is harmless, a false delete\n // destroys the only copy.\n if (hasDevCommits) {\n return { type: 'close-pr', deleteBranch: false, keepReason: 'unmerged-commits' };\n }\n if (!tipIsSyncCommit) {\n return { type: 'close-pr', deleteBranch: false, keepReason: 'tip-not-a-sync-commit' };\n }\n if (hasIndependentHistory) {\n return { type: 'close-pr', deleteBranch: false, keepReason: 'adopted-branch' };\n }\n return { type: 'close-pr', deleteBranch: true };\n case 'own-merged':\n // No marker conjunction needed: the tip being an ancestor of the default branch is unforgeable\n // proof that deleting loses nothing.\n return { type: 'close-pr', deleteBranch: true };\n case 'own-superseded':\n // Those commits are in no other ref.\n return { type: 'close-pr', deleteBranch: false, keepReason: 'unmerged-commits' };\n default:\n return { type: 'noop', reason: 'branch maps to no lane and has no sync history of its own; ignoring' };\n }\n }\n if (!branchExists) return { type: 'import-lane' };\n if (!lastSyncedHead) {\n if (hasDevCommits) {\n if (branchNamesDifferentLane) {\n return {\n type: 'halt',\n reason: 'branch has commits but its .bitmap names a different lane; cannot tell which side is newer',\n };\n }\n // The lane exists but the pair has no sync history: first contact, not a conflict.\n return { type: 'adopt-branch' };\n }\n return { type: 'import-lane' };\n }\n const laneMoved = laneHead !== lastSyncedHead;\n if (laneMoved && hasDevCommits) return { type: 'merge-diverged' };\n if (laneMoved) return { type: 'import-lane' };\n if (hasDevCommits) return { type: 'export-branch' };\n return { type: 'noop', reason: 'converged' };\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAgCA;AACA;AACA;AACA;;AAkBO,SAASA,YAAYA,CAACC,KAAoB,EAAkB;EACjE,MAAM;IAAEC,QAAQ;IAAEC,YAAY;IAAEC,cAAc;IAAEC,aAAa;IAAEC,oBAAoB;IAAEC;EAAU,CAAC,GAAGN,KAAK;EACxG,MAAM;IAAEO,eAAe;IAAEC,qBAAqB;IAAEC;EAAyB,CAA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,MAAM;UACZC,MAAM,EAAE;QACV,CAAC;MACH;MACA;MACA,OAAO;QAAED,IAAI,EAAE;MAAe,CAAC;IACjC;IACA,OAAO;MAAEA,IAAI,EAAE;IAAc,CAAC;EAChC;EACA,MAAMI,SAAS,GAAGb,QAAQ,KAAKE,cAAc;EAC7C,IAAIW,SAAS,IAAIV,aAAa,EAAE,OAAO;IAAEM,IAAI,EAAE;EAAiB,CAAC;EACjE,IAAII,SAAS,EAAE,OAAO;IAAEJ,IAAI,EAAE;EAAc,CAAC;EAC7C,IAAIN,aAAa,EAAE,OAAO;IAAEM,IAAI,EAAE;EAAgB,CAAC;EACnD,OAAO;IAAEA,IAAI,EAAE,MAAM;IAAEC,MAAM,EAAE;EAAY,CAAC;AAC9C","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["planLaneSync","input","laneHead","branchExists","lastSyncedHead","hasDevCommits","conflictLabelPresent","ownership","tipIsSyncCommit","hasIndependentHistory","branchNamesDifferentLane","stateCommitBundlesSources","mayCarryWork","Boolean","mayCarryWorkForDeletion","type","reason","deleteBranch","keepReason","laneMoved"],"sources":["sync-planner.ts"],"sourcesContent":["/**\n * How much of a claim this lane/branch pair has on `origin/<branch>` — the only thing that licenses\n * retiring it, because `close-pr` deletes the branch. Under the default config every branch name maps\n * to a same-named lane, and branches cut after a merged sync PR inherit its `.bitmap`, so \"looks\n * bit-managed\" is not enough. Evidence = attribution (the branch's `.bitmap` lane pointer) plus\n * reachability of the state commit / tip from the default branch:\n *\n * - `own-live` — names this lane; state commit not in the default branch (real, unmerged lane branch).\n * - `own-merged` — names this lane; branch tip already in the default branch (deleting loses nothing).\n * - `own-superseded` — state commit merged but tip not: close the PR, KEEP the branch.\n * - `inherited-or-none` — no pointer, another lane's, or unreadable: not ours, touch nothing.\n */\nexport type LaneOwnershipEvidence = 'own-live' | 'own-merged' | 'own-superseded' | 'inherited-or-none';\n\nexport type LaneSyncInput = {\n /** fingerprint of the lane's component heads on bit.cloud; undefined when the lane is gone */\n laneHead?: string;\n branchExists: boolean;\n /**\n * The lane-component fingerprint as the branch's committed `.bitmap` records it; undefined when the\n * branch holds no state for this lane. Equality with `laneHead` is the definition of converged.\n */\n lastSyncedHead?: string;\n /** whether the branch carries commits on top of the commit that last wrote its `.bitmap` */\n hasDevCommits: boolean;\n /**\n * Whether the state commit also touched non-`.bitmap` files — SUSPECTED work git cannot confirm (the\n * files may already be inside the recorded snap). Content-only, so this reconciler's own\n * source-bundling ledger commits read `true` too. Plans the probing `export-branch` when everything\n * else reads converged; treated like dev commits everywhere a wrong \"no work\" answer could lose\n * something (deletion, divergence, first contact).\n */\n stateCommitBundlesSources?: boolean;\n /**\n * Whether the reconciler itself wrote the tip commit. The one exception to \"markers are annotations\":\n * consulted only on the branch-deletion path — to withhold a deletion, and to discount bundled\n * sources our own ledger commit carries (no probe can run against a deleted lane). It must never\n * decide convergence: a squash body quoting the marker forges it. Must be computed with\n * `isSyncAuthoredMessage`, not the loop guard's substring match.\n */\n tipIsSyncCommit: boolean;\n /**\n * The branch had real (non-bit) commits before this reconciler touched it — it was adopted, not\n * manufactured. Can only withhold a delete, never authorize one.\n */\n hasIndependentHistory?: boolean;\n conflictLabelPresent: boolean;\n /** The branch's committed `.bitmap` names a DIFFERENT lane — another lane's claim, never adopted. */\n branchNamesDifferentLane?: boolean;\n /** @see LaneOwnershipEvidence — consulted only on the \"lane is gone\" path. */\n ownership: LaneOwnershipEvidence;\n};\n\n/**\n * Why a `close-pr` is keeping the branch rather than deleting it. `tip-advanced-during-run` is the one\n * the planner never emits: it is discovered when the executor re-reads the branch just before deleting.\n */\nexport type BranchKeepReason =\n | 'unmerged-commits'\n | 'tip-not-a-sync-commit'\n | 'tip-advanced-during-run'\n | 'adopted-branch';\n\nexport type LaneSyncAction =\n | { type: 'noop'; reason: string }\n | { type: 'import-lane' }\n // May be a probe: the executor asks `bit status` (a read) whether the branch's tree holds anything\n // the lane is missing, and a clean answer settles as converged without writing or pushing a thing —\n // which is why planning it on mere suspicion, run after run, is harmless.\n | { type: 'export-branch' }\n | { type: 'merge-diverged' }\n | { type: 'adopt-branch' }\n // Two variants rather than an optional `keepReason` so the type enforces that a keep always says why.\n | { type: 'close-pr'; deleteBranch: true }\n | { type: 'close-pr'; deleteBranch: false; keepReason: BranchKeepReason }\n | { type: 'halt'; reason: string };\n\nexport function planLaneSync(input: LaneSyncInput): LaneSyncAction {\n const { laneHead, branchExists, lastSyncedHead, hasDevCommits, conflictLabelPresent, ownership } = input;\n const { tipIsSyncCommit, hasIndependentHistory, branchNamesDifferentLane, stateCommitBundlesSources } = input;\n // Suspected-or-real work: everywhere a wrong \"no work\" answer could lose something, bundled sources\n // count like dev commits — the executor's read-only probe is what tells them apart.\n const mayCarryWork = hasDevCommits || Boolean(stateCommitBundlesSources);\n // The deletion path cannot probe (the lane is gone), so there — and only there — the tip marker\n // discounts the sources our own ledger commits bundle (import-lane writes the lane's files,\n // merge-diverged the merged tree). Same message dependence, same direction, as it always had.\n const mayCarryWorkForDeletion = hasDevCommits || (Boolean(stateCommitBundlesSources) && !tipIsSyncCommit);\n if (conflictLabelPresent) {\n return { type: 'noop', reason: 'PR is labeled bit-sync-conflict; resolve and remove the label to resume' };\n }\n if (!laneHead) {\n if (!branchExists) return { type: 'noop', reason: 'lane and branch both absent' };\n switch (ownership) {\n case 'own-live':\n // Each check is a separate reason to withhold a delete: real or suspected work exists nowhere\n // else; a non-sync tip may be a developer's own `.bitmap` write; an adopted branch's\n // pre-existing history was never proven disposable. A false keep is harmless, a false delete\n // destroys the only copy.\n if (mayCarryWorkForDeletion) {\n return { type: 'close-pr', deleteBranch: false, keepReason: 'unmerged-commits' };\n }\n if (!tipIsSyncCommit) {\n return { type: 'close-pr', deleteBranch: false, keepReason: 'tip-not-a-sync-commit' };\n }\n if (hasIndependentHistory) {\n return { type: 'close-pr', deleteBranch: false, keepReason: 'adopted-branch' };\n }\n return { type: 'close-pr', deleteBranch: true };\n case 'own-merged':\n // No marker conjunction needed: the tip being an ancestor of the default branch is unforgeable\n // proof that deleting loses nothing.\n return { type: 'close-pr', deleteBranch: true };\n case 'own-superseded':\n // Those commits are in no other ref.\n return { type: 'close-pr', deleteBranch: false, keepReason: 'unmerged-commits' };\n default:\n return { type: 'noop', reason: 'branch maps to no lane and has no sync history of its own; ignoring' };\n }\n }\n if (!branchExists) return { type: 'import-lane' };\n if (!lastSyncedHead) {\n if (mayCarryWork) {\n if (branchNamesDifferentLane) {\n return {\n type: 'halt',\n reason: 'branch has commits but its .bitmap names a different lane; cannot tell which side is newer',\n };\n }\n // The lane exists but the pair has no sync history: first contact, not a conflict — and\n // adoption already probes via `bit status`, so bundled sources are safe to route here too.\n return { type: 'adopt-branch' };\n }\n return { type: 'import-lane' };\n }\n const laneMoved = laneHead !== lastSyncedHead;\n if (laneMoved && mayCarryWork) return { type: 'merge-diverged' };\n if (laneMoved) return { type: 'import-lane' };\n if (mayCarryWork) return { type: 'export-branch' };\n return { type: 'noop', reason: 'converged' };\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA0CA;AACA;AACA;AACA;;AAqBO,SAASA,YAAYA,CAACC,KAAoB,EAAkB;EACjE,MAAM;IAAEC,QAAQ;IAAEC,YAAY;IAAEC,cAAc;IAAEC,aAAa;IAAEC,oBAAoB;IAAEC;EAAU,CAAC,GAAGN,KAAK;EACxG,MAAM;IAAEO,eAAe;IAAEC,qBAAqB;IAAEC,wBAAwB;IAAEC;EAA0B,CAAC,GAAGV,KAAK;EAC7G;EACA;EACA,MAAMW,YAAY,GAAGP,aAAa,IAAIQ,OAAO,CAACF,yBAAyB,CAAC;EACxE;EACA;EACA;EACA,MAAMG,uBAAuB,GAAGT,aAAa,IAAKQ,OAAO,CAACF,yBAAyB,CAAC,IAAI,CAACH,eAAgB;EACzG,IAAIF,oBAAoB,EAAE;IACxB,OAAO;MAAES,IAAI,EAAE,MAAM;MAAEC,MAAM,EAAE;IAA0E,CAAC;EAC5G;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AI,EAAE;IAAc,CAAC;EAChC;EACA,MAAMI,SAAS,GAAGjB,QAAQ,KAAKE,cAAc;EAC7C,IAAIe,SAAS,IAAIP,YAAY,EAAE,OAAO;IAAEG,IAAI,EAAE;EAAiB,CAAC;EAChE,IAAII,SAAS,EAAE,OAAO;IAAEJ,IAAI,EAAE;EAAc,CAAC;EAC7C,IAAIH,YAAY,EAAE,OAAO;IAAEG,IAAI,EAAE;EAAgB,CAAC;EAClD,OAAO;IAAEA,IAAI,EAAE,MAAM;IAAEC,MAAM,EAAE;EAAY,CAAC;AAC9C","ignoreList":[]}
|
|
@@ -196,6 +196,70 @@ const table = [{
|
|
|
196
196
|
hasDevCommits: true
|
|
197
197
|
},
|
|
198
198
|
type: 'merge-diverged'
|
|
199
|
+
}, {
|
|
200
|
+
// Suspected work only — git cannot tell whether the bundled sources are inside the recorded snap,
|
|
201
|
+
// so the executor probes with a read-only status check and settles without writing when clean.
|
|
202
|
+
name: 'sources bundled into the state commit, otherwise converged -> export-branch (a probe)',
|
|
203
|
+
input: {
|
|
204
|
+
stateCommitBundlesSources: true,
|
|
205
|
+
tipIsSyncCommit: false
|
|
206
|
+
},
|
|
207
|
+
type: 'export-branch',
|
|
208
|
+
action: {
|
|
209
|
+
type: 'export-branch'
|
|
210
|
+
}
|
|
211
|
+
}, {
|
|
212
|
+
name: 'bundled sources count as work when the lane also moved -> merge-diverged',
|
|
213
|
+
input: {
|
|
214
|
+
laneHead: 'L2',
|
|
215
|
+
stateCommitBundlesSources: true,
|
|
216
|
+
tipIsSyncCommit: false
|
|
217
|
+
},
|
|
218
|
+
type: 'merge-diverged'
|
|
219
|
+
}, {
|
|
220
|
+
name: 'own-live with bundled sources -> KEEP the branch, naming the commits',
|
|
221
|
+
input: _objectSpread(_objectSpread({}, laneGone('own-live')), {}, {
|
|
222
|
+
stateCommitBundlesSources: true,
|
|
223
|
+
tipIsSyncCommit: false
|
|
224
|
+
}),
|
|
225
|
+
type: 'close-pr',
|
|
226
|
+
action: {
|
|
227
|
+
type: 'close-pr',
|
|
228
|
+
deleteBranch: false,
|
|
229
|
+
keepReason: 'unmerged-commits'
|
|
230
|
+
}
|
|
231
|
+
}, {
|
|
232
|
+
// Our own ledger commits bundle sources too (import-lane writes the lane's files, merge-diverged
|
|
233
|
+
// the merged tree) — already-exported content, not work. No probe can run against a deleted lane,
|
|
234
|
+
// so the deletion path keeps consulting the tip marker, in the same direction it always has.
|
|
235
|
+
name: 'own-live, bundled sources but the tip is OUR OWN ledger commit -> close-pr AND delete',
|
|
236
|
+
input: _objectSpread(_objectSpread({}, laneGone('own-live')), {}, {
|
|
237
|
+
stateCommitBundlesSources: true,
|
|
238
|
+
tipIsSyncCommit: true
|
|
239
|
+
}),
|
|
240
|
+
type: 'close-pr',
|
|
241
|
+
action: {
|
|
242
|
+
type: 'close-pr',
|
|
243
|
+
deleteBranch: true
|
|
244
|
+
}
|
|
245
|
+
}, {
|
|
246
|
+
// The convergence path is the opposite: a probe IS available there, and a tip that merely CLAIMS
|
|
247
|
+
// to be ours (a squash body quoting the marker) must never suppress it — probe, don't trust.
|
|
248
|
+
name: 'bundled sources with a tip claiming to be ours still probe -> export-branch',
|
|
249
|
+
input: {
|
|
250
|
+
stateCommitBundlesSources: true,
|
|
251
|
+
tipIsSyncCommit: true
|
|
252
|
+
},
|
|
253
|
+
type: 'export-branch'
|
|
254
|
+
}, {
|
|
255
|
+
// Adoption probes via `bit status`, so suspected bundled work routes there like dev commits do.
|
|
256
|
+
name: 'existing branch, never synced, bundled sources -> adopt-branch (first contact)',
|
|
257
|
+
input: {
|
|
258
|
+
lastSyncedHead: undefined,
|
|
259
|
+
ownership: 'inherited-or-none',
|
|
260
|
+
stateCommitBundlesSources: true
|
|
261
|
+
},
|
|
262
|
+
type: 'adopt-branch'
|
|
199
263
|
}, {
|
|
200
264
|
name: 'existing branch, never synced, no dev commits, lane EXISTS -> import-lane (adopt branch)',
|
|
201
265
|
input: {
|