@on-par/factory-core 0.9.14-next.1 → 0.9.14-next.11
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/config/build-route.d.ts +35 -0
- package/dist/config/build-route.d.ts.map +1 -0
- package/dist/config/build-route.js +47 -0
- package/dist/config/build-route.js.map +1 -0
- package/dist/config/config-schema-lint.d.ts.map +1 -1
- package/dist/config/config-schema-lint.js +20 -25
- package/dist/config/config-schema-lint.js.map +1 -1
- package/dist/config/effort.d.ts.map +1 -1
- package/dist/config/effort.js +0 -1
- package/dist/config/effort.js.map +1 -1
- package/dist/config/index.d.ts +3 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +25 -73
- package/dist/config/index.js.map +1 -1
- package/dist/config/policy.d.ts +4 -6
- package/dist/config/policy.d.ts.map +1 -1
- package/dist/config/policy.js +29 -38
- package/dist/config/policy.js.map +1 -1
- package/dist/config/precedence.d.ts +17 -0
- package/dist/config/precedence.d.ts.map +1 -0
- package/dist/config/precedence.js +13 -0
- package/dist/config/precedence.js.map +1 -0
- package/dist/config/repo-config-file.d.ts +4 -0
- package/dist/config/repo-config-file.d.ts.map +1 -1
- package/dist/config/repo-config-file.js +35 -0
- package/dist/config/repo-config-file.js.map +1 -1
- package/dist/config/repo-harnesses.js +3 -3
- package/dist/config/repo-harnesses.js.map +1 -1
- package/dist/config/repo.d.ts +4 -18
- package/dist/config/repo.d.ts.map +1 -1
- package/dist/config/repo.js +115 -164
- package/dist/config/repo.js.map +1 -1
- package/dist/config/sandbox-schema.d.ts +30 -0
- package/dist/config/sandbox-schema.d.ts.map +1 -0
- package/dist/config/sandbox-schema.js +39 -0
- package/dist/config/sandbox-schema.js.map +1 -0
- package/dist/config/v2.d.ts +1 -0
- package/dist/config/v2.d.ts.map +1 -1
- package/dist/config/v2.js +1 -0
- package/dist/config/v2.js.map +1 -1
- package/dist/eval/index.d.ts +2 -1
- package/dist/eval/index.d.ts.map +1 -1
- package/dist/eval/index.js +2 -1
- package/dist/eval/index.js.map +1 -1
- package/dist/eval/judge.d.ts +0 -1
- package/dist/eval/judge.d.ts.map +1 -1
- package/dist/eval/judge.js +2 -6
- package/dist/eval/judge.js.map +1 -1
- package/dist/harness/catalog.d.ts +17 -0
- package/dist/harness/catalog.d.ts.map +1 -1
- package/dist/harness/catalog.js +35 -8
- package/dist/harness/catalog.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/internal.d.ts +6 -5
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +5 -4
- package/dist/internal.js.map +1 -1
- package/dist/kpis/index.d.ts.map +1 -1
- package/dist/kpis/index.js +8 -10
- package/dist/kpis/index.js.map +1 -1
- package/dist/kpis/steerability.d.ts.map +1 -1
- package/dist/kpis/steerability.js +4 -3
- package/dist/kpis/steerability.js.map +1 -1
- package/dist/models/index.d.ts +3 -2
- package/dist/models/index.d.ts.map +1 -1
- package/dist/models/index.js +7 -15
- package/dist/models/index.js.map +1 -1
- package/dist/phases/build-prompts.d.ts.map +1 -1
- package/dist/phases/build-prompts.js +3 -0
- package/dist/phases/build-prompts.js.map +1 -1
- package/dist/phases/ship.d.ts.map +1 -1
- package/dist/phases/ship.js +24 -16
- package/dist/phases/ship.js.map +1 -1
- package/dist/queue/claim-liveness.d.ts +17 -0
- package/dist/queue/claim-liveness.d.ts.map +1 -0
- package/dist/queue/claim-liveness.js +25 -0
- package/dist/queue/claim-liveness.js.map +1 -0
- package/dist/queue/stale-claims.d.ts.map +1 -1
- package/dist/queue/stale-claims.js +6 -18
- package/dist/queue/stale-claims.js.map +1 -1
- package/dist/router/index.d.ts +5 -20
- package/dist/router/index.d.ts.map +1 -1
- package/dist/router/index.js +29 -310
- package/dist/router/index.js.map +1 -1
- package/dist/run/adopt-pr.d.ts +1 -0
- package/dist/run/adopt-pr.d.ts.map +1 -1
- package/dist/run/adopt-pr.js +21 -30
- package/dist/run/adopt-pr.js.map +1 -1
- package/dist/run/check-verdict.d.ts +13 -0
- package/dist/run/check-verdict.d.ts.map +1 -0
- package/dist/run/check-verdict.js +27 -0
- package/dist/run/check-verdict.js.map +1 -0
- package/dist/run/ci-rework-loop.d.ts +7 -3
- package/dist/run/ci-rework-loop.d.ts.map +1 -1
- package/dist/run/ci-rework-loop.js +4 -11
- package/dist/run/ci-rework-loop.js.map +1 -1
- package/dist/run/lane-file-guard.d.ts +2 -2
- package/dist/run/lane-file-guard.d.ts.map +1 -1
- package/dist/run/lane-file-guard.js +4 -9
- package/dist/run/lane-file-guard.js.map +1 -1
- package/dist/run/max-lines-override.d.ts +11 -0
- package/dist/run/max-lines-override.d.ts.map +1 -0
- package/dist/run/max-lines-override.js +17 -0
- package/dist/run/max-lines-override.js.map +1 -0
- package/dist/run/park-comment.d.ts +20 -1
- package/dist/run/park-comment.d.ts.map +1 -1
- package/dist/run/park-comment.js +25 -5
- package/dist/run/park-comment.js.map +1 -1
- package/dist/run/ports.d.ts +2 -0
- package/dist/run/ports.d.ts.map +1 -1
- package/dist/run/ports.js +1 -0
- package/dist/run/ports.js.map +1 -1
- package/dist/run/pr-lookup.d.ts +56 -0
- package/dist/run/pr-lookup.d.ts.map +1 -0
- package/dist/run/pr-lookup.js +67 -0
- package/dist/run/pr-lookup.js.map +1 -0
- package/dist/run/run-issue.d.ts.map +1 -1
- package/dist/run/run-issue.js +79 -69
- package/dist/run/run-issue.js.map +1 -1
- package/dist/run/state.d.ts +19 -0
- package/dist/run/state.d.ts.map +1 -1
- package/dist/run/state.js +52 -2
- package/dist/run/state.js.map +1 -1
- package/dist/run/terminal-events.d.ts +4 -0
- package/dist/run/terminal-events.d.ts.map +1 -0
- package/dist/run/terminal-events.js +15 -0
- package/dist/run/terminal-events.js.map +1 -0
- package/dist/sandbox/index.d.ts +2 -0
- package/dist/sandbox/index.d.ts.map +1 -1
- package/dist/sandbox/index.js +5 -1
- package/dist/sandbox/index.js.map +1 -1
- package/dist/sandbox/writable-paths.d.ts +11 -0
- package/dist/sandbox/writable-paths.d.ts.map +1 -0
- package/dist/sandbox/writable-paths.js +45 -0
- package/dist/sandbox/writable-paths.js.map +1 -0
- package/dist/sim/pipeline.js +1 -1
- package/dist/sim/pipeline.js.map +1 -1
- package/dist/usage/index.js +1 -1
- package/dist/usage/index.js.map +1 -1
- package/dist/utils/index.d.ts +8 -2
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +7 -6
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/lane-removal.d.ts +15 -0
- package/dist/utils/lane-removal.d.ts.map +1 -0
- package/dist/utils/lane-removal.js +51 -0
- package/dist/utils/lane-removal.js.map +1 -0
- package/dist/utils/median.d.ts +4 -0
- package/dist/utils/median.d.ts.map +1 -0
- package/dist/utils/median.js +11 -0
- package/dist/utils/median.js.map +1 -0
- package/dist/utils/worktree-gc.d.ts +1 -171
- package/dist/utils/worktree-gc.d.ts.map +1 -1
- package/dist/utils/worktree-gc.js +2 -739
- package/dist/utils/worktree-gc.js.map +1 -1
- package/dist/utils/worktree-keeps.d.ts +1 -19
- package/dist/utils/worktree-keeps.d.ts.map +1 -1
- package/dist/utils/worktree-keeps.js +2 -64
- package/dist/utils/worktree-keeps.js.map +1 -1
- package/dist/utils/worktree-name.d.ts +1 -9
- package/dist/utils/worktree-name.d.ts.map +1 -1
- package/dist/utils/worktree-name.js +2 -30
- package/dist/utils/worktree-name.js.map +1 -1
- package/dist/worktree/worktree-gc-decide.d.ts +40 -0
- package/dist/worktree/worktree-gc-decide.d.ts.map +1 -0
- package/dist/worktree/worktree-gc-decide.js +117 -0
- package/dist/worktree/worktree-gc-decide.js.map +1 -0
- package/dist/worktree/worktree-gc-evidence.d.ts +87 -0
- package/dist/worktree/worktree-gc-evidence.d.ts.map +1 -0
- package/dist/worktree/worktree-gc-evidence.js +206 -0
- package/dist/worktree/worktree-gc-evidence.js.map +1 -0
- package/dist/worktree/worktree-gc-issues.d.ts +26 -0
- package/dist/worktree/worktree-gc-issues.d.ts.map +1 -0
- package/dist/worktree/worktree-gc-issues.js +51 -0
- package/dist/worktree/worktree-gc-issues.js.map +1 -0
- package/dist/worktree/worktree-gc-scrub.d.ts +10 -0
- package/dist/worktree/worktree-gc-scrub.d.ts.map +1 -0
- package/dist/worktree/worktree-gc-scrub.js +89 -0
- package/dist/worktree/worktree-gc-scrub.js.map +1 -0
- package/dist/worktree/worktree-gc-types.d.ts +142 -0
- package/dist/worktree/worktree-gc-types.d.ts.map +1 -0
- package/dist/worktree/worktree-gc-types.js +33 -0
- package/dist/worktree/worktree-gc-types.js.map +1 -0
- package/dist/worktree/worktree-gc.d.ts +32 -0
- package/dist/worktree/worktree-gc.d.ts.map +1 -0
- package/dist/worktree/worktree-gc.js +313 -0
- package/dist/worktree/worktree-gc.js.map +1 -0
- package/dist/worktree/worktree-keeps.d.ts +20 -0
- package/dist/worktree/worktree-keeps.d.ts.map +1 -0
- package/dist/worktree/worktree-keeps.js +65 -0
- package/dist/worktree/worktree-keeps.js.map +1 -0
- package/dist/worktree/worktree-name.d.ts +10 -0
- package/dist/worktree/worktree-name.d.ts.map +1 -0
- package/dist/worktree/worktree-name.js +31 -0
- package/dist/worktree/worktree-name.js.map +1 -0
- package/package.json +5 -5
- package/dist/utils/worktree-gc-issues.d.ts +0 -22
- package/dist/utils/worktree-gc-issues.d.ts.map +0 -1
- package/dist/utils/worktree-gc-issues.js +0 -80
- package/dist/utils/worktree-gc-issues.js.map +0 -1
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type GcReason, type GcReport, type SweepDeps, type WorktreeListEntry } from './worktree-gc-types.js';
|
|
2
|
+
export * from './worktree-gc-types.js';
|
|
3
|
+
export { findCredentialFiles, scrubFile, zeroFill } from './worktree-gc-scrub.js';
|
|
4
|
+
export { countUnpushedCommits, isWorktreeClean, isZeroCommitLane } from './worktree-gc-evidence.js';
|
|
5
|
+
/** Removal reasons that prove the work reached the remote — the only ones whose local
|
|
6
|
+
* branch is safe to force-delete unconditionally. `ttl-expired` fires on age alone and is
|
|
7
|
+
* excluded: its branch may be the last reachable handle on unpushed commits. The issue-driven
|
|
8
|
+
* reasons (`issue-closed` / `issue-parked`) are also excluded here — they delete the branch
|
|
9
|
+
* only when the candidate's per-candidate `branchReapable` flag proved remote evidence at
|
|
10
|
+
* decision time. See ADR (this PR). */
|
|
11
|
+
export declare const BRANCH_REAPABLE_REASONS: ReadonlySet<GcReason>;
|
|
12
|
+
/** Where a quarantined worktree lands: `<state>/quarantine/`, matching every other runtime
|
|
13
|
+
* path's home under the resolved state dir (see `getFactoryPaths`). */
|
|
14
|
+
export declare function quarantineRoot(repoRoot: string): string;
|
|
15
|
+
/** The destination for a quarantined worktree: its own basename under `quarantineDir`, unless
|
|
16
|
+
* that name is already occupied (e.g. a prior quarantine nobody cleared), in which case a
|
|
17
|
+
* timestamp suffix disambiguates rather than overwriting or failing. */
|
|
18
|
+
export declare function quarantineDestination(quarantineDir: string, worktreePath: string): string;
|
|
19
|
+
export declare function parseWorktreeList(porcelain: string): WorktreeListEntry[];
|
|
20
|
+
export declare function sweepWorktrees(opts: {
|
|
21
|
+
repoRoot: string;
|
|
22
|
+
ttlDays: number;
|
|
23
|
+
dryRun?: boolean;
|
|
24
|
+
repo?: string;
|
|
25
|
+
branchPrefix?: string;
|
|
26
|
+
/** Issues other lanes of this run have in flight: never reaped, whatever their age or PR state (#2964). */
|
|
27
|
+
protectedIssues?: ReadonlySet<number>;
|
|
28
|
+
/** worktree-keeps.json to honor (#3316); defaults to the repo's state file. */
|
|
29
|
+
keepsFile?: string;
|
|
30
|
+
}, deps?: SweepDeps): Promise<GcReport>;
|
|
31
|
+
export declare function formatGcReport(report: GcReport): string;
|
|
32
|
+
//# sourceMappingURL=worktree-gc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worktree-gc.d.ts","sourceRoot":"","sources":["../../src/worktree/worktree-gc.ts"],"names":[],"mapp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, renameSync, rmSync } from 'node:fs';
|
|
3
|
+
import { basename, join, resolve } from 'node:path';
|
|
4
|
+
import { getFactoryPaths } from '../config/index.js';
|
|
5
|
+
import { factoryBranchPrefixes, shellEscape } from '../utils/index.js';
|
|
6
|
+
import { removeMicroVm } from '../utils/microvm.js';
|
|
7
|
+
import { decideWorktree } from './worktree-gc-decide.js';
|
|
8
|
+
import { createEvidenceContext, defaultRunCommand, gatherWorktreeEvidence, laneIssueNumber, resolveMainTip, } from './worktree-gc-evidence.js';
|
|
9
|
+
import { findCredentialFiles, scrubFile } from './worktree-gc-scrub.js';
|
|
10
|
+
import { defaultIssueWarnDedup, } from './worktree-gc-types.js';
|
|
11
|
+
import { isFactoryDirName } from './worktree-name.js';
|
|
12
|
+
import { readWorktreeKeeps, releaseWorktreeKeeps } from './worktree-keeps.js';
|
|
13
|
+
export * from './worktree-gc-types.js';
|
|
14
|
+
export { findCredentialFiles, scrubFile, zeroFill } from './worktree-gc-scrub.js';
|
|
15
|
+
export { countUnpushedCommits, isWorktreeClean, isZeroCommitLane } from './worktree-gc-evidence.js';
|
|
16
|
+
/** Removal reasons that prove the work reached the remote — the only ones whose local
|
|
17
|
+
* branch is safe to force-delete unconditionally. `ttl-expired` fires on age alone and is
|
|
18
|
+
* excluded: its branch may be the last reachable handle on unpushed commits. The issue-driven
|
|
19
|
+
* reasons (`issue-closed` / `issue-parked`) are also excluded here — they delete the branch
|
|
20
|
+
* only when the candidate's per-candidate `branchReapable` flag proved remote evidence at
|
|
21
|
+
* decision time. See ADR (this PR). */
|
|
22
|
+
export const BRANCH_REAPABLE_REASONS = new Set(['merged', 'remote-gone']);
|
|
23
|
+
/** Where a quarantined worktree lands: `<state>/quarantine/`, matching every other runtime
|
|
24
|
+
* path's home under the resolved state dir (see `getFactoryPaths`). */
|
|
25
|
+
export function quarantineRoot(repoRoot) {
|
|
26
|
+
return join(getFactoryPaths(repoRoot).state, 'quarantine');
|
|
27
|
+
}
|
|
28
|
+
/** The destination for a quarantined worktree: its own basename under `quarantineDir`, unless
|
|
29
|
+
* that name is already occupied (e.g. a prior quarantine nobody cleared), in which case a
|
|
30
|
+
* timestamp suffix disambiguates rather than overwriting or failing. */
|
|
31
|
+
export function quarantineDestination(quarantineDir, worktreePath) {
|
|
32
|
+
const base = basename(worktreePath);
|
|
33
|
+
const dest = join(quarantineDir, base);
|
|
34
|
+
return existsSync(dest) ? join(quarantineDir, `${base}-${Date.now()}`) : dest;
|
|
35
|
+
}
|
|
36
|
+
export function parseWorktreeList(porcelain) {
|
|
37
|
+
const entries = [];
|
|
38
|
+
const blocks = porcelain
|
|
39
|
+
.split(/\n\s*\n/)
|
|
40
|
+
.map((b) => b.trim())
|
|
41
|
+
.filter(Boolean);
|
|
42
|
+
for (const block of blocks) {
|
|
43
|
+
let path = null;
|
|
44
|
+
let head = null;
|
|
45
|
+
let branch = null;
|
|
46
|
+
for (const line of block.split('\n')) {
|
|
47
|
+
if (line.startsWith('worktree ')) {
|
|
48
|
+
path = line.slice('worktree '.length).trim();
|
|
49
|
+
}
|
|
50
|
+
else if (line.startsWith('HEAD ')) {
|
|
51
|
+
head = line.slice('HEAD '.length).trim();
|
|
52
|
+
}
|
|
53
|
+
else if (line.startsWith('branch ')) {
|
|
54
|
+
branch = line
|
|
55
|
+
.slice('branch '.length)
|
|
56
|
+
.trim()
|
|
57
|
+
.replace(/^refs\/heads\//, '');
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
if (path) {
|
|
61
|
+
entries.push({ path, head, branch });
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return entries;
|
|
65
|
+
}
|
|
66
|
+
/** Dry-run diagnostics, built from the stored evidence in candidate order. The error warns are
|
|
67
|
+
* logged once per issue. */
|
|
68
|
+
function buildDryRunDiagnostics(evidences, log) {
|
|
69
|
+
const issueNotFound = [];
|
|
70
|
+
const issueUnverifiable = [];
|
|
71
|
+
const noActiveClaim = [];
|
|
72
|
+
const warnedExistence = new Set();
|
|
73
|
+
const warnedClaim = new Set();
|
|
74
|
+
for (const e of evidences) {
|
|
75
|
+
if (e.issue === null)
|
|
76
|
+
continue;
|
|
77
|
+
if (e.existence === 'not-found') {
|
|
78
|
+
issueNotFound.push({ path: e.path, branch: e.branch, issue: e.issue });
|
|
79
|
+
}
|
|
80
|
+
else if (e.existence === 'error') {
|
|
81
|
+
issueUnverifiable.push({ path: e.path, branch: e.branch, issue: e.issue });
|
|
82
|
+
if (!warnedExistence.has(e.issue)) {
|
|
83
|
+
warnedExistence.add(e.issue);
|
|
84
|
+
log('warn', `worktree-gc: GitHub issue existence check failed for #${e.issue} (${e.issueError}) — reporting as unverifiable`);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
for (const e of evidences) {
|
|
89
|
+
if (e.issue === null || !e.branch)
|
|
90
|
+
continue;
|
|
91
|
+
if (e.prState !== 'merged' && e.prState !== 'closed')
|
|
92
|
+
continue;
|
|
93
|
+
if (e.claim === 'unclaimed') {
|
|
94
|
+
noActiveClaim.push({ path: e.path, branch: e.branch, issue: e.issue, prState: e.prState });
|
|
95
|
+
}
|
|
96
|
+
else if (e.issueError !== undefined && !warnedClaim.has(e.issue)) {
|
|
97
|
+
warnedClaim.add(e.issue);
|
|
98
|
+
log('warn', `worktree-gc: GitHub claim-label check failed for #${e.issue} (${e.issueError}) — reporting as unknown (not flagged)`);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return { issueNotFound, issueUnverifiable, noActiveClaim };
|
|
102
|
+
}
|
|
103
|
+
export async function sweepWorktrees(opts, deps = {}) {
|
|
104
|
+
const { runCommand = defaultRunCommand, now = () => Date.now(), log = () => { }, octokit, sandbox, issueWarnDedup = defaultIssueWarnDedup, } = deps;
|
|
105
|
+
const { repoRoot, ttlDays, dryRun = false, repo } = opts;
|
|
106
|
+
const { stdout } = await runCommand('git worktree list --porcelain', { cwd: repoRoot });
|
|
107
|
+
const entries = parseWorktreeList(stdout);
|
|
108
|
+
const repoRootResolved = resolve(repoRoot);
|
|
109
|
+
const repoBase = basename(repoRootResolved);
|
|
110
|
+
// Slugs are [a-z0-9-] only (branchPrefixSlug), so interpolating them into a regex is safe.
|
|
111
|
+
// Matches the resolved prefix and the legacy ship-it one.
|
|
112
|
+
const lanePattern = new RegExp('^(?:' + factoryBranchPrefixes(opts.branchPrefix).join('|') + ')/(\\d+)-');
|
|
113
|
+
const candidates = entries.filter((entry) => {
|
|
114
|
+
const entryPath = resolve(entry.path);
|
|
115
|
+
if (entryPath === repoRootResolved)
|
|
116
|
+
return false;
|
|
117
|
+
const base = basename(entryPath);
|
|
118
|
+
if (isFactoryDirName(repoBase, base, entry.branch, opts.branchPrefix))
|
|
119
|
+
return true;
|
|
120
|
+
// Legacy lane paths (<repo>-ship-it-<n>) predate the -factory- infix; there the checked-out
|
|
121
|
+
// lane-branch shape is what proves factory ownership — manual/* and experiment worktrees
|
|
122
|
+
// under a <repo>-* name never match it and are never candidates.
|
|
123
|
+
return base.startsWith(`${repoBase}-`) && entry.branch !== null && lanePattern.test(entry.branch);
|
|
124
|
+
});
|
|
125
|
+
// Reconcile the issue-warn dedup tracker to this sweep's live candidates before resolving any
|
|
126
|
+
// disposition, so a worktree that's gone (or an issue number no longer in play) drops its
|
|
127
|
+
// suppression state and a later re-appearance warns in full again (see ADR, this PR).
|
|
128
|
+
const activeIssueNumbers = new Set();
|
|
129
|
+
for (const entry of candidates) {
|
|
130
|
+
const issueNumber = laneIssueNumber(entry, lanePattern);
|
|
131
|
+
if (issueNumber !== null)
|
|
132
|
+
activeIssueNumbers.add(issueNumber);
|
|
133
|
+
}
|
|
134
|
+
issueWarnDedup.reconcile(activeIssueNumbers);
|
|
135
|
+
const removed = [];
|
|
136
|
+
const held = [];
|
|
137
|
+
let kept = 0;
|
|
138
|
+
const keepsFile = opts.keepsFile ?? getFactoryPaths(repoRoot).worktreeKeeps;
|
|
139
|
+
const keeps = new Map(readWorktreeKeeps(keepsFile, log).map((k) => [k.issue, k]));
|
|
140
|
+
const keptByRecord = [];
|
|
141
|
+
const releasedKeeps = new Map();
|
|
142
|
+
const mainTip = candidates.length > 0 ? await resolveMainTip(runCommand, repoRoot) : null;
|
|
143
|
+
const ctx = createEvidenceContext({ repoRoot, repo, dryRun, lanePattern, protectedIssues: opts.protectedIssues, keeps, mainTip }, { runCommand, now, log, octokit, issueWarnDedup });
|
|
144
|
+
const evidences = [];
|
|
145
|
+
for (const entry of candidates) {
|
|
146
|
+
const evidence = await gatherWorktreeEvidence(ctx, entry);
|
|
147
|
+
evidences.push(evidence);
|
|
148
|
+
const decision = decideWorktree(evidence, { ttlDays, dryRun });
|
|
149
|
+
if (decision.action === 'keep') {
|
|
150
|
+
kept++;
|
|
151
|
+
if (decision.why === 'keep-record' && evidence.keep) {
|
|
152
|
+
keptByRecord.push({
|
|
153
|
+
path: entry.path,
|
|
154
|
+
branch: entry.branch,
|
|
155
|
+
issue: evidence.keep.issue,
|
|
156
|
+
reason: evidence.keep.reason,
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
else if (decision.why === 'held' && evidence.issue !== null) {
|
|
160
|
+
held.push({ path: entry.path, branch: entry.branch, issue: evidence.issue, why: decision.held ?? '' });
|
|
161
|
+
}
|
|
162
|
+
continue;
|
|
163
|
+
}
|
|
164
|
+
if (evidence.keep)
|
|
165
|
+
releasedKeeps.set(entry.path, evidence.keep.issue);
|
|
166
|
+
removed.push({
|
|
167
|
+
path: entry.path,
|
|
168
|
+
branch: entry.branch,
|
|
169
|
+
ageDays: evidence.ageDays,
|
|
170
|
+
reason: decision.reason,
|
|
171
|
+
scrubbedFiles: [],
|
|
172
|
+
branchDeleted: false,
|
|
173
|
+
branchReapable: decision.branchReapable,
|
|
174
|
+
action: decision.action,
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
if (dryRun) {
|
|
178
|
+
const diagnostics = buildDryRunDiagnostics(evidences, log);
|
|
179
|
+
return { removed, kept, dryRun: true, ...diagnostics, held, keptByRecord };
|
|
180
|
+
}
|
|
181
|
+
for (const candidate of removed) {
|
|
182
|
+
const credentialFiles = findCredentialFiles(candidate.path);
|
|
183
|
+
for (const filePath of credentialFiles) {
|
|
184
|
+
try {
|
|
185
|
+
scrubFile(filePath);
|
|
186
|
+
candidate.scrubbedFiles.push(filePath);
|
|
187
|
+
}
|
|
188
|
+
catch (err) {
|
|
189
|
+
log('warn', `failed to scrub ${filePath}: ${err?.message ?? String(err)}`);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
if (sandbox) {
|
|
193
|
+
await removeMicroVm({ ...sandbox, worktreePath: candidate.path, log });
|
|
194
|
+
}
|
|
195
|
+
if (candidate.action === 'quarantine') {
|
|
196
|
+
const quarantineDir = quarantineRoot(repoRoot);
|
|
197
|
+
const dest = quarantineDestination(quarantineDir, candidate.path);
|
|
198
|
+
try {
|
|
199
|
+
mkdirSync(quarantineDir, { recursive: true });
|
|
200
|
+
await runCommand(`git worktree move ${shellEscape(candidate.path)} ${shellEscape(dest)}`, { cwd: repoRoot });
|
|
201
|
+
candidate.quarantinedTo = dest;
|
|
202
|
+
log('worktree-gc', `quarantined ${candidate.path} to ${dest} — ${candidate.reason}`);
|
|
203
|
+
}
|
|
204
|
+
catch (err) {
|
|
205
|
+
log('warn', `git worktree move failed for ${candidate.path} (${err?.message ?? String(err)}) — falling back to a manual move`);
|
|
206
|
+
try {
|
|
207
|
+
renameSync(candidate.path, dest);
|
|
208
|
+
candidate.quarantinedTo = dest;
|
|
209
|
+
log('worktree-gc', `quarantined ${candidate.path} to ${dest} via manual move — ${candidate.reason}`);
|
|
210
|
+
}
|
|
211
|
+
catch (renameErr) {
|
|
212
|
+
log('warn', `manual move fallback failed for ${candidate.path}: ${renameErr?.message ?? String(renameErr)} — worktree left in place`);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
continue;
|
|
216
|
+
}
|
|
217
|
+
try {
|
|
218
|
+
await runCommand(`git worktree remove --force ${shellEscape(candidate.path)}`, { cwd: repoRoot });
|
|
219
|
+
log('worktree-gc', `removed ${candidate.path} — ${candidate.reason}`);
|
|
220
|
+
}
|
|
221
|
+
catch (err) {
|
|
222
|
+
log('warn', `git worktree remove failed for ${candidate.path}: ${err?.message ?? String(err)}`);
|
|
223
|
+
try {
|
|
224
|
+
rmSync(candidate.path, { recursive: true, force: true });
|
|
225
|
+
log('worktree-gc', `removed ${candidate.path} via rmSync fallback — ${candidate.reason}`);
|
|
226
|
+
}
|
|
227
|
+
catch (rmErr) {
|
|
228
|
+
log('warn', `rmSync fallback failed for ${candidate.path}: ${rmErr?.message ?? String(rmErr)}`);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
releaseWorktreeKeeps(keepsFile, releasedKeeps, log);
|
|
233
|
+
await runCommand('git worktree prune', { cwd: repoRoot }).catch((err) => log('warn', `git worktree prune failed in ${repoRoot}: ${err?.message ?? String(err)}`));
|
|
234
|
+
await deleteReapedBranches(removed, repoRoot, runCommand, log);
|
|
235
|
+
return {
|
|
236
|
+
removed,
|
|
237
|
+
kept,
|
|
238
|
+
dryRun: false,
|
|
239
|
+
issueNotFound: [],
|
|
240
|
+
issueUnverifiable: [],
|
|
241
|
+
noActiveClaim: [],
|
|
242
|
+
held,
|
|
243
|
+
keptByRecord,
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
async function deleteReapedBranches(candidates, repoRoot, runCommand, log) {
|
|
247
|
+
for (const candidate of candidates) {
|
|
248
|
+
if (candidate.branch === null)
|
|
249
|
+
continue;
|
|
250
|
+
if (!BRANCH_REAPABLE_REASONS.has(candidate.reason) && candidate.branchReapable !== true)
|
|
251
|
+
continue;
|
|
252
|
+
try {
|
|
253
|
+
await runCommand(`git branch -D ${shellEscape(candidate.branch)}`, { cwd: repoRoot });
|
|
254
|
+
candidate.branchDeleted = true;
|
|
255
|
+
}
|
|
256
|
+
catch (err) {
|
|
257
|
+
log('warn', `git branch -D failed for ${candidate.branch}: ${err?.message ?? String(err)}`);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
export function formatGcReport(report) {
|
|
262
|
+
const lines = [];
|
|
263
|
+
const verb = report.dryRun ? 'would remove' : 'removed';
|
|
264
|
+
for (const candidate of report.removed) {
|
|
265
|
+
const branchLabel = candidate.branch ?? 'detached';
|
|
266
|
+
const age = Number.isFinite(candidate.ageDays) ? Math.floor(candidate.ageDays) : '∞';
|
|
267
|
+
let line = `${candidate.path} (${branchLabel}, ${age}d old) — ${candidate.reason}`;
|
|
268
|
+
if (candidate.scrubbedFiles.length > 0) {
|
|
269
|
+
line += `, scrubbed ${candidate.scrubbedFiles.length} credential file(s)`;
|
|
270
|
+
}
|
|
271
|
+
if (candidate.branchDeleted && candidate.branch !== null) {
|
|
272
|
+
line += `, deleted branch ${candidate.branch}`;
|
|
273
|
+
}
|
|
274
|
+
if (candidate.action === 'quarantine') {
|
|
275
|
+
line += candidate.quarantinedTo ? `, quarantined to ${candidate.quarantinedTo}` : ', quarantined';
|
|
276
|
+
}
|
|
277
|
+
lines.push(line);
|
|
278
|
+
}
|
|
279
|
+
const removedCount = report.removed.filter((c) => c.action !== 'quarantine').length;
|
|
280
|
+
const quarantinedCount = report.removed.length - removedCount;
|
|
281
|
+
lines.push(quarantinedCount > 0
|
|
282
|
+
? `${verb} ${removedCount} worktree(s), quarantined ${quarantinedCount}, kept ${report.kept}`
|
|
283
|
+
: `${verb} ${removedCount} worktree(s), kept ${report.kept}`);
|
|
284
|
+
for (const c of report.keptByRecord ?? []) {
|
|
285
|
+
lines.push(`${c.path} (${c.branch ?? 'detached'}) — kept (${c.reason})`);
|
|
286
|
+
}
|
|
287
|
+
if (report.issueNotFound.length > 0) {
|
|
288
|
+
lines.push(`${report.issueNotFound.length} worktree(s) flagged — owning issue not found (404):`);
|
|
289
|
+
for (const c of report.issueNotFound) {
|
|
290
|
+
lines.push(` ${c.path} (${c.branch ?? 'detached'}) — issue #${c.issue} not found`);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
if (report.issueUnverifiable.length > 0) {
|
|
294
|
+
lines.push(`${report.issueUnverifiable.length} worktree(s) unverifiable — GitHub issue lookup failed:`);
|
|
295
|
+
for (const c of report.issueUnverifiable) {
|
|
296
|
+
lines.push(` ${c.path} (${c.branch ?? 'detached'}) — issue #${c.issue} unverifiable`);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
if (report.noActiveClaim.length > 0) {
|
|
300
|
+
lines.push(`${report.noActiveClaim.length} worktree(s) flagged — merged/closed PR with no active claim:`);
|
|
301
|
+
for (const c of report.noActiveClaim) {
|
|
302
|
+
lines.push(` ${c.path} (${c.branch ?? 'detached'}) — issue #${c.issue} ${c.prState}, no active claim`);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
if (report.held.length > 0) {
|
|
306
|
+
lines.push(`${report.held.length} worktree(s) kept — decomposed parent with local work:`);
|
|
307
|
+
for (const c of report.held) {
|
|
308
|
+
lines.push(` ${c.path} (${c.branch ?? 'detached'}) — issue #${c.issue}: ${c.why}`);
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
return lines.join('\n');
|
|
312
|
+
}
|
|
313
|
+
//# sourceMappingURL=worktree-gc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worktree-gc.js","sourceRoot":"","sources":["../../src/worktree/worktree-gc.ts"],"names":[],"mappings":"AAAA,iGAAiG;AAEjG,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,cAA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,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { EventKind } from '../events/kinds.js';
|
|
2
|
+
export interface WorktreeKeep {
|
|
3
|
+
issue: number;
|
|
4
|
+
path: string;
|
|
5
|
+
reason: string;
|
|
6
|
+
since: string;
|
|
7
|
+
}
|
|
8
|
+
type KeepLog = (type: EventKind, msg: string) => void;
|
|
9
|
+
/** Reads the keep store. A missing file is empty with no log; an unreadable or malformed one is
|
|
10
|
+
* empty with one warn. Invalid individual entries are dropped. */
|
|
11
|
+
export declare function readWorktreeKeeps(file: string, log?: KeepLog): WorktreeKeep[];
|
|
12
|
+
export declare function findWorktreeKeep(file: string, issue: number, log?: KeepLog): WorktreeKeep | undefined;
|
|
13
|
+
/** Replaces the record for `keep.issue`, else appends. */
|
|
14
|
+
export declare function upsertWorktreeKeep(file: string, keep: WorktreeKeep): void;
|
|
15
|
+
/** Drops the record for `issue`. A no-op (and never creates the file) when absent. */
|
|
16
|
+
export declare function removeWorktreeKeep(file: string, issue: number): void;
|
|
17
|
+
/** Drops the records of kept worktrees a sweep just removed (path -> issue), once the path is gone. */
|
|
18
|
+
export declare function releaseWorktreeKeeps(file: string, released: ReadonlyMap<string, number>, log: KeepLog): void;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=worktree-keeps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worktree-keeps.d.ts","sourceRoot":"","sources":["../../src/worktree/worktree-keeps.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED,KAAK,OAAO,GAAG,CAAC,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;AAatD;mEACmE;AACnE,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,OAAO,GAAG,YAAY,EAAE,CAW7E;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,OAAO,GAAG,YAAY,GAAG,SAAS,CAErG;AASD,0DAA0D;AAC1D,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,GAAG,IAAI,CAGzE;AAED,sFAAsF;AACtF,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAKpE;AAED,uGAAuG;AACvG,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,EAAE,OAAO,GAAG,IAAI,CAS5G"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
// packages/core/src/worktree/worktree-keeps.ts — persistent keep records that protect a parked issue's worktree from GC (#3316)
|
|
2
|
+
import { existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from 'node:fs';
|
|
3
|
+
import { dirname } from 'node:path';
|
|
4
|
+
function isKeep(value) {
|
|
5
|
+
if (typeof value !== 'object' || value === null)
|
|
6
|
+
return false;
|
|
7
|
+
const v = value;
|
|
8
|
+
return (Number.isInteger(v.issue) &&
|
|
9
|
+
typeof v.path === 'string' &&
|
|
10
|
+
typeof v.reason === 'string' &&
|
|
11
|
+
typeof v.since === 'string');
|
|
12
|
+
}
|
|
13
|
+
/** Reads the keep store. A missing file is empty with no log; an unreadable or malformed one is
|
|
14
|
+
* empty with one warn. Invalid individual entries are dropped. */
|
|
15
|
+
export function readWorktreeKeeps(file, log) {
|
|
16
|
+
let parsed;
|
|
17
|
+
try {
|
|
18
|
+
parsed = JSON.parse(readFileSync(file, 'utf8'));
|
|
19
|
+
if (!Array.isArray(parsed))
|
|
20
|
+
throw new Error('not an array');
|
|
21
|
+
}
|
|
22
|
+
catch (err) {
|
|
23
|
+
if (err?.code === 'ENOENT')
|
|
24
|
+
return [];
|
|
25
|
+
log?.('warn', `worktree-gc: cannot read ${file} (${err?.message ?? String(err)}) — treating as no kept worktrees`);
|
|
26
|
+
return [];
|
|
27
|
+
}
|
|
28
|
+
return parsed.filter(isKeep);
|
|
29
|
+
}
|
|
30
|
+
export function findWorktreeKeep(file, issue, log) {
|
|
31
|
+
return readWorktreeKeeps(file, log).find((k) => k.issue === issue);
|
|
32
|
+
}
|
|
33
|
+
function writeKeeps(file, keeps) {
|
|
34
|
+
mkdirSync(dirname(file), { recursive: true });
|
|
35
|
+
const tmp = `${file}.tmp-${process.pid}`;
|
|
36
|
+
writeFileSync(tmp, `${JSON.stringify(keeps, null, 2)}\n`);
|
|
37
|
+
renameSync(tmp, file);
|
|
38
|
+
}
|
|
39
|
+
/** Replaces the record for `keep.issue`, else appends. */
|
|
40
|
+
export function upsertWorktreeKeep(file, keep) {
|
|
41
|
+
const others = readWorktreeKeeps(file).filter((k) => k.issue !== keep.issue);
|
|
42
|
+
writeKeeps(file, [...others, keep]);
|
|
43
|
+
}
|
|
44
|
+
/** Drops the record for `issue`. A no-op (and never creates the file) when absent. */
|
|
45
|
+
export function removeWorktreeKeep(file, issue) {
|
|
46
|
+
const all = readWorktreeKeeps(file);
|
|
47
|
+
const rest = all.filter((k) => k.issue !== issue);
|
|
48
|
+
if (rest.length === all.length)
|
|
49
|
+
return;
|
|
50
|
+
writeKeeps(file, rest);
|
|
51
|
+
}
|
|
52
|
+
/** Drops the records of kept worktrees a sweep just removed (path -> issue), once the path is gone. */
|
|
53
|
+
export function releaseWorktreeKeeps(file, released, log) {
|
|
54
|
+
for (const [path, issue] of released) {
|
|
55
|
+
if (existsSync(path))
|
|
56
|
+
continue;
|
|
57
|
+
try {
|
|
58
|
+
removeWorktreeKeep(file, issue);
|
|
59
|
+
}
|
|
60
|
+
catch (err) {
|
|
61
|
+
log('warn', `could not drop the keep record for #${issue}: ${err?.message ?? String(err)}`);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=worktree-keeps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worktree-keeps.js","sourceRoot":"","sources":["../../src/worktree/worktree-keeps.ts"],"names":[],"mappings":"AAAA,gIAAgI;AAEhI,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACzF,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAapC,SAAS,MAAM,CAAC,KAAc;IAC5B,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IAC9D,MAAM,CAAC,GAAG,KAAgC,CAAC;IAC3C,OAAO,CACL,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC;QACzB,OAAO,CAAC,CAAC,IAAI,KAAK,QAAQ;QAC1B,OAAO,CAAC,CAAC,MAAM,KAAK,QAAQ;QAC5B,OAAO,CAAC,CAAC,KAAK,KAAK,QAAQ,CAC5B,CAAC;AACJ,CAAC;AAED;mEACmE;AACnE,MAAM,UAAU,iBAAiB,CAAC,IAAY,EAAE,GAAa;IAC3D,IAAI,MAAe,CAAC;IACpB,IAAI,CAAC;QACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;QAChD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAC;IAC9D,CAAC;IAAC,OAAO,GAAQ,EAAE,CAAC;QAClB,IAAI,GAAG,EA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AY,EAAE,KAAa;IAC5D,MAAM,GAAG,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC;IACpC,MAAM,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC;IAClD,IAAI,IAAI,CAAC,MAAM,KAAK,GAAG,CAAC,MAAM;QAAE,OAAO;IACvC,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AACzB,CAAC;AAED,uGAAuG;AACvG,MAAM,UAAU,oBAAoB,CAAC,IAAY,EAAE,QAAqC,EAAE,GAAY;IACpG,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,QAAQ,EAAE,CAAC;QACrC,IAAI,UAAU,CAAC,IAAI,CAAC;YAAE,SAAS;QAC/B,IAAI,CAAC;YACH,kBAAkB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAClC,CAAC;QAAC,OAAO,GAAQ,EAAE,CAAC;YAClB,GAAG,CAAC,MAAM,EAAE,uCAAuC,KAAK,KAAK,GAAG,EAAE,OAAO,IAAI,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC9F,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Basename of a lane worktree dir: `<repoBase>-factory-<prefixSlug>-<issue>`, skipping a segment
|
|
2
|
+
* the name already ends with so the default `factory` prefix never yields `factory-factory` (#1709). */
|
|
3
|
+
export declare function worktreeDirName(repoBase: string, issue: number, prefix?: string): string;
|
|
4
|
+
/** Pre-#2763 lane name, kept only so existing checkouts are still found and reaped. */
|
|
5
|
+
export declare function legacyWorktreeDirName(repoBase: string, issue: number, prefix?: string): string;
|
|
6
|
+
/** GC ownership by basename: the `${repoBase}-factory-` infix, or (#2763) an exact worktreeDirName match, since
|
|
7
|
+
* deduped names can lack the infix (software-factory + factory → software-factory-<n>); that one also needs a
|
|
8
|
+
* detached or lane branch so manual worktrees are never claimed. */
|
|
9
|
+
export declare function isFactoryDirName(repoBase: string, base: string, branch: string | null, branchPrefix?: string): boolean;
|
|
10
|
+
//# sourceMappingURL=worktree-name.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worktree-name.d.ts","sourceRoot":"","sources":["../../src/worktree/worktree-name.ts"],"names":[],"mappings":"AAMA;yGACyG;AACzG,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAOxF;AAED,uFAAuF;AACvF,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAE9F;AAED;;qEAEqE;AACrE,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,GAAG,IAAI,EACrB,YAAY,CAAC,EAAE,MAAM,GACpB,OAAO,CAQT"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// packages/core/src/worktree/worktree-name.ts — lane worktree directory naming (#1709).
|
|
2
|
+
import { branchPrefixSlug, factoryBranchPrefixes } from '../utils/index.js';
|
|
3
|
+
/** Fixed ownership infix; worktree-gc matches it as `${repoBase}-factory-`. */
|
|
4
|
+
const WORKTREE_MARKER = 'factory';
|
|
5
|
+
/** Basename of a lane worktree dir: `<repoBase>-factory-<prefixSlug>-<issue>`, skipping a segment
|
|
6
|
+
* the name already ends with so the default `factory` prefix never yields `factory-factory` (#1709). */
|
|
7
|
+
export function worktreeDirName(repoBase, issue, prefix) {
|
|
8
|
+
let name = repoBase;
|
|
9
|
+
for (const segment of [WORKTREE_MARKER, branchPrefixSlug(prefix)]) {
|
|
10
|
+
if (name === segment || name.endsWith(`-${segment}`))
|
|
11
|
+
continue;
|
|
12
|
+
name = `${name}-${segment}`;
|
|
13
|
+
}
|
|
14
|
+
return `${name}-${issue}`;
|
|
15
|
+
}
|
|
16
|
+
/** Pre-#2763 lane name, kept only so existing checkouts are still found and reaped. */
|
|
17
|
+
export function legacyWorktreeDirName(repoBase, issue, prefix) {
|
|
18
|
+
return `${repoBase}-${WORKTREE_MARKER}-${branchPrefixSlug(prefix)}-${issue}`;
|
|
19
|
+
}
|
|
20
|
+
/** GC ownership by basename: the `${repoBase}-factory-` infix, or (#2763) an exact worktreeDirName match, since
|
|
21
|
+
* deduped names can lack the infix (software-factory + factory → software-factory-<n>); that one also needs a
|
|
22
|
+
* detached or lane branch so manual worktrees are never claimed. */
|
|
23
|
+
export function isFactoryDirName(repoBase, base, branch, branchPrefix) {
|
|
24
|
+
if (base.startsWith(`${repoBase}-${WORKTREE_MARKER}-`))
|
|
25
|
+
return true;
|
|
26
|
+
const n = base.match(/-(\d+)$/)?.[1];
|
|
27
|
+
if (n === undefined)
|
|
28
|
+
return false;
|
|
29
|
+
return factoryBranchPrefixes(branchPrefix).some((p) => worktreeDirName(repoBase, Number(n), p) === base && (branch === null || new RegExp(`^${p}/\\d+-`).test(branch)));
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=worktree-name.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worktree-name.js","sourceRoot":"","sources":["../../src/worktree/worktree-name.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE5E,+EAA+E;AAC/E,MAAM,eAAe,GAAG,SAAS,CAAC;AAElC;yGACyG;AACzG,MAAM,UAAU,eAAe,CAAC,QAAgB,EAAE,KAAa,EAAE,MAAe;IAC9E,IAAI,IAAI,GAAG,QAAQ,CAAC;IACpB,KAAK,MAAM,OAAO,IAAI,CAAC,eAAe,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;QAClE,IAAI,IAAI,KAAK,OAAO,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,OAAO,EAAE,CAAC;YAAE,SAAS;QAC/D,IAAI,GAAG,GAAG,IAAI,IAAI,OAAO,EAAE,CAAC;IAC9B,CAAC;IACD,OAAO,GAAG,IAAI,IAAI,KAAK,EAAE,CAAC;AAC5B,CAAC;AAED,uFAAuF;AACvF,MAAM,UAAU,qBAAqB,CAAC,QAAgB,EAAE,KAAa,EAAE,MAAe;IACpF,OAAO,GAAG,QAAQ,IAAI,eAAe,IAAI,gBAAgB,CAAC,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;AAC/E,CAAC;AAED;;qEAEqE;AACrE,MAAM,UAAU,gBAAgB,CAC9B,QAAgB,EAChB,IAAY,EACZ,MAAqB,EACrB,YAAqB;IAErB,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,QAAQ,IAAI,eAAe,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC;IACpE,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACrC,IAAI,CAAC,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC;IAClC,OAAO,qBAAqB,CAAC,YAAY,CAAC,CAAC,IAAI,CAC7C,CAAC,CAAC,EAAE,EAAE,CACJ,eAAe,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAClH,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@on-par/factory-core",
|
|
3
|
-
"version": "0.9.14-next.
|
|
3
|
+
"version": "0.9.14-next.11",
|
|
4
4
|
"description": "Core engine: model router, constitutions, checkers, and pipeline phases for the Software Factory.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -54,10 +54,10 @@
|
|
|
54
54
|
"prepack": "node ../../scripts/pack-hygiene-cli.ts prepack"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@on-par/adr-kit": "0.9.14-next.
|
|
58
|
-
"@on-par/contracts": "0.9.14-next.
|
|
59
|
-
"@on-par/factory-config": "0.9.14-next.
|
|
60
|
-
"@on-par/repo-context": "0.9.14-next.
|
|
57
|
+
"@on-par/adr-kit": "0.9.14-next.11",
|
|
58
|
+
"@on-par/contracts": "0.9.14-next.11",
|
|
59
|
+
"@on-par/factory-config": "0.9.14-next.11",
|
|
60
|
+
"@on-par/repo-context": "0.9.14-next.11",
|
|
61
61
|
"@octokit/rest": "^22.0.0",
|
|
62
62
|
"execa": "^10.1.0",
|
|
63
63
|
"gray-matter": "^4.0.3",
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { EventKind } from '../events/kinds.js';
|
|
2
|
-
import type { IssueWarnDedup, SweepDeps } from './worktree-gc.js';
|
|
3
|
-
/** The owning issue's verdict on a lane worktree. `null` means "no verdict" (no client/repo,
|
|
4
|
-
* or the query failed) and must always fall back to the PR-state/local-evidence rules. */
|
|
5
|
-
export type IssueDisposition = 'reap-closed' | 'reap-parked' | 'reap-decomposed' | 'keep-claimed' | 'keep';
|
|
6
|
-
/** GitHub's verdict on the owning issue. A closed issue and a factory:parked label both mean
|
|
7
|
-
* the lane is finished-or-parked and its clean checkout is redundant (see ADR, this PR). */
|
|
8
|
-
export declare function resolveIssueDisposition(octokit: SweepDeps['octokit'], repo: string | undefined, issue: number, log: (type: EventKind, msg: string) => void, issueWarnDedup: IssueWarnDedup): Promise<IssueDisposition | null>;
|
|
9
|
-
/** The lane issue's existence on GitHub, checked only for worktree-gc's dry-run report.
|
|
10
|
-
* 'not-configured' (no client/repo) and 'error' (the call threw anything but a 404) both mean
|
|
11
|
-
* "no verdict" but are reported differently: 'error' surfaces as unverifiable so a rate-limit
|
|
12
|
-
* or network blip is never mistaken for a confirmed-gone issue. */
|
|
13
|
-
export declare function resolveIssueExistence(octokit: SweepDeps['octokit'], repo: string | undefined, issue: number, log: (type: EventKind, msg: string) => void): Promise<'exists' | 'not-found' | 'error' | 'not-configured'>;
|
|
14
|
-
/** Whether the lane issue carries an active, unexpired claim, checked only for worktree-gc's
|
|
15
|
-
* dry-run report. A `factory:claimed-by:*` label alone is not enough (#1501): if the issue also
|
|
16
|
-
* carries a `factory:claim-expires:*` lease label and that lease has lapsed, `findStaleClaims`
|
|
17
|
-
* (the same primitive the queue's own reconcile uses, ADR-0104/#1506) reads it as unclaimed
|
|
18
|
-
* immediately — no separate release step, and no host-pid/hostname evidence anywhere. Fail-safe:
|
|
19
|
-
* no client/repo, or a lookup error, both resolve to 'unknown' — never conflated with a
|
|
20
|
-
* confirmed 'unclaimed' verdict. */
|
|
21
|
-
export declare function resolveActiveClaim(octokit: SweepDeps['octokit'], repo: string | undefined, issue: number, log: (type: EventKind, msg: string) => void): Promise<'claimed' | 'unclaimed' | 'unknown'>;
|
|
22
|
-
//# sourceMappingURL=worktree-gc-issues.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"worktree-gc-issues.d.ts","sourceRoot":"","sources":["../../src/utils/worktree-gc-issues.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAGpD,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElE;2FAC2F;AAC3F,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG,aAAa,GAAG,iBAAiB,GAAG,cAAc,GAAG,MAAM,CAAC;AAE3G;6FAC6F;AAC7F,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,SAAS,CAAC,SAAS,CAAC,EAC7B,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,KAAK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