# Recorded local build: methodology and reproduction

Recorded September 8, 2026 UTC. This is an original, deliberately broken sample, not a customer build or a performance benchmark. The failure, remote executions, MCP responses, patch and reruns are real; no telemetry or model response was simulated.

The workflow used Codex as the coding client with the Hermetiq skill and the actual local Hermetiq MCP server. Codex read `find_actions` and `get_action_execution`, inspected the source and Bazel execution log, applied the one-line BUILD correction, and ran the same target again. This is a client-assisted workflow, not an unattended Hermetiq service run. The local backend's built-in mock chat was not used.

Execution path: Bazel 9.1.0 on macOS → local Buildbarn Linux ARM64 worker → local Hermetiq BEP receiver/Postgres → official Hermetiq MCP. Backend source revision: efbd9de19d5cfccf46039d3431ccbda7b33df2b0, compiled unchanged. The skill source revision was cddcaa83354e3d1dfc0ddc8c019cbab683f2fea5.

The diagnosis used BEP action data and retrieved stderr through Hermetiq, plus local source inspection and Bazel's execution log to confirm the missing input. This run did not correlate worker logs, infrastructure telemetry, or completed-action-log records; project CAS enrichment was unavailable. The `darwin_arm64` Bazel output path identifies the client's configuration; the execution log independently records the Linux remote platform and runner.

## What was measured

- Failure: one failed `//:release_manifest` action, exit 1. Its remote inputs omit `build-mode.txt`.
- Fix: add `build-mode.txt` to `srcs` in `BUILD.bazel`. No other source change.
- Verification: `//:verify_release` succeeds, with two real remote genrules and one internal Bazel action. The second genrule checks both `version=1.0.0` and `mode=release`.
- Unchanged rerun: both exact action digests are reused from Buildbarn's remote cache; two remote cache hits, zero remote executions, and one internal action.

Each run used `--batch --nouse_action_cache --disk_cache=`. The failed and fixed runs disabled remote cache reads; the unchanged rerun enabled them. Timings in the logs describe only this tiny sample and include different client/backend timing boundaries. No time-saving percentage is claimed.

## Reproduce

Use the files in `sample/` in a new disposable directory with Bazel 9.1.0. A local Buildbarn endpoint and local Hermetiq receiver must already be running. The recorded lab used remote executor/cache `grpc://127.0.0.1:8980`, remote instance `hardlinking`, BES `grpc://127.0.0.1:50091`, and BES instance `local-dev`.

1. Save the fixed `BUILD.bazel`, then copy `BUILD.before.bazel` over `BUILD.bazel`.
2. Run the command below with `--remote_accept_cached=false`; expect exit 1 and `cat: build-mode.txt: No such file or directory`.
3. Use the invocation ID from the log with Hermetiq `find_actions(result="failed")`, then pass the returned action `id` to `get_action_execution`.
4. Apply `fix.diff` (or restore the saved fixed BUILD file) and run the same command again with remote cache reads disabled. Verify success through Hermetiq `get_invocation`.
5. Run unchanged with `--remote_accept_cached=true` and verify two remote cache hits.

```sh
bazel --ignore_all_rc_files --batch build //:verify_release \
  --jobs=2 --nouse_action_cache --disk_cache= \
  --remote_executor=grpc://127.0.0.1:8980 \
  --remote_cache=grpc://127.0.0.1:8980 \
  --remote_instance_name=hardlinking \
  --remote_default_exec_properties=OSFamily=linux \
  --remote_default_exec_properties=container-image=docker://ghcr.io/catthehacker/ubuntu:act-22.04@sha256:dd7654ffb01d5b7b54b23b9ce928a1f7f2d08c7b3d7e320b6574b55d7ccde78b \
  --bes_backend=grpc://127.0.0.1:50091 \
  --bes_header=X-Forwarded-User=public-example-agent \
  --bes_instance_name=local-dev \
  --bes_upload_mode=wait_for_upload_complete \
  --build_event_json_file=build.bep.json \
  --execution_log_json_file=build.execution.json \
  --remote_accept_cached=false
```

## Export provenance

MCP JSON files preserve the server's `structuredContent`, including `truncated:false`; the duplicate JSON-RPC text representation is omitted. Execution JSON files normalize Bazel's consecutive JSON objects into arrays without changing action fields. Logs preserve their text with the original username/absolute recording paths replaced by generic public paths. Only this newly created sample is included; no customer data, credentials, backend binaries or backend logs are exported.
