Repository navigation
fix(ci): local checks fail on clean main while CI stays green - #179181
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs changes before merge. What this changesThis 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.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Regression provenancePossible 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 Before merge
FindingsNone. Agent review detailsHow this fits togetherLocal 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
Technical reviewBest 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
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +400, Tests +220, Docs +9, Other -71. Total +558 across 43 files. Added test files: 6. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment 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.
4b0ac67 to
3ccd995
Compare
|
Merged via squash.
|
…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.
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.
What Problem This Solves
Fixes:
node scripts/check-changed.mjsandcheck-max-lines-ratchet.mts --base origin/mainfail locally for every branch, including pristinemain(observed at 81ad214 and fbc99b8), whilemainCI 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 underGITHUB_ACTIONS=trueand an error locally. The max-lines suppression inventory and the env-var budget were routed through that policy, somainabsorbed 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, andOPENCLAW_*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/mediato messaging,src/acpto gateway-other,src/securityto config-cli, rootsrc/gateway/github*to gateway-methods, rootsrc/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 splitsui/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
main(fbc99b8) plus one unrelated exported constant:node scripts/check-changed.mjsfailsmax-lines suppression ratchetandcore 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.main:check-max-lines-ratchet.mts --base HEAD→max-lines ratchet OK: 438,OPENCLAW_* count 461/461; withGITHUB_ACTIONS=true --base origin/mainexit 0 with the single budget-growth warning; locally againstorigin/mainthe 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.check-max-lines-ratchet.test.ts(moved suppression and stale entry block under GitHub Actions) andcheck-env-var-count.test.ts(unrecorded names block under GitHub Actions; recorded growth warns).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.lint-suppressions.test.tscame frommain's ownscripts/perf/*suppressions on that merge ref, not from this branch; the test passes on this head.