Skip to content

fix(ci): local checks fail on clean main while CI stays green - #179181

Merged
steipete merged 5 commits into
mainfrom
fix/ci-baseline-inventory-drift
Oct 23, 2026
Merged

steipete merged 5 commits into
mainfrom
fix/ci-baseline-inventory-drift

Conversation

@steipete

@steipete steipete commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes: node scripts/check-changed.mjs and check-max-lines-ratchet.mts --base origin/main fail locally for every branch, including pristine main (observed at 81ad214 and fbc99b8), while main CI stays green.

User Impact

User impact: no user-visible product change. Contributors and agents get the same verdict locally and in CI again: unrelated branches pass the baseline ratchets and the core tsgo boundary locally, and CI now stops the drift that caused the local failures instead of only annotating it.

The env-var budget moves from 452 to 461 to record names that already landed on main (each listed with its PR in the file); owner-approved with the land instruction.

Why This Change Was Made

CI runs the same ratchet script with the same base shape; it does not skip it. The difference is scripts/lib/check-limits.mts: since 9ed5a04 every limit violation is a warning under GITHUB_ACTIONS=true and an error locally. The max-lines suppression inventory and the env-var budget were routed through that policy, so main absorbed drift with green CI (the main-push job for dc029d8 annotated these exact warnings): files moved with suppressions but without their baseline entries (#173575, #173811, #173802), dozens of baseline entries went stale, and OPENCLAW_* names landed without budget updates. Every later local run then failed on debt the branch did not create.

The fix separates two things the policy had merged. Whether an inventory describes the tree (unlisted suppression, stale entry, name count different from the budget) is bookkeeping with no legitimate growth path, so it now blocks in CI and locally, matching the sibling shrink ratchets (assertion safety, timeout race, mock exports) that already block. Growth of an inventory relative to the merge base keeps the limit policy, so owner-approved growth still lands with a CI warning.

The core tsgo shard root budget is the opposite case: its own contract (4a93b5e) says oversized shards warn and never block, because no single change owns shard size. Routing it through the limit reporter made it locally fatal for every branch touching core TypeScript. It now warns everywhere. Over-limit shards were rebalanced by moving whole test globs (src/media to messaging, src/acp to gateway-other, src/security to config-cli, root src/gateway/github* to gateway-methods, root src/agents/cli-* to commands); the largest shard is now agents-sessions at 701 roots.

The drift is cleared at its owners rather than grandfathered. main's #180868 has since split the Settings and Sessions page state files, so this branch only splits ui/src/pages/chat/components/chat-message.test.tsx (2,640 lines) into five subject suites plus two support files, all well under the test cap, with its suppression removed. The baseline is pruned (508 to 438), and an internal constant that the env counter misread as an environment name is renamed.

Evidence

  • Before, pristine main (fbc99b8) plus one unrelated exported constant: node scripts/check-changed.mjs fails max-lines suppression ratchet and core tsgo graph boundary (Core test shard root budget exceeded). After, the branch plus the same line with the branch head as base: both lanes pass. In both runs the dead-export scan flags only the proof constant itself.
  • Rebuilt head on current main: check-max-lines-ratchet.mts --base HEAD → max-lines ratchet OK: 438, OPENCLAW_* count 461/461; with GITHUB_ACTIONS=true --base origin/main exit 0 with the single budget-growth warning; locally against origin/main the only failure is that growth, by design.
  • check-tsgo-core-boundary.mts: on the old shard layout with this script, exit 0 with advisory warnings (previously exit 1); on the rebuilt head, exit 0 and silent; exactly-once ownership test passes.
  • Regression tests red on the base scripts, green with the fix: check-max-lines-ratchet.test.ts (moved suppression and stale entry block under GitHub Actions) and check-env-var-count.test.ts (unrecorded names block under GitHub Actions; recorded growth warns).
  • Chat split: 67 declarations / 79 executed tests before and after with identical names and assertions; one moved test now awaits vi.dynamicImportSettled() because it had relied on an earlier test loading the lazy image renderer (the file already uses that idiom elsewhere). pnpm tsgo:core, tsgo:ui, tsgo:test:ui, tsgo:scripts, tsgo:test:root, scoped lint and format pass. No visual change, so no screenshots.
  • The earlier PR CI failure in lint-suppressions.test.ts came from main's own scripts/perf/* suppressions on that merge ref, not from this branch; the test passes on this head.
  • Codex autoreview (P2) of the branch and of the rebuild: scoped-clean.

@clawsweeper

clawsweeper Bot commented Oct 21, 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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-23T00:54:55.713061Z 3ccd995 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui scripts Repository scripts commands Command implementations size: XL labels Oct 21, 2026
@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. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Oct 21, 2026
@clawsweeper

clawsweeper Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR makes inventory drift blocking everywhere, restores advisory shard-size checks, and reconciles existing debt through focused UI extractions and inventory updates.

Example: A contributor runs core checks when a test shard contains 722 roots against the advisory 720-root limit.

  • Before: The local boundary check fails, while GitHub Actions only warns.
  • After: Both environments report the oversized shard without failing; missing or duplicate test ownership still fails.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Useful policy repair supported by recorded CLI behavior and focused regressions, with no introduced defect identified; the inherited CI failure and merge conflict do not lower the rating.
Proof confidence 🐚 platinum hermit (4/6) This maintainer-authored PR is outside the ordinary contributor proof gate; its body records real local-check before/after results, while the inspected historical UI images are not credited to this head.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Contributors encounter local check failures caused by debt already accepted on main while CI remains green.
Reason: The maintainer-authored direction restores documented policy and prevents unrelated branches from inheriting inventory failures.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep open: this maintainer-authored PR repairs a current local/CI policy mismatch, and source review found no actionable introduced defect.

Priority: P2
Reviewed head: 4b0ac67f06968d128801831d75af27c4497e1ef9

Before merge

  • Complete next step - Resolve the reported merge conflict while preserving current-main behavior, then run the affected checks on the resolved head.

Findings

None.

Agent review details

How this fits together

Local changed-file checks and GitHub Actions consume source inventories, budgets, and TypeScript shard configurations to produce diagnostics and exit statuses.

flowchart TD
  A[Source tree and inventories] --> B[Local changed checks]
  A --> C[GitHub Actions]
  B --> D[Inventory ratchets]
  C --> D
  B --> E[TypeScript graph boundary]
  C --> E
  D --> F[Diagnostics and exit status]
  E --> F
Loading

Technical review

Best possible solution:

Keep inventory consistency checks blocking, preserve advisory growth policy, and clear existing debt through the existing owners without weakening coverage.

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

Current-main source and the recorded CLI reproduction establish different local and CI outcomes for inventory drift and oversized shards; this read-only review did not rerun them.

Is this the best way to solve the issue?

The repair separates correctness from cost policy at the existing check owners, while the necessary file splits remove suppression debt and preserve existing behavior.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Inventory consistency severity changes intended behavior with a stated reason (9ed5a04: Centralize advisory CI severity for ordinary size and performance growth while preserving blocking correctness checks.)
  • Core shard root budget keeps the original intent (4a93b5e: Shard size is a shared cost signal; oversized shards should warn while exactly-once ownership remains blocking.)
  • Settings and Sessions ownership keeps the original intent (refactor(ui): scope Sessions and Usage state to Solid owners #173802: Scoped factories retain synchronous request, mutation, recovery, and cleanup decisions; the companion Settings migration applies the same ownership model.)
  • Native chat regression fixtures keeps the original intent (test(ui): finish native chat transcript fixtures #173575: Exercise native Solid rendering while preserving transcript, recovery, media, and lifecycle assertions.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 9ed5a04 adds scripts/check-env-var-count.mts:142 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 9ed5a04a6551; files: scripts/check-env-var-count.mts)

PR surface

Source +400, Tests +220, Docs +9, Other -71. Total +558 across 43 files. Added test files: 6.

View PR surface stats
Area Files Added Removed Net
Source 13 2017 1617 +400
Tests 22 2218 1998 +220
Docs 2 18 9 +9
Config 0 0 0 0
Generated 0 0 0 0
Other 6 41 112 -71
Total 43 4294 3736 +558

Review metrics

Metric Value Why it matters
Recorded environment-name budget 452 → 459 Reconciles names already present on main; it introduces no new user-facing environment variable.

Labels

Label changes:

  • add P2: The mismatch obstructs contributor checks across unrelated branches but does not break the shipped agent runtime.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: The mismatch obstructs contributor checks across unrelated branches but does not break the shipped agent runtime.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

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 21, 2026, 6:03 AM ET / 10:03 UTC.

…isory

The max-lines suppression inventory and the OPENCLAW_* budget used the limit
severity policy, so GitHub Actions only annotated a tree that disagreed with
its own inventory. Main absorbed moved suppressions, stale entries, and
unrecorded env names with green CI, and every later local ratchet run failed
on debt the branch did not create.

Inventory/tree consistency (unlisted suppression, stale entry, name count
different from the budget) now blocks everywhere, like the sibling shrink
ratchets. Growth relative to the merge base keeps the limit policy so
owner-approved growth still lands with a CI warning.

The core tsgo shard root budget is a shared cost signal its contract marks
advisory; routing it through the limit reporter made it locally fatal. It now
warns everywhere.

Proof: new ratchet and env-budget regressions fail on the base scripts and
pass with the fix; the real boundary check on main's shard layout exits 0 with
four advisory warnings instead of failing.
agents-tools (722), gateway-root (725), infra (728), and plugins-platform
(728) exceeded the advisory 720-root limit. Move whole test globs to shards
with headroom: src/media to messaging, src/acp to gateway-other,
src/security to config-cli, and root src/gateway/github* to gateway-methods.
The largest shard is now 719 roots and exactly-once ownership holds.

Messaging test-root selection of the shard guard now includes src/media.
Newer main tests pushed agents-root to 722 roots. Root-level
src/agents/cli-*.test.ts files join the commands shard, which already owns
src/agents/command and CLI program tests: agents-root 693, commands 516.
Preserve current main coverage across grouping, markdown, tools, attachments, and images, sharing render lifecycle and attachment fixtures. Keep all 59 direct cases and eight parameterized declarations, expanding to the same 79 passing tests.

The image disclosure case now waits for its lazy renderer instead of depending on an earlier image test. All seven files have line-cap headroom; UI types and scoped lint pass. Independent review found no actionable P0-P2 defects.
Prune 70 stale max-lines entries (508 -> 438). Reconcile the counted OPENCLAW_* budget from 452 -> 461 and rename the internal agent FTS schema constant.

Record FACTORY_GITHUB_PROOF, FACTORY_ACTOR_ID, FACTORY_SESSION_KEY (#173668), IMAGE_ACTIVATION_CAPTURE_MARKER (#173711), UPDATE_DOCTOR_HISTORICAL_SCANS (#177933), SESSION_WATCHDOG (#176915), PACKAGE_PERMISSIONS_REPAIRED (#175423), PLUGIN_NPM_ROOTS_FALLBACK (#176121), DISABLE_CRON_HOST_EXECUTION and DISABLE_GATEWAY_LOCAL_TERMINALS (#177855), and the removal of DEVICE_NAME_PREFIX (#178345). All names above use the OPENCLAW_ prefix. AGENT_FTS_SCHEMAS is an internal constant, not an environment variable.
@steipete
steipete force-pushed the fix/ci-baseline-inventory-drift branch from 4b0ac67 to 3ccd995 Compare October 23, 2026 00:52
@steipete
steipete merged commit d5ecc7d into main Oct 23, 2026
147 of 148 checks passed
@steipete
steipete deleted the fix/ci-baseline-inventory-drift branch October 23, 2026 01:11
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Oct 23, 2026
#180861 removed the max-lines suppression from extensions/codex/src/migration/session-binding-sidecars.ts while #179181 was in flight. #179181 makes stale baseline entries blocking in CI, so main's ratchet failed until this entry is removed.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 23, 2026
…aw#179181)

* fix(ci): block baseline inventory drift in CI and keep shard size advisory

The max-lines suppression inventory and the OPENCLAW_* budget used the limit
severity policy, so GitHub Actions only annotated a tree that disagreed with
its own inventory. Main absorbed moved suppressions, stale entries, and
unrecorded env names with green CI, and every later local ratchet run failed
on debt the branch did not create.

Inventory/tree consistency (unlisted suppression, stale entry, name count
different from the budget) now blocks everywhere, like the sibling shrink
ratchets. Growth relative to the merge base keeps the limit policy so
owner-approved growth still lands with a CI warning.

The core tsgo shard root budget is a shared cost signal its contract marks
advisory; routing it through the limit reporter made it locally fatal. It now
warns everywhere.

Proof: new ratchet and env-budget regressions fail on the base scripts and
pass with the fix; the real boundary check on main's shard layout exits 0 with
four advisory warnings instead of failing.

* ci(tsgo): rebalance core test shards under the root budget

agents-tools (722), gateway-root (725), infra (728), and plugins-platform
(728) exceeded the advisory 720-root limit. Move whole test globs to shards
with headroom: src/media to messaging, src/acp to gateway-other,
src/security to config-cli, and root src/gateway/github* to gateway-methods.
The largest shard is now 719 roots and exactly-once ownership holds.

Messaging test-root selection of the shard guard now includes src/media.

* ci(tsgo): move agents CLI backend tests into the commands shard

Newer main tests pushed agents-root to 722 roots. Root-level
src/agents/cli-*.test.ts files join the commands shard, which already owns
src/agents/command and CLI program tests: agents-root 693, commands 516.

* test(ui): split chat message rendering coverage

Preserve current main coverage across grouping, markdown, tools, attachments, and images, sharing render lifecycle and attachment fixtures. Keep all 59 direct cases and eight parameterized declarations, expanding to the same 79 passing tests.

The image disclosure case now waits for its lazy renderer instead of depending on an earlier image test. All seven files have line-cap headroom; UI types and scoped lint pass. Independent review found no actionable P0-P2 defects.

* chore(ci): reconcile max-lines baseline and env budget with main

Prune 70 stale max-lines entries (508 -> 438). Reconcile the counted OPENCLAW_* budget from 452 -> 461 and rename the internal agent FTS schema constant.

Record FACTORY_GITHUB_PROOF, FACTORY_ACTOR_ID, FACTORY_SESSION_KEY (openclaw#173668), IMAGE_ACTIVATION_CAPTURE_MARKER (openclaw#173711), UPDATE_DOCTOR_HISTORICAL_SCANS (openclaw#177933), SESSION_WATCHDOG (openclaw#176915), PACKAGE_PERMISSIONS_REPAIRED (openclaw#175423), PLUGIN_NPM_ROOTS_FALLBACK (openclaw#176121), DISABLE_CRON_HOST_EXECUTION and DISABLE_GATEWAY_LOCAL_TERMINALS (openclaw#177855), and the removal of DEVICE_NAME_PREFIX (openclaw#178345). All names above use the OPENCLAW_ prefix. AGENT_FTS_SCHEMAS is an internal constant, not an environment variable.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 23, 2026
openclaw#180861 removed the max-lines suppression from extensions/codex/src/migration/session-binding-sidecars.ts while openclaw#179181 was in flight. openclaw#179181 makes stale baseline entries blocking in CI, so main's ratchet failed until this entry is removed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui commands Command implementations 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: XL 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.

1 participant