Skip to content

refactor(ci3): separate the public interface from internal scripts - #1

Merged
charlielye merged 6 commits into
mainfrom
cl/public-interface
Oct 22, 2026
Merged

charlielye merged 6 commits into
mainfrom
cl/public-interface

Conversation

@charlielye

@charlielye charlielye commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Now that ci3 is shared by more than one repository, consumers need to know what they can rely on. This identifies the public interface by audit and moves everything else under internal/.

Definition

Public is whatever a consuming repository sources or executes, or a person runs by hand. Everything else is internal.

Audit method

For each of the 87 top-level files, across aztec-node and aztec-packages (including .github/ and aztec-packages' ci3-local/), excluding ci3 itself:

  • Path-form references (ci3/<name>, $ci3/<name>) in any file.
  • Bare-name references in shell-like files only (*.sh, *.yml, Makefiles, extensionless scripts), because ci3 is on PATH and most calls look like denoise "...".
  • Markdown was checked separately for tools that are documented rather than scripted.
  • References were then read, not just counted: a reference that does nothing does not make a script public, and neither does a mention in a comment. The first pass of this audit matched comment text and had to be corrected for it.

Result

Count What happens
Sourced or executed by a consumer 50 stay public
Run by hand (cache_ls, cache_delete, clean_remote_tags, start_interactive) 4 stay public
Documented in a consumer skill (bench_compare) 1 stays public
Used only by other ci3 scripts 17 → internal/
Referenced by consumers only redundantly 3 → internal/
Added on main since, used only by ci3 (apply_private_release_patch, from aztec-node#420) 1 → internal/
Referenced by nothing anywhere 7 → internal/, removal candidates
Tests never enrolled in the suite 3 → tests/
Run artifacts committed by accident during this work 2 removed and gitignored

Used only inside ci3: exec_test, filter_cached_test_cmd, get_test_entry, parallelize_strict, sem_sched, semc.c, source_color, source_options, source_stdlib, source_test_params, ssm_send_command, total_mem_gb; and, named in consumer comments but called only from ci3: aws_request_instance_type, log_ci_run, post_github_status, redact, run_test_cmd.

Redundantly referenced: source_redis, source_refname, source_cache. Every consumer reference sat on the line after source ci3/source, which sources all three itself. They are implementation details of that entry point. The consumer PRs drop those lines (ci.sh in both repos, two barretenberg benchmark scripts in aztec-packages), which must land before a consumer bumps its pin to this.

That leaves the sourcing interface as three entry points (source, source_base, source_bootstrap) and two opt-ins (source_npm_auth, source_release_target).

Referenced by nothing (not deleted here; that is a separate call): add_log_time_delta, cpuset_count, docker_has_image, fd_monitor, get_test_owner, source_test, squash_args.

Narrowly used, worth a look later: about 25 public scripts are referenced from three or fewer files. Several have a single caller, e.g. log_ci_run and run_test_cmd (only ci.sh), bench_engine/test_engine/spinner (only the root bootstrap.sh). They are genuinely public today, but are candidates for folding behind fewer entry points.

Mechanics

  • internal/ is added to PATH in source_base, so ci3's scripts keep calling each other by name. It is a documented boundary, not an enforced one.
  • References rewritten: $ci3/<name> → $ci3/internal/<name>, and self-locating source lines inside internal/ go up one level.
  • The three tests now live in tests/, where bootstrap.sh enrolls them. Doing this is what exposed the undefined github_repo_url in upload_benchmarks, fixed separately on main: its test only printed command not found to stderr and passed anyway.

README

Adds an Interface section: the public/internal split; the reverse interface (files ci3 expects from the consuming repository: .test_patterns.yml, scripts/process_flake_log.py, .release-please-manifest.json, build-images/src/home/.gitconfig); and the state that must stay compatible between ci3 versions, since a repository and a submodule of it each pin their own.

Testing

  • ci3's suite passes standalone and as a submodule of aztec-node with the working directory inside ci3/: 8 tests, up from 5.
  • Smoke test from a consumer: source ci3/source still provides the stdlib functions and colours, and internal commands resolve through PATH to ci3/internal/.
  • Not yet run through a consumer's CI. No consumer references anything moved, by construction of the audit, but a pin bump on a consumer PR is the real check.

Rebased on main (2026-10-22)

Rebased onto main after the ports from aztec-node (#304–#544) and the AMI fix. One script was added on main in the meantime, apply_private_release_patch, which only bootstrap_ec2 runs; it moves to internal/ and its call site follows. The suite passes standalone and as a submodule of both consumers (8/8 each), and source ci3/source from a consumer still provides the stdlib, redis and the ref name, with internal commands resolving through PATH. The consumer PRs, aztec-labs-eng/aztec-node#278 and AztecProtocol/aztec-packages#25516, already drop the redundant source_redis/source_refname/source_cache lines.

🤖 Generated with Claude Code

charlielye and others added 6 commits October 22, 2026 16:40
Now that ci3 is shared, consuming repositories need to know what they can rely
on. An audit of every reference in aztec-node and aztec-packages (path-form
anywhere, bare names in shell-like files, since ci3 is on PATH) found 28 of 87
top-level files that neither repository touches.

- 13 are used only by other ci3 scripts and move to internal/.
- 10 are referenced by nothing at all and move there too, as removal candidates.
- 3 are tests that were never enrolled; they move to tests/, where
  bootstrap.sh picks them up. Enrolling upload_benchmarks_test is what exposed
  the undefined github_repo_url fixed on main.
- bench_compare stays public: a consumer skill documents it.

internal/ is added to PATH so ci3's scripts keep calling each other by name.
The README gains an Interface section covering the public/internal split, what
ci3 expects from a consuming repository, and the shared state that has to stay
compatible between ci3 versions.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
cache_ls, cache_delete, clean_remote_tags and start_interactive have no scripted
callers because they are operator tools, which makes them part of the interface
rather than internal.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
joblog.txt and .logged_test_flakes are written by parallelize into the
repository root. Standalone, that is this repository, and they had been
committed by accident.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
source_redis, source_refname and source_cache were only referenced by consumers
on the line after `source ci3/source`, which sources all three itself. They
are implementation details of that entry point, not things to source
separately, so they move to internal/. The consumers drop the redundant lines.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The audit matched comment text as usage. aws_request_instance_type, log_ci_run,
post_github_status, redact and run_test_cmd are named in consumer comments but
called only by other ci3 scripts, so they are internal.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Only bootstrap_ec2 runs it, on the build instance; no consuming repository
does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@charlielye
charlielye merged commit ccc6dd8 into main Oct 22, 2026
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