Skip to content

ci: allow up to 400 net test lines per PR without an allocation record - #197602

Merged
obviyus merged 4 commits into
mainfrom
ci/test-lines-pr-allowance
Nov 12, 2026
Merged

obviyus merged 4 commits into
mainfrom
ci/test-lines-pr-allowance

Conversation

@obviyus

@obviyus obviyus commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

scripts/check-test-lines-ratchet.mts compared the whole tree with a shared scalar ceiling plus every config/test-lines-allocations/*.txt record. Any net test-line growth needed a ledger record, including the one or two regression tests the root AGENTS.md requires for a fix. This blocked several recent PRs with "Allocate…" findings (#197528, #197474, #197471, #197519) and forced a 502-line allocation on #197501.

Solution

  • Gate on the PR's own net test-line delta between its comparison base and head. Other PRs' growth never counts against this PR.
  • Up to 400 net test lines need no record. Above 400, a record that this PR adds or raises must cover the excess. The record format does not change.
  • Release branches are still skipped.
  • When the check fails, it prints the net count, the allowance, the credit and the next step:
    Net test lines: +401; allowance: 400; allocation credit: 0. and then Delete or consolidate tests to remove 1 lines, or add a justified config/test-lines-allocations/<change>.txt record of 1 …

The delta gate makes the rest of the old design unnecessary, so this PR removes it:

  • the shared scalar config/test-lines-baseline.txt and the total-tree count
  • the inherited-debt and overlapping-grant reconciliation, and the manual-raise warning
  • --prune. Nothing calls it; CI already rejects it. It now fails with a clear error and does not do nothing silently.

All callers were checked: ci.yml (release fast lane and checks-fast-baseline-ratchets), scripts/ci-baseline-ratchets.mts, scripts/ci-main-push-checks.sh, changed-path-facts.mjs and node-runtime-conformance.yml. They all pass --base, or they classify the allocation path. That path stays valid for new records. Docs updated: the testing skill, writing-tests.md "Cost budget" and local-proof.md "test-line budget".

The 2,648 merged allocation records now give no credit. This PR keeps them: deleting them all in one PR crashes actions/labeler with write EINVAL. This happened on both attempts of run 43173827401, and it happened only on this PR. They can be deleted later in smaller batches.

Accepted edge case: a main push compares against the previous tip. If one push contains several squash commits, their deltas are added together. Squash merges usually push one commit, and the result is a visible, recoverable failure. This is documented in local-proof.md.

pr-simplify

  • Removed: the scalar ceiling, the debt/grant reconciliation and prune. No new helper or state.
  • Still protected: the 400/401 boundary, record coverage, inert merged growth/records, the release-branch skip, and the release-fast-lane workflow wiring (ci-workflow-guards).
  • Diff against the merge base: script +18/−82, tests +38/−212, docs +23/−41, plus the deleted config/test-lines-baseline.txt.

Evidence

  • oxfmt --check and oxlint on the changed files pass.
  • pnpm test test/scripts/check-test-lines-ratchet.test.ts: 2 passed. ci-workflow-guards.test.ts -t "release fast lane", ci-baseline-ratchets.test.ts and changed-path-facts.test.ts pass.
  • The real script on this branch, run with --base origin/main: Test lines OK. Net test lines: -174; allowance: 400; allocation credit: 0. (exit 0)
  • A scratch commit adding a 401-line test file, compared with this head: Net test lines: +401; allowance: 400; allocation credit: 0. (exit 1). With a 1-line record added: Test lines OK. Net test lines: +401; allowance: 400; allocation credit: 1. (exit 0)
  • pnpm docs:check-links: 0 broken links. git diff --check is clean.

Gate the test-line budget on the change's own net delta against its
comparison base. Up to 400 net lines need no record; records that the
change adds or raises cover the excess. Remove the shared scalar
ceiling, inherited-debt reconciliation, --prune and the merged
allocation records that the delta gate makes inert.

Co-authored-by: obviyus <[email protected]>
@clawsweeper

clawsweeper Bot commented Nov 12, 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.

Deleting 2,648 records in one PR crashes actions/labeler (write EINVAL).
The records give no credit under the delta gate, so they can be removed
separately.

Co-authored-by: obviyus <[email protected]>
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation scripts Repository scripts size: M labels Nov 12, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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 clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Nov 12, 2026
@clawsweeper

clawsweeper Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR replaces the aggregate test-line ceiling with a 400-line allowance per change and allocation records covering additional growth.

Example: A PR adds 400 net test lines without an allocation record.

  • Before: The aggregate ceiling can reject the addition and require an allocation.
  • After: The addition passes without an allocation record.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Focused implementation with recorded native-script behavior and meaningful integration coverage; the prior finding is fixed and broad exact-head CI remains pending.
Proof confidence 🐚 platinum hermit (4/6) This maintainer-authored repository-validation change requires no product E2E proof; the body records native checker output for excess-growth rejection and allocation acceptance, while inspected screenshots concern a linked UI change.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Maintenance · Worth it: Yes · Fix scope: Complete
User problem: Contributors adding focused regression coverage must manage allocation records and inherited aggregate-budget debt.
Reason: The maintainer-authored direction addresses demonstrated friction, preserves explicit allocation for larger additions, and simplifies the existing checker.

Merge readiness

✅ Ready for maintainer review

The prior finding is resolved, and this maintainer-authored PR has no remaining actionable findings; exact-head CI is still pending.

Priority: P3
Reviewed head: 1fa35dccf1103954411d3ec3fc852d0ee9576631

Before merge

None.

Findings

None.

Agent review details

How this fits together

The repository checker receives a Git comparison base, measures net test-source newline growth and changed allocation credit, and returns a pass or actionable failure to local checks and CI.

flowchart TD
  A[Local checks and CI] --> B[Resolve comparison base]
  B --> C[Count net test lines]
  B --> D[Compare allocation records]
  C --> E[Apply 400 line allowance]
  D --> E
  E --> F[Pass or actionable failure]
Loading

Technical review

Best possible solution:

Retain the simpler per-change checker and its updated policy documentation under the normal CI gates.

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

This is an intentional validation-policy change; current-main source and the linked allocation finding establish the reported contributor friction.

Is this the best way to solve the issue?

The existing checker remains the sole decision owner, and the diff removes obsolete aggregate machinery without introducing parallel policy or state.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Aggregate ceiling, baseline and pruning changes intended behavior with a stated reason (ab8293d: Preserve test-reduction gains while allowing non-growing changes through inherited over-budget trees, as documented in ci: ratchet total test lines #182230.)
  • Allocation reconciliation and exact newline accounting changes intended behavior with a stated reason (f996c1c: Allow independent allocation records to merge without double-counting credit while preserving exact Git snapshots, as documented in fix(ci): let independent test budgets merge #187164; this PR retains newline accounting and replaces reconciliation with per-change credit.)
  • Inherited-debt reconciliation changes intended behavior with a stated reason (4c6f043: Permit an exact approved allocation to reconcile existing base debt without creating slack; the new per-change policy makes that aggregate debt irrelevant.)
  • Release exemption and fast-lane enforcement keeps the original intent (fix(ci): release fast lane can land unallocated test growth #192414: Prevent the release-tooling fast lane from bypassing the test budget; the actual workflow-command fixture remains and uses the new threshold, while release-branch exemption is preserved.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit ab8293d adds scripts/check-test-lines-ratchet.mts:27 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: ab8293de67db; files: scripts/check-test-lines-ratchet.mts)
  • Vincent Koc: Raw commit f996c1c adds scripts/check-test-lines-ratchet.mts:38 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: f996c1c487a0; files: scripts/check-test-lines-ratchet.mts)

PR surface

Tests -174, Docs -15, Other -65. Total -254 across 7 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 38 212 -174
Docs 3 26 41 -15
Config 0 0 0 0
Generated 0 0 0 0
Other 2 18 83 -65
Total 7 82 336 -254

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Review metrics

Metric Value Why it matters
Allocation threshold 400 net test lines per change Replaces the shared aggregate ceiling; only growth above this allowance needs changed allocation credit.

Labels

Label changes:

  • 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.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P3: Repository-validation ergonomics with no product runtime change.
  • 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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-11-12T07:35:09.087Z sha c67b0cf :: needs changes before merge. :: [P2] Cite the incident behind the new allocation allowance

Reviewed November 12, 2026, 2:41 AM ET / 07:41 UTC (Revision 2).

@obviyus

obviyus commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. 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 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. clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Nov 12, 2026
@obviyus
obviyus merged commit 2890bbe into main Nov 12, 2026
108 checks passed
@obviyus
obviyus deleted the ci/test-lines-pr-allowance branch November 12, 2026 07:49
obviyus added a commit that referenced this pull request Nov 12, 2026
The per-PR allowance (#197602) gives credit only for records a PR adds or
raises, so merged records no longer affect the check. Split into three PRs
because CI passes the changed-path list in one env var, and one string over
128 KiB makes the check jobs fail to start (E2BIG).

Co-authored-by: obviyus <[email protected]>
obviyus added a commit that referenced this pull request Nov 12, 2026
The per-PR allowance (#197602) gives credit only for records a PR adds or
raises, so merged records no longer affect the check. Split into three PRs
because CI passes the changed-path list in one env var, and one string over
128 KiB makes the check jobs fail to start (E2BIG).

Co-authored-by: obviyus <[email protected]>
obviyus added a commit that referenced this pull request Nov 12, 2026
The per-PR allowance (#197602) gives credit only for records a PR adds or
raises, so merged records no longer affect the check. Split into three PRs
because CI passes the changed-path list in one env var, and one string over
128 KiB makes the check jobs fail to start (E2BIG).

Co-authored-by: obviyus <[email protected]>
steipete added a commit that referenced this pull request Nov 12, 2026
Integrate main 4eb318d to pick up the test-line owner repair in
#197602 after CI run 43186299836 rejected six added fixture lines under
the old shared scalar ceiling. The ONNX test delta is byte-identical.

The real synthetic native integration passes with its original timeout,
along with the repaired budget gate, root typechecks and focused lint.
Fresh Codex review found no actionable issue through P2. Preserve the
previous failed CI and investigated local timeouts in the PR evidence.
vincentkoc added a commit that referenced this pull request Nov 12, 2026
Preserve the upstream test-growth policy and dynamic dependency roots:
#196370
#197250
#197602

Remove only the superseded task-owned 128-line grant. Keep the original
157-line record, upstream Doctor allocation and retired scalar deletion.

The staged checker against 0626eb5 passed: net +157, allowance 400,
allocation credit 157. The measured workload remains frozen at
79f5aeb.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 13, 2026
openclaw#197602)

* ci: allow up to 400 net test lines per PR without an allocation record

Gate the test-line budget on the change's own net delta against its
comparison base. Up to 400 net lines need no record; records that the
change adds or raises cover the excess. Remove the shared scalar
ceiling, inherited-debt reconciliation, --prune and the merged
allocation records that the delta gate makes inert.

Co-authored-by: obviyus <[email protected]>

* ci: keep merged test-line allocation records

Deleting 2,648 records in one PR crashes actions/labeler (write EINVAL).
The records give no credit under the delta gate, so they can be removed
separately.

Co-authored-by: obviyus <[email protected]>

* ci: drop records restored from a newer main

Co-authored-by: obviyus <[email protected]>

* docs(testing): cite the incidents behind the test-line allowance

Co-authored-by: obviyus <[email protected]>

---------

Co-authored-by: obviyus <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 13, 2026
…#197655)

The per-PR allowance (openclaw#197602) gives credit only for records a PR adds or
raises, so merged records no longer affect the check. Split into three PRs
because CI passes the changed-path list in one env var, and one string over
128 KiB makes the check jobs fail to start (E2BIG).

Co-authored-by: obviyus <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 13, 2026
…#197656)

The per-PR allowance (openclaw#197602) gives credit only for records a PR adds or
raises, so merged records no longer affect the check. Split into three PRs
because CI passes the changed-path list in one env var, and one string over
128 KiB makes the check jobs fail to start (E2BIG).

Co-authored-by: obviyus <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 13, 2026
…#197657)

The per-PR allowance (openclaw#197602) gives credit only for records a PR adds or
raises, so merged records no longer affect the check. Split into three PRs
because CI passes the changed-path list in one env var, and one string over
128 KiB makes the check jobs fail to start (E2BIG).

Co-authored-by: obviyus <[email protected]>
Cyb3rb1ade pushed a commit to Cyb3rb1ade/openclaw that referenced this pull request Nov 15, 2026
… merging main

Main's Dreaming enablement and failed-read fixes pushed memory-panel-state.ts
and memory-panel.test.ts over their line caps together with this PR's
additions. Move the wiki.get reply normalization into wiki-page-preview.ts and
the slot-owner tests into memory-panel.slot-owner.test.ts, unchanged.

Since openclaw#197602 allows 400 net test lines per PR, the allocation record now only
covers the remaining 117 of the PR's +517.
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 P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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.

1 participant