Skip to content

nativelink: add --check for offline config validation - #62

Open
b7r6 wants to merge 2 commits into
mainfrom
pr/config-check-flag
Open

b7r6 wants to merge 2 commits into
mainfrom
pr/config-check-flag

Conversation

@b7r6

@b7r6 b7r6 commented Oct 7, 2026 •

Copy link
Copy Markdown
Owner

What and why

Lane A stability fix from the findings catalog (see nativelink-findings-2026-10-05.csv
on the meta/findings-catalog-2026-10-05 branch), rebased onto OSS main
@bf4b3aa855. This fork PR exists to validate the change on CI that is
representative of upstream PR lanes (public read-only cache, same endpoints)
before any upstream submission.

How was this verified?

The branch carries its own regression tests (fails-without where the fix
class allows it — see the branch's test commits). This PR's purpose is the
full representative CI run; green here rehearses the exact checks an
upstream PR would face.

Risk

Fork-internal validation PR; nothing lands anywhere by merging this. The
underlying fix's risk assessment happens at upstream-submission time.

AI assistance

Agent-assisted pipeline (Claude) for rebase and PR mechanics under my
direction; the fix itself carries verification in its tests.

@b7r6
b7r6 force-pushed the pr/config-check-flag branch 3 times, most recently from 6591f4d to 721b463 Compare October 8, 2026 03:39
@b7r6
b7r6 force-pushed the pr/config-check-flag branch 2 times, most recently from c9efe94 to a0a5aea Compare October 15, 2026 11:19
Completes the no-per-PR-OCI-builds intent: image-off-pr moved image.yaml off
PRs and TraceMachina#2877 moved the nix integration job off PRs, but main.yaml's
integration-tests (docker-compose image build + run_integration_tests.sh)
fell between them and still ran on every PR. Defer to nightly + merge-to-main,
matching TraceMachina#2880's pattern. Fork-local until folded into the upstream OCI/nightly
set.
`nativelink <config>` previously validated a config only by booting it
(binding listeners, connecting to backends), so there was no way to
check a config in CI without a live environment.

Add `nativelink --check <config>`: it parses the config (already
running check_store_conflict) and resolves every store/scheduler
name reference — the typo'd-reference class that otherwise only
surfaces at boot — then exits without constructing the store manager,
binding a socket, connecting to any backend, or creating store
directories. Success prints a one-line summary to stdout (exit 0);
unresolved references and duplicate store/scheduler names are collected
and reported to stderr, each with its config path (exit 1).

CasConfig::validate_references walks workers and server services, and
recurses ref_store references for the transitive closure of stores that
are actually wired to a consumer. It is conservative to avoid false
positives: optional/defaulted refs are checked only when present, and
store-internal refs of unwired stores are skipped — so all 17 shipped
example configs pass --check (proven offline via strace: zero network
connects), while a dangling reference is named and fails.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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