Skip to content

Commit 3b3bfbc

Browse files
committed
fix: keep close quality reporting read-only
1 parent 6036c14 commit 3b3bfbc

5 files changed

Lines changed: 30 additions & 8 deletions

File tree

‎.github/workflows/sweep.yml‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2369,6 +2369,7 @@ jobs:
23692369
checkpoint_size=20
23702370
fi
23712371
candidate_quality_summary="not evaluated"
2372+
candidate_quality_detail=""
23722373
mkdir -p .artifacts/apply-reports
23732374
publish_changes() {
23742375
message="$1"
@@ -2443,6 +2444,7 @@ jobs:
24432444
pnpm run --silent workflow -- proposed-item-quality-summary "${quality_args[@]}" > "$candidate_quality_env"
24442445
cat "$candidate_quality_env"
24452446
candidate_quality_summary="$(awk -F= '$1 == "candidate_quality_summary" { print $2 }' "$candidate_quality_env")"
2447+
candidate_quality_detail=" Close candidate mix: $candidate_quality_summary."
24462448
fi
24472449
if [ "$sync_open_pr_batch" = "true" ] && [ -z "$item_numbers" ]; then
24482450
batch_env=".artifacts/comment-sync-batch.env"
@@ -2519,7 +2521,7 @@ jobs:
25192521
pnpm run status -- \
25202522
--target-repo "$TARGET_REPO" \
25212523
--state "Apply idle" \
2522-
--detail "No unchanged high-confidence close proposals are awaiting apply. Close candidate mix: $candidate_quality_summary. Scheduled apply wakes every 15 minutes and exits without scanning unrelated keep-open records when there is no close work." \
2524+
--detail "No unchanged high-confidence close proposals are awaiting apply.$candidate_quality_detail Scheduled apply wakes every 15 minutes and exits without scanning unrelated keep-open records when there is no close work." \
25232525
--run-url "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
25242526
publish_status "chore: update idle sweep apply status"
25252527
{
@@ -2543,7 +2545,7 @@ jobs:
25432545
pnpm run status -- \
25442546
--target-repo "$TARGET_REPO" \
25452547
--state "Apply in progress" \
2546-
--detail "Starting apply/comment-sync run for up to $limit fresh $apply_kind closes. Close reasons: $apply_close_reasons. Close candidate mix: $candidate_quality_summary. Existing Codex automated review comments are updated in place when closing or when comment-only sync is stale by ${comment_sync_min_age_days} day(s); checkpoints commit every $checkpoint_size fresh closes; close delay is ${close_delay_ms}ms; sync-comments-only=$sync_comments_only; item numbers=${item_numbers:-all}." \
2548+
--detail "Starting apply/comment-sync run for up to $limit fresh $apply_kind closes. Close reasons: $apply_close_reasons.$candidate_quality_detail Existing Codex automated review comments are updated in place when closing or when comment-only sync is stale by ${comment_sync_min_age_days} day(s); checkpoints commit every $checkpoint_size fresh closes; close delay is ${close_delay_ms}ms; sync-comments-only=$sync_comments_only; item numbers=${item_numbers:-all}." \
25472549
--run-url "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
25482550
if ! publish_changes "chore: mark sweep apply in progress" records results/sweep-status; then
25492551
echo "Best-effort apply start status update failed"

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ checkpoint, and status-only commits are intentionally omitted.
99

1010
### Added
1111

12+
- Added close-candidate quality telemetry to apply status while keeping reporting separate from close eligibility and comment-only sync. Thanks @brokemac79.
1213
- Added the PR-only `stalled_unproven_pr` close reason: external D/F-rated pull requests whose requested real-behavior proof stayed missing, mock-only, or insufficient can close after 14 idle days, guarded by live checks that the proof request itself was visible for 14 days plus proof-label, draft, head-commit, and human-engagement gates.
1314
- Added the PR-only `abandoned_pr` close reason: external pull requests idle for 30 days that are still drafts, waiting on their author, or failing checks on the live head can close, while high-quality proven work stays open for repair/adopt paths. See `docs/stalled-pr-close-policies.md`.
1415
- Added apply-health telemetry and a quiet-by-default dashboard alert for stalled, cursorless, or fully blocked pruning windows. Thanks @brokemac79.

‎src/repair/workflow-utils.ts‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -928,7 +928,7 @@ export function proposedPrCloseCoverageItemNumbers(options: ProposedItemOptions)
928928
);
929929
}
930930

931-
type ProposedItemSelection = "all" | "pr-close-coverage-proof";
931+
type ProposedItemSelection = "all" | "pr-close-coverage-proof" | "quality-summary";
932932

933933
type ProposedItemCandidate = {
934934
number: number;
@@ -971,7 +971,6 @@ function selectedProposedItemCandidates(
971971

972972
const allowedReasons = new Set([
973973
"cannot_reproduce",
974-
"abandoned_pr",
975974
"clawhub",
976975
"duplicate_or_superseded",
977976
"incoherent",
@@ -980,9 +979,9 @@ function selectedProposedItemCandidates(
980979
"mostly_implemented_on_main",
981980
"not_actionable_in_repo",
982981
"stale_insufficient_info",
983-
"stalled_unproven_pr",
984982
"unconfirmed_product_direction",
985983
]);
984+
const qualitySummaryOnlyReasons = new Set(["abandoned_pr", "stalled_unproven_pr"]);
986985
const allowedCloseReasons =
987986
options.applyCloseReasons === "all"
988987
? null
@@ -1015,7 +1014,10 @@ function selectedProposedItemCandidates(
10151014
decision === "close" &&
10161015
confidence === "high" &&
10171016
isSelectableCloseAction(action, reason) &&
1018-
allowedForTarget(options.targetRepo, type, reason, allowedReasons) &&
1017+
(allowedForTarget(options.targetRepo, type, reason, allowedReasons) ||
1018+
(selection === "quality-summary" &&
1019+
type === "pull_request" &&
1020+
qualitySummaryOnlyReasons.has(reason))) &&
10191021
(!allowedCloseReasons || allowedCloseReasons.has(reason));
10201022
const selectablePromotion =
10211023
decision === "keep_open" &&
@@ -1079,7 +1081,7 @@ function selectedProposedItemCandidates(
10791081
export function proposedItemQualitySummary(
10801082
options: ProposedItemOptions,
10811083
): ProposedItemQualitySummary {
1082-
const candidates = selectedProposedItemCandidates(options, "all");
1084+
const candidates = selectedProposedItemCandidates(options, "quality-summary");
10831085
const counts = new Map<ProposedItemQualityBucket, number>();
10841086
for (const candidate of candidates) {
10851087
counts.set(candidate.qualityBucket, (counts.get(candidate.qualityBucket) || 0) + 1);

‎test/repair/workflow-utils.test.ts‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1216,7 +1216,19 @@ test("workflow utilities summarize proposed close candidate quality buckets", ()
12161216
}),
12171217
);
12181218

1219+
const selected = withCwd(root, () =>
1220+
proposedItemNumbers({
1221+
targetRepo: "openclaw/openclaw",
1222+
applyKind: "all",
1223+
applyCloseReasons: "all",
1224+
staleMinAgeDays: 60,
1225+
minAgeDays: 0,
1226+
minAgeMinutes: null,
1227+
}),
1228+
);
1229+
12191230
assert.equal(summary.total, 8);
1231+
assert.deepEqual(selected, [5, 6, 7, 8, 9, 10]);
12201232
assert.equal(
12211233
summary.summary,
12221234
"1 implemented-on-main, 1 duplicate/superseded, 1 needs PR close proof, 3 aging/low-signal, 1 policy-sensitive, 1 retry after guard skip",

‎test/sweep-workflow.test.ts‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,12 @@ test("apply workflow bounds checkpoints and requeues with a fresh token", () =>
170170
assert.match(applyStep, /--state "Apply idle"/);
171171
assert.match(applyStep, /proposed-item-quality-summary/);
172172
assert.match(applyStep, /candidate_quality_summary="\$\(awk -F=/);
173-
assert.match(applyStep, /Close candidate mix: \$candidate_quality_summary/);
173+
assert.match(
174+
applyStep,
175+
/candidate_quality_detail=" Close candidate mix: \$candidate_quality_summary\."/,
176+
);
177+
assert.match(applyStep, /awaiting apply\.\$candidate_quality_detail Scheduled apply/);
178+
assert.match(applyStep, /\$apply_close_reasons\.\$candidate_quality_detail Existing Codex/);
174179
const applyReconcileIndex = applyStep.indexOf('pnpm run reconcile -- "${reconcile_args[@]}"');
175180
const qualitySummaryIndex = applyStep.indexOf("proposed-item-quality-summary");
176181
const proposedNumbersIndex = applyStep.indexOf("proposed-item-numbers");

0 commit comments

Comments
 (0)