Skip to content

The Build That Had No Reason to Run

S6·E01

Engineering journal · 2–5 August 2026

At a loading depot, the recurring anime engineer checks a running conveyor.

I expected a control-plane change to exercise its own tests and image. Instead the protected-main pipeline also rebuilt the retrieval image. The immediate temptation was to treat that as a harmless cost of sharing a repository. But a build rule that fires on everything can’t tell me which changes actually feed an image. It also creates a misleading trail when I later need to work out why a service image exists.

For the implementation background, see GitLab change rules.

Start with the reader’s question

On 2 August the retrieval work needed an evaluation that could tell me whether a search result set contained enough distinct material to answer a question. A single relevant hit at the top looks good in a ranking metric. It leaves a gap if the answer also needs evidence about a second condition or a third exception. I wanted those failures to remain visible before deciding whether a more expensive reranker would help.

The useful unit is a required claim. The benchmark calls it a nugget. Each ranked result can support zero, one or several of those claims. The aggregate is the union of the claims supported by the first ten results, divided by the required claim count. Five documents making the same point still add one supported claim. The code also defines a separate complete-answer flag and a discounted ranking measure that rewards earlier and less repetitive coverage. They address different questions. A ranking can improve the position of useful evidence while leaving the answer incomplete.

Historical source excerpt. tests/benchmarks/colbert_metrics.py at 9e69d2b275cc, lines 126–132.

    ranking = _validated_ranked_nuggets(ranked_nuggets, expected_nuggets)
    covered = (
        set().union(*(nuggets for rank, nuggets in ranking if rank <= _CUTOFF))
        if ranking
        else set()
    )
    return len(covered) / len(expected_nuggets)
Explain this code line by line
  1. Validate ranks and known claim identifiers.
  2. Start the covered-claim expression.
  3. Union the sets from eligible top-ten positions.
  4. Use that branch when ranking records exist.
  5. Otherwise use an empty set.
  6. End the expression.
  7. Divide unique covered claims by the expected count.

Take an invented three-claim query. Result 1 supports A, result 2 repeats A, and result 5 supports B. The first ten cover two thirds and the completion flag is zero. Now move an allowed result supporting C from rank eleven to rank eight. Coverage rises to three thirds and the flag flips. The first relevant result never moved. If I measured only its position I would miss the change. This illustrates what the new metric can see. It supplies no historical benchmark result.

How a capture bug changes the comparison

The 3 August correction matters because the benchmark consumes a capture of candidate results. Candidate identity and filtering come before the measurement. The corrected capture calls the same sensitive-result predicate as the gateway with separate path, body and heading surfaces. Its input now includes metadata that the first capture omitted. It asks for a bounded overfetch with reranking disabled. A batch that cannot retain ten results after filtering fails visibly. This avoids quietly changing the experiment’s eligible result set.

There are two ways for a ranking comparison to look better for the wrong reason. The new system can see a result the baseline had to exclude, and the baseline can be given a smaller starting pool. Both change the question. The fairest retest would retain the initial result IDs and positions, the filter outcome, and the final eligible IDs under the same query and cutoff. Only then can the ranking comparison attribute a difference to ordering. That is a proposed verification method derived from the inspected sources. I have no retained run here that establishes a production ranking improvement.

Historical source excerpt. packages/rag-gateway/src/rag_gateway/vw43_capture.py at 0aa7154e5c99. Lines 35–40.

        if not _is_sensitive_search_result(
            path_surface,
            str(result.get("content", "")),
            header_surface,
        ):
            kept.append(result)
Explain this code line by line
  1. Ask the existing gateway predicate whether this candidate needs to be excluded.
  2. Provide the path-related fields combined by the preceding lines.
  3. Supply the document content to the same predicate.
  4. Supply the heading and context fields as a separate surface.
  5. Enter the keep branch only for a candidate the predicate did not exclude.
  6. Append that candidate to the eligible list.

Why an unrelated build belongs in the same journal

The GitLab incident was an adjacent example of a boundary that included inputs it should not. The control-plane merge was legitimate. The surrounding pipeline selected a retriever build and deploy marker because both used a repository-wide package pattern. The retained source shows the common rule. The implementation report describes the resulting image publication and separately shows the live workload staying on its previous image.

The anime engineer traces a junction in the sorting lanes while the neighboring conveyor stays idle.
The build boundary follows the connected route. Adjacent activity can stay outside the job.

If I narrowed the rule to the retriever directory alone, the original symptom would disappear. The new rule would then miss shared core changes and root dependency changes. The Dockerfile makes that failure mode concrete. Its early metadata layer copies manifests and the shared lockfile. The build exports frozen requirements and installs the CPU-specific runtime dependency set. A later layer installs the service and core source. The change rule follows both layers rather than guessing from directory names.

The root README wildcard is still an unresolved edge of the claim. It is copied in the metadata layer and omitted in the selected trigger list. The historical test proves the adopted rule. It does not prove that every copied file is an input to the meaningful runtime bytes or that every meaningful input was exhaustively enumerated. I would preserve that question in the ledger rather than silently “correct” the historical rule in an article.

Upstream reference for this part of the implementation: GitLab change rules.

Mechanism at a glance
Changed pathImage input listBoth jobs or neither

Historical source excerpt. .gitlab-ci.yml at 8156f87ad0bd. Lines 2407–2413.

    - if: $CI_COMMIT_BRANCH == "main"
      changes:
        - "services/rag-retriever/Dockerfile"
        - "packages/rag-retriever/**/*"
        - "packages/rootweaver-core/**/*"
        - "pyproject.toml"
        - "uv.lock"
Explain this code line by line
  1. Select this rule for the protected-main branch.
  2. Evaluate the changed paths against the following list.
  3. Include edits to the Dockerfile, which defines the image recipe.
  4. Include edits in the retrieval service package.
  5. Include edits in the shared core package.
  6. Include edits to the workspace project metadata.
  7. Include edits to the resolved dependency lockfile.

Read the evidence in the order the decisions happened

ObservationWhat it answers
Historical GitLab YAML before the changeWhy the unrelated merge could select both jobs.
Revised rules and exact dependency pathsWhat the pipeline is now configured to select.
Reported red contract and 27 green CI checksWhether the targeted regression was demonstrated at the source boundary.
Protected-main run omitted both retriever jobsWhether the real pipeline selection changed for that merge.
Registry publication and unchanged live imageWhy building an image did not by itself change what was running.

Those checks leave the retrieval experiment open on purpose. The build rule now expresses a tighter relationship between a patch and the job it should select. The benchmark changes express a tighter relationship between a set of candidates and the claims it can support. The useful parallel is to preserve the evidence at the stage that actually made a decision.

Follow a capture before interpreting its score

The capture tool was a bridge between the serving retriever and the offline evaluation. At the first source checkpoint it made a hybrid search request with reranking turned off and asked for 30 candidates. The fixed number looked reasonable as spare capacity for filtering. The difficulty was that it encoded a second policy in the capture client. If gateway limits changed or a filter removed more entries than expected, the capture could see a different eligible pool. An apparent difference in reranker quality would then include a difference in which candidates reached either ranker.

The 3 August change sourced the overfetch factor and maximum result count from the same gateway constants. It selected the smaller of the result limit and ten times the overfetch factor. With the historical factor of three and a maximum of fifty, that still yielded 30 candidates. On that revision the number stayed the same. Its source of truth changed. The historical regression also checks a category of result that looks ordinary in its content but has protected context in its metadata. The repair passed the existing gateway filter all the relevant metadata surfaces. The fixture passed eleven in-memory results directly to the filter and checked that ten remained after exclusion. It did not make an HTTP request or exercise overfetch. It supplies evidence that the capture contract was repaired, while an end-to-end replay would still need a stable query set and retained candidate lists.

In a synthetic capture of twelve candidates, suppose two are ineligible. Ten remain. The benchmark can score coverage using those ten. If a third is removed, the tool raises an insufficient-results error. The latter outcome cannot tell me whether a reranker performed poorly, because I never obtained a valid top ten under that contract. This is why I would report capture validity separately from coverage. It keeps changes in the data collection path from being counted as improvements or regressions in relevance.

A pipeline can be green and still do unintended work

The original protected-main run after the control-plane merge succeeded. The trigger had done exactly what its broad package pattern instructed it to do. That is a quiet operational failure. Nobody had to diagnose a broken runner or a bad image to find wasted work. They had to compare the patch against the job graph and ask whether the retriever image had a reason to change.

The first check was a failing contract test over the old YAML. It asserted the relevant input set for both the retriever build and its deploy marker. Fixing only the image job would have left the marker’s scheduler rule broad. Fixing only the marker would have preserved unnecessary image builds. The pair makes the operational intent inspectable: run the image job for its relevant inputs, then make the associated downstream selection agree.

The historical report records 27 CI-selection tests after the fix, and candidate and protected-main pipelines omitting both retriever jobs for the correction. Those tests and the observed run answer different questions. The static contract checks that both selectors list the retriever and shared core. The August pipelines show the jobs skipped on the correction. A positive-input pipeline was not run in this record. The earlier unexpected run also published a retriever artifact, while the deployed service stayed two-of-two healthy on the existing image. The cluster report and absence of an automatic image-update resource explain why the green build was insufficient evidence of a release.

A GitLab change selector and a retrieval capture may look like unrelated machinery. Both encode the material entering a later decision. In one case, the inputs decide which service to build. In the other, they decide which results can support the benchmark. The August changes made each choice inspectable. I would keep separate evidence for candidate selection, score calculation, selected job and running artifact.

The next episode applies the same rule to an operation whose authority may be used only once. It follows the gap between a local decision, a remote acknowledgement and a protected effect.

Glossary and primary references

Change glob

A path pattern used to select jobs based on changed files.

Dockerfile

The build recipe that defines what goes into a container image.

Deploy marker

A downstream CI signal associated with a service build. Its presence alone does not establish a rollout.

GitLab change rules