Field note / ML infrastructure

PyTorch · CI reliability · OIDC · artifact evidence

A CI result needs a chain of custody.

A green job is an observation, not automatically a compatibility signal. To make it useful, bind its producer, upstream revision, evidence, terminal state, and decision policy into a path that another engineer can inspect and trust.

Modern ML systems depend on more than one repository, runner type, operating system, compiler, accelerator, and package path. When an upstream change reaches a downstream backend, the question is not merely whether a workflow turned green. It is whether the result is about the intended change, came from the intended producer, finished in a meaningful state, and carries enough evidence for the next person to act.

That is a chain of custody for CI. It is a compact engineering contract that turns a distributed test outcome into a compatibility signal instead of a disconnected log.

A result becomes trustworthy when its identity, scope, evidence, and decision path are all explicit.

01 / Bind the producer identity

Know which workflow is allowed to speak for a backend.

A callback endpoint that accepts an arbitrary JSON payload has no reliable way to distinguish a real downstream result from an accidental script, an old credential, or an unapproved repository. Shared long-lived secrets make this worse: they are difficult to rotate, easy to copy into the wrong context, and rarely express which workflow was meant to use them.

A better boundary uses workload identity. GitHub Actions can mint an OpenID Connect token during a job when the workflow grants id-token: write. The receiver should validate the issuer, audience, repository, and workflow context before it accepts a result. The token grants the right to make this one authenticated request; it is not a reusable relay password. GitHub documents both the required permission and the claims available for trust conditions in its OIDC reference.

received callback
→ verify JWT signature and issuer
→ require the expected audience
→ match the repository and workflow claims to policy
→ accept the result only for an approved integration

Authentication alone is not authorization. An approved repository may be permitted to report results while still not being allowed to affect a shared dashboard or a merge-facing check. Keep that policy at the receiver, where maintainers can review and change it without trusting a sender-controlled field in the payload.

02 / Bind the revision and scope

A passing job without a precise subject is ambiguous.

Every result needs to state exactly what it exercised: the upstream repository, commit SHA, event type, and a stable delivery or run identity. A pull-request result and a nightly result can be equally valuable, but they answer different questions. Mixing them under one unnamed status makes regressions and release readiness harder to reason about.

A useful job name adds the platform and role without encoding volatile details. For example, linux-rhel9 / build and linux-rhel9 / test (cpu) make it clear that a build result is not a CPU-test result. The delivery identity groups those jobs under the same upstream revision; the job name differentiates the evidence inside the group.

  1. Revision.Record the immutable upstream SHA, not only a moving branch name.
  2. Event.State whether the result belongs to a pull request, nightly, or periodic validation path.
  3. Delivery.Use a stable identifier for the revision or validation run so retries remain traceable.
  4. Job.Use a stable, descriptive job name to distinguish build, CPU, GPU, and diagnostic evidence.

03 / Keep evidence reachable

Separate package transfer from result reporting.

Build artifacts move work between jobs. A wheel produced by a build job may be downloaded by a test job; a test report may be collected after the job finishes. That binary transfer belongs to the producing CI system and follows its own access control, retention, and integrity rules. GitHub Actions artifacts are designed to persist workflow output and share it between jobs, as described in GitHub’s artifact documentation.

A cross-repository result callback should carry references, not the package itself: the workflow URL, a stable artifact name, an optional digest, and a report location appropriate for the audience. This makes a HUD row diagnosable without turning the callback service into an unbounded package mirror or putting credentials in its logs.

build job
→ publishes wheel and report to its CI artifact store
→ test job consumes the wheel
→ result callback reports SHA, conclusion, workflow URL,
  and safe artifact metadata
→ dashboard links the decision back to evidence

A link has a lifecycle too. Check whether the intended audience can open it, whether its retention matches the investigation window, and whether it contains secrets or short-lived signed parameters that will be copied into a durable log. Evidence that disappears before an operator can inspect it is only temporarily useful.

04 / Preserve terminal truth

Missing, cancelled, and invalid are not success.

A result-routing failure must not rewrite a completed test into a false failure, but a failed test invocation must not become a green dashboard row because a summary was missing. These are two different failure domains: the producer decides the test outcome; the relay makes that outcome observable.

Treat the terminal state as a contract. A completed callback needs a valid conclusion and the expected job identity. If a wrapper crashes before it creates its result summary, if a log directory comes from an earlier run, or if a zero-test report is unexpected for that job, report an infrastructure problem explicitly. Do not infer success from the absence of a failing marker.

Fail open only for the reporting transport; fail closed when deciding whether test evidence is valid.

Rate limits deserve the same clarity. Retries can help only when they account for the limiter’s behavior. If rejected requests still occupy a fixed-window quota, a burst of synchronized retries can extend the outage instead of recovering it. Pace callback emission, use backoff with jitter, and preserve the producer’s terminal result while making delayed reporting visible to operators.

05 / Separate evidence from policy

A health decision is not always a configuration change.

A shared CI system often has a configured participation level and a separate rolling health policy. For example, an L3 backend can remain configured as L3 while a seven-day timeout, pass-rate, or end-to-end-latency evaluation places it under temporary protection. The status says, “do not treat this signal as healthy right now.” It does not mean the allowlist has already changed to L2.

That distinction matters in both the user interface and the audit trail. Show configured-level history only when an allowlist change is actually merged. Show temporary-protection episodes separately, with their evaluation window and failed criteria. Otherwise a dashboard can turn a temporary operating state into a false claim about the backend’s configured trust level.

  1. Evidence.Fresh jobs establish the measured pass rate, timeout rate, and time-to-signal.
  2. Operational policy.A rolling evaluation can suppress or isolate an unhealthy backend while investigation begins.
  3. Configuration.A reviewed, merged allowlist change alters the backend’s actual level.
  4. Audit.A durable ledger records both kinds of events with timestamps, criteria, and links to the decision.

A practical result contract

Before a result can guide a compatibility decision, verify these six things.

  1. Identity is verified.The receiver validates a short-lived workload token and enforces repository and workflow policy.
  2. Revision is immutable.The payload identifies an upstream SHA, event type, delivery identity, and stable job name.
  3. Evidence is safe and reachable.Workflow and artifact references are useful to the intended audience without exposing secrets.
  4. Terminal state is honest.Success, failure, cancellation, timeout, missing evidence, and transport failure remain distinct.
  5. Policy is receiver-owned.The sender reports facts; maintainers control promotion, demotion, and dashboard participation.
  6. History preserves meaning.Actual configuration changes and temporary health episodes are recorded as different event types.

Sources

Primary references