@henryqw/pi-subagent 27.6.2 → 27.6.3
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/prune.d.ts +1 -1
- package/dist/runner.d.ts +3 -2
- package/dist/runner.js +8 -2
- package/docs/orchestration.md +1 -1
- package/package.json +1 -1
package/dist/prune.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export interface PruneOwnership {
|
|
|
17
17
|
lease?: string;
|
|
18
18
|
}
|
|
19
19
|
export interface PruneGuards {
|
|
20
|
-
/** Ownership and lease evidence across the repository's existing checkouts. */
|
|
20
|
+
/** Ownership and lease evidence across the repository's existing checkouts, primary first. */
|
|
21
21
|
ownership(checkouts: readonly string[]): Promise<PruneOwnership>;
|
|
22
22
|
/** Every Herdr pane; rejects when Herdr cannot be inspected. */
|
|
23
23
|
panes(): Promise<readonly {
|
package/dist/runner.d.ts
CHANGED
|
@@ -339,8 +339,9 @@ export declare class IsolatedRunner {
|
|
|
339
339
|
invalidIds: string[];
|
|
340
340
|
leaseBusy: boolean;
|
|
341
341
|
}>;
|
|
342
|
-
/** Prune evidence across checkouts
|
|
343
|
-
*
|
|
342
|
+
/** Prune evidence across checkouts, primary first, and orphaned requests whose parent checkout was removed.
|
|
343
|
+
* A non-terminal state owns every resource name its saved text mentions; an unreadable state owns every
|
|
344
|
+
* name its raw text mentions, or every name when unreadable. */
|
|
344
345
|
pruneOwnership(checkouts: readonly string[]): Promise<PruneOwnership>;
|
|
345
346
|
/** After pruning, reconcile aborted requests that recorded a removed resource through the guarded abort path. */
|
|
346
347
|
reconcilePrunedAborts(checkouts: readonly string[], names: readonly string[]): Promise<string[]>;
|
package/dist/runner.js
CHANGED
|
@@ -672,11 +672,17 @@ export class IsolatedRunner {
|
|
|
672
672
|
}
|
|
673
673
|
return { requests, invalidIds: inventory.invalidIds, leaseBusy };
|
|
674
674
|
}
|
|
675
|
-
/** Prune evidence across checkouts
|
|
676
|
-
*
|
|
675
|
+
/** Prune evidence across checkouts, primary first, and orphaned requests whose parent checkout was removed.
|
|
676
|
+
* A non-terminal state owns every resource name its saved text mentions; an unreadable state owns every
|
|
677
|
+
* name its raw text mentions, or every name when unreadable. */
|
|
677
678
|
async pruneOwnership(checkouts) {
|
|
678
679
|
const owners = [];
|
|
679
680
|
let lease;
|
|
681
|
+
const orphans = checkouts[0] ? (await this.store.listOrphans(realpathSync.native(checkouts[0]))).states : [];
|
|
682
|
+
for (const { state } of orphans) {
|
|
683
|
+
if (!terminal(state))
|
|
684
|
+
owners.push({ label: `owned by orphaned ${state.status} request ${state.request.id}; close and delete it from /subagent`, text: JSON.stringify(state) });
|
|
685
|
+
}
|
|
680
686
|
for (const checkout of checkouts) {
|
|
681
687
|
const root = realpathSync.native(checkout);
|
|
682
688
|
if (!lease && await this.store.hasProductiveRunLease(root))
|
package/docs/orchestration.md
CHANGED
|
@@ -410,7 +410,7 @@ Run `/subagent prune` to clean up leftover worker and integration checkouts unde
|
|
|
410
410
|
|
|
411
411
|
- Its branch tip is already in Main's HEAD or in the local `origin` default-branch ref. The command does not fetch.
|
|
412
412
|
- Its checkout has no tracked or untracked changes. No merge, rebase, cherry-pick, revert, or bisect is in progress.
|
|
413
|
-
- No unfinished isolated request, in any checkout of this repository, records it. An unreadable state file blocks every item that it mentions.
|
|
413
|
+
- No unfinished isolated request, in any checkout of this repository, records it. An unreadable state file blocks every item that it mentions. An unfinished orphaned request, whose parent checkout was removed, also blocks its items. To remove them, open that request in `/subagent` and use **Close and delete worktrees (discard work)**.
|
|
414
414
|
- No productive run holds a repository lease.
|
|
415
415
|
- No Herdr pane works inside the checkout. If the command cannot inspect Herdr, it refuses every checkout.
|
|
416
416
|
|