Repository navigation
fix(ci): make the Rust layout gate warn early, cover core/, and ratchet its pins - #6817
Conversation
…et its pins - Warn band: files past 725 lines are listed (without failing) so the margin shows in the author's own PR log. - Scope: drop the name-based prune of `api`/`bin`/`core`/`lib.rs`/`main.rs`/ `rpc` at the top of `crates/openhuman-core/src`. Only `core/` and `lib.rs` still exist; the eight oversized `core/` files are pinned at their current size instead of being skipped. - Ratchet: a pinned file below its pin fails with the value to lower it to, or asks for the entry to be removed once it fits the 750-line limit. Pins are lowered to today's sizes and the three that already fit are removed. - Duplicate pins: `subagent_host/lifecycle.rs` (1304, 1318) and `subagent_host/ops/runner.rs` (1793 twice) were each listed twice; a Map keeps the last one. Each is now listed once and the gate fails on a repeat. Closes tinyhumansai#6310
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe Rust layout gate now checks every Rust file under its source root, warns for unpinned files above 725 lines, and enforces exact-size pins for oversized files. It also rejects duplicate pins and requires pins to decrease when pinned files shrink. ChangesRust Layout Gate
Priority: ⬆️ High Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix · Severity of issue fixed: High Suggested reviewers: Merge Risk: ⚪ Minimal · up to The gate adds broader coverage, near-limit warnings, and stricter pin maintenance without introducing new failures. No actionable merge-blocking risk remains from this change; existing layout violations remain separate follow-up work. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Out of Scope Changes checkExplanation The PR lowers existing legacy pins, including the four legacy pins that
A rabbit checks each Rust file’s length, Comment |
Tiny Sweeper reviewTiny Sweeper reviewed this change across 6 lane(s) and found 1 active actionable finding(s). Detailed lane evidence and any incomplete work are listed below. State: Incomplete Review snapshot
Completeness: Incomplete What changedThe review could not produce a supported behavioral summary; inspect the cited changed surface and lane details below. FeaturesNone identified with supported citations. TestsNo supported feature-to-test mapping was produced. Test execution is not inferred. Findings
Pending checks: Rust E2E (mock backend), Build Playwright E2E Artifact, E2E (Playwright / web lane), Desktop E2E (full suite, 3 OS) Could not review: scripts/__tests__/check-openhuman-rust-layout.test.mjs, scripts/ci/README.md, scripts/ci/check-openhuman-rust-layout.mjs Before merge
How this fits togetherflowchart LR
n0["allRustFiles<br/>changed"]:::changed
n1["rustFiles<br/>changed"]:::changed
n2["directory"]:::impacted
n3["file"]:::impacted
n4["files"]:::impacted
n0 -->|uses| n2
n0 -->|uses| n3
n1 -->|uses| n2
n1 -->|uses| n3
n3 -->|uses| n2
n4 -->|uses| n2
classDef changed fill:#0d4429,stroke:#238636,color:#e6edf3
classDef impacted fill:#161b22,stroke:#6e7681,color:#c9d1d9
classDef flagged fill:#5a1e02,stroke:#d93f0b,color:#ffffff
classDef blocking fill:#67060c,stroke:#f85149,color:#ffffff
Agent review detailscritique
security
tests
commits
description
e2e
Evidence and run details
|
There was a problem hiding this comment.
tinysweeper found nothing blocking, but could not review everything, so this is not an approval: scripts/__tests__/check-openhuman-rust-layout.test.mjs, scripts/ci/README.md, scripts/ci/check-openhuman-rust-layout.mjs.
$0.0051 · 54,611 in / 9,059 out · 17,408 cached (32%) · ladder/vectors, deepseek/deepseek-v4-flash · 779 embedded
tests: $0.0008 · 17,484 in / 2,751 out · 17,408 cached (100%) · deepseek/deepseek-v4-flash
description: $0.0013 · 9,719 in / 3,021 out · 0 cached (0%) · deepseek/deepseek-v4-flash
e2e: $0.0020 · 20,009 in / 1,306 out · 0 cached (0%) · deepseek/deepseek-v4-flash
Summary
mainred.directory === ROOToverapi/bin/core/lib.rs/main.rs/rpc). Four of those six names no longer exist.core/held eight unenforced files (up to 3631 lines); they are now pinned at their current size instead of skipped.subagent_host/lifecycle.rs(1304 and 1318) andsubagent_host/ops/runner.rs(1793 twice) were listed twice, and aMapsilently keeps the last. Each is now listed once, and the gate fails on a repeat.Problem
#6310: the gate had no warning output, pruned
core/from the line limit by directory position, and only checked legacy pins for file existence, so a shrinking file silently regained headroom. The pin list also had two duplicated keys, which hid one pin each.Solution
WARN_AT = 725applies to unpinned files, printed viaconsole.warnbefore the pass/fail result..rsundercrates/openhuman-core/srcthrough the existingallRustFiles(the separate pruning walker is deleted).lineCount < pinfails. The message reads "lower the pin to N" above 750, or "remove its legacy exception" at 750 or below.LEGACY_LIMIT_ENTRIESis the source array; the gate fails if any file appears twice in it before it becomes theMap.lifecycle.rsis 1313, which exceeds 1304, so the effective pin 1318 was the real one; it is now lowered to 1313 by the ratchet.runner.rsis 1427 and is pinned at that.Inherited, not fixed here: on
upstream/main@1b82b9dba4, the gate still fails on four files that overflowed before this PR (#6788, #6793, #6809), and this PR deliberately leaves them to their owner:session_host/runtime_session.rs1993 > 1990tinyagents/turn_runner.rs752 > 750inference/provider/openhuman_backend_model.rs759 > 750inference/provider/openhuman_backend_model_tests.rs761 > 750With this PR the gate reports exactly those four failures and nothing new.
static:module-pins(tinychannels) is also red on main and is likewise inherited.Submission Checklist
scripts/__tests__/check-openhuman-rust-layout.test.mjs, 8 tests, including the exact-limit / exact-pin controls. Revert check: against the pre-PR script (with itsnew Map([...])literal only renamed so pins can be injected), the 2 controls pass and all 6 new-behaviour tests fail.node --test.Closesin## Related.Impact
core/file grows past its new pin.Related
Closes #6310
openhuman-app/src/lib.rs) are still outside the line limit, which is noted in the gate's scope comment.AI Authored PR Metadata (required for Codex/Linear PRs)
Linear Issue
Commit & Branch
fix/layout-gate-6310Validation Run
pnpm --filter openhuman-app format:check, because no app files changedpnpm typecheck, because no TypeScript changednode --test scripts/__tests__/check-openhuman-rust-layout.test.mjs scripts/__tests__/self-hosted-lanes.test.mjs: 28/28 passValidation Blocked
command:node scripts/ci/check-openhuman-rust-layout.mjserror:exits 1 on the four inherited overflows listed above (same four as on main)impact:Rust Quality stays red until those files are split upstreamBehavior Changes
core/, enforces monotonic pins, and rejects duplicate pins.Parity Contract
Duplicate / Superseded PR Handling
Summary by CodeRabbit