Skip to content

Commit e10a866

Browse files
authored
fix(apply): batch exact publication labels (#1085)
* fix(apply): batch exact publication labels * test(apply): preserve batched lease cleanup invariant * fix(apply): receipt partial label mutations * test(apply): track conditional label create receipts * fix(apply): reconcile recovered label comments * fix(apply): receipt label sync timestamps * fix(apply): refresh guards after label batches * fix(apply): restore staged labels before skips * fix(apply): batch recovery label cleanup * fix(apply): separate possible label receipts
1 parent 80847d1 commit e10a866

15 files changed

Lines changed: 1750 additions & 308 deletions

‎src/clawsweeper-apply-decision-workflow.ts‎

Lines changed: 254 additions & 47 deletions
Large diffs are not rendered by default.

‎src/clawsweeper-apply-dependencies.ts‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ export interface CreateApplyDecisionWorkflowDependencies {
5151
actionLedgerItemKey: (item: Pick<Item, "repo" | "number">) => string;
5252
activeApplyMutationRunner: MutationRunner | null;
5353
addIssueLabel: (number: number, label: string, onMutation?: () => void) => void;
54+
beginIssueLabelMutationBatch: (number: number) => void;
5455
applyAuthorPrBudgetStateToReport: (markdown: string, state: AuthorPrBudgetApplyState) => string;
5556
applyBlockingProtectedLabels: (labels: readonly string[], closeReason: unknown) => string[];
5657
applyClosedUnmergedCanonicalBlockedReport: (
@@ -151,6 +152,7 @@ export interface CreateApplyDecisionWorkflowDependencies {
151152
) => boolean;
152153
coveringPrCloseCoveragePullRequestSnapshotSha256: (number: number) => string;
153154
decisionPacketsDirFromArgs: (args: Args, itemsDir: string, closedDir: string) => string;
155+
discardIssueLabelMutationBatch: (number: number) => void;
154156
defaultClosedDir: (profile?: RepositoryProfile) => string;
155157
defaultItemsDir: (profile?: RepositoryProfile) => string;
156158
defaultPlansDir: (profile?: RepositoryProfile) => string;
@@ -190,6 +192,15 @@ export interface CreateApplyDecisionWorkflowDependencies {
190192
attempt: ApplyMutationAttempt;
191193
outcome: "accepted" | "rejected" | "unknown";
192194
}) => string | null;
195+
flushIssueLabelMutationBatch: (
196+
number: number,
197+
beforeItemMutation?: () => void,
198+
afterItemMutation?: (confirmed: boolean) => void,
199+
) => {
200+
itemMutationPublished: boolean;
201+
repositoryDefinitionMutated: boolean;
202+
skippedAdditions: string[];
203+
};
193204
freshPullRequestReviewHead: (markdown: string, context: ItemContext) => boolean;
194205
frontMatterBoolean: (markdown: string, key: string) => boolean;
195206
frontMatterStringArray: (markdown: string, key: string) => string[];

‎src/clawsweeper-label-dependencies.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type { createLabelPolicy } from "./clawsweeper-label-policy.js";
22
import type { SecurityReview } from "./clawsweeper-types.js";
33

44
export interface LabelSynchronizationDependencies {
5+
ghJson: <T>(args: string[]) => T;
56
ghObservedMutationCommand: (options: {
67
identity: string;
78
args: string[];

0 commit comments

Comments
 (0)