Skip to content

Ready-to-merge batch + collaborator request#56

Open
ds4psb-ai wants to merge 20 commits intoopenclaw:mainfrom
ds4psb-ai:main
Open

Ready-to-merge batch + collaborator request#56
ds4psb-ai wants to merge 20 commits intoopenclaw:mainfrom
ds4psb-ai:main

Conversation

@ds4psb-ai
Copy link
Copy Markdown

@ds4psb-ai ds4psb-ai commented May 8, 2026

Ready-to-merge batch + collaborator request.

This PR is the launch-ready consolidation branch from ds4psb-ai/clawsweeper@main. It preserves the existing seven open PR patch sets, adds the concrete launch-readiness fixups from review/follow-up commits, and adds a fork sync verifier so Ted's runtime can stay aligned while upstream merge access is pending.

Crisp ask

Please do one of these:

  1. merge this batch PR, or
  2. add ds4psb-ai as a collaborator on openclaw/clawsweeper so I can land/rebase the seven PRs through the normal squash-merge path.

Included PRs / attribution

Review references already posted

Extra launch-readiness work in this batch

  • CHANGELOG.md now has consolidated attribution for the integrated batch without pretending the upstream PRs were already merged.
  • .github/workflows/sync-from-upstream.yml is fork-gated to ds4psb-ai/clawsweeper; it replays the fork-only patch stack onto latest openclaw/clawsweeper@main, runs pnpm run check, and only force-updates fork main if the verified replay tree changes.

Validation

Latest verified batch head: ds4psb-ai/clawsweeper@117c88aad729a47d5bb16979c5b83c1279634079.

  • Local integration checkout on 2026-05-08 UTC:
    • pnpm run check passed.
    • lint: 0 warnings / 0 errors.
    • test:unit: 134 pass, 0 fail.
    • test:repair: 248 pass, 0 fail.
    • test:coverage: 382 pass, 0 fail; line coverage gate 62.91% against required 49%.
    • format:check: all matched files formatted.
  • Fresh clone of ds4psb-ai/clawsweeper@117c88aad729a47d5bb16979c5b83c1279634079:
    • pnpm install --frozen-lockfile passed.
    • pnpm run check passed with the same 134/248/382 test counts and clean lint/format.
  • Fresh fork sync verifier passed on final head: https://github.com/ds4psb-ai/clawsweeper/actions/runs/25577532770
  • Synthetic upstream fast-forward merge check passed on 2026-05-08 UTC:
    • fresh clone of openclaw/clawsweeper at b9a420e71bdc72e6fecafac1a6480448219d40cc
    • git fetch https://github.com/ds4psb-ai/clawsweeper.git main
    • git merge --ff-only FETCH_HEAD to 117c88aad729a47d5bb16979c5b83c1279634079
    • pnpm install --frozen-lockfile passed
    • pnpm run check passed with the same 134/248/382 test counts and clean lint/format.
  • Upstream PR check on this head: notify skipped successfully by the fork-gated workflow predicate: https://github.com/openclaw/clawsweeper/actions/runs/25577529155/job/75088281285

Why this exists

ds4psb-ai currently has READ on openclaw/clawsweeper, so I cannot use gh pr merge, labels, workflow dispatch, or contributor-branch push even where PRs set maintainerCanModify: true. This batch makes the maintainer action one click while keeping the original contributor PRs and reviews linked for credit.

ds4psb-ai and others added 16 commits May 9, 2026 01:50
Three workflows have echo-only "disabled-target" jobs that fall back
to GitHub's 360-minute job default. Even trivial echo jobs deserve
an explicit small timeout to bound runner exposure on stalled steps.
PR#53's Validation note flagged "two existing notifier tests with Node 22
cancelledByParent". The repo's engines.node is >=24, so Node 22 is
unsupported, but install does not enforce engine-strict and the false
alarm has now surfaced twice.

Verified all 22 notifier tests pass cleanly on Node 24.14.0 and 25.6.1
(node --test test/repair/notify-{events,merge,github-activity}.test.ts).
The 5-second retry-path tests trip the older node:test runner; on
supported Node they finish without cancellation.

Add a short note to AGENTS.md so the next contributor running on Node 22
knows the failure is environmental, not a regression.
Three write-side workflows lacked a top-level concurrency: block:
- repair-comment-router.yml (cron */5min + repository_dispatch)
- repair-self-heal.yml (cron 17,47 hourly)
- repair-finalize-open-prs.yml (workflow_dispatch only)

Without a group, overlapping cron/dispatch runs can race each other on
git push (rebase-strategy=theirs ledger commits) and dispatch worker
slots. comment-router uses a per-target dynamic group to keep parallel
target-repo runs separate; self-heal and finalize-open-prs use static
singleton groups since they operate fleet-wide.

cancel-in-progress is false everywhere — these workflows write ledger
state and should not be interrupted mid-publish.
Signed-off-by: samzong <samzong.lu@gmail.com>
(cherry picked from commit 64a3c46)
(cherry picked from commit e2853b3)
(cherry picked from commit 9d1b504)
(cherry picked from commit e74aa62)
The Policy RFC engine is proposal-only, but its generated artifacts must be reproducible enough for maintainers to review and diff safely. Derive default timestamps from observed evidence instead of wall-clock time, and preserve archived closed-record item numbers alongside active items.

Constraint: PR openclaw#39 was reviewed with two P1 launch blockers around nondeterminism and closed-record parsing.

Rejected: Require every caller to pass timestamps | exported helpers are still public test surfaces and should be safe by default.

Confidence: high

Scope-risk: narrow

Directive: Do not reintroduce wall-clock defaults in policy-rfc generation without deterministic tests.

Tested: pnpm run build:all; node --test test/policy-rfc.test.ts
The fork is serving as the launch-ready runtime lane while upstream merge access is unavailable. Add a scheduled verifier that rebases the fork-only patch stack onto latest openclaw/clawsweeper main, runs the same pnpm check gate, and only then updates fork main.

Constraint: ds4psb-ai has READ on upstream but can write the fork main used by the local OpenClaw runtime.

Rejected: Blindly pull upstream into the fork | merge commits accumulate drift and do not prove the replayed launch stack still passes.

Confidence: medium

Scope-risk: narrow

Directive: Keep this workflow fork-gated; it must not push from upstream if the batch PR is merged.

Tested: workflow syntax inspected locally; full runtime verification follows via GitHub Actions after push.
The scheduled replay job should prove the fork patch stack still applies without rewriting main when the replayed tree is unchanged. Compare tree IDs after pnpm check so the action still verifies but avoids churn from fresh cherry-pick commit metadata.

Constraint: The fork main branch is the runtime surface and should stay stable unless upstream drift changes the verified tree.

Confidence: high

Scope-risk: narrow

Tested: pnpm run check before this workflow-only refinement; pnpm run format:check after.
The fork now carries all seven launch-readiness PRs plus the Policy RFC fixups, so the unreleased changelog should make that provenance reviewable for upstream maintainers and the production runtime fork.

Constraint: Upstream merge access is unavailable, so attribution must describe the integrated fork batch without pretending the upstream PRs are merged.

Confidence: high

Scope-risk: narrow

Tested: pending final pnpm run check on this exact head.
PR openclaw#53's pagination math was covered, but the load-bearing fetch orchestration was not. Export the window hydrator with injectable fetchers and cover the page-one tail-overlap boundary plus missing-total fallback so future refactors cannot double-fetch or drop retained context silently.

Constraint: This is a launch-readiness fixup for a P1 review finding on PR openclaw#53.

Rejected: Only test githubContextWindowPlan | the bug class is in how planned pages are fetched and stitched, not the pure plan math alone.

Confidence: high

Scope-risk: narrow

Directive: Keep total-less GitHub responses on the full-pagination fallback unless GitHub exposes reliable count metadata.

Tested: pnpm run build:all; node --test test/clawsweeper.test.ts
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5ca24e77ef

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/clawsweeper.ts Outdated
Comment on lines +2172 to +2173
for (let page = plan.tailFirstPageNumber; page <= plan.lastPageNumber; page += 1) {
tailPages.push(...(page === 1 && plan.keepStart > 0 ? firstPage : ghPage<T>(path, page)));
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Clamp tail paging to GitHub endpoint caps

This loop trusts tailFirstPageNumber/lastPageNumber from the raw PR totals, but GitHub’s PR list endpoints are capped (files endpoint returns at most 3000 files, commits endpoint at most 250 commits). For large PRs where pull.changed_files or pull.commits exceeds those caps, the computed tail pages are beyond what the API can return, so this branch fetches only empty pages and tailItems becomes empty. That drops the newest context from the prompt (regression from the prior full-pagination behavior, which still preserved a tail from the retrievable window).

Useful? React with 👍 / 👎.

Comment thread src/policy-rfc/scorer.ts Outdated
distinctRepos: distinctRepos.length,
successfulOutcomes,
latestObservedAt,
now: options.now ?? deterministicReferenceDate(latestObservedAt),
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve recency signal in default confidence scoring

The default now value is derived from each pattern’s own latestObservedAt, so any pattern with a valid timestamp is scored with age 0 days and gets maximum recency credit. That effectively disables recency differentiation in normal runs (runPolicyRfc does not pass now), allowing very old and very new patterns to tie on the recency component. A deterministic reference date should be shared across all groups (for example the latest observation in the whole dataset), not recomputed per pattern.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 65749d48cb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/policy-rfc/index.ts
Comment on lines +40 to +41
mkdirSync(outputDir, { recursive: true });
for (const pattern of scored) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Delete stale policy proposal files before writing new output

runPolicyRfc only writes/overwrites proposals that are currently scored, so rerunning with fewer or changed qualifying patterns leaves old *.md/*.json files in results/policy-rfc/<repo-slug>/. That causes consumers of this directory to see proposals that are no longer supported by current evidence, which can silently skew review dashboards and downstream automation.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 117c88aad729a47d5bb16979c5b83c1279634079.

  • runPolicyRfc now removes stale generated policy-rfc-*.md / policy-rfc-*.json files from the output directory before writing the current proposal set.
  • Non-generated operator notes are preserved.
  • Added regression coverage: runPolicyRfc removes stale generated proposal files before writing current output.
  • Verification: local and fresh-clone pnpm run check both passed at this head (test:unit 134, test:repair 248, test:coverage 382; lint/format clean), and fork sync verifier passed: https://github.com/ds4psb-ai/clawsweeper/actions/runs/25577532770

@steipete
Copy link
Copy Markdown
Contributor

steipete commented May 9, 2026

Happy to discuss maintainer requests from humans with a face. This profile seems to be a bot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants