Repository navigation
Conversation
Reuse the verified Cargo.lock update from matrixorigin#1104 at 309c8ca. Keep audit policy unchanged.
XuPeng-SH
left a comment
There was a problem hiding this comment.
Reviewed commit e737a2e. Requesting changes for the clean-artifact identity gap below.
The A/B invalidation fixes otherwise have appropriate ownership and avoid additional runtime state or compatibility paths. Local validation passed all 146 CI Python tests, formatting, standalone build-script Clippy, repository checks, dev setup contracts, and locked offline dependency resolution.
The current-head live harness completed 17/18; the remaining case reports InfraVerificationUnavailable because its hard judger was unavailable. That failed check is not sufficient evidence of a behavioral regression caused by this PR, and its underlying failure remains unproven.
XuPeng-SH
left a comment
There was a problem hiding this comment.
Reviewed commit 7bda3e3. The previous P2 finding is fixed; no new blocking findings.
The canonical build script now conservatively marks ordinary unverified artifacts as dirty. Valid-nonce source tracking and complete trusted source declarations retain their existing responsibilities, and existing identity consumers reject unverified artifacts without another verification schema or state machine. The client release workflow validates its selected source and supplies the existing declaration pair.
Independently reran the prior reproduction using production build_info.rs and the production identity probe: the rebuilt artifact executes the edited behavior after source restoration, but is now rejected while ordinary core reuse is preserved. Clean attested controls still pass. Additional checks covered declaration removal, Git query failures, and source archives without Git metadata.
Local validation passed all 148 CI Python tests, 32 harness preflight tests, formatting, standalone build-script Clippy, Actionlint, repository checks, and dev setup contracts. Implementation, test, and documentation changes were reviewed separately. A read-only merge-tree check against main at d39864b found no conflicts.
This approves the reviewed source. Full local workspace Rust tests, actual release builds, and macOS execution were not performed; full CI timing savings remain unmeasured. CI completion remains a separate merge gate.
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |
Capability assessment: N/A: This change fixes build invalidation and artifact identity declarations; it does not introduce runtime capabilities.
Summary
A fresh checkout can rebuild
astra-coreand its dependents on consecutive Cargo invocations even when the source is unchanged. This PR fixes mechanisms A/B in #1106 and preserves local artifact reuse without letting an unverified binary claim a clean source identity.GIT_OPTIONAL_LOCKS=0for Git queries so build-timegit statuscannot rewrite its own watched index.refs/headsnamespace for its loose ref. Loose remote/tag changes do not invalidate core. Changes to the existing sharedpacked-refsfile can still rebuild it.git_dirty=true, closing the stale clean-artifact identity gap identified in review./varand/private/varaliases.Refs #1106. The PR diff fix in #1107, cross-commit sccache invalidation (mechanism C), conditional dev-tty execution, and self-hosted runner migration remain outside this PR. #1106 remains open.
The branch also contains the earlier dependency update from #1104:
rustls-webpki 0.103.16andwebpki-root-certs/webpki-roots 1.0.10. Current upstream main (d39864bc) now contains the identical lockfile change. No audit command or ignore rule is changed here.User and compatibility impact
The clean-build declaration is deliberately stricter. The existing public boolean schema is unchanged:
git_dirty=falsemeans an explicitly clean build;trueincludes both tracked changes and an unverified source state.Ordinary Cargo builds, including release-profile builds, report
truewithout either:ASTRA_BUILD_ATTESTATION_NONCE, enabling tracked-source invalidation and a fresh Git status check whenever those inputs change; orASTRA_BUILD_SOURCE_GIT_SHAtogether withASTRA_BUILD_SOURCE_GIT_DIRTY=true|false.Missing/malformed declarations cannot establish clean identity for ordinary builds. An orchestrator must refresh its declaration for every build and prevent source changes during compilation; a constant
falsein a developer shell is not verification. Existing container/manual-harness builders and the local API launcher already supply the pair. The client release workflow now verifies its selected SHA and clean tracked state before exporting the pair, failing before Cargo on an invalid checkout.Both health responses and
--build-info-jsonuse the canonical embedded boolean. Existing clean-artifact consumers therefore reject ordinary unverified binaries without adding a second verification path or changing their schema. The API reference and harness guide document how to create identity-sensitive artifacts.Valid-nonce builds still detect unstaged edits when a nonce is reused. Deleted tracked files conservatively invalidate those builds until restored or staged. Removing the nonce removes broad source watches and returns to an unverified identity.
The second/third build of an unchanged checkout can reuse artifacts. Git index/ref changes can still invalidate metadata. The issue's 3m48s second compilation is an example, not a guaranteed saving; controlled before/after CI timing remains outstanding.
Architecture and complexity delta
crates/core/build.rs.build_info.rsand invokes productionscripts/harness/preflight.py::probe_build_info.Verification
Local validation for
7bda3e33:make format-check: passed.-D warnings: passed.python3 scripts/ci/validate_repository.py: passed.bash scripts/dev/test_setup_contract.sh: passed.git diff --check: passed.The new regression builds a clean fixture, changes actual downstream Rust behavior without staging, rebuilds, restores the source without rebuilding, verifies that the checkout is clean and the binary still executes the changed behavior, then calls the production identity probe. At
e737a2ec, ordinary and invalid-nonce cases incorrectly pass that probe. With this fix, both are rejected while core remains Fresh. Valid-nonce and refreshed explicit-declaration controls accept clean artifacts and reject edited artifacts.Other fixtures cover cold checkout/index immutability with Git status enabled; second/third-build reuse; detached HEAD; packed/loose refs; linked worktrees; loose remote/tag changes; staged edits; nonce changes; source archives; incomplete declarations; unrelated tracked edits; and attested deletion/restoration. Release shell contracts use real Git fixtures and a stubbed Cargo command under Bash and sh, covering clean, dirty, wrong-revision, and unavailable-Git cases, plus declaration persistence between steps.
The public-probe fixture seeds dependency resolution from the repository lockfile and verifies the resolved registry versions/checksums against it. A cold environment may fetch the small serde dependency closure; subsequent fixture builds are locked and offline.
The broader
scripts.harness.test_preflightsuite could not import locally because theharborPython dependency is absent. This does not affect the new regression's direct execution of the production probe, which passed. Full workspace Rust tests and actual release builds were not run locally; fresh PR CI remains required. No final CI success is claimed.Earlier dependency validation at
0e1eb6ffpassed locked metadata resolution and cargo-audit 0.22.1 against fixed advisory database4b587f00996ebe5c05a73eaef105ef241e876414, with zero blocking vulnerabilities and existing allowed warnings retained.Read-only merge-tree validation against current upstream main
d39864bcfound no conflicts. No merge was performed. Database verification is not applicable: no schema or query changes.Final checklist