Establish workspace architecture baseline and CI scopes#6758
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds centralized workspace architecture governance, policy-driven CI scopes, explicit Cargo workspace wiring, removal of ChangesWorkspace architecture governance
Estimated code review effort: 5 (Critical) | ~120 minutes Sequence Diagram(s)sequenceDiagram
participant CI
participant workspace_architecture.py
participant CargoMetadata
participant workspace-architecture.json
participant Cargo
CI->>workspace_architecture.py: Run audit or print scoped exclusions
workspace_architecture.py->>CargoMetadata: Inspect workspace members and dependencies
workspace_architecture.py->>workspace-architecture.json: Load classifications, exclusions, and baselines
workspace_architecture.py-->>CI: Return audit status or package scope
CI->>Cargo: Run scoped Clippy, tests, or coverage
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
scripts/workspace_architecture.py (1)
56-58: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winReject unsupported policy schemas.
schema_versionis never checked, so a future v2 policy would silently be interpreted with v1 rules. Validate version1before returning the policy.Proposed fix
def load_policy(): with POLICY_PATH.open(encoding="utf-8") as handle: - return json.load(handle) + policy = json.load(handle) + if policy.get("schema_version") != 1: + raise ValueError("unsupported workspace architecture schema version") + return policy🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@scripts/workspace_architecture.py` around lines 56 - 58, Update load_policy to validate the loaded policy’s schema_version before returning it, accepting only version 1 and rejecting unsupported or missing versions instead of interpreting them with v1 rules.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/coverage.yml:
- Around line 52-67: Update the coverage workflow’s initial `cargo llvm-cov
--workspace` invocation to include `--ignore-run-fail`, ensuring report
generation continues when tests fail. Remove `--no-fail-fast` from both `cargo
llvm-cov report` commands while preserving the existing exclusion arguments and
output formats.
---
Nitpick comments:
In `@scripts/workspace_architecture.py`:
- Around line 56-58: Update load_policy to validate the loaded policy’s
schema_version before returning it, accepting only version 1 and rejecting
unsupported or missing versions instead of interpreting them with v1 rules.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 7312682e-77dd-45b7-ba8d-8c31ae7ad1b6
📒 Files selected for processing (12)
.github/workflows/coverage.yml.github/workflows/test.ymlCargo.tomlchangelog.d/6758-workspace-architecture.mdcrates/perry-ext-http/Cargo.tomldocs/src/SUMMARY.mddocs/src/contributing/architecture.mddocs/src/contributing/building.mddocs/src/contributing/crate-policy.mdscripts/ci_test_scope.pyscripts/workspace_architecture.pyworkspace-architecture.json
* refactor(hir): consolidate compiler types * chore(changelog): add fragment for #6760
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@changelog.d/6760-merge-types-into-hir.md`:
- Line 1: Expand the changelog entry to document the root cause of consolidating
compiler type definitions, identify the affected crate or module paths including
perry_hir::types and the removed standalone types crate, and record the
validation performed, including the dependency reduction verification.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 2b6fae94-b704-4a73-abc4-ff84871485f3
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (247)
CLAUDE.mdCargo.tomlchangelog.d/6760-merge-types-into-hir.mdcrates/perry-codegen-arkts/Cargo.tomlcrates/perry-codegen-arkts/src/inline.rscrates/perry-codegen-arkts/src/lib.rscrates/perry-codegen-arkts/src/tests.rscrates/perry-codegen-arkts/src/tests/containers.rscrates/perry-codegen-arkts/src/tests/mutations.rscrates/perry-codegen-arkts/src/tests/widgets.rscrates/perry-codegen-arkts/src/types.rscrates/perry-codegen-arkts/src/view_builders.rscrates/perry-codegen-arkts/src/widget_walks.rscrates/perry-codegen-arkts/tests/phase2_full_app_smoke.rscrates/perry-codegen-js/Cargo.tomlcrates/perry-codegen-js/src/emit/mod.rscrates/perry-codegen-swiftui/Cargo.tomlcrates/perry-codegen-wasm/Cargo.tomlcrates/perry-codegen-wasm/src/emit/closures.rscrates/perry-codegen-wasm/src/emit/compile.rscrates/perry-codegen-wasm/src/emit/expr/calls.rscrates/perry-codegen-wasm/src/emit/locals.rscrates/perry-codegen-wasm/src/emit/mod.rscrates/perry-codegen/Cargo.tomlcrates/perry-codegen/src/boxed_vars.rscrates/perry-codegen/src/codegen/artifacts.rscrates/perry-codegen/src/codegen/boxed_locals.rscrates/perry-codegen/src/codegen/closure.rscrates/perry-codegen/src/codegen/closure_collect.rscrates/perry-codegen/src/codegen/entry.rscrates/perry-codegen/src/codegen/func_registry.rscrates/perry-codegen/src/codegen/function.rscrates/perry-codegen/src/codegen/method.rscrates/perry-codegen/src/codegen/mod.rscrates/perry-codegen/src/codegen/module_globals_emit.rscrates/perry-codegen/src/codegen/opts.rscrates/perry-codegen/src/codegen/typed_abi.rscrates/perry-codegen/src/collectors/clamp_detect.rscrates/perry-codegen/src/collectors/class_accessors.rscrates/perry-codegen/src/collectors/closures.rscrates/perry-codegen/src/collectors/hir_facts.rscrates/perry-codegen/src/collectors/pointer_locals.rscrates/perry-codegen/src/collectors/scalar_method_dispatch.rscrates/perry-codegen/src/collectors/scalar_methods.rscrates/perry-codegen/src/collectors/this_as_value.rscrates/perry-codegen/src/expr/array_methods.rscrates/perry-codegen/src/expr/arrays_finds.rscrates/perry-codegen/src/expr/bigint_set.rscrates/perry-codegen/src/expr/calls/helpers.rscrates/perry-codegen/src/expr/channel.rscrates/perry-codegen/src/expr/compare.rscrates/perry-codegen/src/expr/dyn_extern_i18n.rscrates/perry-codegen/src/expr/env_clones.rscrates/perry-codegen/src/expr/helpers.rscrates/perry-codegen/src/expr/index_get.rscrates/perry-codegen/src/expr/index_set.rscrates/perry-codegen/src/expr/literals_vars.rscrates/perry-codegen/src/expr/logical_collections.rscrates/perry-codegen/src/expr/math_simple.rscrates/perry-codegen/src/expr/mod.rscrates/perry-codegen/src/expr/native_memory.rscrates/perry-codegen/src/expr/new_dynamic.rscrates/perry-codegen/src/expr/object_literal.rscrates/perry-codegen/src/expr/pod_layout_constants.rscrates/perry-codegen/src/expr/property_get.rscrates/perry-codegen/src/expr/property_get/nullish_read_location_tests.rscrates/perry-codegen/src/expr/property_set.rscrates/perry-codegen/src/expr/proxy_reflect.rscrates/perry-codegen/src/expr/shadow_slot.rscrates/perry-codegen/src/expr/static_method.rscrates/perry-codegen/src/lower_call/buffer_intrinsic.rscrates/perry-codegen/src/lower_call/closure_analysis.rscrates/perry-codegen/src/lower_call/console_promise.rscrates/perry-codegen/src/lower_call/early_branches.rscrates/perry-codegen/src/lower_call/extern_func.rscrates/perry-codegen/src/lower_call/func_ref.rscrates/perry-codegen/src/lower_call/native/mod.rscrates/perry-codegen/src/lower_call/new.rscrates/perry-codegen/src/lower_call/new_ctor_args.rscrates/perry-codegen/src/lower_call/options/abort.rscrates/perry-codegen/src/lower_call/property_get.rscrates/perry-codegen/src/lower_call/scalar_method.rscrates/perry-codegen/src/lower_string_method.rscrates/perry-codegen/src/native_value/pod.rscrates/perry-codegen/src/stmt/let_stmt.rscrates/perry-codegen/src/stmt/loops.rscrates/perry-codegen/src/stmt/unused_expr.rscrates/perry-codegen/src/type_analysis.rscrates/perry-codegen/src/type_analysis/numeric.rscrates/perry-codegen/src/type_analysis/numeric/tests.rscrates/perry-codegen/src/type_analysis/pod.rscrates/perry-codegen/src/type_analysis/predicates.rscrates/perry-codegen/src/type_analysis/refine.rscrates/perry-codegen/src/type_analysis/strings.rscrates/perry-codegen/src/type_analysis_class_fields.rscrates/perry-codegen/src/type_analysis_facts.rscrates/perry-codegen/src/type_analysis_net.rscrates/perry-codegen/src/type_analysis_tests.rscrates/perry-codegen/src/typed_shape.rscrates/perry-codegen/tests/app_window_config_options.rscrates/perry-codegen/tests/class_keys_gc_root.rscrates/perry-codegen/tests/constructor_recursion.rscrates/perry-codegen/tests/i64_spec_ternary_recursion.rscrates/perry-codegen/tests/large_object_barriers.rscrates/perry-codegen/tests/native_proof_buffer_views.rscrates/perry-codegen/tests/native_proof_regressions.rscrates/perry-codegen/tests/perry_builtin_name_collision.rscrates/perry-codegen/tests/private_guard_declaring_class.rscrates/perry-codegen/tests/shadow_slot_hygiene.rscrates/perry-codegen/tests/static_symbol_hygiene.rscrates/perry-codegen/tests/typed_feedback.rscrates/perry-codegen/tests/typed_shape_descriptor.rscrates/perry-codegen/tests/typed_shape_descriptors.rscrates/perry-hir/Cargo.tomlcrates/perry-hir/examples/stable_hash_cross_process.rscrates/perry-hir/src/analysis.rscrates/perry-hir/src/analysis/value_types.rscrates/perry-hir/src/analysis/value_types_tests.rscrates/perry-hir/src/destructuring/mod.rscrates/perry-hir/src/destructuring/var_decl/alias_tracking.rscrates/perry-hir/src/destructuring/var_decl/native_fetch.rscrates/perry-hir/src/destructuring/var_decl/type_infer.rscrates/perry-hir/src/dynamic_import.rscrates/perry-hir/src/dynamic_import/tests.rscrates/perry-hir/src/ir/decl.rscrates/perry-hir/src/ir/expr.rscrates/perry-hir/src/ir/module.rscrates/perry-hir/src/ir/stmt.rscrates/perry-hir/src/js_transform/cross_module_natives.rscrates/perry-hir/src/js_transform/imports.rscrates/perry-hir/src/js_transform/local_natives.rscrates/perry-hir/src/jsx.rscrates/perry-hir/src/lib.rscrates/perry-hir/src/lower/closure_analysis.rscrates/perry-hir/src/lower/const_fold_fn.rscrates/perry-hir/src/lower/context.rscrates/perry-hir/src/lower/decorators.rscrates/perry-hir/src/lower/eval_super_scan.rscrates/perry-hir/src/lower/expr_assign.rscrates/perry-hir/src/lower/expr_call/array_only_methods.rscrates/perry-hir/src/lower/expr_call/imported_array_methods.rscrates/perry-hir/src/lower/expr_call/intrinsics/apply_call.rscrates/perry-hir/src/lower/expr_call/intrinsics/eval_strict.rscrates/perry-hir/src/lower/expr_call/intrinsics/native_arena.rscrates/perry-hir/src/lower/expr_call/local_array_methods.rscrates/perry-hir/src/lower/expr_call/module_class_static.rscrates/perry-hir/src/lower/expr_call/module_static.rscrates/perry-hir/src/lower/expr_call/native_module.rscrates/perry-hir/src/lower/expr_call/post_args_dispatch.rscrates/perry-hir/src/lower/expr_call/regex_string.rscrates/perry-hir/src/lower/expr_call/static_receiver.rscrates/perry-hir/src/lower/expr_call/textencoder.rscrates/perry-hir/src/lower/expr_call/url_date_instance.rscrates/perry-hir/src/lower/expr_function.rscrates/perry-hir/src/lower/expr_member.rscrates/perry-hir/src/lower/expr_member/member_tail.rscrates/perry-hir/src/lower/expr_misc.rscrates/perry-hir/src/lower/expr_new.rscrates/perry-hir/src/lower/expr_new/helpers.rscrates/perry-hir/src/lower/expr_new/member.rscrates/perry-hir/src/lower/expr_new/non_ident.rscrates/perry-hir/src/lower/expr_object.rscrates/perry-hir/src/lower/for_head.rscrates/perry-hir/src/lower/locals.rscrates/perry-hir/src/lower/lower_expr/arm_ident.rscrates/perry-hir/src/lower/lower_expr/arm_unary.rscrates/perry-hir/src/lower/lower_expr/helpers.rscrates/perry-hir/src/lower/lower_expr/reactive_text.rscrates/perry-hir/src/lower/lower_module_fn.rscrates/perry-hir/src/lower/lowering_context.rscrates/perry-hir/src/lower/misc.rscrates/perry-hir/src/lower/module_decl.rscrates/perry-hir/src/lower/module_decl/namespace.rscrates/perry-hir/src/lower/shared_mutable_capture.rscrates/perry-hir/src/lower/stmt.rscrates/perry-hir/src/lower/stmt_loops.rscrates/perry-hir/src/lower/tests.rscrates/perry-hir/src/lower/type_widening.rscrates/perry-hir/src/lower/typed_parse.rscrates/perry-hir/src/lower/widget_decl/reactive_animate.rscrates/perry-hir/src/lower_decl/block.rscrates/perry-hir/src/lower_decl/body_stmt.rscrates/perry-hir/src/lower_decl/class_captures.rscrates/perry-hir/src/lower_decl/class_computed.rscrates/perry-hir/src/lower_decl/class_decl.rscrates/perry-hir/src/lower_decl/class_members.rscrates/perry-hir/src/lower_decl/fn_decl.rscrates/perry-hir/src/lower_decl/helpers.rscrates/perry-hir/src/lower_decl/interface_decl.rscrates/perry-hir/src/lower_decl/private_members.rscrates/perry-hir/src/lower_decl/typeof_narrow.rscrates/perry-hir/src/lower_patterns.rscrates/perry-hir/src/lower_types.rscrates/perry-hir/src/lower_types/extract.rscrates/perry-hir/src/monomorph/inference_lookup.rscrates/perry-hir/src/monomorph/mod.rscrates/perry-hir/src/monomorph/substitute_type.rscrates/perry-hir/src/monomorph/tests.rscrates/perry-hir/src/stable_hash/mod.rscrates/perry-hir/src/stable_hash/tests.rscrates/perry-hir/src/stable_hash/types.rscrates/perry-hir/src/types.rscrates/perry-hir/tests/c262_parity.rscrates/perry-hir/tests/cheerio_call_rewrite.rscrates/perry-hir/tests/native_arena.rscrates/perry-hir/tests/shape_inference.rscrates/perry-transform/Cargo.tomlcrates/perry-transform/src/async_to_generator.rscrates/perry-transform/src/deforest/mod.rscrates/perry-transform/src/finally_inline.rscrates/perry-transform/src/generator/id_scan.rscrates/perry-transform/src/generator/mod.rscrates/perry-transform/src/generator/per_iteration.rscrates/perry-transform/src/inline/analysis.rscrates/perry-transform/src/inline/call_inliner.rscrates/perry-transform/src/inline/closure_analysis.rscrates/perry-transform/src/inline/exact_receivers.rscrates/perry-transform/src/inline/factory_specialize.rscrates/perry-transform/src/inline/imul.rscrates/perry-transform/src/inline/mod.rscrates/perry-transform/src/inline/substitute.rscrates/perry-transform/src/state_desugar.rscrates/perry-transform/src/unroll/escape_analysis.rscrates/perry-transform/src/unroll/mod.rscrates/perry-types/Cargo.tomlcrates/perry/Cargo.tomlcrates/perry/src/commands/compile/bootstrap.rscrates/perry/src/commands/compile/collect_modules.rscrates/perry/src/commands/compile/object_cache.rscrates/perry/src/commands/compile/object_cache/object_cache_tests.rscrates/perry/src/commands/compile/run_pipeline.rscrates/perry/src/commands/compile/types.rscrates/perry/src/commands/typecheck.rsdocs/po/de.podocs/po/es.podocs/po/fr.podocs/po/id.podocs/po/it.podocs/po/ja.podocs/po/ko.podocs/po/messages.potdocs/po/th.podocs/po/vi.podocs/po/zh-CN.podocs/src/contributing/architecture.mddocs/src/contributing/building.mdworkspace-architecture.json
💤 Files with no reviewable changes (10)
- crates/perry-codegen/Cargo.toml
- crates/perry-codegen-swiftui/Cargo.toml
- crates/perry-codegen-arkts/Cargo.toml
- crates/perry-codegen-js/Cargo.toml
- crates/perry/Cargo.toml
- crates/perry-codegen-wasm/Cargo.toml
- crates/perry-transform/Cargo.toml
- crates/perry-hir/Cargo.toml
- crates/perry-types/Cargo.toml
- Cargo.toml
🚧 Files skipped from review as they are similar to previous changes (2)
- docs/src/contributing/architecture.md
- docs/src/contributing/building.md
| @@ -0,0 +1 @@ | |||
| **Compiler architecture:** move the shared compiler type definitions into `perry_hir::types`, remove the standalone types crate, and reduce the Perry dependency closure from 18 crates to 17 crates. | |||
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Expand the changeset with root cause, affected paths, and validation notes.
As per coding guidelines, changelog fragments must contain the long-form root cause, relevant file paths, and validation performed; this one-line summary is insufficient for release notes.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@changelog.d/6760-merge-types-into-hir.md` at line 1, Expand the changelog
entry to document the root cause of consolidating compiler type definitions,
identify the affected crate or module paths including perry_hir::types and the
removed standalone types crate, and record the validation performed, including
the dependency reduction verification.
Source: Coding guidelines
The perry-types -> perry-hir merge moved `Type` to crates/perry-hir/src/types.rs and dropped the crate, but two files in perry-codegen still referred to it by fully-qualified path. Because the crate name never appears in a `use` line there, nothing that scans imports could see them, so the build broke with 8 x E0433: crates/perry-codegen/src/stmt/loops.rs:2408 crates/perry-codegen/src/stmt/masked_window_region.rs:164,365,433,457 api-docs-drift was just the first job to compile perry-codegen and report it; cargo-test and Clippy fail the same way. Mechanical rename, no semantic change: `Type` kept its variants and its definition line in the move. Verified with `cargo check -p perry-codegen` (exit 0) and a repo-wide sweep confirming no perry_types / perry-types reference survives outside git history.
Summary
default-membersfrom 58 packages to theperryproductArchitecture baseline
Validation
python3 scripts/workspace_architecture.py --self-testpython3 scripts/workspace_architecture.py --check --print-summarycargo metadata --no-deps --format-version 1cargo fmt --all -- --checkcargo check -p perrycargo clippy -p perry --binsgit diff --checkFollow-up
Phase 2 can use this baseline to consolidate shallow internal crates, beginning with the reviewed
perry-types→perry-hirmerge while preserving the CLI closure and CI coverage.Summary by CodeRabbit
New Features
Build & Quality
Documentation
Refactor