@codyswann/lisa 4.10.15 → 4.11.1
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/cli/doctor-worktree-hygiene.d.ts +5 -2
- package/dist/cli/doctor-worktree-hygiene.d.ts.map +1 -1
- package/dist/cli/doctor-worktree-hygiene.js +12 -6
- package/dist/cli/doctor-worktree-hygiene.js.map +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +2 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/prune-commands.d.ts +52 -0
- package/dist/cli/prune-commands.d.ts.map +1 -0
- package/dist/cli/prune-commands.js +158 -0
- package/dist/cli/prune-commands.js.map +1 -0
- package/dist/cli/prune-report.d.ts +52 -0
- package/dist/cli/prune-report.d.ts.map +1 -0
- package/dist/cli/prune-report.js +143 -0
- package/dist/cli/prune-report.js.map +1 -0
- package/dist/cli/stash-prune-policy.d.ts +72 -0
- package/dist/cli/stash-prune-policy.d.ts.map +1 -0
- package/dist/cli/stash-prune-policy.js +90 -0
- package/dist/cli/stash-prune-policy.js.map +1 -0
- package/dist/cli/stash-prune.d.ts +104 -0
- package/dist/cli/stash-prune.d.ts.map +1 -0
- package/dist/cli/stash-prune.js +206 -0
- package/dist/cli/stash-prune.js.map +1 -0
- package/dist/cli/worktree-inventory.d.ts +82 -0
- package/dist/cli/worktree-inventory.d.ts.map +1 -0
- package/dist/cli/worktree-inventory.js +195 -0
- package/dist/cli/worktree-inventory.js.map +1 -0
- package/dist/cli/worktree-liveness.d.ts +52 -0
- package/dist/cli/worktree-liveness.d.ts.map +1 -0
- package/dist/cli/worktree-liveness.js +124 -0
- package/dist/cli/worktree-liveness.js.map +1 -0
- package/dist/cli/worktree-ownership.d.ts +65 -0
- package/dist/cli/worktree-ownership.d.ts.map +1 -0
- package/dist/cli/worktree-ownership.js +142 -0
- package/dist/cli/worktree-ownership.js.map +1 -0
- package/dist/cli/worktree-prune-policy.d.ts +76 -0
- package/dist/cli/worktree-prune-policy.d.ts.map +1 -0
- package/dist/cli/worktree-prune-policy.js +114 -0
- package/dist/cli/worktree-prune-policy.js.map +1 -0
- package/dist/cli/worktree-prune.d.ts +96 -0
- package/dist/cli/worktree-prune.d.ts.map +1 -0
- package/dist/cli/worktree-prune.js +153 -0
- package/dist/cli/worktree-prune.js.map +1 -0
- package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
- package/dist/core/upstream-evidence-manifest.js +18 -0
- package/dist/core/upstream-evidence-manifest.js.map +1 -1
- package/package.json +1 -1
- package/plugins/lisa/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-agy/plugin.json +1 -1
- package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-agy/plugin.json +1 -1
- package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-agy/plugin.json +1 -1
- package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-agy/plugin.json +1 -1
- package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-agy/plugin.json +1 -1
- package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-agy/plugin.json +1 -1
- package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-agy/plugin.json +1 -1
- package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-agy/plugin.json +1 -1
- package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-agy/plugin.json +1 -1
- package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
|
@@ -27,8 +27,11 @@ export declare const WORKTREE_COUNT_WARN_THRESHOLD = 10;
|
|
|
27
27
|
* only appeared once enough worktrees had piled up.
|
|
28
28
|
*
|
|
29
29
|
* Read-only and warn-only by design. Doctor reports the count and names the
|
|
30
|
-
* repair; it never removes a worktree itself
|
|
31
|
-
*
|
|
30
|
+
* repair; it never removes a worktree itself. What it names is now a verb
|
|
31
|
+
* rather than a manual procedure: reporting a mess an agent has no sanctioned
|
|
32
|
+
* way to clear is the state that produced the accumulation in the first place
|
|
33
|
+
* (CodySwannGT/lisa#2993), so the repair line points at `lisa worktree prune`,
|
|
34
|
+
* which answers "does this idle-looking checkout still hold work?" itself.
|
|
32
35
|
*
|
|
33
36
|
* Running from INSIDE a worktree naturally reports clean: the roots live in the
|
|
34
37
|
* primary checkout, so a worktree has none of its own. That matches how
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor-worktree-hygiene.d.ts","sourceRoot":"","sources":["../../src/cli/doctor-worktree-hygiene.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAI/C;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,6BAA6B,KAAK,CAAC;AAQhD
|
|
1
|
+
{"version":3,"file":"doctor-worktree-hygiene.d.ts","sourceRoot":"","sources":["../../src/cli/doctor-worktree-hygiene.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAI/C;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,6BAA6B,KAAK,CAAC;AAQhD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,oBAAoB,CACxC,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,WAAW,CAAC,CAyDtB"}
|
|
@@ -30,8 +30,11 @@ export const WORKTREE_COUNT_WARN_THRESHOLD = 10;
|
|
|
30
30
|
* only appeared once enough worktrees had piled up.
|
|
31
31
|
*
|
|
32
32
|
* Read-only and warn-only by design. Doctor reports the count and names the
|
|
33
|
-
* repair; it never removes a worktree itself
|
|
34
|
-
*
|
|
33
|
+
* repair; it never removes a worktree itself. What it names is now a verb
|
|
34
|
+
* rather than a manual procedure: reporting a mess an agent has no sanctioned
|
|
35
|
+
* way to clear is the state that produced the accumulation in the first place
|
|
36
|
+
* (CodySwannGT/lisa#2993), so the repair line points at `lisa worktree prune`,
|
|
37
|
+
* which answers "does this idle-looking checkout still hold work?" itself.
|
|
35
38
|
*
|
|
36
39
|
* Running from INSIDE a worktree naturally reports clean: the roots live in the
|
|
37
40
|
* primary checkout, so a worktree has none of its own. That matches how
|
|
@@ -72,10 +75,13 @@ export async function checkWorktreeHygiene(targetPath) {
|
|
|
72
75
|
`over the threshold of ${WORKTREE_COUNT_WARN_THRESHOLD}. ` +
|
|
73
76
|
"Each one is a full checkout that every file crawler walks past, which is " +
|
|
74
77
|
"what makes unit suites time out from ambient load rather than defects. " +
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
78
|
+
"Run `lisa worktree prune` to see which of them are provably nobody's " +
|
|
79
|
+
"live work: it reports by default and removes only with `--apply`, and " +
|
|
80
|
+
"it refuses any worktree a process is working inside, or that holds " +
|
|
81
|
+
"unpushed commits or uncommitted changes (CodySwannGT/lisa#2993). " +
|
|
82
|
+
"Underneath it uses the plain `git worktree remove`, which refuses a " +
|
|
83
|
+
"dirty tree, and `git worktree prune` for registrations whose directory " +
|
|
84
|
+
"is already gone (CodySwannGT/lisa#2490)",
|
|
79
85
|
};
|
|
80
86
|
}
|
|
81
87
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor-worktree-hygiene.js","sourceRoot":"","sources":["../../src/cli/doctor-worktree-hygiene.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAy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yDAAyD;IACzD,SAAS,EAAE,OAAO,SAAS,CAAC;IAC5B,qCAAqC;IACrC,SAAS,EAAE,OAAO,SAAS,CAAC;IAC5B,4EAA4E;IAC5E,iBAAiB,EAAE,OAAO,iBAAiB,CAAC;IAC5C,2EAA2E;IAC3E,OAAO,EAAE,OAAO,OAAO,CAAC;IACxB,8DAA8D;IAC9D,KAAK,EAAE,OAAO,KAAK,CAAC;IACpB,iEAAiE;IACjE,uBAAuB,EAAE,OAAO,uBAAuB,CAAC;IACxD,sEAAsE;IACtE,eAAe,EAAE,OAAO,eAAe,CAAC;IACxC,uDAAuD;IACvD,YAAY,EAAE,OAAO,YAAY,CAAC;IAClC,qEAAqE;IACrE,oBAAoB,EAAE,OAAO,oBAAoB,CAAC;IAClD,iEAAiE;IACjE,UAAU,EAAE,OAAO,UAAU,CAAC;IAC9B,4EAA4E;IAC5E,eAAe,EAAE,OAAO,eAAe,CAAC;IACxC,kEAAkE;IAClE,eAAe,EAAE,OAAO,eAAe,CAAC;IACxC,gFAAgF;IAChF,cAAc,EAAE,OAAO,cAAc,CAAC;IACtC,0EAA0E;IAC1E,kBAAkB,EAAE,OAAO,kBAAkB,CAAC;CAC/C;AAyND;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAC3B,YAAY,GAAE,OAAO,CAAC,mBAAmB,CAAM,GAC9C,OAAO,CAgET;AAED,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/cli/index.js
CHANGED
|
@@ -8,6 +8,7 @@ import { runHealthCli } from "./health-cmd.js";
|
|
|
8
8
|
import { addGateCommands } from "./gate-commands.js";
|
|
9
9
|
import { runKaneCli, runKanePilotCli, runKaneProbeCli, } from "./kane-cmd.js";
|
|
10
10
|
import { printUpdateWarning } from "./print-update-warning.js";
|
|
11
|
+
import { addPruneCommands } from "./prune-commands.js";
|
|
11
12
|
import { DEFAULT_SETUP_PROJECT_DEPENDENCIES, runSetupProject, } from "./setup-project.js";
|
|
12
13
|
import { runSetupWiki } from "./setup-wiki.js";
|
|
13
14
|
import { addSharedOptions } from "./shared-options.js";
|
|
@@ -172,6 +173,7 @@ function addMaintenanceCommands(program, deps) {
|
|
|
172
173
|
});
|
|
173
174
|
addGateCommands(program, deps);
|
|
174
175
|
addKaneCommands(program, deps);
|
|
176
|
+
addPruneCommands(program);
|
|
175
177
|
program
|
|
176
178
|
.command("cross-pollinate")
|
|
177
179
|
.description("Make locally-authored agent definitions available to the other agents this project supports")
|
package/dist/cli/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAEL,iBAAiB,GAClB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAyB,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EACL,UAAU,EACV,eAAe,EACf,eAAe,GAEhB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EACL,kCAAkC,EAClC,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAmB,MAAM,qBAAqB,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EACL,wBAAwB,EACxB,oBAAoB,GACrB,MAAM,0BAA0B,CAAC;AA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B,EAAE,OAAmB,EAAE,EAAE;QACtE,MAAM,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;IAEH,gBAAgB,CACd,OAAO;SACJ,OAAO,CAAC,eAAe,CAAC;SACxB,WAAW,CAAC,uDAAuD,CAAC;SACpE,cAAc,CACb,eAAe,EACf,iBAAiB,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAC3C;SACA,QAAQ,CAAC,eAAe,EAAE,8CAA8C,CAAC,CAC7E,CAAC,MAAM,CACN,KAAK,EACH,WAA+B,EAC/B,OAAuC,EACvC,EAAE;QACF,MAAM,IAAI,CAAC,eAAe,CAAC,WAAW,EAAE,OAAO,EAAE;YAC/C,GAAG,kCAAkC;YACrC,QAAQ,EAAE,IAAI,CAAC,QAAQ;SACxB,CAAC,CAAC;IACL,CAAC,CACF,CAAC;IAEF,gBAAgB,CACd,OAAO;SACJ,OAAO,CAAC,YAAY,CAAC;SACrB,WAAW,CAAC,0DAA0D,CAAC;SACvE,QAAQ,CAAC,QAAQ,EAAE,oBAAoB,CAAC,CAC5C,CAAC,MAAM,CAAC,KAAK,EAAE,WAA+B,EAAE,OAAmB,EAAE,EAAE;QACtE,MAAM,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;IAEH,sBAAsB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAEtC,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Registration and CLI runners for Lisa's cleanup verbs.
|
|
3
|
+
*
|
|
4
|
+
* These exist because an agent could previously DETECT accumulated disk state
|
|
5
|
+
* and never remove it: `lisa doctor` reports dirty worktrees and work at risk,
|
|
6
|
+
* and the enumerated command list held no `worktree` verb and no `stash` verb
|
|
7
|
+
* (CodySwannGT/lisa#2993). Detection without remediation is not half a
|
|
8
|
+
* solution — it is the state in which the disk keeps filling with a recorded
|
|
9
|
+
* warning nobody is permitted to act on.
|
|
10
|
+
*
|
|
11
|
+
* The answer is a vetted verb, never an override. Nothing here relaxes the
|
|
12
|
+
* safety-net guard: the raw `git worktree remove --force`, `git stash drop`,
|
|
13
|
+
* and `git stash clear` forms stay blocked for everybody, this command never
|
|
14
|
+
* passes `--force` to git, and the entitlement rules it enforces are in
|
|
15
|
+
* `worktree-prune-policy` and `stash-prune-policy` where they can be tested.
|
|
16
|
+
* @module cli/prune-commands
|
|
17
|
+
*/
|
|
18
|
+
import type { Command } from "commander";
|
|
19
|
+
import { type StashPruneOptions } from "./stash-prune.js";
|
|
20
|
+
import { type WorktreePruneOptions } from "./worktree-prune.js";
|
|
21
|
+
/** Options accepted by the claim verb. */
|
|
22
|
+
export interface WorktreeClaimOptions {
|
|
23
|
+
/** Owner id to record; defaults to the runtime's session id. */
|
|
24
|
+
readonly owner?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Run `lisa worktree prune`.
|
|
28
|
+
* @param targetPath - Repository path
|
|
29
|
+
* @param options - Command-line options
|
|
30
|
+
* @returns Process exit code
|
|
31
|
+
*/
|
|
32
|
+
export declare function runWorktreePruneCli(targetPath: string | undefined, options: WorktreePruneOptions): Promise<number>;
|
|
33
|
+
/**
|
|
34
|
+
* Run `lisa worktree claim`.
|
|
35
|
+
* @param targetPath - Worktree path to claim
|
|
36
|
+
* @param options - Command-line options
|
|
37
|
+
* @returns Process exit code
|
|
38
|
+
*/
|
|
39
|
+
export declare function runWorktreeClaimCli(targetPath: string | undefined, options: WorktreeClaimOptions): Promise<number>;
|
|
40
|
+
/**
|
|
41
|
+
* Run `lisa stash prune`.
|
|
42
|
+
* @param targetPath - Repository path
|
|
43
|
+
* @param options - Command-line options
|
|
44
|
+
* @returns Process exit code
|
|
45
|
+
*/
|
|
46
|
+
export declare function runStashPruneCli(targetPath: string | undefined, options: StashPruneOptions): Promise<number>;
|
|
47
|
+
/**
|
|
48
|
+
* Register every cleanup verb.
|
|
49
|
+
* @param program - Commander program to mutate
|
|
50
|
+
*/
|
|
51
|
+
export declare function addPruneCommands(program: Command): void;
|
|
52
|
+
//# sourceMappingURL=prune-commands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prune-commands.d.ts","sourceRoot":"","sources":["../../src/cli/prune-commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,EAIL,KAAK,iBAAiB,EACvB,MAAM,kBAAkB,CAAC;AAO1B,OAAO,EAML,KAAK,oBAAoB,EAC1B,MAAM,qBAAqB,CAAC;AAK7B,0CAA0C;AAC1C,MAAM,WAAW,oBAAoB;IACnC,gEAAgE;IAChE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAcD;;;;;GAKG;AACH,wBAAsB,mBAAmB,CACvC,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,MAAM,CAAC,CA+BjB;AAED;;;;;GAKG;AACH,wBAAsB,mBAAmB,CACvC,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,MAAM,CAAC,CA6BjB;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CACpC,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,MAAM,CAAC,CAmBjB;AA4ED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAGvD"}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import * as path from "node:path";
|
|
2
|
+
import { applyStashPrune, planStashPrune, } from "./stash-prune.js";
|
|
3
|
+
import { renderStashPlan, renderWorktreePlan } from "./prune-report.js";
|
|
4
|
+
import { git } from "./worktree-inventory.js";
|
|
5
|
+
import { resolveCallerOwnerId, writeOwnerReceipt, } from "./worktree-ownership.js";
|
|
6
|
+
import { applyWorktreePrune, defaultWorktreePruneDependencies, planWorktreePrune, pruneMissingRegistrations, } from "./worktree-prune.js";
|
|
7
|
+
/** Help text for the optional repository-path positional argument. */
|
|
8
|
+
const REPO_ARG_DESCRIPTION = "Repository path (default: current directory)";
|
|
9
|
+
/**
|
|
10
|
+
* Print lines through a writer.
|
|
11
|
+
* @param lines - Lines to print
|
|
12
|
+
* @param write - Sink, defaults to stdout
|
|
13
|
+
*/
|
|
14
|
+
function emit(lines, write = line => process.stdout.write(`${line}\n`)) {
|
|
15
|
+
lines.forEach(write);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Run `lisa worktree prune`.
|
|
19
|
+
* @param targetPath - Repository path
|
|
20
|
+
* @param options - Command-line options
|
|
21
|
+
* @returns Process exit code
|
|
22
|
+
*/
|
|
23
|
+
export async function runWorktreePruneCli(targetPath, options) {
|
|
24
|
+
const repoPath = path.resolve(targetPath ?? process.cwd());
|
|
25
|
+
const plan = await planWorktreePrune(repoPath, options, defaultWorktreePruneDependencies());
|
|
26
|
+
const outcomes = options.apply === true ? await applyWorktreePrune(plan) : [];
|
|
27
|
+
const forgotten = options.apply === true ? await pruneMissingRegistrations(plan) : 0;
|
|
28
|
+
if (options.json === true) {
|
|
29
|
+
emit([
|
|
30
|
+
JSON.stringify({ plan, outcomes, forgottenRegistrations: forgotten }, undefined, 2),
|
|
31
|
+
]);
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
emit([
|
|
35
|
+
...renderWorktreePlan(plan, options.apply === true),
|
|
36
|
+
...outcomes
|
|
37
|
+
.filter(outcome => !outcome.removed)
|
|
38
|
+
.map(outcome => ` FAILED ${outcome.path} — ${outcome.error ?? "git refused it"}`),
|
|
39
|
+
]);
|
|
40
|
+
}
|
|
41
|
+
return outcomes.some(outcome => !outcome.removed) ? 1 : 0;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Run `lisa worktree claim`.
|
|
45
|
+
* @param targetPath - Worktree path to claim
|
|
46
|
+
* @param options - Command-line options
|
|
47
|
+
* @returns Process exit code
|
|
48
|
+
*/
|
|
49
|
+
export async function runWorktreeClaimCli(targetPath, options) {
|
|
50
|
+
const worktree = path.resolve(targetPath ?? process.cwd());
|
|
51
|
+
const owner = options.owner ?? resolveCallerOwnerId();
|
|
52
|
+
if (owner === undefined) {
|
|
53
|
+
emit([
|
|
54
|
+
"No owner id available. Pass --owner <id>, or run under an agent runtime " +
|
|
55
|
+
"that sets one, so the claim names somebody.",
|
|
56
|
+
]);
|
|
57
|
+
return 1;
|
|
58
|
+
}
|
|
59
|
+
const adminDirectory = await git(["rev-parse", "--absolute-git-dir"], worktree).then(out => out.trim(), () => "");
|
|
60
|
+
if (adminDirectory === "") {
|
|
61
|
+
emit([
|
|
62
|
+
`${worktree} is not inside a git repository, so it cannot be claimed.`,
|
|
63
|
+
]);
|
|
64
|
+
return 1;
|
|
65
|
+
}
|
|
66
|
+
const receipt = await writeOwnerReceipt(adminDirectory, owner);
|
|
67
|
+
emit([
|
|
68
|
+
`Claimed ${worktree} for ${owner}.`,
|
|
69
|
+
`Receipt: ${receipt} (inside the git control plane, so it never dirties the working tree).`,
|
|
70
|
+
]);
|
|
71
|
+
return 0;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Run `lisa stash prune`.
|
|
75
|
+
* @param targetPath - Repository path
|
|
76
|
+
* @param options - Command-line options
|
|
77
|
+
* @returns Process exit code
|
|
78
|
+
*/
|
|
79
|
+
export async function runStashPruneCli(targetPath, options) {
|
|
80
|
+
const repoPath = path.resolve(targetPath ?? process.cwd());
|
|
81
|
+
const plan = await planStashPrune(repoPath, options);
|
|
82
|
+
const outcomes = options.apply === true ? await applyStashPrune(plan) : [];
|
|
83
|
+
if (options.json === true) {
|
|
84
|
+
emit([JSON.stringify({ plan, outcomes }, undefined, 2)]);
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
emit([
|
|
88
|
+
...renderStashPlan(plan, options.apply === true),
|
|
89
|
+
...outcomes
|
|
90
|
+
.filter(outcome => !outcome.dropped)
|
|
91
|
+
.map(outcome => ` FAILED ${outcome.sha.slice(0, 8)} — ${outcome.error ?? "git refused it"}`),
|
|
92
|
+
]);
|
|
93
|
+
}
|
|
94
|
+
return outcomes.some(outcome => !outcome.dropped) ? 1 : 0;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Register the worktree command group.
|
|
98
|
+
* @param program - Commander program to mutate
|
|
99
|
+
*/
|
|
100
|
+
function addWorktreeCommands(program) {
|
|
101
|
+
const worktree = program
|
|
102
|
+
.command("worktree")
|
|
103
|
+
.description("Inspect and retire this repository's agent worktrees");
|
|
104
|
+
worktree
|
|
105
|
+
.command("prune")
|
|
106
|
+
.description("Remove agent worktrees that are provably nobody's live work (dry run unless --apply)")
|
|
107
|
+
.argument("[path]", REPO_ARG_DESCRIPTION)
|
|
108
|
+
.option("--apply", "Perform the removals (default: report only)")
|
|
109
|
+
.option("--idle-hours <hours>", "Quiescence an unclaimed worktree must show before it is eligible (default: 24)")
|
|
110
|
+
.option("--json", "Emit the plan and outcomes as JSON")
|
|
111
|
+
.action(async (targetPath, options) => {
|
|
112
|
+
const code = await runWorktreePruneCli(targetPath, options);
|
|
113
|
+
if (code !== 0) {
|
|
114
|
+
process.exitCode = code;
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
worktree
|
|
118
|
+
.command("claim")
|
|
119
|
+
.description("Record this agent as the owner of a worktree so it can retire it later")
|
|
120
|
+
.argument("[path]", "Worktree path (default: current directory)")
|
|
121
|
+
.option("--owner <id>", "Owner id to record")
|
|
122
|
+
.action(async (targetPath, options) => {
|
|
123
|
+
const code = await runWorktreeClaimCli(targetPath, options);
|
|
124
|
+
if (code !== 0) {
|
|
125
|
+
process.exitCode = code;
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Register the stash command group.
|
|
131
|
+
* @param program - Commander program to mutate
|
|
132
|
+
*/
|
|
133
|
+
function addStashCommands(program) {
|
|
134
|
+
program
|
|
135
|
+
.command("stash")
|
|
136
|
+
.description("Clear provably redundant stash entries")
|
|
137
|
+
.command("prune")
|
|
138
|
+
.description("Drop stash entries that are provably redundant, preserving each one under a ref first (dry run unless --apply)")
|
|
139
|
+
.argument("[path]", REPO_ARG_DESCRIPTION)
|
|
140
|
+
.option("--apply", "Perform the drops (default: report only)")
|
|
141
|
+
.option("--older-than-hours <hours>", "Age a machine-generated backup must reach before it counts as debris (default: 24)")
|
|
142
|
+
.option("--json", "Emit the plan and outcomes as JSON")
|
|
143
|
+
.action(async (targetPath, options) => {
|
|
144
|
+
const code = await runStashPruneCli(targetPath, options);
|
|
145
|
+
if (code !== 0) {
|
|
146
|
+
process.exitCode = code;
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Register every cleanup verb.
|
|
152
|
+
* @param program - Commander program to mutate
|
|
153
|
+
*/
|
|
154
|
+
export function addPruneCommands(program) {
|
|
155
|
+
addWorktreeCommands(program);
|
|
156
|
+
addStashCommands(program);
|
|
157
|
+
}
|
|
158
|
+
//# sourceMappingURL=prune-commands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prune-commands.js","sourceRoot":"","sources":["../../src/cli/prune-commands.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EACL,eAAe,EACf,cAAc,GAGf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,EAAE,GAAG,EAAE,MAAM,yBAA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B,WAAW,CAAC,wCAAwC,CAAC;SACrD,OAAO,CAAC,OAAO,CAAC;SAChB,WAAW,CACV,gHAAgH,CACjH;SACA,QAAQ,CAAC,QAAQ,EAAE,oBAAoB,CAAC;SACxC,MAAM,CAAC,SAAS,EAAE,0CAA0C,CAAC;SAC7D,MAAM,CACL,4BAA4B,EAC5B,oFAAoF,CACrF;SACA,MAAM,CAAC,QAAQ,EAAE,oCAAoC,CAAC;SACtD,MAAM,CACL,KAAK,EAAE,UAA8B,EAAE,OAA0B,EAAE,EAAE;QACnE,MAAM,IAAI,GAAG,MAAM,gBAAgB,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QACzD,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC;YACf,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;QAC1B,CAAC;IACH,CAAC,CACF,CAAC;AACN,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAgB;IAC/C,mBAAmB,CAAC,OAAO,CAAC,CAAC;IAC7B,gBAAgB,CAAC,OAAO,CAAC,CAAC;AAC5B,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Operator-readable reports for the prune verbs.
|
|
3
|
+
*
|
|
4
|
+
* Every candidate appears in the output, kept ones included, with the reason it
|
|
5
|
+
* was kept, and nothing is ever truncated.
|
|
6
|
+
*
|
|
7
|
+
* The harder half is the EMPTY case. A verb that finds nothing and exits 0 in
|
|
8
|
+
* silence is indistinguishable from one that did not run, one that found
|
|
9
|
+
* nothing because its probe failed, and one that found candidates and printed
|
|
10
|
+
* none — and the operator has no way to tell those apart. So both reports
|
|
11
|
+
* always open by naming the scope they searched and how much was in it, and
|
|
12
|
+
* always close with an explicit "N of M are candidates" verdict. An empty
|
|
13
|
+
* inspection and a clean tree must never print the same thing.
|
|
14
|
+
* @module cli/prune-report
|
|
15
|
+
*/
|
|
16
|
+
import { type StashVerdict } from "./stash-prune-policy.js";
|
|
17
|
+
import type { StashPrunePlan } from "./stash-prune.js";
|
|
18
|
+
import type { WorktreePrunePlan } from "./worktree-prune.js";
|
|
19
|
+
import { type WorktreeVerdict } from "./worktree-prune-policy.js";
|
|
20
|
+
/**
|
|
21
|
+
* Describe one worktree verdict in a single line.
|
|
22
|
+
* @param verdict - Verdict for one worktree
|
|
23
|
+
* @returns Report line
|
|
24
|
+
*/
|
|
25
|
+
export declare function describeWorktreeVerdict(verdict: WorktreeVerdict): string;
|
|
26
|
+
/**
|
|
27
|
+
* Describe one stash verdict in a single line.
|
|
28
|
+
* @param verdict - Verdict for one stash entry
|
|
29
|
+
* @returns Report line
|
|
30
|
+
*/
|
|
31
|
+
export declare function describeStashVerdict(verdict: StashVerdict): string;
|
|
32
|
+
/**
|
|
33
|
+
* Render the worktree plan for a human.
|
|
34
|
+
*
|
|
35
|
+
* Never returns an empty list. The opening line names the scope and the count
|
|
36
|
+
* inspected even when that count is zero, so the operator can always tell the
|
|
37
|
+
* verb ran.
|
|
38
|
+
* @param plan - Plan produced by the prune verb
|
|
39
|
+
* @param applied - Whether removals were actually performed
|
|
40
|
+
* @returns Report lines
|
|
41
|
+
*/
|
|
42
|
+
export declare function renderWorktreePlan(plan: WorktreePrunePlan, applied: boolean): readonly string[];
|
|
43
|
+
/**
|
|
44
|
+
* Render the stash plan for a human.
|
|
45
|
+
*
|
|
46
|
+
* Never returns an empty list, for the same reason as the worktree report.
|
|
47
|
+
* @param plan - Plan produced by the stash prune verb
|
|
48
|
+
* @param applied - Whether drops were actually performed
|
|
49
|
+
* @returns Report lines
|
|
50
|
+
*/
|
|
51
|
+
export declare function renderStashPlan(plan: StashPrunePlan, applied: boolean): readonly string[];
|
|
52
|
+
//# sourceMappingURL=prune-report.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prune-report.d.ts","sourceRoot":"","sources":["../../src/cli/prune-report.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAEL,KAAK,YAAY,EAClB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAEL,KAAK,eAAe,EACrB,MAAM,4BAA4B,CAAC;AAMpC;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,eAAe,GAAG,MAAM,CAMxE;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,CAOlE;AAuED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,iBAAiB,EACvB,OAAO,EAAE,OAAO,GACf,SAAS,MAAM,EAAE,CAkBnB;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,cAAc,EACpB,OAAO,EAAE,OAAO,GACf,SAAS,MAAM,EAAE,CAMnB"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Operator-readable reports for the prune verbs.
|
|
3
|
+
*
|
|
4
|
+
* Every candidate appears in the output, kept ones included, with the reason it
|
|
5
|
+
* was kept, and nothing is ever truncated.
|
|
6
|
+
*
|
|
7
|
+
* The harder half is the EMPTY case. A verb that finds nothing and exits 0 in
|
|
8
|
+
* silence is indistinguishable from one that did not run, one that found
|
|
9
|
+
* nothing because its probe failed, and one that found candidates and printed
|
|
10
|
+
* none — and the operator has no way to tell those apart. So both reports
|
|
11
|
+
* always open by naming the scope they searched and how much was in it, and
|
|
12
|
+
* always close with an explicit "N of M are candidates" verdict. An empty
|
|
13
|
+
* inspection and a clean tree must never print the same thing.
|
|
14
|
+
* @module cli/prune-report
|
|
15
|
+
*/
|
|
16
|
+
import { STASH_BLOCKER_EXPLANATIONS, } from "./stash-prune-policy.js";
|
|
17
|
+
import { BLOCKER_EXPLANATIONS, } from "./worktree-prune-policy.js";
|
|
18
|
+
/** Closing line when a dry run performed nothing. */
|
|
19
|
+
const DRY_RUN_SUFFIX = "This was a dry run — nothing was changed. Re-run with --apply to perform it.";
|
|
20
|
+
/**
|
|
21
|
+
* Describe one worktree verdict in a single line.
|
|
22
|
+
* @param verdict - Verdict for one worktree
|
|
23
|
+
* @returns Report line
|
|
24
|
+
*/
|
|
25
|
+
export function describeWorktreeVerdict(verdict) {
|
|
26
|
+
return verdict.eligible
|
|
27
|
+
? ` REMOVE ${verdict.path}`
|
|
28
|
+
: ` KEEP ${verdict.path} — ${verdict.blockers
|
|
29
|
+
.map(blocker => BLOCKER_EXPLANATIONS[blocker])
|
|
30
|
+
.join("; ")}`;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Describe one stash verdict in a single line.
|
|
34
|
+
* @param verdict - Verdict for one stash entry
|
|
35
|
+
* @returns Report line
|
|
36
|
+
*/
|
|
37
|
+
export function describeStashVerdict(verdict) {
|
|
38
|
+
const label = `stash@{${verdict.index}} ${verdict.sha.slice(0, 8)}`;
|
|
39
|
+
return verdict.eligible
|
|
40
|
+
? ` DROP ${label} — ${verdict.redundancy ?? "redundant"}`
|
|
41
|
+
: ` KEEP ${label} — ${verdict.blockers
|
|
42
|
+
.map(blocker => STASH_BLOCKER_EXPLANATIONS[blocker])
|
|
43
|
+
.join("; ")}`;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Close the worktree report with an explicit candidate count.
|
|
47
|
+
*
|
|
48
|
+
* The zero cases are spelled out separately rather than folded into one
|
|
49
|
+
* "0 of N" line, because "there was nothing to look at", "everything was
|
|
50
|
+
* refused on its merits", and "nothing could be assessed at all" are three
|
|
51
|
+
* different situations that call for three different operator responses.
|
|
52
|
+
* @param plan - Plan produced by the prune verb
|
|
53
|
+
* @param applied - Whether removals were actually performed
|
|
54
|
+
* @returns Closing line
|
|
55
|
+
*/
|
|
56
|
+
function summarizeWorktreePlan(plan, applied) {
|
|
57
|
+
const inspected = plan.verdicts.length;
|
|
58
|
+
const eligible = plan.verdicts.filter(verdict => verdict.eligible).length;
|
|
59
|
+
if (inspected === 0) {
|
|
60
|
+
return (`No worktrees are registered for ${plan.repoPath}, so there was nothing ` +
|
|
61
|
+
"to assess. This is an empty inspection, not a clean result.");
|
|
62
|
+
}
|
|
63
|
+
if (!plan.livenessAvailable) {
|
|
64
|
+
return (`0 of ${inspected} worktrees are candidates: every one was refused ` +
|
|
65
|
+
"because the live-process probe could not run, so NOTHING here was " +
|
|
66
|
+
"assessed on its merits.");
|
|
67
|
+
}
|
|
68
|
+
if (eligible === 0) {
|
|
69
|
+
return (`0 of ${inspected} worktrees are candidates — each was refused for the ` +
|
|
70
|
+
"reason named on its line above.");
|
|
71
|
+
}
|
|
72
|
+
return applied
|
|
73
|
+
? `Removed ${eligible} of ${inspected} worktrees.`
|
|
74
|
+
: `${eligible} of ${inspected} worktrees are candidates. ${DRY_RUN_SUFFIX}`;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Close the stash report with an explicit candidate count.
|
|
78
|
+
* @param plan - Plan produced by the stash prune verb
|
|
79
|
+
* @param applied - Whether drops were actually performed
|
|
80
|
+
* @returns Closing line
|
|
81
|
+
*/
|
|
82
|
+
function summarizeStashPlan(plan, applied) {
|
|
83
|
+
const inspected = plan.verdicts.length;
|
|
84
|
+
const eligible = plan.verdicts.filter(verdict => verdict.eligible).length;
|
|
85
|
+
if (inspected === 0) {
|
|
86
|
+
return (`No stash entries exist in ${plan.repoPath}, so there was nothing to ` +
|
|
87
|
+
"assess. This is an empty inspection, not a clean result.");
|
|
88
|
+
}
|
|
89
|
+
if (eligible === 0) {
|
|
90
|
+
return (`0 of ${inspected} stash entries are candidates — each was kept for the ` +
|
|
91
|
+
"reason named on its line above.");
|
|
92
|
+
}
|
|
93
|
+
return applied
|
|
94
|
+
? `Dropped ${eligible} of ${inspected} stash entries. Each was first ` +
|
|
95
|
+
"anchored under refs/lisa/pruned-stashes/<sha> and can be restored " +
|
|
96
|
+
"with `git stash apply <ref>`."
|
|
97
|
+
: `${eligible} of ${inspected} stash entries are candidates. ${DRY_RUN_SUFFIX}`;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Render the worktree plan for a human.
|
|
101
|
+
*
|
|
102
|
+
* Never returns an empty list. The opening line names the scope and the count
|
|
103
|
+
* inspected even when that count is zero, so the operator can always tell the
|
|
104
|
+
* verb ran.
|
|
105
|
+
* @param plan - Plan produced by the prune verb
|
|
106
|
+
* @param applied - Whether removals were actually performed
|
|
107
|
+
* @returns Report lines
|
|
108
|
+
*/
|
|
109
|
+
export function renderWorktreePlan(plan, applied) {
|
|
110
|
+
return [
|
|
111
|
+
`Inspected ${plan.verdicts.length} worktree(s) registered for ${plan.repoPath}.`,
|
|
112
|
+
...(plan.livenessAvailable
|
|
113
|
+
? []
|
|
114
|
+
: [
|
|
115
|
+
"The live-process probe could not run, so NOTHING is eligible. This " +
|
|
116
|
+
"is unassessed, not clean: without it a worktree another agent is " +
|
|
117
|
+
"working in right now is indistinguishable from an abandoned one.",
|
|
118
|
+
]),
|
|
119
|
+
...plan.verdicts.map(describeWorktreeVerdict),
|
|
120
|
+
...(plan.prunableRegistrations.length > 0
|
|
121
|
+
? [
|
|
122
|
+
`${plan.prunableRegistrations.length} registration(s) point at a directory that is already gone and will be forgotten.`,
|
|
123
|
+
]
|
|
124
|
+
: []),
|
|
125
|
+
summarizeWorktreePlan(plan, applied),
|
|
126
|
+
];
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Render the stash plan for a human.
|
|
130
|
+
*
|
|
131
|
+
* Never returns an empty list, for the same reason as the worktree report.
|
|
132
|
+
* @param plan - Plan produced by the stash prune verb
|
|
133
|
+
* @param applied - Whether drops were actually performed
|
|
134
|
+
* @returns Report lines
|
|
135
|
+
*/
|
|
136
|
+
export function renderStashPlan(plan, applied) {
|
|
137
|
+
return [
|
|
138
|
+
`Inspected ${plan.verdicts.length} stash entr(ies) in ${plan.repoPath}.`,
|
|
139
|
+
...plan.verdicts.map(describeStashVerdict),
|
|
140
|
+
summarizeStashPlan(plan, applied),
|
|
141
|
+
];
|
|
142
|
+
}
|
|
143
|
+
//# sourceMappingURL=prune-report.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prune-report.js","sourceRoot":"","sources":["../../src/cli/prune-report.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EACL,0BAA0B,GAE3B,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EACL,oBAAoB,GAErB,MAAM,4BAA4B,CAAC;AAEpC,qDAAqD;AACrD,MAAM,cAAc,GAClB,8EAA8E,CAAC;AAEjF;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,OAAwB;IAC9D,OAAO,OAAO,CAAC,QAAQ;QACrB,CAAC,CAAC,aAAa,OAAO,CAAC,IAAI,EAAE;QAC7B,CAAC,CAAC,aAAa,OAAO,CAAC,IAAI,MAAM,OAAO,CAAC,QAAQ;aAC5C,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;aAC7C,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;AACtB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAAqB;IACxD,MAAM,KAAK,GAAG,UAAU,OAAO,CAAC,KAAK,KAAK,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;IACpE,OAAO,OAAO,CAAC,QAAQ;QACrB,CAAC,CAAC,aAAa,KAAK,MAAM,OAAO,CAAC,UAAU,IAAI,WAAW,EAAE;QAC7D,CAAC,CAAC,aAAa,KAAK,MAAM,OAAO,CAAC,QAAQ;aACrC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,0BAA0B,CAAC,OAAO,CAAC,CAAC;aACnD,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;AACtB,CA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.
|
|
3
|
+
*
|
|
4
|
+
* Stashes are harder to own than worktrees: `refs/stash` is a single reflog
|
|
5
|
+
* shared by every worktree of a repository, so an entry an agent finds may have
|
|
6
|
+
* been pushed a minute ago by a sibling working three directories away. There
|
|
7
|
+
* is no path, no branch, and no author to scope by. The only defensible
|
|
8
|
+
* entitlement is therefore not "mine" but **provably redundant** — an entry
|
|
9
|
+
* whose content is already preserved somewhere else, or machine-generated
|
|
10
|
+
* debris whose producing run is provably long dead.
|
|
11
|
+
*
|
|
12
|
+
* Everything else is kept and reported. A stash that cannot be proven redundant
|
|
13
|
+
* is precisely the case the standing block on `git stash drop` exists for.
|
|
14
|
+
* @module cli/stash-prune-policy
|
|
15
|
+
*/
|
|
16
|
+
/** Why one stash entry was kept. */
|
|
17
|
+
export type StashBlocker = "not-provably-redundant" | "too-recent" | "unreadable";
|
|
18
|
+
/** Why one stash entry may be dropped. */
|
|
19
|
+
export type StashRedundancy = "empty-and-published" | "machine-debris";
|
|
20
|
+
/** Everything the rule is allowed to consider about one stash entry. */
|
|
21
|
+
export interface StashFacts {
|
|
22
|
+
/** Position in `git stash list` at plan time. */
|
|
23
|
+
readonly index: number;
|
|
24
|
+
/** Commit id of the stash entry — the identity that survives renumbering. */
|
|
25
|
+
readonly sha: string;
|
|
26
|
+
/** Reflog subject, e.g. `WIP on main: …` or the lint-staged backup message. */
|
|
27
|
+
readonly subject: string;
|
|
28
|
+
/** Age of the entry in seconds. */
|
|
29
|
+
readonly ageSeconds: number;
|
|
30
|
+
/** Whether every fact below could be established. */
|
|
31
|
+
readonly readable: boolean;
|
|
32
|
+
/** Whether the entry records no change at all against the commit it came from. */
|
|
33
|
+
readonly recordsNoChange: boolean;
|
|
34
|
+
/** Whether the commit the entry came from is reachable from a remote. */
|
|
35
|
+
readonly baseOnRemote: boolean;
|
|
36
|
+
}
|
|
37
|
+
/** Tunable part of the rule. */
|
|
38
|
+
export interface StashPrunePolicy {
|
|
39
|
+
/** Age a machine-generated backup must reach before it is debris. */
|
|
40
|
+
readonly minDebrisAgeSeconds: number;
|
|
41
|
+
}
|
|
42
|
+
/** Result of applying the rule to one stash entry. */
|
|
43
|
+
export interface StashVerdict {
|
|
44
|
+
/** Position in `git stash list` at plan time. */
|
|
45
|
+
readonly index: number;
|
|
46
|
+
/** Commit id of the stash entry. */
|
|
47
|
+
readonly sha: string;
|
|
48
|
+
/** Whether the entry may be dropped. */
|
|
49
|
+
readonly eligible: boolean;
|
|
50
|
+
/** Why it may be dropped, when it may. */
|
|
51
|
+
readonly redundancy?: StashRedundancy;
|
|
52
|
+
/** Why it was kept, when it was. */
|
|
53
|
+
readonly blockers: readonly StashBlocker[];
|
|
54
|
+
}
|
|
55
|
+
/** Default debris age: a lint-staged run that old is not coming back. */
|
|
56
|
+
export declare const DEFAULT_MIN_DEBRIS_AGE_SECONDS: number;
|
|
57
|
+
/** Operator-readable explanation for each blocker. */
|
|
58
|
+
export declare const STASH_BLOCKER_EXPLANATIONS: Readonly<Record<StashBlocker, string>>;
|
|
59
|
+
/**
|
|
60
|
+
* Report whether a reflog subject is lint-staged's automatic backup.
|
|
61
|
+
* @param subject - Reflog subject of the stash entry
|
|
62
|
+
* @returns True when the entry is machine-generated backup debris
|
|
63
|
+
*/
|
|
64
|
+
export declare function isLintStagedBackup(subject: string): boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Decide whether one stash entry may be dropped, and say why not when it may not.
|
|
67
|
+
* @param facts - Gathered facts about the entry
|
|
68
|
+
* @param policy - Tunable thresholds
|
|
69
|
+
* @returns Verdict with the reason it may be dropped, or every reason it may not
|
|
70
|
+
*/
|
|
71
|
+
export declare function classifyStash(facts: StashFacts, policy: StashPrunePolicy): StashVerdict;
|
|
72
|
+
//# sourceMappingURL=stash-prune-policy.d.ts.map
|