Skip to content

chore(ci): harden arch check and import hygiene — unblock branch CI#93

Merged
Lythaeon merged 2 commits into
mainfrom
chore/ci-import-hygiene
Apr 9, 2026
Merged

chore(ci): harden arch check and import hygiene — unblock branch CI#93
Lythaeon merged 2 commits into
mainfrom
chore/ci-import-hygiene

Conversation

@Lythaeon

@Lythaeon Lythaeon commented Apr 9, 2026

Copy link
Copy Markdown
Owner

Description

Makes the architecture boundary check portable on runners without rg and cleans up a small set of remaining absolute-path references in the core runtime/host code. This matters because the same arch-check failure can block every open PR regardless of branch-specific logic, and the import cleanup keeps the runtime code aligned with the contribution standards the project expects.

Changes

  • scripts/arch-check.sh: route forbidden-import checks through the existing search helper and fix the rg argument order so the script works with or without rg installed
  • crates/sof-observer/src/framework/host.rs: import TxCommitmentStatus and TransactionDispatchMode, use thread::available_parallelism(), and remove inline absolute-path references from plugin hook subscription setup
  • crates/sof-observer/src/runtime.rs: import kernel-bypass queue types/helpers and thread, then replace remaining obvious absolute-path calls in the public runtime surface
  • Affected slices: app/runtime, framework
  • Cross-slice communication changes: none; this is import hygiene only
  • Migration requirements: none

Motivation

Business motivation:

  • Unblock CI on every branch that runs cargo make arch-check on a runner image without rg.
  • Reduce review churn from style-only path-noise comments in core runtime files.

Technical motivation:

  • Keep the boundary checker correct regardless of tool availability.
  • Prefer semantic imports over repeated crate::... and std::... references in hot-path runtime code.

Alternative approaches considered:

  • Installing rg in CI instead of hardening the script. That keeps the script brittle for developers and other runners, so I rejected it.
  • Leaving the import cleanup for later. That would keep the same style issue alive in the most visible runtime files.

Scope and impact

  • Affected slices: framework, app/runtime
  • Data/API changes: none
  • Backward compatibility: unchanged
  • Performance impact: neutral to marginally positive from simpler helper dispatch in arch-check; no runtime behavior change
  • Security impact: none

Testing

  • Unit tests
  • Integration tests
  • Manual verification
  • Performance checks (if applicable)
  • Security checks (if applicable)

Commands/results:

cargo make arch-check
cargo test -p sof --lib --no-run
cargo fmt --check --all

All commands passed locally.

Related issues and documentation

  • Fixes:
  • Related: open perf PR stack (#89, #91, #92) depends on this shared CI portability fix
  • Architecture docs: docs/architecture/README.md
  • Relevant ARD/ADR: docs/architecture/ard/0001-project-structure-and-code-goals.md, docs/architecture/ard/0003-slice-dependency-contracts.md
  • Operations/runbook updates: none

Reviewer checklist

  • Code follows project standards and architecture constraints
  • Slice boundaries are respected (docs/architecture/ard/0003-slice-dependency-contracts.md)
  • Tests added/updated and passing
  • Documentation updated (README/docs/operations as needed)
  • No undocumented breaking change
  • Performance trade-offs documented where relevant
  • Security considerations addressed where relevant

Additional notes

  • This PR is intentionally small and intended to merge before the remaining perf branches are restacked onto main.

@Lythaeon Lythaeon merged commit bf80ef9 into main Apr 9, 2026
2 checks passed
@Lythaeon Lythaeon deleted the chore/ci-import-hygiene branch April 9, 2026 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant