HOVEL // chapter 32
Chapter 32 Part 05 / Engineering

Bazel Build Review

Reviewed on 27 September 2026 against main revision a2bfde0, using the supplied mature-Bazel review strategy. This is a source-level review with targeted execution and the gate results below, not a certification of every action or remote-cache entry. The scope is the current root/core build architecture and verification contract; public module and SDK behavior remains unchanged.

Existing foundations

AreaRepository evidenceAssessment
Version and dependency ownershipRoot and core .bazelversion, MODULE.bazel, and committed locks; .aspect/version.axlBazel 9.1.1 and Aspect 2026.33.3 are pinned. Both active workspaces use Bzlmod. No tracked WORKSPACE file needs migration.
Declared toolchainsRoot and core module manifestsGo, Python, Rust, Zig C/C++, and the docs Node toolchain are declared. This is stronger than host PATH provisioning; it does not prove every custom action's inputs are complete.
Lint and architecturetools/lint/BUILD.bazel, core/tools/lint/lint_action.bzl, tools/bazel/policy/check_repo_policy.pyDeclared lint snapshots and result tests already cover Buildifier, language tools, ownership, layering, and core internal visibility. Buildifier already enables lint warnings.
Full validation.aspect/check.axl, .github/workflows/ci.ymlThe supported full-tree contract is aspect hovel-check. Unqualified recursive root targets are not a substitute: core is a separate workspace and AXL owns dispatch.
Remote executionBoth active .bazelrc files, configure_bazel_cache.pyBuildBuddy uses TLS, a digest-pinned Ubuntu image, network-off workers, and credential files outside source control. Developer BuildBuddy configuration disables local-result uploads; credential-free CI runs locally. Cache-only rollout advice is already behind this repository's deployment stage.
Reproducibility.aspect/repro.axl, reproducibility.yml, repo-tools/tasks/reproducibility.pyIndependent sequential runners, fresh output roots, disabled cache reads, execution evidence, and artifact hash comparison already exist. This review did not rerun the release matrix.
Observability.aspect/config.axl, ci_summary.py, ci_audit.pyBEP capture, invocation links, task timing, and remote timing/cache counters exist. The audit explicitly distinguishes request counters from unique actions.

Findings fixed in this review

  1. P1: six Python test targets did not execute their assertions. //tools/bazel/buildifier:buildifier_test and //tools/bazel/policy:repo_policy_test named pytest-function modules as their executable main files but never called pytest. Importing pytest as a dependency does not start collection. The same defect affected //repo-tools/tasks:checkout_test, //sdk/python:coverage_test, //modules/tools:package_examples_test, and //modules/picblobs/tools:build_dist_test. The pytest modules now invoke pytest and propagate its exit status; the dependency-free packager test uses unittest. Existing suites already include these targets.
  2. P2: Buildifier discovery omitted repository configuration. The wrapper selected BUILD, MODULE, and .bzl files but skipped the checked-in REPO.bazel. It now includes REPO, VENDOR, and legacy WORKSPACE names as well, with regression coverage for explicit paths and directory discovery. Recognizing legacy filenames for linting does not reintroduce WORKSPACE dependency management. AXL remains a separate language surface.
  3. P2: C/C++ auto-detection policy required an action environment flag. The active rc files and policy check used --action_env for BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN. The rules_cc repository rule reads repository_ctx.os.environ; its documented control is --repo_env. Both workspaces and the active Picblobs base configuration now express that repository-level intent. A regression test rejects the old action-only policy configuration. Existing compiler registrations and the Zig cache boundary remain unchanged.

Remaining work, ordered by acceptance evidence

PriorityObserved gapNext change and acceptance criterion
NextThe policy scans literal no-remote/no-sandbox and default-shell-env strings, but does not cover local or requires-network tags. It is a textual guardrail, not an evaluated graph audit.Add an Aspect-owned inventory of evaluated execution requirements, with target-specific rationale and ownership. Preserve documented VHS, Wine, and manual QEMU boundaries; a newly introduced unowned exemption should fail the policy gate.
NextNetwork-off BuildBuddy execution does not establish a strict local Linux sandbox baseline. The general CI configuration does not explicitly require linux-sandbox.Add a credential-free strict sandbox lane through AXL, initially for repository and representative core/docs actions, then expand. Require actual uncached execution and record unsupported host boundaries rather than silently falling back.
NextBuildifier and repository policy receive the complete lint source snapshot. An unrelated content/source edit can invalidate both actions.Narrow inputs at analysis time while retaining every configuration, BUILD file, ownership file, and Go import needed by each check. Measure null and leaf-edit action counts before and after; do not merely filter files after the action starts.
NextPerformance data exists, but there is no checked-in clean/null/leaf/core-edit benchmark corpus or graph budget.Add an AXL benchmark workflow using isolated checkouts, BEP graph counters, profiles, and execution logs. Establish baselines before thresholds; report action reuse separately from CAS request success.
Follow-upCI cache/backend selection is credential-driven; client flags do not demonstrate server-side permission boundaries.Document and verify BuildBuddy credential scopes for same-repository PRs, fork PRs, trusted main, and releases. The acceptance evidence is service authorization plus workflow tests, not an assumption that disabling local uploads prevents all remote writes.
Follow-upThe Picblobs custom linker still uses run_shell around a declared compiler and linker inputs.Move shell branching into a declared tool or a suitable linking rule, preserving the existing architecture-specific link behavior and cross-platform artifact checks. Shell use alone is not evidence of an undeclared compiler.
Follow-upNo tracked BUILD declaration found by this review uses flaky or shard_count; this does not measure actual flake rate or runtime skew.Use recorded durations to choose repeated-test experiments and any sharding work. Add sharding only after proving that the runner partitions tests correctly; keep retries visible.

Validation

  • aspect hovel-check: passed on 27 September 2026 in 5m 22s using the existing local BuildBuddy selection. This includes repo, core, SDKs, module examples, modules, docs, and agent validation.
  • All six repaired test targets passed: 48 pytest cases and one unittest case actually executed, including the two new regression cases.
  • Expanding Buildifier discovery first failed on the missing REPO.bazel module docstring. Adding the docstring made the enforcing lint test pass, demonstrating that the file is now checked.
  • The final review-text and runner cleanup changes are covered by a subsequent aspect hovel-check repo and aspect hovel-check docs run, recorded with the pull request.

Remote cache hits are allowed in this ordinary verification gate. No new independent release reproduction, strict local sandbox run, benchmark baseline, or server-side credential audit is claimed by this review.

Primary references

Bazel 9 and removal of WORKSPACE, rules_cc repository toolchain configuration, and Buildifier file types and linting were checked against the supplied report. Keep existing validated pins; upgrading toolchains or changing remote infrastructure is separate work.