Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

docs(ci): document usage and contracts of ci helper scripts

Steven Enamakel8909a95d2f5f
diff --git a/scripts/ci/nextest-coverage.sh b/scripts/ci/nextest-coverage.sh
index 3a8c3e2779..0c33128fdc 100644
--- a/scripts/ci/nextest-coverage.sh
+++ b/scripts/ci/nextest-coverage.sh
@@ -1,5 +1,10 @@
#!/usr/bin/env bash
# One durable JUnit report and count inventory per instrumented configuration.
+# Usage: bash scripts/ci/nextest-coverage.sh <suite> <cargo command...>
+# Run from the repository root. The command must contain a `nextest` argument.
+# NEXTEST_REPORT_DIR selects durable <suite>.toml/.xml/.json outputs. Optional
+# NEXTEST_EXPECTED_TARGETS and NEXTEST_EXPECTED_INVENTORY name the target-list
+# and nextest-list JSON inputs accepted by nextest-report.mjs.
set -euo pipefail
suite="$1"
shift
diff --git a/scripts/ci/nextest-report.mjs b/scripts/ci/nextest-report.mjs
index a954f4fe58..b88f8e0892 100644
--- a/scripts/ci/nextest-report.mjs
+++ b/scripts/ci/nextest-report.mjs
@@ -1,5 +1,10 @@
#!/usr/bin/env node
// Consume nextest's JUnit vocabulary; retain counts before checking inventory.
+// Usage: node scripts/ci/nextest-report.mjs <junit.xml> <counts.json>
+// [newline-delimited-targets.txt] [nextest-list.json]
+// NEXTEST_ELAPSED_SECONDS supplies the recorded command duration. Exit 1 means
+// missing/empty reporting or an unmet inventory expectation; test failures are
+// recorded here, while the calling wrapper preserves the test runner's status.
import fs from "node:fs";
const [report, output, expectedFile, inventoryFile] = process.argv.slice(2);
diff --git a/scripts/ci/self-hosted/verify-linkage.mjs b/scripts/ci/self-hosted/verify-linkage.mjs
index 32953c0afa..7dbd3ee7b2 100644
--- a/scripts/ci/self-hosted/verify-linkage.mjs
+++ b/scripts/ci/self-hosted/verify-linkage.mjs
@@ -1,10 +1,14 @@
#!/usr/bin/env node
// Inspect real lane outputs, rather than assuming a linker flag took effect.
+// CLI: run from the repository root with an optional JSON output path (default
+// ci-out/linkage.json). Require one ordinary and one coverage ELF in the private
+// target trees; this samples real artifacts rather than auditing every binary.
import { execFileSync } from "node:child_process";
import { readdirSync, statSync, mkdirSync, writeFileSync } from "node:fs";
import { join, dirname } from "node:path";
import { pathToFileURL } from "node:url";
+/** Classify readelf section-table and .comment output using lane proof markers. */
export function classifyElf(sections, comments) {
return {
executable: /\s\.interp\s/.test(sections),
@@ -13,6 +17,11 @@ export function classifyElf(sections, comments) {
};
}
+/**
+ * Find the first readable debug deps/example ELF of the requested coverage kind.
+ * Skip unreadable/non-ELF candidates; throw if a matching ELF lacks mold metadata
+ * or no candidate exists. Directory traversal errors also propagate.
+ */
export function findProof(root, instrumented) {
const visit = (directory) => {
for (const entry of readdirSync(directory, { withFileTypes: true })) {
diff --git a/scripts/ci/self-hosted/verify-runner.sh b/scripts/ci/self-hosted/verify-runner.sh
index fb4ed337ea..611579a364 100644
--- a/scripts/ci/self-hosted/verify-runner.sh
+++ b/scripts/ci/self-hosted/verify-runner.sh
@@ -1,5 +1,8 @@
#!/usr/bin/env bash
# Fail closed on stale guests. Never install or silently select another compiler.
+# `image` checks only the pinned digest against CI_IMAGE_BUILD_INFO (default
+# /etc/ohci/build-info). With no argument, also check preinstalled tools and
+# signed-cache settings, then append masked configuration to required GITHUB_ENV.
set -euo pipefail
root="$(cd "$(dirname "$0")/../../.." && pwd)"
image="$(cat "$root/scripts/ci/self-hosted/guest-image.txt")"
diff --git a/scripts/lib/module-pin-inventory.mjs b/scripts/lib/module-pin-inventory.mjs
index 0dad5a5d0a..47e93a35bb 100644
--- a/scripts/lib/module-pin-inventory.mjs
+++ b/scripts/lib/module-pin-inventory.mjs
@@ -25,7 +25,10 @@ export const PIN_MAP = {
tinyflows: { submodule: "vendor/tinyflows" },
};
-/** Return each module repository needed by the pin gate, in stable order. */
+/**
+ * Return sorted, unique repository paths needed by the pin gate. Providers use
+ * builtAgainst; other records use submodule or sharesWith. Omit absent paths.
+ */
export function modulePinRepositories(pinMap = PIN_MAP) {
return [
...new Set(