Skip to content

fix(ci): pack broad changed-target rows within the Node matrix cap - #160376

Merged
steipete merged 1 commit into
mainfrom
steipete/ci-changed-target-row-cap
Sep 28, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/ci-changed-target-row-cap

Conversation

@steipete

@steipete steipete commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes: broad changed-target PRs fail CI preflight before any Node tests can run because their retained plan exceeds the 130-row matrix cap.

Reported blockers: #160224, #160164, #160291, and #160208.

User Impact

Developers can run the same selected CI coverage within the existing row cap. There is no product behavior change. Broad changed-target jobs can be longer; caps, workflow guards, timeouts, runners, and worker limits remain unchanged.

Why This Change Was Made

The earlier fallback retains unsplit owner rows when time splitting overflows, but the changed-target chunks can already overflow on their own. Only in that case, partition targets by pretest build mode and serial/concurrent policy, allocate rows proportionally by predicted seconds with at least one per policy, then balance within each partition. Refuse budgets too small to retain every policy. Preserve the exact target multiset, build prerequisites, serial-target concurrency, and every canonical, plugin, channel, boundary, and dist row. If other non-dist rows already fill the cap, leave the plan to the existing final guard.

Related: #160254 packs whole serial rows in boundChangedNodeRows; this change only rebuilds changed-target chunks after the retained plan still exceeds the cap.

Evidence

Executed the actual Build CI manifest step from ci.yml with real scope detection and canonical Blacksmith PR options against the same main inventory before and after the change:

Changed paths Non-dist rows before → after Selected targets preserved Changed-target rows before → after Maximum target-row estimate after
#160224 151 → 130 5,832 65 → 44 224 s
#160164 93 → 93 5,362 6 → 6 148 s
#160291 145 → 130 3,796 65 → 50 200 s

Both overflowing baseline manifests fail the actual final guard; all three candidate manifests succeed. Each comparison preserves the exact selected-target array, emitted changed-target multiset, and all other row descriptors. The current #160164 diff already fits, and its entire plan is identical. These are path-list replays against current main inventory, without the historical comparison base, so counts differ from the originally reported runs.

The #160224 maximum is 224 test seconds, or 328 seconds including its 104-second private-QA build, against the unchanged 3,600-second workflow timeout, also below a conservative 1,800-second cutoff reserving half the deadline for setup, preparation, and variance. Estimates are not measured CI job walls.

The original-cap regression failed before the repair (186 rows instead of 130). The execution-policy regression also fails on global LPT packing: eight build-dependent targets spread into eight build rows instead of two. It also checks duplicate-target preservation, private-QA preparation, serial Memory Core targets, unchanged small plans, and no-capacity rejection. In the #160224 replay, runtime/private-QA target rows decrease from 2/5 to 1/1; preparation applies to 14 targets instead of 49. The existing compact fallback/dist-budget regression stays covered.

  • The direct owner run executed both files: 327 passed, 2 timed out (1,021.84 s wall). The unchanged cases were “retains every PR-exempt file in hourly and release plans with its canonical owner” (206.15 s) and “retains leaf-config owners while keeping dependency hubs on their direct consumers” (166.95 s), both against their existing 120 s timeout. These cases repeatedly compose real repository inventories; the new row-budget path is not selected by their changed-plan calls. A sequential one-worker diagnostic reproduced the leaf-config timeout at 167.97 s; the coordinator interruption prevented the integration diagnostic from completing. The timeout cause is not established as fixed. No timeout, worker setting, or assertion was changed. The exact-head GitHub owner shard subsequently passed all 325 cases, including the leaf-config case in 90.09 s; the local timeout history remains above.
  • The new synthetic regression passes with --maxWorkers=1: 7.36 s wall / 6.45 s Vitest in a cold focused run, and 327 ms inside the full owner suite. On exact-head CI, the new case took 3.145 s; the complete existing owner file took 553.87 s because it repeatedly composes repository-wide selections. It adds no sleeps, process boots, or worker/timeout changes.
  • 488 workflow-planning tests passed before the policy amendment; the workflow itself is unchanged, and the amended policy is also exercised through the actual-manifest replays above.
  • Script and all root-test type lanes, scoped oxfmt/oxlint, script erasability, line-cap ratchet, docs inventory/link sanity, and git diff --check pass. Fresh independent P0–P2 autoreview is clean.

The Node-lane documentation describes the fallback. Changelog changes remain release-owned.

Exact-head CI: https://github.com/openclaw/openclaw/actions/runs/36411111449 . ClawSweeper completed review of 7b17de1eff03d6bfbf1fc67fa1e3d4cac74ac0b0 with no actionable findings or before-merge requests.

@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation scripts Repository scripts size: M labels Sep 28, 2026
@steipete
steipete marked this pull request as ready for review September 28, 2026 10:40
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 28, 2026
@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge. Reviewed September 28, 2026, 7:02 AM ET / 11:02 UTC (Revision 2).

ClawSweeper review

What this changes

The branch repacks changed Node test targets by build and concurrency requirements when a pull request’s CI matrix exceeds its row cap, and adds a regression test and documentation.

Merge readiness

⛔ Needs changes before merge - 2 items remain

This PR still addresses a CI overflow present on current main; the merged plugin-owner fix is complementary. One low-capacity case needs repair before merge because packing can admit a Node test row that exceeds its job deadline.

Priority: P2
Reviewed head: 7b17de1eff03d6bfbf1fc67fa1e3d4cac74ac0b0

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Production-path replay evidence is useful, but the unbounded low-capacity case prevents a merge-ready rating.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): The changed planner was exercised through the actual Build CI manifest step with real changed-path selection and Blacksmith PR options; the captured before-and-after replays report admitted 130-row plans with selected targets preserved. That proof covers the reported workloads but not the newly identified low-capacity bound; no stored-data contract changes.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The changed planner was exercised through the actual Build CI manifest step with real changed-path selection and Blacksmith PR options; the captured before-and-after replays report admitted 130-row plans with selected targets preserved. That proof covers the reported workloads but not the newly identified low-capacity bound; no stored-data contract changes.
Evidence reviewed 8 items Introduced packing path: The new row-budget branch allocates bins by policy and predicted seconds, but does not retain the existing 12-target-per-job bound.
Existing execution bound: The ordinary changed-target path limits a row to 12 targets because each target runs in its own child process.
Low-capacity fixture: The added fixture supplies 1,000 ordinary targets priced at 20 seconds each. With four policy rows available, the packing branch would put that ordinary partition in one row estimated at 20,000 seconds.
Findings 1 actionable finding [P2] Bound each packed changed-target row before admitting it
Security None None.

How this fits together

OpenClaw CI selects tests from changed files, assigns them to owner and changed-target rows, then emits a Node job matrix. The workflow admits rows within its matrix cap and runs each changed target in a separate child process.

flowchart LR
A[Changed files] --> B[Test selection]
B --> C[Owner rows]
B --> D[Changed targets]
D --> E[Policy-aware packing]
C --> F[Node matrix cap]
E --> F
F --> G[Test jobs]
Loading

Before merge

  • Bound each packed changed-target row before admitting it (P2) - The new binning path checks that each policy gets a row but never checks how many targets a row receives. With the added fixture’s 1,000 ordinary targets and only four policy rows available, one row is estimated at 20,000 seconds; the runner launches each target separately and the workflow defaults to 60 minutes. This can turn a clear preflight rejection into an inevitable job timeout. Retain the existing 12-target bound or reject a plan that cannot fit it. I missed this on the earlier review of the same head.
  • Complete next step (P2) - Preserve the 12-target bound in packed rows or reject insufficient row capacity, and add a low-capacity regression before merge.

Findings

  • [P2] Bound each packed changed-target row before admitting it — scripts/lib/ci-changed-node-test-plan.mts:623-626
Agent review details

Security

None.

PR surface

Tests +111, Docs +5, Other +63. Total +179 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 111 0 +111
Docs 1 5 0 +5
Config 0 0 0 0
Generated 0 0 0 0
Other 1 97 34 +63
Total 3 213 34 +179

Review metrics

Metric Value Why it matters
Planner and test growth production +63 net lines, tests +111 lines The added planner path serves CI admission and has one focused regression case.

Technical review

Best possible solution:

Keep policy-aware packing within the existing changed-target job bound, and fail CI admission clearly when the remaining rows cannot hold every target.

Do we have a high-confidence way to reproduce the issue?

Yes. The reported overflow has production manifest-step before-and-after replays; source inspection also gives a high-confidence low-capacity case, though this read-only review did not execute it.

Is this the best way to solve the issue?

No. The existing changed-target planner is the right owner, but packing must reject a row budget that breaks its per-job target bound.

Full review comments:

  • [P2] Bound each packed changed-target row before admitting it — scripts/lib/ci-changed-node-test-plan.mts:623-626
    The new binning path checks that each policy gets a row but never checks how many targets a row receives. With the added fixture’s 1,000 ordinary targets and only four policy rows available, one row is estimated at 20,000 seconds; the runner launches each target separately and the workflow defaults to 60 minutes. This can turn a clear preflight rejection into an inevitable job timeout. Retain the existing 12-target bound or reject a plan that cannot fit it. I missed this on the earlier review of the same head.
    Confidence: 0.9
    Late finding: first raised on code an earlier review cycle already covered.

Overall correctness: patch is incorrect
Overall confidence: 0.9

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 958de2c2b549.

Labels

Label changes:

  • add merge-risk: 🚨 automation: A packed row can pass matrix admission yet exceed the Node job deadline when few row slots remain.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (terminal): The changed planner was exercised through the actual Build CI manifest step with real changed-path selection and Blacksmith PR options; the captured before-and-after replays report admitted 130-row plans with selected targets preserved. That proof covers the reported workloads but not the newly identified low-capacity bound; no stored-data contract changes.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.
  • remove status: 👀 ready for maintainer look: Current PR status label is status: ⏳ waiting on author.

Label justifications:

  • P2: This is a bounded CI planning repair with a normal-priority edge case, not a product runtime emergency.
  • merge-risk: 🚨 automation: A packed row can pass matrix admission yet exceed the Node job deadline when few row slots remain.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (terminal): The changed planner was exercised through the actual Build CI manifest step with real changed-path selection and Blacksmith PR options; the captured before-and-after replays report admitted 130-row plans with selected targets preserved. That proof covers the reported workloads but not the newly identified low-capacity bound; no stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The changed planner was exercised through the actual Build CI manifest step with real changed-path selection and Blacksmith PR options; the captured before-and-after replays report admitted 130-row plans with selected targets preserved. That proof covers the reported workloads but not the newly identified low-capacity bound; no stored-data contract changes.

Evidence

Acceptance criteria:

  • [P1] node scripts/run-vitest.mjs test/scripts/ci-changed-node-test-plan.test.ts --maxWorkers=1.
  • [P1] node scripts/check-changed.mjs --dry-run -- scripts/lib/ci-changed-node-test-plan.mts test/scripts/ci-changed-node-test-plan.test.ts docs/ci/scope-and-routing/node-test-lanes.md.
  • [P1] git diff --check.

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • VACInc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Add a low-capacity regression that rejects packing when a row would exceed the established target bound.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-28T10:47:32.942Z sha 7b17de1 :: needs maintainer review before merge. :: none

@VACInc

VACInc commented Sep 28, 2026

Copy link
Copy Markdown
Member

#160324 (commit 81a840a) is merged and restores canonical ownership for exact selected plugin tests. It does not implement this PR's separate repair for retained changed-target chunks that still exceed the row budget: partitioning by build/concurrency requirements and balancing within the available rows. These changes are complementary, not duplicates. Preserve the selected-plugin routing now on main and this PR's independent coverage, execution-policy boundaries, and validation. Keep this PR open.

@clawsweeper clawsweeper Bot added merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 28, 2026
@steipete
steipete merged commit 492f665 into main Sep 28, 2026
233 of 234 checks passed
@steipete
steipete deleted the steipete/ci-changed-target-row-cap branch September 28, 2026 11:03
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

MarMarLabs added a commit to MarMarLabs/openclaw that referenced this pull request Sep 28, 2026
158 upstream commits, including the Kie AI, Z.AI and Novita video
providers (openclaw#160080) and several CI planner repairs (openclaw#160187, openclaw#160260,
openclaw#160324, openclaw#160376). No file outside the generated set and the test routing
list changed on both sides.

Two conflicts, both generated: docs/.generated/config-baseline.counts.json
and docs/.generated/config-baseline.sha256. openclaw#160080 adds plugin settings,
so plugin goes from 4353 to 4374. This branch keeps channel at 3788 and
core stays at 2464. Both files came from upstream and were regenerated.
test/vitest/vitest.extension-database-workers-paths.mjs changed on both
sides in separate places and merged cleanly, with upstream's ten new
entries and this branch's Feishu entry all kept.

build:docker ran in a separate detached checkout of this commit outside the
nested node_modules install. Regenerating there changed those two files and
nothing else, giving the predicted counts, the upstream core and plugin
hashes, this branch's channel hash and a new combined hash. The three
generated-file checks pass there.

Upstream deleted 38 test files in this range. None of them were added or
changed by this branch.

Feishu: 106 files and 1853 tests in the extension project, 17 files and
312 tests in the database-workers project. The forwarder test and the
routing guards pass, 1980 tests. tsgo:core, tsgo:extensions,
tsgo:extensions:test, tsgo:test:root, the line-cap, max-lines and
assertion-safety ratchets against upstream/main, oxlint and oxfmt on the
43 changed code files all pass.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: M status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants