Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
4d9db7a
Add durable agent mailbox library and focused hosted test target
GraciousGazelles Oct 23, 2026
7c2f9b3
Integrate opt-in native mailbox acceptance, settlement and wait reports
GraciousGazelles Oct 23, 2026
f120288
Repair mailbox custody and retry semantics with native regressions
GraciousGazelles Oct 23, 2026
1b70065
Quote the focused native integration test command in hosted workflow
GraciousGazelles Oct 23, 2026
8589c83
Bind wait observations to canonical result bodies and native input ad…
GraciousGazelles Oct 23, 2026
9bd8df0
Fix native adapter compilation and immutable progress replacement
GraciousGazelles Oct 23, 2026
403e750
Recover interrupted mailbox waits and verify exact body custody
GraciousGazelles Oct 23, 2026
aa56bca
Persist mailbox wait lifecycle before publication and align shared wi…
GraciousGazelles Oct 23, 2026
09b4285
fix(mailbox): retain exact goal custody across progress and recovery
GraciousGazelles Oct 23, 2026
ed3f439
fix(mailbox): bind deferred handback to captured native token
GraciousGazelles Oct 23, 2026
be6ca99
test(mailbox): reconcile hosted fixtures and reviewed wait snapshots
GraciousGazelles Oct 23, 2026
2b1fe61
fix(mailbox): reject incompatible native recipients before acceptance
GraciousGazelles Oct 23, 2026
f8f78bd
fix(mailbox): resolve accepted spawn retries before role reload
GraciousGazelles Oct 23, 2026
97adde1
ci: keep fork Bazel execution on standard hosted runners
GraciousGazelles Oct 23, 2026
3ca85f3
fix(ci): emit canonical single-plus preview versions
GraciousGazelles Oct 23, 2026
d64f96f
fix(mailbox): correct owned path conversion and apply hosted formatting
GraciousGazelles Oct 23, 2026
e12fbb6
ci(mailbox): include owned crate in protected analysis coverage
GraciousGazelles Oct 23, 2026
08988d6
ci(mailbox): retire temporary source preparation workflow
GraciousGazelles Oct 23, 2026
c4794f7
fix(agents): reconcile mailbox recovery and bounded wait contracts
GraciousGazelles Oct 23, 2026
99ac7f5
fix(build): retain pinned zlib downloads on Ubuntu snapshots
GraciousGazelles Oct 23, 2026
7dd06d6
Merge commit '68eacd6b3da33db70d5e55e0a00df7b0967a0633' into feat/qui…
GraciousGazelles Oct 23, 2026
60f8730
fix(agents): retain mailbox wait terminals across legacy history
GraciousGazelles Oct 23, 2026
38beece
style(agents): apply hosted await formatting
GraciousGazelles Oct 23, 2026
088400b
fix(mailbox): resolve protected lint and hosted Windows failures
GraciousGazelles Oct 23, 2026
ca9a473
test(mailbox): complete legacy execution fixtures
GraciousGazelles Oct 23, 2026
c7445be
fix(mailbox): clean goal continuation lint diagnostics
GraciousGazelles Oct 23, 2026
28558ee
test(mailbox): satisfy workspace compatibility and test lints
GraciousGazelles Oct 23, 2026
f94ba4c
style(mailbox): label cleared-goal settlement argument
GraciousGazelles Oct 23, 2026
78bbda5
ci: keep SDK and post-main health on hosted execution
GraciousGazelles Oct 23, 2026
01ec0b2
test(mailbox): move final replay fixture pending refs
GraciousGazelles Oct 23, 2026
8000e30
test(mailbox): annotate native fixture arguments
GraciousGazelles Oct 23, 2026
a985d87
fix(ci): use GNU host for fork Windows release checks
GraciousGazelles Oct 23, 2026
69b2dfe
fix(ci): budget cold hosted-local compiler jobs
GraciousGazelles Oct 23, 2026
a3a3d44
test(pty): restore Ctrl-C handling in Windows fixture
GraciousGazelles Oct 23, 2026
0a5adf9
test(exec-server): allow normal Windows handshake startup
GraciousGazelles Oct 23, 2026
91c55ba
fix(bazel): keep WebRTC build caches in action outputs
GraciousGazelles Oct 23, 2026
027cd1e
test(exec-server): import handshake timeout on Windows
GraciousGazelles Oct 23, 2026
59b1472
fix(ci): budget cold hosted-local validation
GraciousGazelles Oct 23, 2026
07e313c
fix(ci): allow cold shell startup and reclaim unused SDK space
GraciousGazelles Oct 24, 2026
027d340
fix(ci): match native fork budgets to the hosted runner limit
GraciousGazelles Oct 24, 2026
f219529
fix(ci): prepare hosted Linux namespaces for sandbox tests
GraciousGazelles Oct 24, 2026
d24c920
fix(ci): retain lean local settings in hosted fork fallback
GraciousGazelles Oct 24, 2026
9cfdec1
fix(ci): retain interrupted sharded test diagnostics
GraciousGazelles Oct 24, 2026
d50fadb
fix(ci): run diagnostic fixture with native Windows shell
GraciousGazelles Oct 24, 2026
d2418d7
test(ci): supply native Windows environment for log fixture
GraciousGazelles Oct 24, 2026
a5d7070
test(ci): bound fake Bazel arguments on Windows
GraciousGazelles Oct 24, 2026
c7fdf23
test(pty): await resumed PowerShell prompt after Ctrl-C
GraciousGazelles Oct 24, 2026
3992c1d
fix(ci): retain lean settings through the hosted shell entry point
GraciousGazelles Oct 24, 2026
6fbbd5c
test(agents): align accepted-work receipt schema expectations
GraciousGazelles Oct 24, 2026
016a30d
test(agents): retain receipt schemas in focused carry coverage
GraciousGazelles Oct 24, 2026
69c8c8b
test(mailbox): retain structured join failure diagnostics
GraciousGazelles Oct 24, 2026
afa196d
test(mailbox): repeat serial adapter group for intermittent reports
GraciousGazelles Oct 24, 2026
32fb3c3
test: reproduce mailbox activation writer contention
GraciousGazelles Oct 24, 2026
1203008
fix: reserve mailbox writer before custody reads
GraciousGazelles Oct 24, 2026
ae4c58c
style: format mailbox contention regression
GraciousGazelles Oct 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/actions/setup-bazel-ci/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,24 @@ runs:
- id: setup_ci
uses: ./.github/actions/setup-ci

- name: Reclaim unused hosted Linux Android SDK
if: ${{ github.repository == 'sednalabs/codex' && runner.os == 'Linux' && runner.environment == 'github-hosted' }}
shell: bash
run: |
set -euo pipefail
# Native Linux Rust targets do not use this preinstalled image SDK.
# Keep the workspace, tool cache, and Bazel/Cargo caches intact.
df -h /
if [[ -d /usr/local/lib/android ]]; then
if [[ "$(realpath /usr/local/lib/android)" != /usr/local/lib/android ]]; then
echo "::error::Refusing to reclaim a non-canonical runner SDK path"
exit 1
fi
du -sh /usr/local/lib/android
sudo rm -rf -- /usr/local/lib/android
fi
df -h /

- name: Set up Bazel
uses: bazel-contrib/setup-bazel@c5acdfb288317d0b5c0bbd7a396a3dc868bb0f86 # 0.19.0
# Without an explicit Bazelisk version, setup-bazel leaves PATH unchanged
Expand Down
27 changes: 25 additions & 2 deletions .github/scripts/run-bazel-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ print_bazel_test_log_tails() {
local testlogs_dir

local -a bazel_info_args=(info)
if [[ -n "${BUILDBUDDY_API_KEY:-}" ]]; then
if [[ -n "${BUILDBUDDY_API_KEY:-}" || "$ci_config" == "ci-bazel" ]]; then
# `bazel info` needs the same CI config as the failed test invocation so
# platform-specific output roots match. On Windows, omitting `ci-windows`
# would point at `local_windows-fastbuild` even when the test ran with the
Expand Down Expand Up @@ -141,7 +141,20 @@ print_bazel_test_log_tails() {
if [[ -f "$test_log" ]]; then
tail -n 200 "$test_log"
else
echo "Missing test log: $test_log"
# A build failure can interrupt a sharded target before its final test.log
# exists. Retain the failed attempt evidence already written by Bazel.
local found_attempt=0
local attempt_log
for attempt_log in "${testlogs_dir}/${rel_path}"/shard_*_of_*/test_attempts/attempt_*.log; do
if [[ -f "$attempt_log" ]]; then
found_attempt=1
echo "Bazel sharded attempt log: ${attempt_log}"
tail -n 200 "$attempt_log"
fi
done
if [[ $found_attempt -eq 0 ]]; then
echo "Missing test log: $test_log"
fi
fi
echo "::endgroup::"
done
Expand Down Expand Up @@ -377,6 +390,12 @@ if [[ "${RUNNER_OS:-}" == "Windows" ]]; then
post_config_bazel_args+=("--test_env=PATH=${CODEX_BAZEL_WINDOWS_PATH}")
fi

if [[ -z "${BUILDBUDDY_API_KEY:-}" && "${GITHUB_ACTIONS:-}" == "true" && "${GITHUB_REPOSITORY:-}" == "sednalabs/codex" && "${RUNNER_ENVIRONMENT:-}" == "github-hosted" ]]; then
# This entry point omits remote configs when keyless, so the Python fallback
# cannot infer that it must retain the shared lean, hosted-local CI settings.
ci_config=ci-bazel
fi

bazel_console_log="$(mktemp)"
trap 'rm -f "$bazel_console_log"' EXIT

Expand All @@ -386,6 +405,10 @@ if [[ -n "${BUILDBUDDY_API_KEY:-}" ]]; then
bazel_run_args+=("--config=${ci_config}")
else
echo "BuildBuddy API key is not available; using local Bazel configuration."
if [[ "$ci_config" == "ci-bazel" ]]; then
echo "Retaining shared hosted-local CI settings: --config=ci-bazel"
bazel_run_args+=(--config=ci-bazel)
fi
fi
if (( ${#bazel_args[@]} > 1 )); then
# Explicit caller flags must follow rc configs so workflow-level safety and
Expand Down
16 changes: 16 additions & 0 deletions .github/scripts/run_bazel_with_buildbuddy.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,22 @@ def bazel_args_with_remote_config(
config = remote_config(args, env)
if config is None:
configured_args = bazel_args_without_remote_execution(args)
local_config_args = configured_args
if "--" in configured_args:
local_config_args = configured_args[: configured_args.index("--")]
if (
env.get("GITHUB_ACTIONS") == "true"
and env.get("GITHUB_REPOSITORY") == "sednalabs/codex"
and env.get("RUNNER_ENVIRONMENT") == "github-hosted"
and uses_remote_execution(args)
and "--config=ci-bazel" not in local_config_args
):
# Removing a remote platform must not also lose the shared CI
# settings: lean Rust artifacts and no duplicate on-runner disk CAS.
local_command_idx = next(
idx for idx, arg in enumerate(configured_args) if not arg.startswith("-")
)
configured_args.insert(local_command_idx + 1, "--config=ci-bazel")
else:
# `remote_config()` returns a configuration only when this key is present.
api_key = env["BUILDBUDDY_API_KEY"]
Expand Down
201 changes: 199 additions & 2 deletions .github/scripts/test_ci_planners.py
Original file line number Diff line number Diff line change
Expand Up @@ -1012,7 +1012,7 @@ def test_v2_residency_route_stays_on_multi_agent_orchestration_lane(self) -> Non
]
)
self.assertEqual(recipe.count("cargo nextest run"), 4)
self.assertEqual(recipe.count("RUST_MIN_STACK="), 4)
self.assertEqual(recipe.count("RUST_MIN_STACK="), 6)
self.assertEqual(recipe.count("--no-tests=fail"), 4)
for test_name in (
"agent::control::residency::tests::"
Expand Down Expand Up @@ -1598,6 +1598,25 @@ def test_bazel_macos_clippy_caps_hosted_runner_fanout(self) -> None:
self.assertIn("--jobs=96", clippy_run)
self.assertIn("--loading_phase_threads=8", clippy_run)

def test_bazel_windows_clippy_fork_uses_native_host(self) -> None:
payload = load_workflow_payload(REPO_ROOT / ".github/workflows/bazel.yml")
clippy_steps = ((payload.get("jobs") or {}).get("clippy") or {}).get("steps") or []
clippy_run = next(
step
for step in clippy_steps
if step.get("name") == "bazel build --config=clippy lint targets"
).get("run") or ""
fork_no_key_condition = (
'[[ "${GITHUB_REPOSITORY:-}" == "sednalabs/codex" '
'&& -z "${BUILDBUDDY_API_KEY:-}" ]]'
)
self.assertIn('[[ "${RUNNER_OS}" == "Windows" ]]', clippy_run)
self.assertIn(fork_no_key_condition, clippy_run)
self.assertIn(
"bazel_clippy_args+=(--host_platform=//:local_windows)", clippy_run
)
self.assertEqual(clippy_run.count("--host_platform=//:local_windows"), 1)

def test_bazel_windows_tests_serialize_host_global_policy_state(self) -> None:
payload = load_workflow_payload(REPO_ROOT / ".github/workflows/bazel.yml")
windows_steps = (
Expand All @@ -1608,6 +1627,92 @@ def test_bazel_windows_tests_serialize_host_global_policy_state(self) -> None:
step for step in windows_steps if step.get("name") == "bazel test shard"
).get("run") or ""
self.assertIn("--local_test_jobs=1", windows_test_run)
self.assertIn(
'[[ "${GITHUB_REPOSITORY:-}" == "sednalabs/codex" '
'&& -z "${BUILDBUDDY_API_KEY:-}" ]]',
windows_test_run,
)
self.assertIn(
"bazel_test_args+=(--host_platform=//:local_windows)", windows_test_run
)

def test_bazel_windows_release_build_fork_uses_gnullvm_host(self) -> None:
payload = load_workflow_payload(REPO_ROOT / ".github/workflows/bazel.yml")
release_steps = (
((payload.get("jobs") or {}).get("verify-release-build") or {}).get("steps")
or []
)
release_run = next(
step
for step in release_steps
if step.get("name") == "bazel build verify-release-build targets"
).get("run") or ""
fork_no_key_windows_condition = (
'[[ "${RUNNER_OS}" == "Windows" '
'&& "${GITHUB_REPOSITORY:-}" == "sednalabs/codex" '
'&& -z "${BUILDBUDDY_API_KEY:-}" ]]'
)
self.assertIn(fork_no_key_windows_condition, release_run)
self.assertIn(
"bazel_build_args+=(--host_platform=//:local_windows)", release_run
)

def test_fork_hosted_local_compile_jobs_keep_bounded_full_build_budget(self) -> None:
fork_budget = "${{ github.repository == 'sednalabs/codex' && 360 || 30 }}"
for workflow_name, job_name, expected_budget in (
("bazel.yml", "clippy", fork_budget),
("sdk.yml", "sdks", fork_budget),
(
"bazel.yml",
"test",
"${{ github.repository == 'sednalabs/codex' && 360 || 120 }}",
),
(
"bazel.yml",
"verify-release-build",
"${{ github.repository == 'sednalabs/codex' && 360 || 60 }}",
),
):
with self.subTest(workflow=workflow_name, job=job_name):
payload = load_workflow_payload(
REPO_ROOT / ".github/workflows" / workflow_name
)
job = (payload.get("jobs") or {}).get(job_name) or {}
self.assertEqual(job.get("timeout-minutes"), expected_budget)

def test_fork_hosted_linux_bazel_tests_prepare_user_namespaces(self) -> None:
payload = load_workflow_payload(REPO_ROOT / ".github/workflows/bazel.yml")
steps = ((payload.get("jobs") or {}).get("test") or {}).get("steps") or []
prepare_step = next(
step
for step in steps
if step.get("name") == "Enable user namespaces for hosted Linux sandbox tests"
)
self.assertEqual(
prepare_step.get("if"),
"${{ github.repository == 'sednalabs/codex' && runner.os == 'Linux' "
"&& runner.environment == 'github-hosted' }}",
)
self.assertEqual(prepare_step.get("shell"), "bash")
prepare_run = prepare_step.get("run") or ""
self.assertIn("sudo sysctl -w kernel.unprivileged_userns_clone=1", prepare_run)
self.assertIn(
"if sudo sysctl -n kernel.apparmor_restrict_unprivileged_userns "
">/dev/null 2>&1; then",
prepare_run,
)
self.assertIn(
"sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0",
prepare_run,
)
self.assertLess(
steps.index(prepare_step),
next(
index
for index, step in enumerate(steps)
if step.get("name") == "bazel test //..."
),
)

def test_bazel_windows_native_main_uses_gnullvm_proc_macro_toolchain(self) -> None:
bazel = load_workflow_payload(REPO_ROOT / ".github/workflows/bazel.yml")
Expand Down Expand Up @@ -1665,6 +1770,14 @@ def test_bazel_windows_native_main_uses_gnullvm_proc_macro_toolchain(self) -> No
native_test_run,
)
self.assertIn("--local_test_jobs=1", native_test_run)
self.assertIn(
'[[ "${GITHUB_REPOSITORY:-}" == "sednalabs/codex" '
'&& -z "${BUILDBUDDY_API_KEY:-}" ]]',
native_test_run,
)
self.assertIn(
"bazel_test_args+=(--host_platform=//:local_windows)", native_test_run
)

module_bazel = (REPO_ROOT / "MODULE.bazel").read_text(encoding="utf-8")
self.assertIn(
Expand Down Expand Up @@ -2042,6 +2155,33 @@ def test_bazel_ci_docs_only_plan_is_fail_closed_and_preserves_required_signal(se
)
self.assertEqual(proc.returncode, 0, proc.stderr)

def test_fork_hosted_linux_bazel_reclaims_only_unused_image_sdk(self) -> None:
payload = load_workflow_payload(
REPO_ROOT / ".github/actions/setup-bazel-ci/action.yml"
)
steps = (payload.get("runs") or {}).get("steps") or []
cleanup = next(
step
for step in steps
if step.get("name") == "Reclaim unused hosted Linux Android SDK"
)
self.assertEqual(
cleanup.get("if"),
"${{ github.repository == 'sednalabs/codex' && runner.os == 'Linux' "
"&& runner.environment == 'github-hosted' }}",
)
self.assertEqual(cleanup.get("shell"), "bash")
script = cleanup.get("run") or ""
self.assertIn("realpath /usr/local/lib/android", script)
removal_commands = [
line.strip()
for line in script.splitlines()
if line.strip().startswith("sudo rm ")
]
self.assertEqual(removal_commands, ["sudo rm -rf -- /usr/local/lib/android"])
setup_bazel = next(step for step in steps if step.get("name") == "Set up Bazel")
self.assertLess(steps.index(cleanup), steps.index(setup_bazel))

def test_bazel_cache_writes_are_limited_to_trusted_post_merge_pushes(self) -> None:
setup_action = load_workflow_payload(REPO_ROOT / ".github/actions/setup-bazel-ci/action.yml")
setup_bazel_step = next(
Expand Down Expand Up @@ -4872,6 +5012,63 @@ def test_sedna_branch_build_uses_safe_ref_env_and_cached_macos_x64_preview(
self.assertIn('"notarized": False', macos_stage_script)
self.assertNotIn("${{ needs.metadata.outputs.display_ref }}", macos_stage_script)

def test_sedna_branch_preview_version_preserves_one_metadata_separator(self) -> None:
metadata_step = workflow_step_by_name(
REPO_ROOT / ".github/workflows/sedna-branch-build.yml",
"metadata",
"Compute preview version",
)
script = metadata_step.get("run") or ""
git_fixture = """
git() {
case "$1" in
rev-parse) printf '%s\\n' deadbeef ;;
tag) printf '%s\\n' "${PREVIEW_TEST_TAG}" ;;
*) return 2 ;;
esac
}
"""
cases = (
("", "0.0.0-sedna.0+ci.42.gdeadbeef"),
("v1.2.3-sedna.4", "1.2.3-sedna.4+ci.42.gdeadbeef"),
(
"v0.146.0-alpha.8-sedna.10",
"0.146.0-alpha.8-sedna.10+ci.42.gdeadbeef",
),
(
"v0.146.0-alpha.8-sedna.10+upstream.8593",
"0.146.0-alpha.8-sedna.10+upstream.8593.ci.42.gdeadbeef",
),
)
commit = "deadbeef" + "0" * 32
for tag, expected in cases:
with self.subTest(tag=tag), tempfile.TemporaryDirectory() as tmpdir:
output_path = Path(tmpdir) / "github-output"
proc = subprocess.run(
["bash", "-c", git_fixture + script],
check=False,
capture_output=True,
text=True,
env={
**os.environ,
"PREVIEW_TEST_TAG": tag,
"GITHUB_OUTPUT": str(output_path),
"GITHUB_RUN_NUMBER": "42",
"CHECKOUT_REF": commit,
"DISPLAY_REF": "feature/preview",
"HOST_ONLY": "false",
"PLATFORM": "linux-x86_64",
},
)
self.assertEqual(proc.returncode, 0, proc.stderr)
outputs = parse_github_output_file(output_path)
self.assertEqual(outputs["preview_version"], expected)
self.assertEqual(outputs["preview_version"].count("+"), 1)
self.assertEqual(outputs["checkout_ref"], commit)
self.assertEqual(
outputs["artifact_name"], "sedna-branch-feature-preview-deadbeef"
)

def test_sedna_branch_build_host_only_command_has_valid_shell_syntax(self) -> None:
workflow_path = REPO_ROOT / ".github/workflows/sedna-branch-build.yml"
payload = load_workflow_payload(workflow_path)
Expand Down Expand Up @@ -5541,7 +5738,7 @@ def test_stack_sensitive_targeted_recipes_set_rust_min_stack(self) -> None:
multi_agent_recipe = "\n".join(
recipes["core-multi-agent-orchestration-targeted"]
)
self.assertEqual(multi_agent_recipe.count("RUST_MIN_STACK="), 4)
self.assertEqual(multi_agent_recipe.count("RUST_MIN_STACK="), 6)

blocking_waits_core_recipe = "\n".join(
recipes["blocking-waits-core-targeted"]
Expand Down
Loading
Loading