You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: inc/Abilities/WorkspaceAbilities.php
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -1794,7 +1794,7 @@ private function registerAbilities(): void {
1794
1794
),
1795
1795
'limit' => array(
1796
1796
'type' => 'integer',
1797
-
'description' => 'Page size for bounded dry-run, direct apply, budgeted apply, or job-backed apply.',
1797
+
'description' => 'Positive page size for bounded dry-run, direct apply, budgeted apply, or job-backed apply.',
1798
1798
),
1799
1799
'offset' => array(
1800
1800
'type' => 'integer',
@@ -1835,7 +1835,7 @@ private function registerAbilities(): void {
1835
1835
'properties' => array(
1836
1836
'limit' => array(
1837
1837
'type' => 'integer',
1838
-
'description' => 'Maximum active_no_signal rows to inspect in this page. Defaults to 25.',
1838
+
'description' => 'Positive maximum active_no_signal rows to inspect in this page. Defaults to 25.',
1839
1839
),
1840
1840
'offset' => array(
1841
1841
'type' => 'integer',
@@ -1878,7 +1878,7 @@ private function registerAbilities(): void {
1878
1878
),
1879
1879
'limit' => array(
1880
1880
'type' => 'integer',
1881
-
'description' => 'Maximum active_no_signal rows to inspect in this page. Defaults to 25.',
1881
+
'description' => 'Positive maximum active_no_signal rows to inspect in this page. Defaults to 25.',
1882
1882
),
1883
1883
'offset' => array(
1884
1884
'type' => 'integer',
@@ -1918,7 +1918,7 @@ private function registerAbilities(): void {
1918
1918
),
1919
1919
'limit' => array(
1920
1920
'type' => 'integer',
1921
-
'description' => 'Maximum active_no_signal rows to inspect in this page. Defaults to 25.',
1921
+
'description' => 'Positive maximum active_no_signal rows to inspect in this page. Defaults to 25.',
1922
1922
),
1923
1923
'offset' => array(
1924
1924
'type' => 'integer',
@@ -1966,7 +1966,7 @@ private function registerAbilities(): void {
1966
1966
),
1967
1967
'limit' => array(
1968
1968
'type' => 'integer',
1969
-
'description' => 'Maximum worktrees to scan in a dry-run page. Defaults to ' . Workspace::ARTIFACT_CLEANUP_DEFAULT_LIMIT . '. Use 0 to disable the cap (still bounded by exhaustive=false unless you also pass exhaustive=true).',
1969
+
'description' => 'Positive maximum worktrees to scan in a dry-run page. Defaults to ' . Workspace::ARTIFACT_CLEANUP_DEFAULT_LIMIT . '. Use exhaustive=true for the explicit unbounded full audit mode.',
// Allow callers to opt out of bounded mode entirely.
46
+
if ( $limit < 0 ) {
47
+
returnnew \WP_Error('invalid_artifact_cleanup_limit', 'Artifact cleanup --limit must be greater than 0. Use --exhaustive for an unbounded full artifact audit.', array( 'status' => 400 ));
48
+
}
49
+
if ( ! $exhaustive && $limit <= 0 ) {
50
+
returnnew \WP_Error('invalid_artifact_cleanup_limit', 'Artifact cleanup --limit must be greater than 0. Use --exhaustive for an unbounded full artifact audit.', array( 'status' => 400 ));
51
+
}
52
+
// Allow callers to opt out of bounded mode entirely only through the
53
+
// explicit exhaustive path, which also enables safety probes.
47
54
if ( $exhaustive ) {
48
55
$limit = 0;
49
56
}
@@ -191,7 +198,7 @@ public function worktree_cleanup_artifacts( array $opts = array() ): array|\WP_E
191
198
* `next_offset` continuation when the scan is partial.
192
199
*
193
200
* @param bool $force Whether to allow dirty/unpushed worktrees.
datamachine_code_cleanup_assert(str_contains($doc_comment, 'Daily cleanup path: DB-backed plan, then apply only those rows after revalidation'), 'worktree examples point daily cleanup to DB-backed run_id controller path');
657
660
datamachine_code_cleanup_assert(str_contains($doc_comment, 'workspace cleanup plan --mode=retention'), 'worktree examples include DB-backed cleanup plan');
658
661
datamachine_code_cleanup_assert(str_contains($doc_comment, 'workspace cleanup run --mode=retention'), 'worktree examples include task-backed cleanup run');
@@ -932,6 +935,12 @@ public function execute( array $input ): array
datamachine_code_cleanup_assert(! str_contains(WP_CLI::$successes[0] ?? '', 'Save JSON'), 'cleanup-artifacts dry-run does not normalize saving plan files');
0 commit comments