Skip to content

fix(ci): let independent test budgets merge - #187164

Merged
vincentkoc merged 2 commits into
mainfrom
fix/test-line-budget-allocations-20261029
Oct 29, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
fix/test-line-budget-allocations-20261029

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Closes #187163

What Problem This Solves

Independent PRs with justified regression tests repeatedly conflict while editing the same test-line ceiling, including #186977.

User Impact

Maintainers can review separate test-budget records that merge independently. The aggregate test-line limit, inherited-debt checks, and review requirement remain in force. This changes repository validation only.

Why This Change Was Made

Keep the fixed scalar and add tracked integer records under config/test-lines-allocations/. When the parsed allocation map changes, positive effective-ceiling growth cannot exceed positive actual test-line growth against the same selected base. This includes scalar movement, so an older branch cannot reuse credit that pruning already folded into the scalar.

The checker now measures changed sources in the same literal-LF units as the total. Git numstat reports zero net lines for an unterminated line gaining its final newline; the previous check could therefore admit real growth through the inherited non-growing exception.

Pruning folds the measured total into the scalar and removes tracked allocation records, including at zero slack. Index/reference snapshots remain exact; untracked files are ignored and preserved. Scalar-only reconciliation remains separately review-owned.

The change reuses the existing scalar parser, Git snapshot loader, checker, and CI routing. It adds 94 tooling lines and 170 net test lines; its own allocation is exactly 170. The extra tooling owns record loading and exact changed-source LF accounting. No package/runtime surface or dependency changes.

Evidence

  • Original dependency-free checker: two real branches with independent grants failed after merging; a newline-only increase incorrectly passed with numstat delta zero.
  • Patched native checker: eight real-Git fixture groups passed, covering both merge orders, overlap/double credit, unallocated growth, literal LF and inherited debt, staged/worktree snapshots, deleted/untracked records, prune plus old-branch grants against both bases, and malformed/overflow inputs. Disposable fixtures were removed.
  • Exact source review at frozen base 64cb11485db8b0c30bab2e359124dcf99bd5fb0a: independent reviewer found no actionable issue. Local autoreview completed one P0–P3 pass with scoped-clean status and no findings on staged snapshot dfca9f91eaae88dce40513c781e2b56a7fed5ead7ef6029bfa9762ce9b2f63be.
  • Targeted native formatting, git diff --check, and docs inventory passed.
  • Current-head CI run 40804056614 tested e4f13c0ea6f30915777ab206034c45db618284bd through merge de335931853c8dee7167da9d36ae4181b8d0dc09, with ordered baseline 44ffd0a845b32480ffaf46ff6cfbcaa2267491c1 and PR-head parents. All 99 relevant cases passed: 10 checker and 64 changed-scope cases, plus 25 check-family cases. Corrected changed-file/script lint, type, docs, format, guards and all remaining selected proof jobs passed. The seven brace corrections were independently reviewed as behavior-equivalent; their two added test lines are included in the 170-line grant.
  • The current ratchet job passed: 6,246,092 total; 6,320,170 effective ceiling; 74,078 slack. Upstream chore: restore measured test-code headroom #187162 reconciled the scalar before this tested merge. This PR leaves the scalar unchanged and adds only its measured 170-line allocation. The earlier debt failure is historical, not the current gate result; no additional scalar reconciliation is pending here.
  • Overall CI remains failed: 30 successful jobs, 28 skipped, one root failure and its aggregate. The sole root is core-lint job 123219675109: existing eslint(curly) at src/agents/tools/sessions-send-tool.admission.test.ts:722, alongside existing session-manager max-lines warnings. The failing source, warning subjects, lint configuration, runner and dependency inputs have identical Git objects in the actual baseline and tested merge. The informational classifier labels it new because the scheduled main job passed without comparing selected scope; this attribution uses the inspected source objects instead. The native inherited-failure route retains the real red result and all review/security requirements.
  • The native focused Testbox request queued and was stopped before tests. Its provider reports completed while native reconciliation retains custody because no Actions association is available. No Testbox test pass is claimed; hosted CI supplies registered proof.
  • Exact-head ClawSweeper review completed on e4f13c0 with zero findings, Before merge: None, and no Rank-up moves. Maintainer source review and independent inspection of the raw CI logs are complete.

@vincentkoc vincentkoc self-assigned this Oct 29, 2026
@clawsweeper

clawsweeper Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review in progress

ClawSweeper is reviewing this revision. This supersedes any previous blocked status.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation scripts Repository scripts size: M labels Oct 29, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review October 29, 2026 01:52
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper status

Please report the existing review request status for this PR at e4f13c0ea6f30915777ab206034c45db618284bd. This is a status inquiry only; preserve the queued review request.

@clawsweeper

clawsweeper Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

@clawsweeper please report the existing review request status for this pr at e4f13c0ea6f30915 is retired; ClawSweeper now only reviews.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 29, 2026
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 29, 2026
@clawsweeper

clawsweeper Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR adds independent test-budget allocation records and measures test growth using literal newline counts.

Example: Two branches each add one test line to a repository with two lines and a ceiling of two.

  • Before: Both branches must edit the same scalar ceiling, creating a merge conflict.
  • After: Separate one-line allocations merge into an effective ceiling of four.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, useful change with production-checker validation and distinct real-Git regressions; the unrelated required CI failure remains visible.
Proof confidence 🐚 platinum hermit (4/6) Ordinary contributor proof gating does not apply to this maintainer-authored PR; its body records native real-Git scenarios, and hosted checks confirm the exact-head production checker and focused suites passed.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Feature · Worth it: Yes · Fix scope: Complete
User problem: Maintainers repeatedly refresh a shared budget scalar while independent regression-test changes wait to merge.
Reason: The maintainer-authored direction addresses a documented incident while retaining aggregate limits and review-owned justification.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR addresses demonstrated budget contention and incorrect newline accounting; no actionable patch defect was found.

Priority: P2
Reviewed head: e4f13c0ea6f30915777ab206034c45db618284bd

Before merge

None.

Findings

None.

Agent review details

How this fits together

The repository's test-line checker reads tracked tests, budget files, and a Git comparison snapshot, then returns a CI result or explicitly prunes budget metadata.

flowchart TD
  A[Tracked tests] --> D[Test line checker]
  B[Scalar and allocation records] --> D
  C[Git comparison snapshot] --> D
  D --> E[Growth and debt checks]
  E --> F[CI result]
  D --> G[Explicit budget pruning]
Loading

Technical review

Best possible solution:

Keep exact LF accounting, allocation validation, inherited-debt enforcement, and pruning together in the existing checker.

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

Current-main source establishes both shared-scalar contention and the LF-versus-numstat mismatch; linked discussion supplies a concrete landing incident, and no target code was executed during this review.

Is this the best way to solve the issue?

The approach is focused: it reuses the existing parser, Git snapshot loader, checker, and CI routing while comparing effective ceilings to prevent folded allocations from granting credit twice.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 8a3c02cb3c01.

Provenance checked

  • Test-line accounting and inherited debt keeps the original intent (ab8293d: Preserve test-reduction gains without blocking unrelated or shrinking changes when main exceeds its ceiling.)
  • Budget representation and pruning changes intended behavior with a stated reason (ci: ratchet total test lines #182230: A single scalar supplied a deliberate ceiling and downward-only effective pruning; this PR explains replacing shared edits with independent allocations while preserving that effective limit.)
  • Exact justified regression allowances keeps the original intent (37106c5: Allow fix PRs to raise the ceiling by their exact justified regression growth while requiring approval for other increases.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Vincent Koc: Raw commit e136a5c adds docs/ci/local-proof.md:11 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: e136a5cc1c03; files: docs/ci/local-proof.md)

PR surface

Tests +170, Docs +31, Other +96. Total +297 across 8 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 3 202 32 +170
Docs 3 41 10 +31
Config 0 0 0 0
Generated 0 0 0 0
Other 2 132 36 +96
Total 8 375 78 +297

Review metrics

Metric Value Why it matters
Tooling versus test growth Tooling +94 net lines; tests +170 net lines Growth implements allocation loading and consistent LF accounting, with real-Git coverage of distinct merge, pruning, debt, and snapshot failures; the allocation matches test growth.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #187163
Summary: The linked issue owns independent reviewed allocations, and this PR implements that request.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

  • add P2: Repeated budget conflicts impede reviewed changes, and inconsistent counting weakens a repository validation contract.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: Repeated budget conflicts impede reviewed changes, and inconsistent counting weakens a repository validation contract.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 28, 2026, 10:23 PM ET / October 29, 2026, 02:23 UTC.

@vincentkoc
vincentkoc merged commit f996c1c into main Oct 29, 2026
152 of 155 checks passed
@vincentkoc
vincentkoc deleted the fix/test-line-budget-allocations-20261029 branch October 29, 2026 02:30
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 29, 2026
* fix(ci): let independent test budgets merge

* fix(ci): require braces in test budget checks
nxmxbbd added a commit to nxmxbbd/openclaw that referenced this pull request Nov 3, 2026
Conflict: config/test-lines-baseline.txt. Main no longer raises the shared
scalar for new tests; each change adds its own record under
config/test-lines-allocations/ (openclaw#187164). Kept main's scalar and moved this
branch's 98 added test lines into plugin-schedule-retire-186957.txt.
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 P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: independent reviewed test-line allocations

1 participant