@aviaratech/ai-delivery 0.3.36 → 0.3.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/README.md +5 -6
  2. package/dist/agent.d.ts +1 -1
  3. package/dist/agent.js +1 -3
  4. package/dist/agent.js.map +2 -2
  5. package/dist/callerErrors.test.js +0 -14
  6. package/dist/callerErrors.test.js.map +2 -2
  7. package/dist/cli.js +0 -15
  8. package/dist/cli.js.map +2 -2
  9. package/dist/dispatch.d.ts +1 -1
  10. package/dist/dispatch.js +1 -15
  11. package/dist/dispatch.js.map +2 -2
  12. package/dist/fixtures/discovery.d.ts +16 -16
  13. package/dist/git.d.ts +0 -3
  14. package/dist/git.js +2 -25
  15. package/dist/git.js.map +2 -2
  16. package/dist/github/commandIdentityPolicy.js +0 -2
  17. package/dist/github/commandIdentityPolicy.js.map +2 -2
  18. package/dist/issueIntake.test.js +0 -7
  19. package/dist/issueIntake.test.js.map +2 -2
  20. package/dist/mcp/tools.d.ts +0 -36
  21. package/dist/mcp/tools.js +0 -34
  22. package/dist/mcp/tools.js.map +2 -2
  23. package/dist/pluginPackaging.test.js +0 -47
  24. package/dist/pluginPackaging.test.js.map +2 -2
  25. package/dist/pr.d.ts +0 -55
  26. package/dist/pr.js +0 -211
  27. package/dist/pr.js.map +3 -3
  28. package/dist/pr.test.js +5 -737
  29. package/dist/pr.test.js.map +3 -3
  30. package/dist/prAssociation.test.js +1 -1
  31. package/dist/prAssociation.test.js.map +2 -2
  32. package/dist/prDispatch.test.js +4 -31
  33. package/dist/prDispatch.test.js.map +2 -2
  34. package/dist/readView.d.ts +1 -0
  35. package/dist/readView.js +1 -0
  36. package/dist/readView.js.map +2 -2
  37. package/dist/readView.test.js +29 -2
  38. package/dist/readView.test.js.map +2 -2
  39. package/dist/stdoutRegression.test.js +0 -38
  40. package/dist/stdoutRegression.test.js.map +2 -2
  41. package/dist/targetPolicyRoutes.test.js +1 -32
  42. package/dist/targetPolicyRoutes.test.js.map +2 -2
  43. package/dist/targetRepositoryExecution.test.js +0 -12
  44. package/dist/targetRepositoryExecution.test.js.map +2 -2
  45. package/dist/utils/atomicJson.d.ts +0 -2
  46. package/dist/utils/atomicJson.js +0 -4
  47. package/dist/utils/atomicJson.js.map +2 -2
  48. package/dist/utils/filesystem.d.ts +0 -8
  49. package/dist/utils/filesystem.js +1 -12
  50. package/dist/utils/filesystem.js.map +2 -2
  51. package/dist/verification.d.ts +0 -35
  52. package/dist/verification.js +1 -47
  53. package/dist/verification.js.map +2 -2
  54. package/dist/version.js +24 -2
  55. package/dist/version.js.map +2 -2
  56. package/package.json +1 -1
  57. package/plugins/ai-delivery/.claude-plugin/plugin.json +2 -2
  58. package/plugins/ai-delivery/plugin.json +1 -1
  59. package/plugins/ai-delivery/runtime/dist/cli.js +108 -115
  60. package/plugins/ai-delivery/runtime/package.json +1 -1
  61. package/plugins/ai-delivery/skills/pr-handoff/SKILL.md +4 -4
  62. package/dist/services/deliveryAdmission.d.ts +0 -49
  63. package/dist/services/deliveryAdmission.js +0 -142
  64. package/dist/services/deliveryAdmission.js.map +0 -7
  65. package/dist/services/worktreeRegistry.d.ts +0 -342
  66. package/dist/services/worktreeRegistry.js +0 -831
  67. package/dist/services/worktreeRegistry.js.map +0 -7
  68. package/dist/worktree.d.ts +0 -16
  69. package/dist/worktree.js +0 -108
  70. package/dist/worktree.js.map +0 -7
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/services/worktreeRegistry.ts"],
4
- "sourcesContent": ["import { closeSync, existsSync, fsyncSync, lstatSync, openSync, readFileSync, readdirSync } from 'node:fs';\nimport { dirname, join, resolve } from 'node:path';\nimport { z } from 'zod';\n\nimport {\n assertPrivateFile,\n CoordinateSchema,\n DigestSchema,\n digestBytes,\n stableJson,\n writeCreateOnly,\n} from '../delivery/common.js';\nimport { digestValue } from '../delivery/index.js';\nimport { gitCommonDir } from '../git.js';\nimport { RuntimeAdmissionSchema } from './deliveryAdmission.js';\nimport { logInfo, logWarn } from '../logger.js';\nimport { ensureDataDirectory, ISSUE_CLI_DATA_DIR } from '../utils/filesystem.js';\nimport {\n ensurePrivateDirectoryDurably,\n writeJsonFileAtomically,\n writePrivateJsonFileAtomically,\n} from '../utils/atomicJson.js';\nimport { withLock } from '../utils/lockfile.js';\n\nexport interface WorktreeEntry {\n branch: string;\n createdAt: string;\n /** Agent identity that prepared the worktree; hook-context commands (lint-guard) fall back to it. */\n identity?: string;\n issueNumber?: number;\n path: string;\n prNumber?: number;\n status: WorktreeStatus;\n type: 'issue' | 'pr' | 'standalone';\n updatedAt: string;\n}\n\nexport type WorktreeStatus = 'active' | 'error' | 'merged' | 'pr-published' | 'stale';\n\ninterface WorktreeRegistry {\n worktrees: WorktreeEntry[];\n}\n\nconst REGISTRY_PATH = `${ISSUE_CLI_DATA_DIR}/worktrees.json`;\nconst LOCK_RETRY_MESSAGE = 'Worktree registry locked by another process. Retrying...';\n\nconst ContinuationRowSchema = z\n .strictObject({\n branch: z.string().min(1),\n createdAt: z.string().min(1),\n identity: z.string().min(1),\n issueNumber: z.number().int().positive(),\n path: z.string().min(1),\n prNumber: z.number().int().positive().optional(),\n status: z.enum(['active', 'error', 'merged', 'pr-published', 'stale']),\n type: z.literal('issue'),\n updatedAt: z.string().min(1),\n })\n .transform(({ prNumber, ...row }) => ({ ...row, ...(prNumber === undefined ? {} : { prNumber }) }));\n/** @internal Private exact-plan checkpoint; it is not a public transition purpose. */\nexport const CommittedContinuationPlanSchema = z\n .strictObject({\n schemaVersion: z.literal('ai-delivery.committed-continuation-plan@1'),\n planId: DigestSchema,\n repository: z.string().min(1),\n repoRoot: z.string().min(1),\n configDigest: DigestSchema,\n currentRuntime: RuntimeAdmissionSchema,\n row: ContinuationRowSchema,\n replacement: ContinuationRowSchema,\n head: CoordinateSchema,\n terminalHead: CoordinateSchema,\n terminalMergeId: DigestSchema,\n operator: z.strictObject({\n actorLogin: z.string().min(1),\n credentialIdentity: z.string().regex(/^user:[1-9]\\d*$/u),\n }),\n reviewerActor: z.string().min(1),\n preserved: z.array(z.strictObject({ path: z.string().min(1), digest: DigestSchema })).min(1),\n })\n .superRefine((plan, ctx) => {\n const { planId, ...content } = plan;\n const { prNumber: _pr, identity: _identity, status: _status, updatedAt: _updated, ...original } = plan.row;\n const { identity: _newIdentity, status: _newStatus, updatedAt: _newUpdated, ...replacement } = plan.replacement;\n if (\n planId !== digestValue(content) ||\n plan.row.status !== 'merged' ||\n !plan.row.prNumber ||\n plan.replacement.status !== 'active' ||\n plan.replacement.prNumber !== undefined ||\n stableJson(original) !== stableJson(replacement) ||\n plan.head.sha === plan.terminalHead.sha ||\n new Set(plan.preserved.map((file) => file.path)).size !== plan.preserved.length\n )\n ctx.addIssue({ code: 'custom', message: 'Committed continuation plan identity or disposition is invalid.' });\n });\nexport type CommittedContinuationPlan = z.infer<typeof CommittedContinuationPlanSchema>;\nconst ContinuationIntentSchema = z\n .strictObject({\n schemaVersion: z.literal('ai-delivery.committed-continuation-intent@1'),\n intentId: DigestSchema,\n plan: CommittedContinuationPlanSchema,\n authorityCommentId: z.number().int().positive(),\n acceptanceCommentId: z.number().int().positive(),\n })\n .superRefine(({ intentId, ...content }, ctx) => {\n if (intentId !== digestValue(content))\n ctx.addIssue({ code: 'custom', message: 'Continuation intent identity is invalid.' });\n });\ntype ContinuationIntent = z.infer<typeof ContinuationIntentSchema>;\nconst ContinuationCompletionSchema = z\n .strictObject({\n schemaVersion: z.literal('ai-delivery.committed-continuation-completion@1'),\n completionId: DigestSchema,\n intentId: DigestSchema,\n planId: DigestSchema,\n row: ContinuationRowSchema,\n head: CoordinateSchema,\n completed: z.literal(true),\n })\n .superRefine(({ completionId, ...content }, ctx) => {\n if (completionId !== digestValue(content))\n ctx.addIssue({ code: 'custom', message: 'Continuation completion identity is invalid.' });\n });\n\nexport function committedContinuationPlanPath(root: string, issueNumber: number, head: string): string {\n return join(gitCommonDir(root), 'ai-delivery', 'continuations', String(issueNumber), `${head}.plan.json`);\n}\nfunction continuationIntentPath(plan: CommittedContinuationPlan): string {\n return committedContinuationPlanPath(plan.repoRoot, plan.row.issueNumber, plan.head.sha).replace(\n /\\.plan\\.json$/u,\n '.intent.json',\n );\n}\nfunction continuationCompletionPath(plan: CommittedContinuationPlan): string {\n return continuationIntentPath(plan).replace(/\\.intent\\.json$/u, '.completion.json');\n}\nfunction continuationBeforeimagePath(plan: CommittedContinuationPlan, digest: string): string {\n return join(gitCommonDir(plan.repoRoot), 'ai-delivery', 'continuations', 'evidence', `${digest.slice(7)}.bin`);\n}\nfunction assertContinuationPreserved(plan: CommittedContinuationPlan, beforeimages = false): void {\n for (const file of plan.preserved) {\n if (\n digestBytes(assertPrivateFile(file.path)) !== file.digest ||\n (beforeimages && digestBytes(assertPrivateFile(continuationBeforeimagePath(plan, file.digest))) !== file.digest)\n )\n throw new Error('Committed continuation original evidence changed.');\n }\n if (beforeimages) {\n const bytes = Buffer.from(stableJson(plan.row));\n if (!assertPrivateFile(continuationBeforeimagePath(plan, digestBytes(bytes))).equals(bytes))\n throw new Error('Committed continuation original row beforeimage changed.');\n }\n}\n\n/** @internal Pending intents are recoverable only by the same supported develop boundary. */\nexport function pendingCommittedContinuation(issueNumber: number, root: string): ContinuationIntent | undefined {\n const directory = join(gitCommonDir(root), 'ai-delivery', 'continuations', String(issueNumber));\n if (!existsSync(directory)) return undefined;\n let pending: ContinuationIntent | undefined;\n for (const name of readdirSync(directory)\n .filter((name) => name.endsWith('.intent.json'))\n .sort()) {\n const intent = ContinuationIntentSchema.parse(\n JSON.parse(assertPrivateFile(join(directory, name)).toString('utf8')),\n );\n const plan = intent.plan;\n if (\n plan.repoRoot !== resolve(root) ||\n plan.row.issueNumber !== issueNumber ||\n join(directory, name) !== continuationIntentPath(plan)\n )\n throw new Error('Committed continuation checkpoint identity disagrees.');\n assertContinuationPreserved(plan, true);\n const completionPath = continuationCompletionPath(plan);\n if (existsSync(completionPath)) {\n const completion = ContinuationCompletionSchema.parse(\n JSON.parse(assertPrivateFile(completionPath).toString('utf8')),\n );\n if (\n completion.intentId !== intent.intentId ||\n completion.planId !== plan.planId ||\n stableJson(completion.row) !== stableJson(plan.replacement) ||\n stableJson(completion.head) !== stableJson(plan.head)\n )\n throw new Error('Committed continuation completion disagrees with its intent.');\n assertOwnerWitness(plan.replacement, root);\n // Terminal recovery validates existing ancestors and repairs their directory durability.\n prepareCommittedContinuationDirectory(root, directory, false);\n prepareCommittedContinuationDirectory(\n root,\n dirname(continuationBeforeimagePath(plan, plan.preserved[0]!.digest)),\n false,\n );\n syncCommittedContinuationDirectory(completionPath);\n } else {\n if (pending) throw new Error('Issue has multiple incomplete committed continuations.');\n pending = intent;\n }\n }\n return pending;\n}\n\nfunction ownerContent(entry: WorktreeEntry): Record<string, unknown> {\n if (!entry.identity) throw new Error('ai-delivery worktree ownership requires the preparing identity.');\n return {\n branch: entry.branch,\n identity: entry.identity,\n ...(entry.issueNumber === undefined ? {} : { issueNumber: entry.issueNumber }),\n path: entry.path,\n ...(entry.prNumber === undefined || entry.type === 'issue' ? {} : { prNumber: entry.prNumber }),\n schemaVersion: 'ai-delivery.worktree-owner@1',\n type: entry.type,\n };\n}\n\nfunction ownerPath(root: string, entry: WorktreeEntry): string {\n const id = digestValue(ownerContent(entry)).slice('sha256:'.length);\n return join(gitCommonDir(root), 'ai-delivery', 'worktree-owners', `${id}.json`);\n}\n\n/** An immutable witness separates new rows from legacy rows in the same canonical registry. */\nexport function assertAiDeliveryWorktreeOwner(entry: WorktreeEntry, root: string): void {\n if (entry.issueNumber !== undefined && pendingCommittedContinuation(entry.issueNumber, root))\n throw new Error('Committed continuation is pending or incomplete; resume supported develop.');\n assertOwnerWitness(entry, root);\n}\n\nfunction assertOwnerWitness(entry: WorktreeEntry, root: string): void {\n const content = ownerContent(entry);\n const path = ownerPath(root, entry);\n let stored: unknown;\n try {\n stored = JSON.parse(assertPrivateFile(path).toString('utf8')) as unknown;\n } catch {\n throw new Error('Worktree lacks its exact ai-delivery ownership witness.');\n }\n if (JSON.stringify(stored) !== JSON.stringify({ ...content, ownerId: digestValue(content) })) {\n throw new Error('Worktree ownership witness disagrees with the canonical registry identity.');\n }\n}\n\n/** Ordinary source mutations refuse a pending committed continuation. */\nexport function assertIssueWorktreeTransitionAdmission(\n issueNumber: number,\n root: string,\n committedRecovery = false,\n): void {\n if (pendingCommittedContinuation(issueNumber, root) && !committedRecovery)\n throw new Error('Committed continuation is pending or incomplete; resume supported develop.');\n}\n\nfunction writeWorktreeOwner(entry: WorktreeEntry, root: string, transition = false): void {\n const content = ownerContent(entry);\n writeCreateOnly(ownerPath(root, entry), Buffer.from(JSON.stringify({ ...content, ownerId: digestValue(content) })));\n if (!transition) assertAiDeliveryWorktreeOwner(entry, root);\n}\n\n/** @internal New continuation checkpoints are published only while both owning locks are held. */\nexport function writeCommittedContinuationCheckpoint(path: string, value: unknown): void {\n const assertEqual = () => {\n const stored: unknown = JSON.parse(assertPrivateFile(path).toString('utf8')) as unknown;\n if (stableJson(stored) !== stableJson(value)) throw new Error('Committed continuation checkpoint changed.');\n };\n try {\n assertEqual();\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code !== 'ENOENT') throw error;\n writePrivateJsonFileAtomically(path, value);\n assertEqual();\n }\n // Retry completes durability if the prior publisher died after rename but before directory sync.\n syncCommittedContinuationDirectory(path);\n}\n\nfunction syncCommittedContinuationDirectory(path: string): void {\n const directory = openSync(dirname(path), 'r');\n try {\n fsyncSync(directory);\n } finally {\n closeSync(directory);\n }\n}\n\n/** Repair only this new namespace, anchored at the existing Git common directory. */\nfunction prepareCommittedContinuationDirectory(root: string, directory: string, create = true): void {\n const deliveryDirectory = join(gitCommonDir(root), 'ai-delivery');\n const continuationRoot = join(deliveryDirectory, 'continuations');\n const paths = [deliveryDirectory, continuationRoot, directory];\n const validate = (path: string, missing: boolean) => {\n let metadata;\n try {\n metadata = lstatSync(path);\n } catch (error) {\n if (missing && (error as NodeJS.ErrnoException).code === 'ENOENT') return;\n throw error;\n }\n if (\n !metadata.isDirectory() ||\n metadata.isSymbolicLink() ||\n (path !== deliveryDirectory && (metadata.mode & 0o077) !== 0)\n )\n throw new Error('Committed continuation evidence requires a private directory.');\n };\n for (const path of paths) validate(path, create && path !== deliveryDirectory);\n if (create) ensurePrivateDirectoryDurably(directory);\n for (const path of paths) {\n validate(path, false);\n // Existing mkdir state can be recovery from death before its parent was synced.\n syncCommittedContinuationDirectory(path);\n }\n}\n\n/** @internal One canonical row, its immutable witnesses, and the existing registry lock own this recovery. */\nexport async function withCommittedContinuationRegistry<T>(\n root: string,\n issueNumber: number,\n operation: (input: {\n current: WorktreeEntry;\n pending: ContinuationIntent | undefined;\n ownerWitness: { path: string; digest: string };\n prepare(this: void): void;\n begin(\n this: void,\n plan: CommittedContinuationPlan,\n ids: { authorityCommentId: number; acceptanceCommentId: number },\n ): void;\n commit(this: void): void;\n complete(this: void): void;\n }) => Promise<T>,\n): Promise<T> {\n ensureRegistryDirectory(root);\n return withLock(REGISTRY_PATH, {\n projectRoot: root,\n timeout: 5000,\n operation: async () => {\n const pending = pendingCommittedContinuation(issueNumber, root);\n let intent = pending;\n let current: WorktreeEntry;\n const readCurrent = () => {\n const registry = loadRegistryStrict(root);\n const matches = registry.worktrees.filter((row) => row.type === 'issue' && row.issueNumber === issueNumber);\n const row = matches[0];\n if (matches.length !== 1 || !row)\n throw new Error('Committed continuation requires one exact canonical issue row.');\n if (registry.worktrees.some((other) => other !== row && registryIdentitiesOverlap(other, row)))\n throw new Error('Committed continuation overlaps another canonical owner.');\n assertOwnerWitness(row, root);\n return { registry, row };\n };\n current = readCurrent().row;\n if (\n pending &&\n ![pending.plan.row, pending.plan.replacement].some((row) => stableJson(row) === stableJson(current))\n )\n throw new Error('Committed continuation canonical row drifted.');\n const original = pending?.plan.row ?? current;\n assertOwnerWitness(original, root);\n const witnessPath = ownerPath(root, original);\n const ownerWitness = { path: witnessPath, digest: digestBytes(assertPrivateFile(witnessPath)) };\n return operation({\n current,\n pending,\n ownerWitness,\n prepare: () =>\n prepareCommittedContinuationDirectory(\n root,\n join(gitCommonDir(root), 'ai-delivery', 'continuations', String(issueNumber)),\n ),\n begin: (raw, ids) => {\n const plan = CommittedContinuationPlanSchema.parse(raw);\n if (\n plan.repoRoot !== resolve(root) ||\n plan.row.issueNumber !== issueNumber ||\n stableJson(plan.row) !== stableJson(original) ||\n !plan.preserved.some((file) => stableJson(file) === stableJson(ownerWitness))\n )\n throw new Error('Committed continuation lacks exact original custody.');\n const content = { schemaVersion: 'ai-delivery.committed-continuation-intent@1' as const, plan, ...ids };\n const next = ContinuationIntentSchema.parse({ ...content, intentId: digestValue(content) });\n if (intent && stableJson(next) !== stableJson(intent))\n throw new Error('Committed continuation intent drifted.');\n assertContinuationPreserved(plan);\n const evidenceDirectory = dirname(continuationBeforeimagePath(plan, plan.preserved[0]!.digest));\n prepareCommittedContinuationDirectory(root, evidenceDirectory);\n for (const file of plan.preserved)\n writeCreateOnly(continuationBeforeimagePath(plan, file.digest), assertPrivateFile(file.path), file.digest);\n const rowBytes = Buffer.from(stableJson(plan.row));\n writeCreateOnly(continuationBeforeimagePath(plan, digestBytes(rowBytes)), rowBytes, digestBytes(rowBytes));\n writeCommittedContinuationCheckpoint(continuationIntentPath(plan), next);\n intent = next;\n },\n commit: () => {\n if (!intent) throw new Error('Committed continuation lacks its durable intent.');\n const { registry, row } = readCurrent();\n if (stableJson(row) !== stableJson(current))\n throw new Error('Committed continuation canonical row changed before commit.');\n assertContinuationPreserved(intent.plan, true);\n const replacementOwner = ownerContent(intent.plan.replacement);\n writeCommittedContinuationCheckpoint(ownerPath(root, intent.plan.replacement), {\n ...replacementOwner,\n ownerId: digestValue(replacementOwner),\n });\n registry.worktrees.splice(registry.worktrees.indexOf(row), 1, intent.plan.replacement);\n saveRegistryStrict(root, registry);\n current = intent.plan.replacement;\n },\n complete: () => {\n if (!intent || stableJson(readCurrent().row) !== stableJson(intent.plan.replacement))\n throw new Error('Committed continuation replacement row is incomplete.');\n assertContinuationPreserved(intent.plan, true);\n assertOwnerWitness(intent.plan.replacement, root);\n const content = {\n schemaVersion: 'ai-delivery.committed-continuation-completion@1' as const,\n intentId: intent.intentId,\n planId: intent.plan.planId,\n row: intent.plan.replacement,\n head: intent.plan.head,\n completed: true as const,\n };\n writeCommittedContinuationCheckpoint(continuationCompletionPath(intent.plan), {\n ...content,\n completionId: digestValue(content),\n });\n },\n });\n },\n });\n}\n\n/**\n * The only recovery transition for a worktree that remained active after its\n * delivery completed elsewhere. Callers must establish the terminal delivery\n * from GitHub and immutable receipts before invoking this locked transition.\n */\nexport interface CompletedIssueWorktreeReconciliation {\n removeSource?: (entry: WorktreeEntry) => void;\n branch: string;\n issueNumber: number;\n path: string;\n prNumber: number;\n projectRoot?: string;\n}\n\ntype IssueWorktreeDeliveryTransition =\n | {\n branch: string;\n issueNumber: number;\n path: string;\n prNumber: number;\n projectRoot?: string;\n status: 'pr-published';\n }\n | {\n branch: string;\n issueNumber: number;\n path: string;\n projectRoot?: string;\n status: 'merged';\n };\n\nexport async function addWorktreeEntry(entry: WorktreeEntry, projectRoot?: string): Promise<void> {\n const root = projectRoot ?? process.cwd();\n const normalizedEntry: WorktreeEntry = {\n ...entry,\n status: entry.status,\n updatedAt: entry.updatedAt,\n };\n\n ensureRegistryDirectory(root);\n await withLock(REGISTRY_PATH, {\n onTimeout: () => {\n logWarn(LOCK_RETRY_MESSAGE);\n },\n operation: () => {\n const registry = loadRegistryStrict(root);\n\n const collisions = registry.worktrees.filter((existing) => registryIdentitiesOverlap(existing, normalizedEntry));\n const [existing] = collisions;\n if (collisions.length > 0) {\n if (collisions.length === 1 && existing !== undefined && isIdempotentRegistration(existing, normalizedEntry)) {\n assertAiDeliveryWorktreeOwner(existing, root);\n logInfo(`Worktree already registered: ${normalizedEntry.path}`);\n return;\n }\n if (collisions.length === 1 && existing !== undefined && isMergedIssueReactivation(existing, normalizedEntry)) {\n assertAiDeliveryWorktreeOwner(existing, root);\n const existingIndex = registry.worktrees.indexOf(existing);\n registry.worktrees.splice(existingIndex, 1, {\n ...normalizedEntry,\n createdAt: existing.createdAt,\n });\n saveRegistryStrict(root, registry);\n logInfo(`Reactivated merged issue worktree: ${normalizedEntry.path}`);\n return;\n }\n throw new Error(\n `New worktree entry conflicts with existing canonical registry identity: ${normalizedEntry.path}.`,\n );\n }\n\n writeWorktreeOwner(normalizedEntry, root);\n registry.worktrees.push(normalizedEntry);\n logInfo(`Added to worktree registry: ${normalizedEntry.path}`);\n saveRegistryStrict(root, registry);\n },\n projectRoot: root,\n timeout: 5000,\n });\n}\n\n/** Resolve the sole canonical issue row for a provider-mutating lifecycle transition. */\nexport function getIssueWorktreeStrict(issueNumber: number, projectRoot?: string): WorktreeEntry {\n const root = projectRoot ?? process.cwd();\n const registry = loadRegistryStrict(root);\n const matching = registry.worktrees.filter((entry) => entry.type === 'issue' && entry.issueNumber === issueNumber);\n const entry = matching[0];\n if (matching.length !== 1 || entry === undefined) {\n throw new Error(\n `Expected exactly one canonical registry row for issue #${String(issueNumber)}; found ${String(matching.length)}.`,\n );\n }\n assertAiDeliveryWorktreeOwner(entry, root);\n return entry;\n}\n\n/** Native metadata never adopts source; retain every transition and canonical registry fence. */\nexport function assertNativeIssueTrackingAdmission(issueNumber: number, root: string): void {\n assertIssueWorktreeTransitionAdmission(issueNumber, root);\n const matches = listWorktreesStrict(root).filter(\n (entry) => entry.type === 'issue' && entry.issueNumber === issueNumber,\n );\n if (matches.length > 1) throw new Error(`Issue #${String(issueNumber)} has duplicate worktree owners.`);\n}\n\nexport function getStaleWorktrees(daysOld: number, projectRoot?: string): WorktreeEntry[] {\n const root = projectRoot ?? process.cwd();\n const registry = loadRegistry(root);\n const cutoffDate = new Date();\n cutoffDate.setDate(cutoffDate.getDate() - daysOld);\n\n return registry.worktrees.filter((entry) => {\n const updatedAt = new Date(entry.updatedAt);\n return updatedAt < cutoffDate || entry.status === 'stale' || entry.status === 'merged';\n });\n}\n\nexport function getWorktreeByIssue(issueNumber: number, projectRoot?: string): null | WorktreeEntry {\n const root = projectRoot ?? process.cwd();\n const registry = loadRegistry(root);\n return registry.worktrees.find((w) => w.type === 'issue' && w.issueNumber === issueNumber) ?? null;\n}\n\nexport function getWorktreeByPR(prNumber: number, projectRoot?: string): null | WorktreeEntry {\n const root = projectRoot ?? process.cwd();\n const registry = loadRegistry(root);\n return registry.worktrees.find((w) => w.type === 'pr' && w.prNumber === prNumber) ?? null;\n}\n\nexport function listWorktrees(projectRoot?: string): WorktreeEntry[] {\n const root = projectRoot ?? process.cwd();\n const registry = loadRegistry(root);\n return registry.worktrees;\n}\n\n/**\n * Reads the registry for a terminal safety decision. Unlike the operational\n * listing helper, this fails closed if an existing registry cannot be read.\n */\nexport function listWorktreesStrict(projectRoot?: string): WorktreeEntry[] {\n const root = projectRoot ?? process.cwd();\n const registry = loadRegistryStrict(root);\n return registry.worktrees;\n}\n\nexport async function markStaleEntries(thresholdMs: number, projectRoot?: string): Promise<number> {\n const root = projectRoot ?? process.cwd();\n let updated = 0;\n ensureRegistryDirectory(root);\n await withLock(REGISTRY_PATH, {\n onTimeout: () => {\n logWarn(LOCK_RETRY_MESSAGE);\n },\n operation: () => {\n const registry = loadRegistryStrict(root);\n const now = Date.now();\n const newWorktrees = registry.worktrees.map((entry) => {\n const age = now - new Date(entry.updatedAt).getTime();\n if (\n age >= thresholdMs &&\n entry.type !== 'standalone' &&\n entry.status !== 'stale' &&\n entry.status !== 'merged'\n ) {\n assertAiDeliveryWorktreeOwner(entry, root);\n updated += 1;\n return {\n ...entry,\n status: 'stale' as const,\n updatedAt: new Date().toISOString(),\n };\n }\n return entry;\n });\n if (updated > 0) {\n registry.worktrees = newWorktrees;\n saveRegistryStrict(root, registry);\n }\n },\n projectRoot: root,\n timeout: 5000,\n });\n return updated;\n}\n\n/** Atomically reconcile one verified terminal PR without changing its original producer identity. */\nexport async function reconcileCompletedIssueWorktreeDelivery(\n options: CompletedIssueWorktreeReconciliation,\n): Promise<'already-reconciled' | 'reconciled'> {\n if (!Number.isSafeInteger(options.prNumber) || options.prNumber <= 0) {\n throw new Error(`Canonical PR number must be a positive integer for issue #${String(options.issueNumber)}.`);\n }\n const root = options.projectRoot ?? process.cwd();\n ensureRegistryDirectory(root);\n return await withLock(REGISTRY_PATH, {\n onTimeout: () => {\n logWarn(LOCK_RETRY_MESSAGE);\n },\n operation: () => {\n const registry = loadRegistryStrict(root);\n const matchingIndex = requireCanonicalIssueIndex({ ...options, registry });\n const entry = registry.worktrees[matchingIndex];\n if (entry === undefined) {\n throw new Error(\n `Canonical registry row for issue #${String(options.issueNumber)} disappeared during reconciliation.`,\n );\n }\n assertAiDeliveryWorktreeOwner(entry, root);\n if (\n options.removeSource !== undefined &&\n registry.worktrees.some(\n (other, index) =>\n index !== matchingIndex && registryIdentitiesOverlap(other, { ...entry, prNumber: options.prNumber }),\n )\n )\n throw new Error('Another registry owner claims this source; preserve both registrations before cleanup.');\n if (entry.status === 'merged' && entry.prNumber === options.prNumber && options.removeSource === undefined) {\n return 'already-reconciled';\n }\n if (\n !(entry.status === 'active' && entry.prNumber === undefined) &&\n !(entry.status === 'pr-published' && entry.prNumber === options.prNumber) &&\n !(entry.status === 'merged' && entry.prNumber === options.prNumber)\n ) {\n throw new Error(\n `Invalid completed-delivery reconciliation for #${String(options.issueNumber)}: ${entry.status}.`,\n );\n }\n registry.worktrees.splice(matchingIndex, 1, {\n ...entry,\n prNumber: options.prNumber,\n status: 'merged',\n updatedAt: new Date().toISOString(),\n });\n if (options.removeSource !== undefined) {\n options.removeSource(registry.worktrees[matchingIndex]!);\n registry.worktrees.splice(matchingIndex, 1);\n }\n saveRegistryStrict(root, registry);\n if (options.removeSource === undefined)\n assertIssueDeliveryReadback({\n options: { ...options, status: 'merged' },\n registry: loadRegistryStrict(root),\n });\n return 'reconciled';\n },\n projectRoot: root,\n timeout: 5000,\n });\n}\n\n/** Remove one exact active standalone row without weakening registry parsing or identity checks. */\nexport async function removeActiveStandaloneWorktreeEntry(input: {\n branch: string;\n path: string;\n projectRoot: string;\n}): Promise<void> {\n const root = input.projectRoot;\n ensureRegistryDirectory(root);\n await withLock(REGISTRY_PATH, {\n onTimeout: () => {\n logWarn(LOCK_RETRY_MESSAGE);\n },\n operation: () => {\n const registry = loadRegistryStrict(root);\n const matchingIndexes = registry.worktrees.flatMap((entry, index) =>\n entry.path === input.path || entry.branch === input.branch ? [index] : [],\n );\n const [matchingIndex] = matchingIndexes;\n const entry = matchingIndex === undefined ? undefined : registry.worktrees[matchingIndex];\n if (\n matchingIndexes.length !== 1 ||\n entry === undefined ||\n entry.path !== input.path ||\n entry.branch !== input.branch ||\n entry.type !== 'standalone' ||\n entry.status !== 'active' ||\n entry.issueNumber !== undefined ||\n entry.prNumber !== undefined\n ) {\n throw new Error('Expected one exact active standalone registry row for qualification cleanup.');\n }\n if (matchingIndex === undefined) {\n throw new Error('Qualification cleanup registry identity disappeared before removal.');\n }\n assertAiDeliveryWorktreeOwner(entry, root);\n registry.worktrees.splice(matchingIndex, 1);\n saveRegistryStrict(root, registry);\n const readback = loadRegistryStrict(root).worktrees;\n if (readback.some((candidate) => candidate.path === input.path || candidate.branch === input.branch)) {\n throw new Error('Qualification cleanup registry readback retained the standalone identity.');\n }\n },\n projectRoot: root,\n timeout: 5000,\n });\n}\n\nexport async function removeWorktreeEntry(path: string, projectRoot?: string): Promise<boolean> {\n const root = projectRoot ?? process.cwd();\n\n ensureRegistryDirectory(root);\n return await withLock(REGISTRY_PATH, {\n onTimeout: () => {\n logWarn(LOCK_RETRY_MESSAGE);\n },\n operation: () => {\n const registry = loadRegistryStrict(root);\n const matching = registry.worktrees.filter((row) => row.path === path);\n if (matching.length > 1) throw new Error('Worktree registry contains duplicate paths.');\n if (matching[0] !== undefined) {\n assertAiDeliveryWorktreeOwner(matching[0], root);\n registry.worktrees = registry.worktrees.filter((row) => row.path !== path);\n saveRegistryStrict(root, registry);\n logInfo(`Removed from worktree registry: ${path}`);\n return true;\n }\n\n return false;\n },\n projectRoot: root,\n timeout: 5000,\n });\n}\n\nexport async function updateIssueWorktreeDelivery(options: IssueWorktreeDeliveryTransition): Promise<void> {\n const { branch, issueNumber, path, status } = options;\n const root = options.projectRoot ?? process.cwd();\n ensureRegistryDirectory(root);\n await withLock(REGISTRY_PATH, {\n onTimeout: () => {\n logWarn(LOCK_RETRY_MESSAGE);\n },\n operation: () => {\n const registry = loadRegistryStrict(root);\n const matchingIndex = requireCanonicalIssueIndex({ branch, issueNumber, path, registry });\n const entry = registry.worktrees[matchingIndex];\n if (entry === undefined) {\n throw new Error(`Canonical registry row for issue #${String(issueNumber)} disappeared during transition.`);\n }\n assertAiDeliveryWorktreeOwner(entry, root);\n assertIssueDeliveryTransition({ entry, options });\n registry.worktrees.splice(matchingIndex, 1, {\n ...entry,\n ...(options.status === 'pr-published' ? { prNumber: options.prNumber } : {}),\n status,\n updatedAt: new Date().toISOString(),\n });\n saveRegistryStrict(root, registry);\n assertIssueDeliveryReadback({ options, registry: loadRegistryStrict(root) });\n },\n projectRoot: root,\n timeout: 5000,\n });\n}\n\nfunction assertIssueDeliveryReadback({\n options,\n registry,\n}: {\n options: IssueWorktreeDeliveryTransition;\n registry: WorktreeRegistry;\n}): void {\n const rows = registry.worktrees.filter(\n (candidate) => candidate.type === 'issue' && candidate.issueNumber === options.issueNumber,\n );\n const entry = rows[0];\n if (\n rows.length !== 1 ||\n entry === undefined ||\n entry.branch !== options.branch ||\n entry.path !== options.path ||\n entry.status !== options.status ||\n (options.status === 'pr-published' && entry.prNumber !== options.prNumber)\n ) {\n throw new Error(`Canonical registry transition readback failed for issue #${String(options.issueNumber)}.`);\n }\n}\n\nfunction assertIssueDeliveryTransition({\n entry,\n options,\n}: {\n entry: WorktreeEntry;\n options: IssueWorktreeDeliveryTransition;\n}): void {\n if (options.status === 'pr-published') {\n if (!Number.isSafeInteger(options.prNumber) || options.prNumber <= 0) {\n throw new Error(`Canonical PR number must be a positive integer for issue #${String(options.issueNumber)}.`);\n }\n if (entry.status === 'active' && entry.prNumber === undefined) {\n return;\n }\n if (entry.status === 'pr-published' && entry.prNumber === options.prNumber) {\n return;\n }\n if (entry.status === 'pr-published' && entry.prNumber !== undefined) {\n throw new Error(\n `Issue #${String(options.issueNumber)} cannot replace canonical PR #${String(entry.prNumber)} with #${String(options.prNumber)}.`,\n );\n }\n throw new Error(\n `Invalid issue delivery transition for #${String(options.issueNumber)}: ${entry.status} -> pr-published.`,\n );\n }\n\n if (\n (entry.status === 'pr-published' || entry.status === 'merged') &&\n entry.prNumber !== undefined &&\n Number.isSafeInteger(entry.prNumber) &&\n entry.prNumber > 0\n ) {\n return;\n }\n throw new Error(`Invalid issue delivery transition for #${String(options.issueNumber)}: ${entry.status} -> merged.`);\n}\n\nfunction ensureRegistryDirectory(root: string): void {\n ensureDataDirectory(root);\n}\n\nfunction isIdempotentRegistration(existing: WorktreeEntry, incoming: WorktreeEntry): boolean {\n return (\n existing.branch === incoming.branch &&\n existing.identity === incoming.identity &&\n existing.issueNumber === incoming.issueNumber &&\n existing.path === incoming.path &&\n existing.prNumber === incoming.prNumber &&\n existing.status === incoming.status &&\n existing.type === incoming.type\n );\n}\n\nfunction isMergedIssueReactivation(existing: WorktreeEntry, incoming: WorktreeEntry): boolean {\n return (\n existing.branch === incoming.branch &&\n existing.identity === incoming.identity &&\n existing.issueNumber === incoming.issueNumber &&\n existing.path === incoming.path &&\n existing.prNumber !== undefined &&\n existing.status === 'merged' &&\n existing.type === 'issue' &&\n incoming.prNumber === undefined &&\n incoming.status === 'active' &&\n incoming.type === 'issue'\n );\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction loadRegistry(root: string): WorktreeRegistry {\n const registryPath = resolve(root, REGISTRY_PATH);\n if (!existsSync(registryPath)) {\n return { worktrees: [] };\n }\n try {\n const raw = readFileSync(registryPath, 'utf8');\n const parsed = JSON.parse(raw) as {\n worktrees: (Partial<WorktreeEntry> & Pick<WorktreeEntry, 'branch' | 'createdAt' | 'path' | 'type'>)[];\n };\n return {\n worktrees: parsed.worktrees.map((entry) => {\n const status = normalizeStatus(entry.status);\n return {\n branch: entry.branch,\n createdAt: entry.createdAt,\n ...(entry.identity !== undefined ? { identity: entry.identity } : {}),\n ...(entry.issueNumber !== undefined ? { issueNumber: entry.issueNumber } : {}),\n path: entry.path,\n ...(entry.prNumber !== undefined ? { prNumber: entry.prNumber } : {}),\n status,\n type: entry.type,\n updatedAt: entry.updatedAt ?? entry.createdAt,\n };\n }),\n };\n } catch (error: unknown) {\n logWarn(`Failed to load worktree registry: ${error instanceof Error ? error.message : String(error)}`);\n return { worktrees: [] };\n }\n}\n\nfunction loadRegistryStrict(root: string): WorktreeRegistry {\n const registryPath = resolve(root, REGISTRY_PATH);\n if (!existsSync(registryPath)) {\n return { worktrees: [] };\n }\n try {\n const raw = readFileSync(registryPath, 'utf8');\n const parsed = JSON.parse(raw) as unknown;\n if (!isRecord(parsed) || Object.keys(parsed).length !== 1 || !Array.isArray(parsed.worktrees)) {\n throw new Error('Registry must be an object with a worktrees array.');\n }\n return {\n worktrees: parsed.worktrees.map((entry, index) => normalizeStrictWorktreeEntry(entry, index)),\n };\n } catch (error: unknown) {\n throw new Error(`Unable to read worktree registry: ${error instanceof Error ? error.message : String(error)}`);\n }\n}\n\nfunction normalizeStatus(raw: unknown): WorktreeStatus {\n if (raw === 'merged' || raw === 'pr-published' || raw === 'active' || raw === 'error' || raw === 'stale') {\n return raw;\n }\n throw new Error('Worktree registry status is invalid.');\n}\n\nfunction normalizeStrictWorktreeEntry(entry: unknown, index: number): WorktreeEntry {\n if (!isRecord(entry)) {\n throw new Error(`worktrees[${String(index)}] must be an object.`);\n }\n const allowed = new Set([\n 'branch',\n 'createdAt',\n 'identity',\n 'issueNumber',\n 'path',\n 'prNumber',\n 'status',\n 'type',\n 'updatedAt',\n ]);\n const unknown = Object.keys(entry).filter((key) => !allowed.has(key));\n if (unknown.length > 0) {\n throw new Error(`worktrees[${String(index)}] has unsupported fields: ${unknown.join(', ')}.`);\n }\n const branch = requiredString(entry.branch, `worktrees[${String(index)}].branch`);\n const createdAt = requiredString(entry.createdAt, `worktrees[${String(index)}].createdAt`);\n const path = requiredString(entry.path, `worktrees[${String(index)}].path`);\n const type = requiredWorktreeType(entry.type, `worktrees[${String(index)}].type`);\n const status = requiredWorktreeStatus(entry.status, `worktrees[${String(index)}].status`);\n const identity = optionalString(entry.identity, `worktrees[${String(index)}].identity`);\n const issueNumber = optionalPositiveInteger(entry.issueNumber, `worktrees[${String(index)}].issueNumber`);\n const prNumber = optionalPositiveInteger(entry.prNumber, `worktrees[${String(index)}].prNumber`);\n const updatedAt = requiredString(entry.updatedAt, `worktrees[${String(index)}].updatedAt`);\n\n if (type === 'issue' && issueNumber === undefined) {\n throw new Error(`worktrees[${String(index)}].issueNumber is required for issue worktrees.`);\n }\n return {\n branch,\n createdAt,\n ...(identity === undefined ? {} : { identity }),\n ...(issueNumber === undefined ? {} : { issueNumber }),\n path,\n ...(prNumber === undefined ? {} : { prNumber }),\n status,\n type,\n updatedAt,\n };\n}\n\nfunction optionalPositiveInteger(value: unknown, label: string): number | undefined {\n if (value === undefined) {\n return undefined;\n }\n if (typeof value !== 'number' || !Number.isSafeInteger(value) || value <= 0) {\n throw new Error(`${label} must be a positive integer.`);\n }\n return value;\n}\n\nfunction optionalString(value: unknown, label: string): string | undefined {\n if (value === undefined) {\n return undefined;\n }\n return requiredString(value, label);\n}\n\nfunction registryIdentitiesOverlap(left: WorktreeEntry, right: WorktreeEntry): boolean {\n return (\n left.path === right.path ||\n left.branch === right.branch ||\n (left.issueNumber !== undefined && right.issueNumber !== undefined && left.issueNumber === right.issueNumber) ||\n (left.prNumber !== undefined && right.prNumber !== undefined && left.prNumber === right.prNumber)\n );\n}\n\nfunction requireCanonicalIssueIndex({\n branch,\n issueNumber,\n path,\n registry,\n}: {\n branch: string;\n issueNumber: number;\n path: string;\n registry: WorktreeRegistry;\n}): number {\n const issueIndexes = registry.worktrees.flatMap((entry, index) =>\n entry.type === 'issue' && entry.issueNumber === issueNumber ? [index] : [],\n );\n if (issueIndexes.length !== 1) {\n throw new Error(\n `Expected exactly one canonical registry row for issue #${String(issueNumber)}; found ${String(issueIndexes.length)}.`,\n );\n }\n const matchingIndex = issueIndexes[0];\n const entry = matchingIndex === undefined ? undefined : registry.worktrees[matchingIndex];\n if (matchingIndex === undefined || entry === undefined) {\n throw new Error(`Canonical registry row for issue #${String(issueNumber)} disappeared during transition.`);\n }\n if (entry.branch !== branch || entry.path !== path) {\n throw new Error(\n `Canonical registry row for issue #${String(issueNumber)} does not match branch ${branch} and path ${path}.`,\n );\n }\n return matchingIndex;\n}\n\nfunction requiredString(value: unknown, label: string): string {\n if (typeof value !== 'string' || value.trim().length === 0) {\n throw new Error(`${label} must be a non-empty string.`);\n }\n return value;\n}\n\nfunction requiredWorktreeStatus(value: unknown, label: string): WorktreeStatus {\n if (value === 'merged' || value === 'pr-published' || value === 'active' || value === 'error' || value === 'stale') {\n return value;\n }\n throw new Error(`${label} is invalid.`);\n}\n\nfunction requiredWorktreeType(value: unknown, label: string): WorktreeEntry['type'] {\n if (value === 'issue' || value === 'pr' || value === 'standalone') {\n return value;\n }\n throw new Error(`${label} is invalid.`);\n}\n\nfunction saveRegistryStrict(root: string, registry: WorktreeRegistry): void {\n ensureRegistryDirectory(root);\n const registryPath = resolve(root, REGISTRY_PATH);\n try {\n writeJsonFileAtomically(registryPath, registry);\n } catch (error: unknown) {\n throw new Error(`Unable to save worktree registry: ${error instanceof Error ? error.message : String(error)}`);\n }\n}\n\n/** Current, prospective custody is separate from legacy producer/policy transitions. */\n"],
5
- "mappings": "AAAA,SAAS,WAAW,YAAY,WAAW,WAAW,UAAU,cAAc,mBAAmB;AACjG,SAAS,SAAS,MAAM,eAAe;AACvC,SAAS,SAAS;AAElB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,mBAAmB;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W,UAAU,QAAQ,UAAU,cAAc;AACjE,WAAO;AAAA,EACT;AACA,QAAM,IAAI,MAAM,GAAG,KAAK,cAAc;AACxC;AAEA,SAAS,mBAAmB,MAAc,UAAkC;AAC1E,0BAAwB,IAAI;AAC5B,QAAM,eAAe,QAAQ,MAAM,aAAa;AAChD,MAAI;AACF,4BAAwB,cAAc,QAAQ;AAAA,EAChD,SAAS,OAAgB;AACvB,UAAM,IAAI,MAAM,qCAAqC,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC,EAAE;AAAA,EAC/G;AACF;",
6
- "names": ["name", "row", "existing", "entry"]
7
- }
@@ -1,16 +0,0 @@
1
- import type { WorktreeEntry } from './services/worktreeRegistry.js';
2
- /** @internal Shared physical custody check for preparation and same-owner continuation. */
3
- export declare function assertIssueWorktreeLocation(row: WorktreeEntry, root: string): void;
4
- export interface MergeCleanupAttestation {
5
- baseBranch: string;
6
- baseSha: string;
7
- headBranch: string;
8
- headSha: string;
9
- mergeSha: string;
10
- mergeTree: string;
11
- remoteBaseSha: string;
12
- remoteHeadSha: string | null;
13
- strategy: 'merge' | 'squash' | 'rebase';
14
- }
15
- /** Remove only a finished, retained source and its exact local branch; never force Git removal. */
16
- export declare function removeFinishedIssueSource(row: WorktreeEntry, root: string, headSha: string, attestation?: MergeCleanupAttestation): void;
package/dist/worktree.js DELETED
@@ -1,108 +0,0 @@
1
- import { existsSync, lstatSync, realpathSync } from "node:fs";
2
- import { isAbsolute, join, relative, sep } from "node:path";
3
- import { resolveGitRemoteName } from "./github/repo.js";
4
- import { DeliveryError } from "./errors.js";
5
- import { assertClean, defaultBaseRef, git, gitCommonDir, gitExitCode, gitRoot, primaryGitRoot } from "./git.js";
6
- function assertSafePath(root, target) {
7
- const rel = relative(join(root, ".worktrees"), target);
8
- if (rel === "" || rel.startsWith("..") || rel.startsWith("/")) {
9
- throw new DeliveryError("Worktree path must be inside the repository .worktrees directory.");
10
- }
11
- }
12
- function assertIssueNumber(issueNumber) {
13
- if (!Number.isSafeInteger(issueNumber) || issueNumber <= 0) throw new DeliveryError("Issue number must be positive.");
14
- }
15
- function assertIssueWorktreeLocation(row, root) {
16
- assertIssueNumber(row.issueNumber ?? 0);
17
- const branch = `issue/${String(row.issueNumber)}`;
18
- const target = join(root, ".worktrees", `issue-${String(row.issueNumber)}`);
19
- if (row.type !== "issue" || row.path !== target || row.branch !== branch || !existsSync(target) || gitRoot(target) !== realpathSync(target) || gitCommonDir(target) !== gitCommonDir(root)) {
20
- throw new DeliveryError("Registered worktree disagrees with its exact repository, path or branch.");
21
- }
22
- if (git(target, "branch", "--show-current") !== branch) throw new DeliveryError("Registered branch drifted.");
23
- }
24
- function gitWorktreeRows(root) {
25
- return git(root, "worktree", "list", "--porcelain").split("\n\n").filter(Boolean).map((block) => block.split("\n"));
26
- }
27
- function pathPresent(path) {
28
- try {
29
- lstatSync(path);
30
- return true;
31
- } catch (error) {
32
- if (error.code === "ENOENT") return false;
33
- throw error;
34
- }
35
- }
36
- function removeMergedIssueSource(row, root, remote, attestation, allowAbsent) {
37
- assertSafePath(root, row.path);
38
- if (row.status !== "merged" || row.path !== join(root, ".worktrees", `issue-${String(row.issueNumber)}`)) {
39
- throw new DeliveryError("Only the exact registered merged issue worktree can be cleaned.");
40
- }
41
- const present = existsSync(row.path);
42
- if (present && gitRoot(row.path) !== realpathSync(row.path)) {
43
- throw new DeliveryError("Registered worktree points elsewhere.");
44
- }
45
- if (!present && !allowAbsent) {
46
- throw new DeliveryError("Registered worktree is missing.");
47
- }
48
- if (present) assertClean(row.path);
49
- const base = defaultBaseRef(root, remote);
50
- const branchIncluded = gitExitCode(root, "merge-base", "--is-ancestor", row.branch, base) === 0;
51
- if (attestation) {
52
- if (attestation.headBranch !== row.branch || attestation.headSha !== git(present ? row.path : root, "rev-parse", present ? "HEAD" : row.branch) || attestation.remoteHeadSha !== null && attestation.remoteHeadSha !== attestation.headSha || attestation.baseBranch !== base.slice(`refs/remotes/${resolveGitRemoteName(root, remote)}/`.length) || attestation.remoteBaseSha !== git(root, "rev-parse", base) || gitExitCode(root, "merge-base", "--is-ancestor", attestation.baseSha, attestation.mergeSha) !== 0 || gitExitCode(root, "merge-base", "--is-ancestor", attestation.mergeSha, base) !== 0 || git(root, "rev-parse", `${attestation.mergeSha}^{tree}`) !== attestation.mergeTree || !branchIncluded && attestation.strategy === "merge") {
53
- throw new DeliveryError("Exact merged-result cleanup attestation disagrees with Git or remote readback.");
54
- }
55
- } else if (!branchIncluded) {
56
- throw new DeliveryError(
57
- "Branch is not included in the current base and exact merged-result attestation is absent."
58
- );
59
- }
60
- if (present) git(root, "worktree", "remove", row.path);
61
- }
62
- function removeFinishedIssueSource(row, root, headSha, attestation) {
63
- assertIssueNumber(row.issueNumber ?? 0);
64
- if (row.branch !== `issue/${String(row.issueNumber)}` || row.path !== join(root, ".worktrees", `issue-${String(row.issueNumber)}`))
65
- throw new DeliveryError("Registered path or branch differs from the finished issue; preserve the source.");
66
- if (gitExitCode(root, "symbolic-ref", "--quiet", `refs/heads/${row.branch}`) === 0)
67
- throw new DeliveryError("Registered branch is symbolic; preserve its target and restore direct branch ownership.");
68
- if (pathPresent(row.path) && realpathSync(row.path) !== row.path)
69
- throw new DeliveryError("Registered source has a symlinked path; preserve its physical worktree.");
70
- const current = relative(row.path, realpathSync(process.cwd()));
71
- if (row.path === primaryGitRoot(root) || !(current === ".." || current.startsWith(`..${sep}`) || isAbsolute(current)))
72
- throw new DeliveryError("Cleanup targets the current or primary worktree; run finish from outside that worktree.");
73
- const rows = gitWorktreeRows(root).filter(
74
- (lines) => lines.includes(`worktree ${row.path}`) || lines.includes(`branch refs/heads/${row.branch}`)
75
- );
76
- if (pathPresent(row.path)) {
77
- if (lstatSync(row.path).isSymbolicLink())
78
- throw new DeliveryError("Registered source is a symlink; preserve the source.");
79
- assertIssueWorktreeLocation(row, root);
80
- try {
81
- assertClean(row.path);
82
- } catch {
83
- throw new DeliveryError("Worktree contains local changes; preserve them before cleanup.");
84
- }
85
- if (rows.length !== 1 || rows[0].some((line) => /^(?:locked|prunable)(?: |$)/u.test(line)))
86
- throw new DeliveryError("Worktree custody is ambiguous or locked; preserve the source.");
87
- if (git(row.path, "ls-files", "-v", "-z").split("\0").some((entry) => /^(?:[a-z]|S) /u.test(entry)))
88
- throw new DeliveryError("Worktree has hidden index entries; preserve local data before cleanup.");
89
- if (git(row.path, "ls-files", "--others", "--ignored", "--exclude-standard", "-z") !== "")
90
- throw new DeliveryError("Worktree contains ignored files; preserve local data before cleanup.");
91
- } else if (rows.length !== 0)
92
- throw new DeliveryError("Missing worktree still has Git custody; reconcile it without forced cleanup.");
93
- if (gitExitCode(root, "show-ref", "--verify", "--quiet", `refs/heads/${row.branch}`) !== 0) {
94
- if (!pathPresent(row.path)) return;
95
- throw new DeliveryError("Registered branch is absent; preserve the source.");
96
- }
97
- if (git(root, "rev-parse", `refs/heads/${row.branch}`) !== headSha)
98
- throw new DeliveryError("Local branch differs from the finished PR head; preserve its commits.");
99
- removeMergedIssueSource(row, root, void 0, attestation, true);
100
- git(root, "update-ref", "--no-deref", "-d", `refs/heads/${row.branch}`, headSha);
101
- if (pathPresent(row.path) || gitExitCode(root, "show-ref", "--verify", "--quiet", `refs/heads/${row.branch}`) === 0)
102
- throw new DeliveryError("Cleanup readback is incomplete; inspect the retained source without retrying removal.");
103
- }
104
- export {
105
- assertIssueWorktreeLocation,
106
- removeFinishedIssueSource
107
- };
108
- //# sourceMappingURL=worktree.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/worktree.ts"],
4
- "sourcesContent": ["import { existsSync, lstatSync, realpathSync } from 'node:fs';\nimport { isAbsolute, join, relative, sep } from 'node:path';\n\nimport { resolveGitRemoteName } from './github/repo.js';\n\nimport { DeliveryError } from './errors.js';\nimport { assertClean, defaultBaseRef, git, gitCommonDir, gitExitCode, gitRoot, primaryGitRoot } from './git.js';\nimport type { WorktreeEntry } from './services/worktreeRegistry.js';\n\nfunction assertSafePath(root: string, target: string): void {\n const rel = relative(join(root, '.worktrees'), target);\n if (rel === '' || rel.startsWith('..') || rel.startsWith('/')) {\n throw new DeliveryError('Worktree path must be inside the repository .worktrees directory.');\n }\n}\n\nfunction assertIssueNumber(issueNumber: number): void {\n if (!Number.isSafeInteger(issueNumber) || issueNumber <= 0) throw new DeliveryError('Issue number must be positive.');\n}\n\n/** @internal Shared physical custody check for preparation and same-owner continuation. */\nexport function assertIssueWorktreeLocation(row: WorktreeEntry, root: string): void {\n assertIssueNumber(row.issueNumber ?? 0);\n const branch = `issue/${String(row.issueNumber)}`;\n const target = join(root, '.worktrees', `issue-${String(row.issueNumber)}`);\n if (\n row.type !== 'issue' ||\n row.path !== target ||\n row.branch !== branch ||\n !existsSync(target) ||\n gitRoot(target) !== realpathSync(target) ||\n gitCommonDir(target) !== gitCommonDir(root)\n ) {\n throw new DeliveryError('Registered worktree disagrees with its exact repository, path or branch.');\n }\n if (git(target, 'branch', '--show-current') !== branch) throw new DeliveryError('Registered branch drifted.');\n}\n\nfunction gitWorktreeRows(root: string): string[][] {\n return git(root, 'worktree', 'list', '--porcelain')\n .split('\\n\\n')\n .filter(Boolean)\n .map((block) => block.split('\\n'));\n}\nfunction pathPresent(path: string): boolean {\n try {\n lstatSync(path);\n return true;\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === 'ENOENT') return false;\n throw error;\n }\n}\n\nexport interface MergeCleanupAttestation {\n baseBranch: string;\n baseSha: string;\n headBranch: string;\n headSha: string;\n mergeSha: string;\n mergeTree: string;\n remoteBaseSha: string;\n remoteHeadSha: string | null;\n strategy: 'merge' | 'squash' | 'rebase';\n}\n\nfunction removeMergedIssueSource(\n row: WorktreeEntry,\n root: string,\n remote: string | undefined,\n attestation: MergeCleanupAttestation | undefined,\n allowAbsent: boolean,\n): void {\n assertSafePath(root, row.path);\n if (row.status !== 'merged' || row.path !== join(root, '.worktrees', `issue-${String(row.issueNumber)}`)) {\n throw new DeliveryError('Only the exact registered merged issue worktree can be cleaned.');\n }\n const present = existsSync(row.path);\n if (present && gitRoot(row.path) !== realpathSync(row.path)) {\n throw new DeliveryError('Registered worktree points elsewhere.');\n }\n if (!present && !allowAbsent) {\n throw new DeliveryError('Registered worktree is missing.');\n }\n if (present) assertClean(row.path);\n const base = defaultBaseRef(root, remote);\n const branchIncluded = gitExitCode(root, 'merge-base', '--is-ancestor', row.branch, base) === 0;\n if (attestation) {\n if (\n attestation.headBranch !== row.branch ||\n attestation.headSha !== git(present ? row.path : root, 'rev-parse', present ? 'HEAD' : row.branch) ||\n (attestation.remoteHeadSha !== null && attestation.remoteHeadSha !== attestation.headSha) ||\n attestation.baseBranch !== base.slice(`refs/remotes/${resolveGitRemoteName(root, remote)}/`.length) ||\n attestation.remoteBaseSha !== git(root, 'rev-parse', base) ||\n gitExitCode(root, 'merge-base', '--is-ancestor', attestation.baseSha, attestation.mergeSha) !== 0 ||\n gitExitCode(root, 'merge-base', '--is-ancestor', attestation.mergeSha, base) !== 0 ||\n git(root, 'rev-parse', `${attestation.mergeSha}^{tree}`) !== attestation.mergeTree ||\n (!branchIncluded && attestation.strategy === 'merge')\n ) {\n throw new DeliveryError('Exact merged-result cleanup attestation disagrees with Git or remote readback.');\n }\n } else if (!branchIncluded) {\n throw new DeliveryError(\n 'Branch is not included in the current base and exact merged-result attestation is absent.',\n );\n }\n if (present) git(root, 'worktree', 'remove', row.path);\n}\n\n/** Remove only a finished, retained source and its exact local branch; never force Git removal. */\nexport function removeFinishedIssueSource(\n row: WorktreeEntry,\n root: string,\n headSha: string,\n attestation?: MergeCleanupAttestation,\n): void {\n assertIssueNumber(row.issueNumber ?? 0);\n if (\n row.branch !== `issue/${String(row.issueNumber)}` ||\n row.path !== join(root, '.worktrees', `issue-${String(row.issueNumber)}`)\n )\n throw new DeliveryError('Registered path or branch differs from the finished issue; preserve the source.');\n if (gitExitCode(root, 'symbolic-ref', '--quiet', `refs/heads/${row.branch}`) === 0)\n throw new DeliveryError('Registered branch is symbolic; preserve its target and restore direct branch ownership.');\n if (pathPresent(row.path) && realpathSync(row.path) !== row.path)\n throw new DeliveryError('Registered source has a symlinked path; preserve its physical worktree.');\n const current = relative(row.path, realpathSync(process.cwd()));\n if (row.path === primaryGitRoot(root) || !(current === '..' || current.startsWith(`..${sep}`) || isAbsolute(current)))\n throw new DeliveryError('Cleanup targets the current or primary worktree; run finish from outside that worktree.');\n const rows = gitWorktreeRows(root).filter(\n (lines) => lines.includes(`worktree ${row.path}`) || lines.includes(`branch refs/heads/${row.branch}`),\n );\n if (pathPresent(row.path)) {\n if (lstatSync(row.path).isSymbolicLink())\n throw new DeliveryError('Registered source is a symlink; preserve the source.');\n assertIssueWorktreeLocation(row, root);\n try {\n assertClean(row.path);\n } catch {\n throw new DeliveryError('Worktree contains local changes; preserve them before cleanup.');\n }\n if (rows.length !== 1 || rows[0]!.some((line) => /^(?:locked|prunable)(?: |$)/u.test(line)))\n throw new DeliveryError('Worktree custody is ambiguous or locked; preserve the source.');\n if (\n git(row.path, 'ls-files', '-v', '-z')\n .split('\\0')\n .some((entry) => /^(?:[a-z]|S) /u.test(entry))\n )\n throw new DeliveryError('Worktree has hidden index entries; preserve local data before cleanup.');\n if (git(row.path, 'ls-files', '--others', '--ignored', '--exclude-standard', '-z') !== '')\n throw new DeliveryError('Worktree contains ignored files; preserve local data before cleanup.');\n } else if (rows.length !== 0)\n throw new DeliveryError('Missing worktree still has Git custody; reconcile it without forced cleanup.');\n if (gitExitCode(root, 'show-ref', '--verify', '--quiet', `refs/heads/${row.branch}`) !== 0) {\n if (!pathPresent(row.path)) return;\n throw new DeliveryError('Registered branch is absent; preserve the source.');\n }\n if (git(root, 'rev-parse', `refs/heads/${row.branch}`) !== headSha)\n throw new DeliveryError('Local branch differs from the finished PR head; preserve its commits.');\n removeMergedIssueSource(row, root, undefined, attestation, true);\n git(root, 'update-ref', '--no-deref', '-d', `refs/heads/${row.branch}`, headSha);\n if (pathPresent(row.path) || gitExitCode(root, 'show-ref', '--verify', '--quiet', `refs/heads/${row.branch}`) === 0)\n throw new DeliveryError('Cleanup readback is incomplete; inspect the retained source without retrying removal.');\n}\n"],
5
- "mappings": "AAAA,SAAS,YAAY,WAAW,oBAAoB;AACpD,SAAS,YAAY,MAAM,UAAU,WAAW;AAEhD,SAAS,4BAA4B;AAErC,SAAS,qBAAqB;AAC9B,SAAS,aAAa,gBAAgB,KAAK,cAAc,aAAa,SAAS,sBAAsB;AAGrG,SAAS,eAAe,MAAc,QAAsB;AAC1D,QAAM,MAAM,SAAS,KAAK,MAAM,YAAY,GAAG,MAAM;AACrD,MAAI,QAAQ,MAAM,IAAI,WAAW,IAAI,KAAK,IAAI,WAAW,GAAG,GAAG;AAC7D,UAAM,IAAI,cAAc,mEAAmE;AAAA,EAC7F;AACF;AAEA,SAAS,kBAAkB,aAA2B;AACpD,MAAI,CAAC,OAAO,cAAc,WAAW,KAAK,eAAe,EAAG,OAAM,IAAI,cAAc,gCAAgC;AACtH;AAGO,SAAS,4BAA4B,KAAoB,MAAoB;AAClF,oBAAkB,IAAI,eAAe,CAAC;AACtC,QAAM,SAAS,SAAS,OAAO,IAAI,WAAW,CAAC;AAC/C,QAAM,SAAS,KAAK,MAAM,cAAc,SAAS,OAAO,IAAI,WAAW,CAAC,EAAE;AAC1E,MACE,IAAI,SAAS,WACb,IAAI,SAAS,UACb,IAAI,WAAW,UACf,CAAC,WAAW,MAAM,KAClB,QAAQ,MAAM,MAAM,aAAa,MAAM,KACvC,aAAa,MAAM,MAAM,aAAa,IAAI,GAC1C;AACA,UAAM,IAAI,cAAc,0EAA0E;AAAA,EACpG;AACA,MAAI,IAAI,QAAQ,UAAU,gBAAgB,MAAM,OAAQ,OAAM,IAAI,cAAc,4BAA4B;AAC9G;AAEA,SAAS,gBAAgB,MAA0B;AACjD,SAAO,IAAI,MAAM,YAAY,QAAQ,aAAa,EAC/C,MAAM,MAAM,EACZ,OAAO,OAAO,EACd,IAAI,CAAC,UAAU,MAAM,MAAM,IAAI,CAAC;AACrC;AACA,SAAS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